text: /*!
   * pannellum-react v1.2.4 - https://github.com/farminf/pannellum-react
   * MIT Licensed
   */
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.PannellumReact=e(require("react")):t.PannellumReact=e(t.React)}(window,function(t){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=24)}([function(t,e,i){(function(e){var i;i="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=i}).call(this,i(16))},function(t,e,i){(function(e){var n,r=void 0!==e?e:"undefined"!=typeof window?window:{},a=i(27);"undefined"!=typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"])||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),t.exports=n}).call(this,i(16))},function(t,e,i){"use strict";var n=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i)},this.off=function(e,i){var n;return!!t[e]&&(n=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(n,1),n>-1)},this.trigger=function(e){var i,n,r,a;if(i=t[e])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(){t={}}}};n.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),t},n.prototype.push=function(t){this.trigger("data",t)},n.prototype.flush=function(t){this.trigger("done",t)},t.exports=n},function(t,e,i){"use strict";var n,r,a,s,o,u=i(37).toUnsigned;n=function(t,e){var i,a,s,o,l,c=[];if(!e.length)return null;for(i=0;i<t.byteLength;)a=u(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),s=r(t.subarray(i+4,i+8)),o=a>1?i+a:t.byteLength,s===e[0]&&(1===e.length?c.push(t.subarray(i+8,o)):(l=n(t.subarray(i+8,o),e.slice(1))).length&&(c=c.concat(l))),i=o;return c},r=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),e+=String.fromCharCode(t[2]),e+=String.fromCharCode(t[3])},a=function(t){return n(t,["moov","trak"]).reduce(function(t,e){var i,r,a,s,o;return(i=n(e,["tkhd"])[0])?(r=i[0],s=u(i[a=0===r?12:20]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]),(o=n(e,["mdia","mdhd"])[0])?(a=0===(r=o[0])?12:20,t[s]=u(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3]),t):null):null},{})},s=function(t,e){var i,r,a;return i=n(e,["moof","traf"]),r=[].concat.apply([],i.map(function(e){return n(e,["tfhd"]).map(function(i){var r,a;return r=u(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),a=t[r]||9e4,(n(e,["tfdt"]).map(function(t){var e,i;return e=t[0],i=u(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),1===e&&(i*=Math.pow(2,32),i+=u(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),i})[0]||1/0)/a})})),a=Math.min.apply(null,r),isFinite(a)?a:0},o=function(t){var e=[];return n(t,["moov","trak"]).forEach(function(t){var i=n(t,["mdia","hdlr"]),a=n(t,["tkhd"]);i.forEach(function(t,i){var n,s,o=r(t.subarray(8,12)),u=a[i];"vide"===o&&(s=0===(n=new DataView(u.buffer,u.byteOffset,u.byteLength)).getUint8(0)?n.getUint32(12):n.getUint32(20),e.push(s))})}),e},t.exports={findBox:n,parseType:r,timescale:a,startTime:s,videoTrackIds:o}},function(e,i){e.exports=t},function(t,e,i){!function(e){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var r=s.parseURL(t);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(e);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)):e;var o=s.parseURL(t);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,h=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(h)}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(t){var e=i.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(r,"");t.length!==(t=t.replace(a,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=s}()},function(t,e,i){"use strict";t.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},function(t,e){function i(t){return t.replace(/\n\r?\s*/g,"")}t.exports=function(t){for(var e="",n=0;n<arguments.length;n++)e+=i(t[n])+(arguments[n+1]||"");return e}},function(t,e,i){"use strict";var n,r,a,s,o,u,l,c=i(2),h=i(17),d=i(38),p=i(39),f=i(40),m=i(42),g=i(43).H264Stream,y=i(45),v=i(46),_=i(47),b=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],T=["width","height","profileIdc","levelIdc","profileCompatibility"];o=function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)},u=function(t,e){var i;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},l=function(t){var e,i=0;for(e=0;e<t.length;e++)i+=t[e].data.byteLength;return i},(r=function(t,e){var i=[],n=0,a=0,s=0,o=1/0;e=e||{},r.prototype.init.call(this),this.push=function(e){p.collectDtsInfo(t,e),t&&b.forEach(function(i){t[i]=e[i]}),i.push(e)},this.setEarliestDts=function(e){a=e-t.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(t){o=t},this.setAudioAppendStart=function(t){s=t},this.flush=function(){var r,a,s,o;0!==i.length?(r=this.trimAdtsFramesByEarliestDts_(i),t.baseMediaDecodeTime=p.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),this.prefixWithSilence_(t,r),t.samples=this.generateSampleTable_(r),s=h.mdat(this.concatenateFrameData_(r)),i=[],a=h.moof(n,[t]),o=new Uint8Array(a.byteLength+s.byteLength),n++,o.set(a),o.set(s,a.byteLength),p.clearDtsInfo(t),this.trigger("data",{track:t,boxes:o}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.prefixWithSilence_=function(t,e){var i,n,r,a,u=0,l=0,c=0;if(e.length&&(i=_.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),n=Math.ceil(9e4/(t.samplerate/1024)),s&&o&&(u=i-Math.max(s,o),c=(l=Math.floor(u/n))*n),!(l<1||c>45e3))){for((r=v[t.samplerate])||(r=e[0].data),a=0;a<l;a++)e.splice(a,0,{data:r});t.baseMediaDecodeTime-=Math.floor(_.videoTsToAudioTs(c,t.samplerate))}},this.trimAdtsFramesByEarliestDts_=function(e){return t.minSegmentDts>=a?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=a&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},this.generateSampleTable_=function(t){var e,i,n=[];for(e=0;e<t.length;e++)i=t[e],n.push({size:i.data.byteLength,duration:1024});return n},this.concatenateFrameData_=function(t){var e,i,n=0,r=new Uint8Array(l(t));for(e=0;e<t.length;e++)i=t[e],r.set(i.data,n),n+=i.data.byteLength;return r}}).prototype=new c,(n=function(t,e){var i,r,a=0,s=[],o=[];e=e||{},n.prototype.init.call(this),delete t.minPTS,this.gopCache_=[],this.push=function(e){p.collectDtsInfo(t,e),"seq_parameter_set_rbsp"!==e.nalUnitType||i||(i=e.config,t.sps=[e.data],T.forEach(function(e){t[e]=i[e]},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||r||(r=e.data,t.pps=[e.data]),s.push(e)},this.flush=function(){for(var i,n,r,u,l,c;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=d.groupNalsIntoFrames(s),(r=d.groupFramesIntoGops(i))[0][0].keyFrame||((n=this.getGopForFusion_(s[0],t))?(r.unshift(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.pts=n.pts,r.dts=n.dts,r.duration+=n.duration):r=d.extendFirstKeyFrame(r)),o.length){var f;if(!(f=e.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r)))return this.gopCache_.unshift({gop:r.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");p.clearDtsInfo(t),r=f}p.collectDtsInfo(t,r),t.samples=d.generateSampleTable(r),l=h.mdat(d.concatenateNalData(r)),t.baseMediaDecodeTime=p.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",r.map(function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})),this.gopCache_.unshift({gop:r.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime),this.trigger("timelineStartInfo",t.timelineStartInfo),u=h.moof(a,[t]),c=new Uint8Array(u.byteLength+l.byteLength),a++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:t,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){p.clearDtsInfo(t),i=void 0,r=void 0},this.getGopForFusion_=function(e){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,t.pps&&u(t.pps[0],a.pps[0])&&t.sps&&u(t.sps[0],a.sps[0])&&(r.dts<t.timelineStartInfo.dts||(i=e.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(t){var e,i,n,r,a,s,u,l;for(a=t.byteLength,s=t.nalCount,u=t.duration,e=i=0;e<o.length&&i<t.length&&(n=o[e],r=t[i],n.pts!==r.pts);)r.pts>n.pts?e++:(i++,a-=r.byteLength,s-=r.nalCount,u-=r.duration);return 0===i?t:i===t.length?null:((l=t.slice(i)).byteLength=a,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(t){var e,i,n,r,a,s,u;for(e=o.length-1,i=t.length-1,a=null,s=!1;e>=0&&i>=0;){if(n=o[e],r=t[i],n.pts===r.pts){s=!0;break}n.pts>r.pts?e--:(e===o.length-1&&(a=i),i--)}if(!s&&null===a)return null;if(0===(u=s?i:a))return t;var l=t.slice(u),c=l.reduce(function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t},{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(t){o=t}}).prototype=new c,(s=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==t.remux?this.remuxTracks=!!t.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(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBoxes.push(t.boxes),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track),void("audio"===t.track.type&&(this.audioTrack=t.track)))}}).prototype=new c,s.prototype.flush=function(t){var e,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)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,T.forEach(function(t){s.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,b.forEach(function(t){s.info[t]=this.audioTrack[t]},this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=h.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++)(e=this.pendingCaptions[r]).startTime=e.startPts-o,e.startTime/=9e4,e.endTime=e.endPts-o,e.endTime/=9e4,s.captionStreams[e.stream]=!0,s.captions.push(e);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).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(t){var e,i,u=this,l=!0;a.prototype.init.call(this),t=t||{},this.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var e={};this.transmuxPipeline_=e,e.type="aac",e.metadataStream=new f.MetadataStream,e.aacStream=new y,e.audioTimestampRolloverStream=new f.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new f.TimestampRolloverStream("timed-metadata"),e.adtsStream=new m,e.coalesceStream=new s(t,e.metadataStream),e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)}),e.aacStream.on("data",function(n){"timed-metadata"!==n.type||e.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:u.baseMediaDecodeTime},codec:"adts",type:"audio"},e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new r(i,t),e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream))}),e.coalesceStream.on("data",this.trigger.bind(this,"data")),e.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="ts",a.metadataStream=new f.MetadataStream,a.packetStream=new f.TransportPacketStream,a.parseStream=new f.TransportParseStream,a.elementaryStream=new f.ElementaryStream,a.videoTimestampRolloverStream=new f.TimestampRolloverStream("video"),a.audioTimestampRolloverStream=new f.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new f.TimestampRolloverStream("timed-metadata"),a.adtsStream=new m,a.h264Stream=new g,a.captionStream=new f.CaptionStream,a.coalesceStream=new s(t,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 o;if("metadata"===s.type){for(o=s.tracks.length;o--;)e||"video"!==s.tracks[o].type?i||"audio"!==s.tracks[o].type||((i=s.tracks[o]).timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime):(e=s.tracks[o]).timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime;e&&!a.videoSegmentStream&&(a.coalesceStream.numberOfTracks++,a.videoSegmentStream=new n(e,t),a.videoSegmentStream.on("timelineStartInfo",function(t){i&&(i.timelineStartInfo=t,a.audioSegmentStream.setEarliestDts(t.dts))}),a.videoSegmentStream.on("processedGopsInfo",u.trigger.bind(u,"gopInfo")),a.videoSegmentStream.on("baseMediaDecodeTime",function(t){i&&a.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)),i&&!a.audioSegmentStream&&(a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new r(i,t),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(t){var n=this.transmuxPipeline_;this.baseMediaDecodeTime=t,i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,p.clearDtsInfo(i),i.timelineStartInfo.baseMediaDecodeTime=t,n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),e&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[],n.videoTimestampRolloverStream.discontinuity()),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,p.clearDtsInfo(e),n.captionStream.reset(),e.timelineStartInfo.baseMediaDecodeTime=t),n.timedMetadataTimestampRolloverStream&&n.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){if(l){var e=o(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),l=!1}this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){l=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new c,t.exports={Transmuxer:a,VideoSegmentStream:n,AudioSegmentStream:r,AUDIO_PROPERTIES:b,VIDEO_PROPERTIES:T}},function(t,e,i){"use strict";var n=i(0),r=i(28),a=i(29),s=i(33);function o(t,e,i){var n=t;return r(e)?(i=e,"string"==typeof t&&(n={uri:t})):n=s(e,{uri:t}),n.callback=i,n}function u(t,e,i){return l(e=o(t,e,i))}function l(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,i=function(i,n,r){e||(e=!0,t.callback(i,n,r))};function n(t){return clearTimeout(c),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,i(t,y)}function r(){if(!o){var e;clearTimeout(c),e=t.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var n=y,r=null;return 0!==e?(n={body:function(){var t=void 0;if(t=l.response?l.response:l.responseText||function(t){if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}(l),g)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:d,headers:{},url:h,rawRequest:l},l.getAllResponseHeaders&&(n.headers=a(l.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),i(r,n,n.body)}}var s,o,l=t.xhr||null;l||(l=t.cors||t.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var c,h=l.url=t.uri||t.url,d=l.method=t.method||"GET",p=t.body||t.data,f=l.headers=t.headers||{},m=!!t.sync,g=!1,y={body:void 0,headers:{},statusCode:0,method:d,url:h,rawRequest:l};if("json"in t&&!1!==t.json&&(g=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),p=JSON.stringify(!0===t.json?p:t.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(r,0)},l.onload=r,l.onerror=n,l.onprogress=function(){},l.onabort=function(){o=!0},l.ontimeout=n,l.open(d,h,!m,t.username,t.password),m||(l.withCredentials=!!t.withCredentials),!m&&t.timeout>0&&(c=setTimeout(function(){if(!o){o=!0,l.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),l.setRequestHeader)for(s in f)f.hasOwnProperty(s)&&l.setRequestHeader(s,f[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(l),l.send(p||null),l}t.exports=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var i=0;i<t.length;i++)e(t[i])}(["get","put","post","patch","head","delete"],function(t){u["delete"===t?"del":t]=function(e,i,n){return(i=o(e,i,n)).method=t.toUpperCase(),l(i)}})},function(t,e,i){var n=i(0),r=t.exports={WebVTT:i(34),VTTCue:i(35),VTTRegion:i(36)};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()},function(t,e,i){},function(t,e,i){},function(t,e){window.libpannellum=function(t,e,i){function n(n){var s,c,h,d,p,f,m,g,y,v,_,b,T,S,w,k,C=e.createElement("canvas");function E(t,e){return 1==t.level&&1!=e.level?-1:1==e.level&&1!=t.level?1:e.timestamp-t.timestamp}function x(t,e){return t.level!=e.level?t.level-e.level:t.diff-e.diff}function A(t,e,i,n,r,a){this.vertices=t,this.side=e,this.level=i,this.x=n,this.y=r,this.path=a.replace("%s",e).replace("%l",i).replace("%x",n).replace("%y",r)}function P(t,e,i,n,r){if(function(t,e){var i=D(t,e.slice(0,3)),n=D(t,e.slice(3,6)),r=D(t,e.slice(6,9)),a=D(t,e.slice(9,12)),s=i[0]+n[0]+r[0]+a[0];if(-4==s||4==s)return!1;var o=i[1]+n[1]+r[1]+a[1];if(-4==o||4==o)return!1;return i[2]+n[2]+r[2]+a[2]!=4}(t,e.vertices)){var a=e.vertices,o=a[0]+a[3]+a[6]+a[9],u=a[1]+a[4]+a[7]+a[10],l=a[2]+a[5]+a[8]+a[11],c=Math.sqrt(o*o+u*u+l*l),h=Math.asin(l/c),d=Math.atan2(u,o)-n;d+=d>Math.PI?-2*Math.PI:d<-Math.PI?2*Math.PI:0,d=Math.abs(d),e.diff=Math.acos(Math.sin(i)*Math.sin(h)+Math.cos(i)*Math.cos(h)*Math.cos(d));for(var p=!1,f=0;f<s.nodeCache.length;f++)if(s.nodeCache[f].path==e.path){p=!0,s.nodeCache[f].timestamp=s.nodeCacheTimestamp++,s.nodeCache[f].diff=e.diff,s.currentNodes.push(s.nodeCache[f]);break}if(p||(e.timestamp=s.nodeCacheTimestamp++,s.currentNodes.push(e),s.nodeCache.push(e)),e.level<s.level){var m=y.cubeResolution*Math.pow(2,e.level-y.maxLevel),g=Math.ceil(m*y.invTileResolution)-1,v=m%y.tileResolution*2,_=2*m%y.tileResolution;0===_&&(_=y.tileResolution),0===v&&(v=2*y.tileResolution);var b=.5;e.x!=g&&e.y!=g||(b=1-y.tileResolution/(y.tileResolution+_));var T,S=1-b,w=[],k=b,C=b,E=b,x=S,L=S,O=S;_<y.tileResolution&&(e.x==g&&e.y!=g?(C=.5,L=.5,"d"!=e.side&&"u"!=e.side||(E=.5,O=.5)):e.x!=g&&e.y==g&&(k=.5,x=.5,"l"!=e.side&&"r"!=e.side||(E=.5,O=.5))),v<=y.tileResolution&&(e.x==g&&(k=0,x=1,"l"!=e.side&&"r"!=e.side||(E=0,O=1)),e.y==g&&(C=0,L=1,"d"!=e.side&&"u"!=e.side||(E=0,O=1))),T=new A([a[0],a[1],a[2],a[0]*k+a[3]*x,a[1]*b+a[4]*S,a[2]*E+a[5]*O,a[0]*k+a[6]*x,a[1]*C+a[7]*L,a[2]*E+a[8]*O,a[0]*b+a[9]*S,a[1]*C+a[10]*L,a[2]*E+a[11]*O],e.side,e.level+1,2*e.x,2*e.y,y.fullpath),w.push(T),e.x==g&&v<=y.tileResolution||(T=new A([a[0]*k+a[3]*x,a[1]*b+a[4]*S,a[2]*E+a[5]*O,a[3],a[4],a[5],a[3]*b+a[6]*S,a[4]*C+a[7]*L,a[5]*E+a[8]*O,a[0]*k+a[6]*x,a[1]*C+a[7]*L,a[2]*E+a[8]*O],e.side,e.level+1,2*e.x+1,2*e.y,y.fullpath),w.push(T)),e.x==g&&v<=y.tileResolution||e.y==g&&v<=y.tileResolution||(T=new A([a[0]*k+a[6]*x,a[1]*C+a[7]*L,a[2]*E+a[8]*O,a[3]*b+a[6]*S,a[4]*C+a[7]*L,a[5]*E+a[8]*O,a[6],a[7],a[8],a[9]*k+a[6]*x,a[10]*b+a[7]*S,a[11]*E+a[8]*O],e.side,e.level+1,2*e.x+1,2*e.y+1,y.fullpath),w.push(T)),e.y==g&&v<=y.tileResolution||(T=new A([a[0]*b+a[9]*S,a[1]*C+a[10]*L,a[2]*E+a[11]*O,a[0]*k+a[6]*x,a[1]*C+a[7]*L,a[2]*E+a[8]*O,a[9]*k+a[6]*x,a[10]*b+a[7]*S,a[11]*E+a[8]*O,a[9],a[10],a[11]],e.side,e.level+1,2*e.x,2*e.y+1,y.fullpath),w.push(T));for(var I=0;I<w.length;I++)P(t,w[I],i,n,r)}}}function L(t,e,i){var n=Math.sin(e),r=Math.cos(e);return"x"==i?[t[0],r*t[1]+n*t[2],r*t[2]-n*t[1],t[3],r*t[4]+n*t[5],r*t[5]-n*t[4],t[6],r*t[7]+n*t[8],r*t[8]-n*t[7]]:"y"==i?[r*t[0]-n*t[2],t[1],r*t[2]+n*t[0],r*t[3]-n*t[5],t[4],r*t[5]+n*t[3],r*t[6]-n*t[8],t[7],r*t[8]+n*t[6]]:"z"==i?[r*t[0]+n*t[1],r*t[1]-n*t[0],t[2],r*t[3]+n*t[4],r*t[4]-n*t[3],t[5],r*t[6]+n*t[7],r*t[7]-n*t[6],t[8]]:void 0}function O(t){return[t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]}C.style.width=C.style.height="100%",n.appendChild(C),this.init=function(t,E,x,A,P,L,O,I){if(E===i&&(E="equirectangular"),"equirectangular"!=E&&"cubemap"!=E&&"multires"!=E)throw console.log("Error: invalid image type specified!"),{type:"config error"};if(v=E,y=t,_=x,k=I||{},s){if(h&&(c.detachShader(s,h),c.deleteShader(h)),d&&(c.detachShader(s,d),c.deleteShader(d)),c.bindBuffer(c.ARRAY_BUFFER,null),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,null),s.texture&&c.deleteTexture(s.texture),s.nodeCache)for(var U=0;U<s.nodeCache.length;U++)c.deleteTexture(s.nodeCache[U].texture);c.deleteProgram(s),s=i}var M;g=i;var D,N=!1;if("cubemap"==v)for(M=0;M<6;M++)y[M].width>0?(D===i&&(D=y[M].width),D!=y[M].width&&console.log("Cube faces have inconsistent widths: "+D+" vs. "+y[M].width)):N=!0;function B(t){if(N){var e=t*t*4,i=new Uint8ClampedArray(e),n=I.backgroundColor?I.backgroundColor:[0,0,0];n[0]*=255,n[1]*=255,n[2]*=255;for(var r=0;r<e;r++)i[r++]=n[0],i[r++]=n[1],i[r++]=n[2];var a=new ImageData(i,t,t);for(M=0;M<6;M++)0==y[M].width&&(y[M]=a)}}if("cubemap"==v&&0!=(D&D-1)&&(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/)||navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))||(c||(c=C.getContext("experimental-webgl",{alpha:!1,depth:!1})),c&&1286==c.getError()&&R()),!c&&("multires"==v&&y.hasOwnProperty("fallbackPath")||"cubemap"==v)&&("WebkitAppearance"in e.documentElement.style||navigator.userAgent.match(/Trident.*rv[ :]*11\./)||-1!==navigator.appVersion.indexOf("MSIE 10"))){var j;f&&n.removeChild(f),(f=e.createElement("div")).className="pnlm-world",j=y.basePath?y.basePath+y.fallbackPath:y.fallbackPath;var F=["f","r","b","l","u","d"],H=0,V=function(){var t=e.createElement("canvas");t.className="pnlm-face pnlm-"+F[this.side]+"face",f.appendChild(t);var i=t.getContext("2d");t.style.width=this.width+4+"px",t.style.height=this.height+4+"px",t.width=this.width+4,t.height=this.height+4,i.drawImage(this,2,2);var n,r,a=i.getImageData(0,0,t.width,t.height),s=a.data;for(n=2;n<t.width-2;n++)for(r=0;r<4;r++)s[4*(n+t.width)+r]=s[4*(n+2*t.width)+r],s[4*(n+t.width*(t.height-2))+r]=s[4*(n+t.width*(t.height-3))+r];for(n=2;n<t.height-2;n++)for(r=0;r<4;r++)s[4*(n*t.width+1)+r]=s[4*(n*t.width+2)+r],s[4*((n+1)*t.width-2)+r]=s[4*((n+1)*t.width-3)+r];for(r=0;r<4;r++)s[4*(t.width+1)+r]=s[4*(2*t.width+2)+r],s[4*(2*t.width-2)+r]=s[4*(3*t.width-3)+r],s[4*(t.width*(t.height-2)+1)+r]=s[4*(t.width*(t.height-3)+2)+r],s[4*(t.width*(t.height-1)-2)+r]=s[4*(t.width*(t.height-2)-3)+r];for(n=1;n<t.width-1;n++)for(r=0;r<4;r++)s[4*n+r]=s[4*(n+t.width)+r],s[4*(n+t.width*(t.height-1))+r]=s[4*(n+t.width*(t.height-2))+r];for(n=1;n<t.height-1;n++)for(r=0;r<4;r++)s[n*t.width*4+r]=s[4*(n*t.width+1)+r],s[4*((n+1)*t.width-1)+r]=s[4*((n+1)*t.width-2)+r];for(r=0;r<4;r++)s[r]=s[4*(t.width+1)+r],s[4*(t.width-1)+r]=s[4*(2*t.width-2)+r],s[t.width*(t.height-1)*4+r]=s[4*(t.width*(t.height-2)+1)+r],s[4*(t.width*t.height-1)+r]=s[4*(t.width*(t.height-1)-2)+r];i.putImageData(a,0,0),z.call(this)},z=function(){this.width>0?(p===i&&(p=this.width),p!=this.width&&console.log("Fallback faces have inconsistent widths: "+p+" vs. "+this.width)):N=!0,6==++H&&(p=this.width,n.appendChild(f),O())};for(N=!1,M=0;M<6;M++){var q=new Image;q.crossOrigin=k.crossOrigin?k.crossOrigin:"anonymous",q.side=M,q.onload=V,q.onerror=z,q.src="multires"==v?encodeURI(j.replace("%s",F[M])+"."+y.extension):encodeURI(y[M].src)}B(p)}else{if(!c)throw console.log("Error: no WebGL support detected!"),{type:"no webgl"};"cubemap"==v&&B(D),y.basePath?y.fullpath=y.basePath+y.path:y.fullpath=y.path,y.invTileResolution=1/y.tileResolution;var G=[-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1];for(m=[],M=0;M<6;M++)m[M]=G.slice(12*M,12*M+12),G=[-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1];var W=0,Y=0;if("equirectangular"==v?(W=Math.max(y.width,y.height),Y=c.getParameter(c.MAX_TEXTURE_SIZE)):"cubemap"==v&&(W=D,Y=c.getParameter(c.MAX_CUBE_MAP_TEXTURE_SIZE)),W>Y)throw console.log("Error: The image is too big; it's "+W+"px wide, but this device's maximum supported size is "+Y+"px."),{type:"webgl size error",width:W,maxWidth:Y};I===i||I.horizonPitch===i&&I.horizonRoll===i||(g=[I.horizonPitch==i?0:I.horizonPitch,I.horizonRoll==i?0:I.horizonRoll]);var X=c.TEXTURE_2D;c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),h=c.createShader(c.VERTEX_SHADER);var K=r;"multires"==v&&(K=a),c.shaderSource(h,K),c.compileShader(h),d=c.createShader(c.FRAGMENT_SHADER);var $=u;"cubemap"==v?(X=c.TEXTURE_CUBE_MAP,$=o):"multires"==v&&($=l),c.shaderSource(d,$),c.compileShader(d),s=c.createProgram(),c.attachShader(s,h),c.attachShader(s,d),c.linkProgram(s),c.getShaderParameter(h,c.COMPILE_STATUS)||console.log(c.getShaderInfoLog(h)),c.getShaderParameter(d,c.COMPILE_STATUS)||console.log(c.getShaderInfoLog(d)),c.getProgramParameter(s,c.LINK_STATUS)||console.log(c.getProgramInfoLog(s)),c.useProgram(s),s.drawInProgress=!1;var Z=I.backgroundColor?I.backgroundColor:[0,0,0];c.clearColor(Z[0],Z[1],Z[2],1),c.clear(c.COLOR_BUFFER_BIT),s.texCoordLocation=c.getAttribLocation(s,"a_texCoord"),c.enableVertexAttribArray(s.texCoordLocation),"multires"!=v?(b||(b=c.createBuffer()),c.bindBuffer(c.ARRAY_BUFFER,b),c.bufferData(c.ARRAY_BUFFER,new Float32Array([-1,1,1,1,1,-1,-1,1,1,-1,-1,-1]),c.STATIC_DRAW),c.vertexAttribPointer(s.texCoordLocation,2,c.FLOAT,!1,0,0),s.aspectRatio=c.getUniformLocation(s,"u_aspectRatio"),c.uniform1f(s.aspectRatio,c.drawingBufferWidth/c.drawingBufferHeight),s.psi=c.getUniformLocation(s,"u_psi"),s.theta=c.getUniformLocation(s,"u_theta"),s.f=c.getUniformLocation(s,"u_f"),s.h=c.getUniformLocation(s,"u_h"),s.v=c.getUniformLocation(s,"u_v"),s.vo=c.getUniformLocation(s,"u_vo"),s.rot=c.getUniformLocation(s,"u_rot"),c.uniform1f(s.h,A/(2*Math.PI)),c.uniform1f(s.v,P/Math.PI),c.uniform1f(s.vo,L/Math.PI*2),"equirectangular"==v&&(s.backgroundColor=c.getUniformLocation(s,"u_backgroundColor"),c.uniform4fv(s.backgroundColor,Z.concat([1]))),s.texture=c.createTexture(),c.bindTexture(X,s.texture),"cubemap"==v?(c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y[1]),c.texImage2D(c.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y[3]),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y[4]),c.texImage2D(c.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y[5]),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y[0]),c.texImage2D(c.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y[2])):c.texImage2D(X,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y),c.texParameteri(X,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(X,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(X,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(X,c.TEXTURE_MAG_FILTER,c.LINEAR)):(s.vertPosLocation=c.getAttribLocation(s,"a_vertCoord"),c.enableVertexAttribArray(s.vertPosLocation),T||(T=c.createBuffer()),S||(S=c.createBuffer()),w||(w=c.createBuffer()),c.bindBuffer(c.ARRAY_BUFFER,S),c.bufferData(c.ARRAY_BUFFER,new Float32Array([0,0,1,0,1,1,0,1]),c.STATIC_DRAW),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,w),c.bufferData(c.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),c.STATIC_DRAW),s.perspUniform=c.getUniformLocation(s,"u_perspMatrix"),s.cubeUniform=c.getUniformLocation(s,"u_cubeMatrix"),s.level=-1,s.currentNodes=[],s.nodeCache=[],s.nodeCacheTimestamp=0);var J=c.getError();if(0!==J)throw console.log("Error: Something went wrong with WebGL!",J),{type:"webgl error"};O()}},this.destroy=function(){if(n!==i&&(C!==i&&n.contains(C)&&n.removeChild(C),f!==i&&n.contains(f)&&n.removeChild(f)),c){var t=c.getExtension("WEBGL_lose_context");t&&t.loseContext()}},this.resize=function(){var e=t.devicePixelRatio||1;C.width=C.clientWidth*e,C.height=C.clientHeight*e,c&&(1286==c.getError()&&R(),c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),"multires"!=v&&c.uniform1f(s.aspectRatio,C.clientWidth/C.clientHeight))},this.resize(),this.setPose=function(t,e){g=[t,e]},this.render=function(t,e,n,r){var a,o,u=0;if(r===i&&(r={}),r.roll&&(u=r.roll),g!==i){var l=g[0],h=g[1],d=t,b=e,w=Math.cos(h)*Math.sin(t)*Math.sin(l)+Math.cos(t)*(Math.cos(l)*Math.cos(e)+Math.sin(h)*Math.sin(l)*Math.sin(e)),k=-Math.sin(t)*Math.sin(h)+Math.cos(t)*Math.cos(h)*Math.sin(e),U=Math.cos(h)*Math.cos(l)*Math.sin(t)+Math.cos(t)*(-Math.cos(e)*Math.sin(l)+Math.cos(l)*Math.sin(h)*Math.sin(e));t=Math.asin(Math.max(Math.min(U,1),-1)),e=Math.atan2(k,w);var D=[Math.cos(d)*(Math.sin(h)*Math.sin(l)*Math.cos(b)-Math.cos(l)*Math.sin(b)),Math.cos(d)*Math.cos(h)*Math.cos(b),Math.cos(d)*(Math.cos(l)*Math.sin(h)*Math.cos(b)+Math.sin(b)*Math.sin(l))],R=[-Math.cos(t)*Math.sin(e),Math.cos(t)*Math.cos(e)],N=Math.acos(Math.max(Math.min((D[0]*R[0]+D[1]*R[1])/(Math.sqrt(D[0]*D[0]+D[1]*D[1]+D[2]*D[2])*Math.sqrt(R[0]*R[0]+R[1]*R[1])),1),-1));D[2]<0&&(N=2*Math.PI-N),u+=N}if(c||"multires"!=v&&"cubemap"!=v){if("multires"!=v){var B=2*Math.atan(Math.tan(.5*n)/(c.drawingBufferWidth/c.drawingBufferHeight));a=1/Math.tan(.5*B),c.uniform1f(s.psi,e),c.uniform1f(s.theta,t),c.uniform1f(s.rot,u),c.uniform1f(s.f,a),!0===_&&"equirectangular"==v&&(c.bindTexture(c.TEXTURE_2D,s.texture),c.texImage2D(c.TEXTURE_2D,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,y)),c.drawArrays(c.TRIANGLES,0,6)}else{var j=function(t,e,i,n){var r=2*Math.atan(Math.tan(t/2)*c.drawingBufferHeight/c.drawingBufferWidth),a=1/Math.tan(r/2);return[a/e,0,0,0,0,a,0,0,0,0,(n+i)/(i-n),2*n*i/(i-n),0,0,-1,0]}(n,c.drawingBufferWidth/c.drawingBufferHeight,.1,100);!function(t){var e=1;for(;e<y.maxLevel&&c.drawingBufferWidth>y.tileResolution*Math.pow(2,e-1)*Math.tan(t/2)*.707;)e++;s.level=e}(n);var F=[1,0,0,0,1,0,0,0,1];F=function(t){return[t[0],t[1],t[2],0,t[3],t[4],t[5],0,t[6],t[7],t[8],0,0,0,0,1]}(F=L(F=L(F=L(F,-u,"z"),-t,"x"),e,"y")),c.uniformMatrix4fv(s.perspUniform,!1,new Float32Array(O(j))),c.uniformMatrix4fv(s.cubeUniform,!1,new Float32Array(O(F)));var H=function(t,e){return[t[0]*e[0],t[0]*e[1],t[0]*e[2],0,t[5]*e[4],t[5]*e[5],t[5]*e[6],0,t[10]*e[8],t[10]*e[9],t[10]*e[10],t[11],-e[8],-e[9],-e[10],0]}(j,F);if(s.nodeCache.sort(E),s.nodeCache.length>200&&s.nodeCache.length>s.currentNodes.length+50)for(var V=s.nodeCache.splice(200,s.nodeCache.length-200),z=0;z<V.length;z++)c.deleteTexture(V[z].texture);s.currentNodes=[];var q=["f","b","u","d","l","r"];for(o=0;o<6;o++){P(H,new A(m[o],q[o],1,0,0,y.fullpath),t,e,n)}for(s.currentNodes.sort(x),z=I.length-1;z>=0;z--)-1===s.currentNodes.indexOf(I[z].node)&&(I[z].node.textureLoad=!1,I.splice(z,1));if(0===I.length)for(z=0;z<s.currentNodes.length;z++){var G=s.currentNodes[z];if(!G.texture&&!G.textureLoad){G.textureLoad=!0,setTimeout(M,0,G);break}}!function(){if(!s.drawInProgress){s.drawInProgress=!0,c.clear(c.COLOR_BUFFER_BIT);for(var t=0;t<s.currentNodes.length;t++)s.currentNodes[t].textureLoaded>1&&(c.bindBuffer(c.ARRAY_BUFFER,T),c.bufferData(c.ARRAY_BUFFER,new Float32Array(s.currentNodes[t].vertices),c.STATIC_DRAW),c.vertexAttribPointer(s.vertPosLocation,3,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,S),c.vertexAttribPointer(s.texCoordLocation,2,c.FLOAT,!1,0,0),c.bindTexture(c.TEXTURE_2D,s.currentNodes[t].texture),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0));s.drawInProgress=!1}}()}if(r.returnImage!==i)return C.toDataURL("image/png")}else{var W={f:"translate3d(-"+((o=p/2)+2)+"px, -"+(o+2)+"px, -"+o+"px)",b:"translate3d("+(o+2)+"px, -"+(o+2)+"px, "+o+"px) rotateX(180deg) rotateZ(180deg)",u:"translate3d(-"+(o+2)+"px, -"+o+"px, "+(o+2)+"px) rotateX(270deg)",d:"translate3d(-"+(o+2)+"px, "+o+"px, -"+(o+2)+"px) rotateX(90deg)",l:"translate3d(-"+o+"px, -"+(o+2)+"px, "+(o+2)+"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)",r:"translate3d("+o+"px, -"+(o+2)+"px, -"+(o+2)+"px) rotateY(270deg)"},Y=(a=1/Math.tan(n/2))*C.clientWidth/2+"px",X="perspective("+Y+") translateZ("+Y+") rotateX("+t+"rad) rotateY("+e+"rad) ",K=Object.keys(W);for(z=0;z<6;z++){var $=f.querySelector(".pnlm-"+K[z]+"face");$&&($.style.webkitTransform=X+W[K[z]],$.style.transform=X+W[K[z]])}}},this.isLoading=function(){if(c&&"multires"==v)for(var t=0;t<s.currentNodes.length;t++)if(!s.currentNodes[t].textureLoaded)return!0;return!1},this.getCanvas=function(){return C};var I=[],U=function(){var t,e=4,i={};function n(){var n=this;this.texture=this.callback=null,this.image=new Image,this.image.crossOrigin=t||"anonymous";var r=function(){n.image.width>0&&n.image.height>0?(!function(t,e){c.bindTexture(c.TEXTURE_2D,e),c.texImage2D(c.TEXTURE_2D,0,c.RGB,c.RGB,c.UNSIGNED_BYTE,t),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null)}(n.image,n.texture),n.callback(n.texture,!0)):n.callback(n.texture,!1),function(t){if(I.length){var n=I.shift();t.loadTexture(n.src,n.texture,n.callback)}else i[e++]=t}(n)};this.image.addEventListener("load",r),this.image.addEventListener("error",r)}n.prototype.loadTexture=function(t,e,i){this.texture=e,this.callback=i,this.image.src=t};for(var r=0;r<e;r++)i[r]=new n;return function(n,r,a,s){t=s;var o=c.createTexture();return e?i[--e].loadTexture(r,o,a):I.push(new function(t,e,i,n){this.node=t,this.src=e,this.texture=i,this.callback=n}(n,r,o,a)),o}}();function M(t){U(t,encodeURI(t.path+"."+y.extension),function(e,i){t.texture=e,t.textureLoaded=i?2:1},k.crossOrigin)}function D(t,e){var i=function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[4]*e[0]+t[5]*e[1]+t[6]*e[2],t[11]+t[8]*e[0]+t[9]*e[1]+t[10]*e[2],1/(t[12]*e[0]+t[13]*e[1]+t[14]*e[2])]}(t,e),n=i[0]*i[3],r=i[1]*i[3],a=i[2]*i[3],s=[0,0,0];return n<-1&&(s[0]=-1),n>1&&(s[0]=1),r<-1&&(s[1]=-1),r>1&&(s[1]=1),(a<-1||a>1)&&(s[2]=1),s}function R(){console.log("Reducing canvas size due to error 1286!"),C.width=Math.round(C.width/2),C.height=Math.round(C.height/2)}}var r=["attribute vec2 a_texCoord;","varying vec2 v_texCoord;","void main() {","gl_Position = vec4(a_texCoord, 0.0, 1.0);","v_texCoord = a_texCoord;","}"].join(""),a=["attribute vec3 a_vertCoord;","attribute vec2 a_texCoord;","uniform mat4 u_cubeMatrix;","uniform mat4 u_perspMatrix;","varying mediump vec2 v_texCoord;","void main(void) {","gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);","v_texCoord = a_texCoord;","}"].join(""),s=["precision mediump float;","uniform float u_aspectRatio;","uniform float u_psi;","uniform float u_theta;","uniform float u_f;","uniform float u_h;","uniform float u_v;","uniform float u_vo;","uniform float u_rot;","const float PI = 3.14159265358979323846264;","uniform sampler2D u_image;","uniform samplerCube u_imageCube;","varying vec2 v_texCoord;","uniform vec4 u_backgroundColor;","void main() {","float x = v_texCoord.x * u_aspectRatio;","float y = v_texCoord.y;","float sinrot = sin(u_rot);","float cosrot = cos(u_rot);","float rot_x = x * cosrot - y * sinrot;","float rot_y = x * sinrot + y * cosrot;","float sintheta = sin(u_theta);","float costheta = cos(u_theta);","float a = u_f * costheta - rot_y * sintheta;","float root = sqrt(rot_x * rot_x + a * a);","float lambda = atan(rot_x / root, a / root) + u_psi;","float phi = atan((rot_y * costheta + u_f * sintheta) / root);"].join("\n"),o=s+["float cosphi = cos(phi);","gl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));","}"].join("\n"),u=s+["lambda = mod(lambda + PI, PI * 2.0) - PI;","vec2 coord = vec2(lambda / PI, phi / (PI / 2.0));","if(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)","gl_FragColor = u_backgroundColor;","else","gl_FragColor = texture2D(u_image, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));","}"].join("\n"),l=["varying mediump vec2 v_texCoord;","uniform sampler2D u_sampler;","void main(void) {","gl_FragColor = texture2D(u_sampler, v_texCoord);","}"].join("");return{renderer:function(t,e,i,r){return new n(t,e,i,r)}}}(window,document)},function(t,e){window.pannellum=function(t,e,i){function n(n,r){var a,s,o,u,l,c,h,d,p,f=this,m=!1,g=Date.now(),y=0,v=0,_=-1,b=0,T=0,S=new Array(10),w=!1,k=!1,C=!1,E={yaw:0,pitch:0,hfov:0},x=!1,A=!1,P=0,L=0,O={},I={},U=[],M=!1,D=!1,R={hfov:100,minHfov:50,maxHfov:120,pitch:0,minPitch:i,maxPitch:i,yaw:0,minYaw:-180,maxYaw:180,roll:0,haov:360,vaov:180,vOffset:0,autoRotate:!1,autoRotateInactivityDelay:-1,autoRotateStopDelay:i,type:"equirectangular",northOffset:0,showFullscreenCtrl:!0,dynamic:!1,doubleClickZoom:!0,keyboardZoom:!0,mouseZoom:!0,showZoomCtrl:!0,autoLoad:!1,showControls:!0,orientationOnByDefault:!1,hotSpotDebug:!1,backgroundColor:[0,0,0],avoidShowingBackground:!1,animationTimingFunction:function(t){return t<.5?2*t*t:(4-2*t)*t-1},draggable:!0,disableKeyboardCtrl:!1,crossOrigin:"anonymous",touchPanSpeedCoeffFactor:1,capturedKeyNumbers:[16,17,27,37,38,39,40,61,65,68,83,87,107,109,173,187,189],strings:{loadButtonLabel:"Click to<br>Load<br>Panorama",loadingLabel:"Loading...",bylineLabel:"by %s",noPanoramaError:"No panorama image was specified.",fileAccessError:"The file %s could not be accessed.",malformedURLError:"There is something wrong with the panorama URL.",iOS8WebGLError:"Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).",genericWebGLError:"Your browser does not have the necessary WebGL support to display this panorama.",textureSizeError:"This panorama is too big for your device! It's %spx wide, but your device only supports images up to %spx wide. Try another device. (If you're the author, try scaling down the image.)",unknownError:"Unknown error. Check developer console."}};(n="string"==typeof n?e.getElementById(n):n).classList.add("pnlm-container"),n.tabIndex=0;var N=e.createElement("div");N.className="pnlm-ui",n.appendChild(N);var B=e.createElement("div");B.className="pnlm-render-container",n.appendChild(B);var j=e.createElement("div");j.className="pnlm-dragfix",N.appendChild(j);var F=e.createElement("span");F.className="pnlm-about-msg",F.innerHTML='<a href="https://pannellum.org/" target="_blank">Pannellum</a>',N.appendChild(F),j.addEventListener("contextmenu",function t(e){var i=Z(e);F.style.left=i.x+"px";F.style.top=i.y+"px";clearTimeout(t.t1);clearTimeout(t.t2);F.style.display="block";F.style.opacity=1;t.t1=setTimeout(function(){F.style.opacity=0},2e3);t.t2=setTimeout(function(){F.style.display="none"},2500);e.preventDefault()});var H={},V=e.createElement("div");V.className="pnlm-sprite pnlm-hot-spot-debug-indicator",N.appendChild(V),H.container=e.createElement("div"),H.container.className="pnlm-panorama-info",H.title=e.createElement("div"),H.title.className="pnlm-title-box",H.container.appendChild(H.title),H.author=e.createElement("div"),H.author.className="pnlm-author-box",H.container.appendChild(H.author),N.appendChild(H.container),H.load={},H.load.box=e.createElement("div"),H.load.box.className="pnlm-load-box",H.load.boxp=e.createElement("p"),H.load.box.appendChild(H.load.boxp),H.load.lbox=e.createElement("div"),H.load.lbox.className="pnlm-lbox",H.load.lbox.innerHTML='<div class="pnlm-loading"></div>',H.load.box.appendChild(H.load.lbox),H.load.lbar=e.createElement("div"),H.load.lbar.className="pnlm-lbar",H.load.lbarFill=e.createElement("div"),H.load.lbarFill.className="pnlm-lbar-fill",H.load.lbar.appendChild(H.load.lbarFill),H.load.box.appendChild(H.load.lbar),H.load.msg=e.createElement("p"),H.load.msg.className="pnlm-lmsg",H.load.box.appendChild(H.load.msg),N.appendChild(H.load.box),H.errorMsg=e.createElement("div"),H.errorMsg.className="pnlm-error-msg pnlm-info-box",N.appendChild(H.errorMsg);var z={};z.container=e.createElement("div"),z.container.className="pnlm-controls-container",N.appendChild(z.container),z.load=e.createElement("div"),z.load.className="pnlm-load-button",z.load.addEventListener("click",function(){At(),Mt()}),N.appendChild(z.load),z.zoom=e.createElement("div"),z.zoom.className="pnlm-zoom-controls pnlm-controls",z.zoomIn=e.createElement("div"),z.zoomIn.className="pnlm-zoom-in pnlm-sprite pnlm-control",z.zoomIn.addEventListener("click",function(){u&&(It(a.hfov-5),vt())}),z.zoom.appendChild(z.zoomIn),z.zoomOut=e.createElement("div"),z.zoomOut.className="pnlm-zoom-out pnlm-sprite pnlm-control",z.zoomOut.addEventListener("click",function(){u&&(It(a.hfov+5),vt())}),z.zoom.appendChild(z.zoomOut),z.container.appendChild(z.zoom),z.fullscreen=e.createElement("div"),z.fullscreen.addEventListener("click",Pt),z.fullscreen.className="pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control",(e.fullscreenEnabled||e.mozFullScreenEnabled||e.webkitFullscreenEnabled||e.msFullscreenEnabled)&&z.container.appendChild(z.fullscreen),z.orientation=e.createElement("div"),z.orientation.addEventListener("click",function(t){A?Rt():Nt()}),z.orientation.addEventListener("mousedown",function(t){t.stopPropagation()}),z.orientation.addEventListener("touchstart",function(t){t.stopPropagation()}),z.orientation.addEventListener("pointerdown",function(t){t.stopPropagation()}),z.orientation.className="pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";var q,G=!1;t.DeviceOrientationEvent?t.addEventListener("deviceorientation",function e(i){t.removeEventListener("deviceorientation",e),i&&null!==i.alpha&&null!==i.beta&&null!==i.gamma?(z.container.appendChild(z.orientation),q=!0,G&&Nt()):q=!1}):q=!1;var W=e.createElement("div");function Y(){var n=e.createElement("div");if(n.innerHTML="\x3c!--[if lte IE 9]><i></i><![endif]--\x3e",1!=n.getElementsByTagName("i").length){var r,s;if(d=a.hfov,p=a.pitch,"cubemap"==a.type){for(l=[],r=0;r<6;r++)l.push(new Image),l[r].crossOrigin=a.crossOrigin;H.load.lbox.style.display="block",H.load.lbar.style.display="none"}else if("multires"==a.type){var o=JSON.parse(JSON.stringify(a.multiRes));a.basePath&&a.multiRes.basePath&&!/^(?:[a-z]+:)?\/\//i.test(a.multiRes.basePath)?o.basePath=a.basePath+a.multiRes.basePath:a.multiRes.basePath?o.basePath=a.multiRes.basePath:a.basePath&&(o.basePath=a.basePath),l=o}else if(!0===a.dynamic)l=a.panorama;else{if(a.panorama===i)return void $(a.strings.noPanoramaError);l=new Image}if("cubemap"==a.type){var u=6,c=function(){0===--u&&K()},h=function(t){var i=e.createElement("a");i.href=t.target.src,i.textContent=i.href,$(a.strings.fileAccessError.replace("%s",i.outerHTML))};for(r=0;r<l.length;r++)"null"==(s=a.cubeMap[r])?(console.log("Will use background instead of missing cubemap face "+r),c()):(a.basePath&&!X(s)&&(s=a.basePath+s),l[r].onload=c,l[r].onerror=h,l[r].src=jt(s))}else if("multires"==a.type)K();else if(s="",a.basePath&&(s=a.basePath),!0!==a.dynamic){s=X(a.panorama)?a.panorama:s+a.panorama,l.onload=function(){t.URL.revokeObjectURL(this.src),K()};var f=new XMLHttpRequest;f.onloadend=function(){if(200!=f.status){var n=e.createElement("a");n.href=s,n.textContent=n.href,$(a.strings.fileAccessError.replace("%s",n.outerHTML))}!function(e){var n=new FileReader;n.addEventListener("loadend",function(){var r=n.result;if(navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)){var s=r.indexOf("ÿÂ");(s<0||s>65536)&&$(a.strings.iOS8WebGLError)}var o=r.indexOf("<x:xmpmeta");if(o>-1&&!0!==a.ignoreGPanoXMP){var u=r.substring(o,r.indexOf("</x:xmpmeta>")+12),c=function(t){var e;return u.indexOf(t+'="')>=0?e=(e=u.substring(u.indexOf(t+'="')+t.length+2)).substring(0,e.indexOf('"')):u.indexOf(t+">")>=0&&(e=(e=u.substring(u.indexOf(t+">")+t.length+1)).substring(0,e.indexOf("<"))),e!==i?Number(e):null},h={fullWidth:c("GPano:FullPanoWidthPixels"),croppedWidth:c("GPano:CroppedAreaImageWidthPixels"),fullHeight:c("GPano:FullPanoHeightPixels"),croppedHeight:c("GPano:CroppedAreaImageHeightPixels"),topPixels:c("GPano:CroppedAreaTopPixels"),heading:c("GPano:PoseHeadingDegrees"),horizonPitch:c("GPano:PosePitchDegrees"),horizonRoll:c("GPano:PoseRollDegrees")};null!==h.fullWidth&&null!==h.croppedWidth&&null!==h.fullHeight&&null!==h.croppedHeight&&null!==h.topPixels&&(U.indexOf("haov")<0&&(a.haov=h.croppedWidth/h.fullWidth*360),U.indexOf("vaov")<0&&(a.vaov=h.croppedHeight/h.fullHeight*180),U.indexOf("vOffset")<0&&(a.vOffset=-180*((h.topPixels+h.croppedHeight/2)/h.fullHeight-.5)),null!==h.heading&&U.indexOf("northOffset")<0&&(a.northOffset=h.heading,!1!==a.compass&&(a.compass=!0)),null!==h.horizonPitch&&null!==h.horizonRoll&&(U.indexOf("horizonPitch")<0&&(a.horizonPitch=h.horizonPitch),U.indexOf("horizonRoll")<0&&(a.horizonRoll=h.horizonRoll)))}l.src=t.URL.createObjectURL(e)}),n.readAsBinaryString!==i?n.readAsBinaryString(e):n.readAsText(e)}(this.response),H.load.msg.innerHTML=""},f.onprogress=function(t){if(t.lengthComputable){var e,i,n,r=t.loaded/t.total*100;H.load.lbarFill.style.width=r+"%",t.total>1e6?(e="MB",i=(t.loaded/1e6).toFixed(2),n=(t.total/1e6).toFixed(2)):t.total>1e3?(e="kB",i=(t.loaded/1e3).toFixed(1),n=(t.total/1e3).toFixed(1)):(e="B",i=t.loaded,n=t.total),H.load.msg.innerHTML=i+" / "+n+" "+e}else H.load.lbox.style.display="block",H.load.lbar.style.display="none"};try{f.open("GET",s,!0)}catch(t){$(a.strings.malformedURLError)}f.responseType="blob",f.setRequestHeader("Accept","image/*,*/*;q=0.9"),f.withCredentials="use-credentials"===a.crossOrigin,f.send()}a.draggable&&N.classList.add("pnlm-grab"),N.classList.remove("pnlm-grabbing")}else $()}function X(t){return new RegExp("^(?:[a-z]+:)?//","i").test(t)||"/"==t[0]||"blob:"==t.slice(0,5)}function K(){s||(s=new libpannellum.renderer(B)),C||(C=!0,j.addEventListener("mousedown",J,!1),e.addEventListener("mousemove",et,!1),e.addEventListener("mouseup",it,!1),a.mouseZoom&&(N.addEventListener("mousewheel",ht,!1),N.addEventListener("DOMMouseScroll",ht,!1)),a.doubleClickZoom&&j.addEventListener("dblclick",Q,!1),N.addEventListener("mozfullscreenchange",Lt,!1),N.addEventListener("webkitfullscreenchange",Lt,!1),N.addEventListener("msfullscreenchange",Lt,!1),N.addEventListener("fullscreenchange",Lt,!1),t.addEventListener("resize",yt,!1),t.addEventListener("orientationchange",yt,!1),a.disableKeyboardCtrl||(n.addEventListener("keydown",dt,!1),n.addEventListener("keyup",ft,!1),n.addEventListener("blur",pt,!1)),e.addEventListener("mouseleave",it,!1),""===e.documentElement.style.pointerAction&&""===e.documentElement.style.touchAction?(j.addEventListener("pointerdown",ut,!1),j.addEventListener("pointermove",lt,!1),j.addEventListener("pointerup",ct,!1),j.addEventListener("pointerleave",ct,!1)):(j.addEventListener("touchstart",nt,!1),j.addEventListener("touchmove",rt,!1),j.addEventListener("touchend",at,!1)),t.navigator.pointerEnabled&&(n.style.touchAction="none")),function(){try{var t={};a.horizonPitch!==i&&(t.horizonPitch=a.horizonPitch*Math.PI/180),a.horizonRoll!==i&&(t.horizonRoll=a.horizonRoll*Math.PI/180),a.backgroundColor!==i&&(t.backgroundColor=a.backgroundColor),s.init(l,a.type,a.dynamic,a.haov*Math.PI/180,a.vaov*Math.PI/180,a.vOffset*Math.PI/180,wt,t),!0!==a.dynamic&&(l=i)}catch(t){if("webgl error"==t.type||"no webgl"==t.type)$();else{if("webgl size error"!=t.type)throw $(a.strings.unknownError),t;$(a.strings.textureSizeError.replace("%s",t.width).replace("%s",t.maxWidth))}}}(),It(a.hfov),setTimeout(function(){!0},500)}function $(t){t===i&&(t=a.strings.genericWebGLError),H.errorMsg.innerHTML="<p>"+t+"</p>",z.load.style.display="none",H.load.box.style.display="none",H.errorMsg.style.display="table",k=!0,B.style.display="none",Ft("error",t)}function Z(t){var e=n.getBoundingClientRect(),i={};return i.x=t.clientX-e.left,i.y=t.clientY-e.top,i}function J(t){if(t.preventDefault(),n.focus(),u&&a.draggable){var e=Z(t);if(a.hotSpotDebug){var i=tt(t);console.log("Pitch: "+i[0]+", Yaw: "+i[1]+", Center Pitch: "+a.pitch+", Center Yaw: "+a.yaw+", HFOV: "+a.hfov)}Ut(),Rt(),a.roll=0,E.hfov=0,m=!0,g=Date.now(),y=e.x,v=e.y,b=a.yaw,T=a.pitch,N.classList.add("pnlm-grabbing"),N.classList.remove("pnlm-grab"),Ft("mousedown",t),vt()}}function Q(t){if(a.minHfov===a.hfov)f.setHfov(d,1e3);else{var e=tt(t);f.lookAt(e[0],e[1],a.minHfov,1e3)}}function tt(t){var e=Z(t),i=s.getCanvas(),n=i.clientWidth,r=i.clientHeight,o=e.x/n*2-1,u=(1-e.y/r*2)*r/n,l=1/Math.tan(a.hfov*Math.PI/360),c=Math.sin(a.pitch*Math.PI/180),h=Math.cos(a.pitch*Math.PI/180),d=l*h-u*c,p=Math.sqrt(o*o+d*d),f=180*Math.atan((u*h+l*c)/p)/Math.PI,m=180*Math.atan2(o/p,d/p)/Math.PI+a.yaw;return m<-180&&(m+=360),m>180&&(m-=360),[f,m]}function et(t){if(m&&u){g=Date.now();var e=s.getCanvas(),i=e.clientWidth,n=e.clientHeight,r=Z(t),o=180*(Math.atan(y/i*2-1)-Math.atan(r.x/i*2-1))/Math.PI*a.hfov/90+b;E.yaw=(o-a.yaw)%360*.2,a.yaw=o;var l=2*Math.atan(Math.tan(a.hfov/360*Math.PI)*n/i)*180/Math.PI,c=180*(Math.atan(r.y/n*2-1)-Math.atan(v/n*2-1))/Math.PI*l/90+T;E.pitch=.2*(c-a.pitch),a.pitch=c}}function it(t){m&&(m=!1,Date.now()-g>15&&(E.pitch=E.yaw=0),N.classList.add("pnlm-grab"),N.classList.remove("pnlm-grabbing"),g=Date.now(),Ft("mouseup",t))}function nt(t){if(u&&a.draggable){Ut(),Rt(),a.roll=0,E.hfov=0;var e=Z(t.targetTouches[0]);if(y=e.x,v=e.y,2==t.targetTouches.length){var i=Z(t.targetTouches[1]);y+=.5*(i.x-e.x),v+=.5*(i.y-e.y),_=Math.sqrt((e.x-i.x)*(e.x-i.x)+(e.y-i.y)*(e.y-i.y))}m=!0,g=Date.now(),b=a.yaw,T=a.pitch,Ft("touchstart",t),vt()}}function rt(t){if(a.draggable&&(t.preventDefault(),u&&(g=Date.now()),m&&u)){var e=Z(t.targetTouches[0]),i=e.x,n=e.y;if(2==t.targetTouches.length&&-1!=_){var r=Z(t.targetTouches[1]);i+=.5*(r.x-e.x),n+=.5*(r.y-e.y);var s=Math.sqrt((e.x-r.x)*(e.x-r.x)+(e.y-r.y)*(e.y-r.y));It(a.hfov+.1*(_-s)),_=s}var o=a.hfov/360*a.touchPanSpeedCoeffFactor,l=(y-i)*o+b;E.yaw=(l-a.yaw)%360*.2,a.yaw=l;var c=(n-v)*o+T;E.pitch=.2*(c-a.pitch),a.pitch=c}}function at(){m=!1,Date.now()-g>150&&(E.pitch=E.yaw=0),_=-1,g=Date.now(),Ft("touchend",event)}W.className="pnlm-compass pnlm-controls pnlm-control",N.appendChild(W),r.firstScene?xt(r.firstScene):r.default&&r.default.firstScene?xt(r.default.firstScene):xt(null),At(!0);var st=[],ot=[];function ut(t){"touch"==t.pointerType&&(st.push(t.pointerId),ot.push({clientX:t.clientX,clientY:t.clientY}),t.targetTouches=ot,nt(t),t.preventDefault())}function lt(t){if("touch"==t.pointerType)for(var e=0;e<st.length;e++)if(t.pointerId==st[e])return ot[e].clientX=t.clientX,ot[e].clientY=t.clientY,t.targetTouches=ot,rt(t),void t.preventDefault()}function ct(t){if("touch"==t.pointerType){for(var e=!1,n=0;n<st.length;n++)t.pointerId==st[n]&&(st[n]=i),st[n]&&(e=!0);e||(st=[],ot=[],at()),t.preventDefault()}}function ht(t){u&&("fullscreenonly"!=a.mouseZoom||w)&&(t.preventDefault(),Ut(),g=Date.now(),t.wheelDeltaY?(It(a.hfov-.05*t.wheelDeltaY),E.hfov=t.wheelDelta<0?1:-1):t.wheelDelta?(It(a.hfov-.05*t.wheelDelta),E.hfov=t.wheelDelta<0?1:-1):t.detail&&(It(a.hfov+1.5*t.detail),E.hfov=t.detail>0?1:-1),vt())}function dt(t){Ut(),g=Date.now(),Rt(),a.roll=0;var e=t.which||t.keycode;a.capturedKeyNumbers.indexOf(e)<0||(t.preventDefault(),27==e?w&&Pt():mt(e,!0))}function pt(){for(var t=0;t<10;t++)S[t]=!1}function ft(t){var e=t.which||t.keycode;a.capturedKeyNumbers.indexOf(e)<0||(t.preventDefault(),mt(e,!1))}function mt(t,e){var i=!1;switch(t){case 109:case 189:case 17:case 173:S[0]!=e&&(i=!0),S[0]=e;break;case 107:case 187:case 16:case 61:S[1]!=e&&(i=!0),S[1]=e;break;case 38:S[2]!=e&&(i=!0),S[2]=e;break;case 87:S[6]!=e&&(i=!0),S[6]=e;break;case 40:S[3]!=e&&(i=!0),S[3]=e;break;case 83:S[7]!=e&&(i=!0),S[7]=e;break;case 37:S[4]!=e&&(i=!0),S[4]=e;break;case 65:S[8]!=e&&(i=!0),S[8]=e;break;case 39:S[5]!=e&&(i=!0),S[5]=e;break;case 68:S[9]!=e&&(i=!0),S[9]=e}i&&e&&(c="undefined"!=typeof performance&&performance.now()?performance.now():Date.now(),vt())}function gt(t){var e=O[t],i=Math.min(1,Math.max((Date.now()-e.startTime)/1e3/(e.duration/1e3),0)),n=e.startPosition+a.animationTimingFunction(i)*(e.endPosition-e.startPosition);if(e.endPosition>e.startPosition&&n>=e.endPosition||e.endPosition<e.startPosition&&n<=e.endPosition||e.endPosition===e.startPosition){n=e.endPosition,E[t]=0;var r=O[t].callback,s=O[t].callbackArgs;delete O[t],"function"==typeof r&&r(s)}a[t]=n}function yt(){Lt()}function vt(){x||(x=!0,_t())}function _t(){if(function(){var t;if(u){a.yaw>180?a.yaw-=360:a.yaw<-180&&(a.yaw+=360),t=a.yaw;var e=0;if(a.avoidShowingBackground){var n=s.getCanvas(),r=a.hfov/2,o=180*Math.atan2(Math.tan(r/180*Math.PI),n.width/n.height)/Math.PI,l=a.vaov>a.haov;l?o*(1-Math.min(Math.cos((a.pitch-r)/180*Math.PI),Math.cos((a.pitch+r)/180*Math.PI))):e=r*(1-Math.min(Math.cos((a.pitch-o)/180*Math.PI),Math.cos((a.pitch+o)/180*Math.PI)))}var h=a.maxYaw-a.minYaw,d=-180,p=180;h<360&&(d=a.minYaw+a.hfov/2+e,p=a.maxYaw-a.hfov/2-e,h<a.hfov&&(d=p=(d+p)/2),a.yaw=Math.max(d,Math.min(p,a.yaw))),!1!==a.autoRotate&&t!=a.yaw&&c!==i&&(a.autoRotate*=-1);var n=s.getCanvas(),f=2*Math.atan(Math.tan(a.hfov/180*Math.PI*.5)/(n.width/n.height))/Math.PI*180,m=a.minPitch+f/2,g=a.maxPitch-f/2,y=a.maxPitch-a.minPitch;y<f&&(m=g=(m+g)/2),isNaN(m)&&(m=-90),isNaN(g)&&(g=90),a.pitch=Math.max(m,Math.min(g,a.pitch)),s.render(a.pitch*Math.PI/180,a.yaw*Math.PI/180,a.hfov*Math.PI/180,{roll:a.roll*Math.PI/180}),Et(),a.compass&&(W.style.transform="rotate("+(-a.yaw-a.northOffset)+"deg)",W.style.webkitTransform="rotate("+(-a.yaw-a.northOffset)+"deg)"),a.onRender&&a.onRender()}}(),h&&clearTimeout(h),m||!0===A)requestAnimationFrame(_t);else if(S[0]||S[1]||S[2]||S[3]||S[4]||S[5]||S[6]||S[7]||S[8]||S[9]||a.autoRotate||O.pitch||O.yaw||O.hfov||Math.abs(E.yaw)>.01||Math.abs(E.pitch)>.01||Math.abs(E.hfov)>.01)!function(){if(u){var t,e=!1,n=a.pitch,r=a.yaw,s=a.hfov;t="undefined"!=typeof performance&&performance.now()?performance.now():Date.now(),c===i&&(c=t);var o=(t-c)*a.hfov/1700;if(o=Math.min(o,1),S[0]&&!0===a.keyboardZoom&&(It(a.hfov+(.8*E.hfov+.5)*o),e=!0),S[1]&&!0===a.keyboardZoom&&(It(a.hfov+(.8*E.hfov-.2)*o),e=!0),(S[2]||S[6])&&(a.pitch+=(.8*E.pitch+.2)*o,e=!0),(S[3]||S[7])&&(a.pitch+=(.8*E.pitch-.2)*o,e=!0),(S[4]||S[8])&&(a.yaw+=(.8*E.yaw-.2)*o,e=!0),(S[5]||S[9])&&(a.yaw+=(.8*E.yaw+.2)*o,e=!0),e&&(g=Date.now()),Date.now(),a.autoRotate){if(t-c>.001){var l=(t-c)/1e3,h=(E.yaw/l*o-.2*a.autoRotate)*l;h=(-a.autoRotate>0?1:-1)*Math.min(Math.abs(a.autoRotate*l),Math.abs(h)),a.yaw+=h}a.autoRotateStopDelay&&(a.autoRotateStopDelay-=t-c,a.autoRotateStopDelay<=0&&(a.autoRotateStopDelay=!1,L=a.autoRotate,a.autoRotate=0))}if(O.pitch&&(gt("pitch"),n=a.pitch),O.yaw&&(gt("yaw"),r=a.yaw),O.hfov&&(gt("hfov"),s=a.hfov),o>0&&!a.autoRotate&&(S[4]||S[5]||S[8]||S[9]||O.yaw||(a.yaw+=E.yaw*o*.85),S[2]||S[3]||S[6]||S[7]||O.pitch||(a.pitch+=E.pitch*o*.85),S[0]||S[1]||O.hfov||It(a.hfov+E.hfov*o*.85)),c=t,o>0){E.yaw=.8*E.yaw+(a.yaw-r)/o*.2,E.pitch=.8*E.pitch+(a.pitch-n)/o*.2,E.hfov=.8*E.hfov+(a.hfov-s)/o*.2;var d=a.autoRotate?Math.abs(a.autoRotate):5;E.yaw=Math.min(d,Math.max(E.yaw,-d)),E.pitch=Math.min(d,Math.max(E.pitch,-d)),E.hfov=Math.min(d,Math.max(E.hfov,-d))}S[0]&&S[1]&&(E.hfov=0),(S[2]||S[6])&&(S[3]||S[7])&&(E.pitch=0),(S[4]||S[8])&&(S[5]||S[9])&&(E.yaw=0)}}(),a.autoRotateInactivityDelay>=0&&L&&Date.now()-g>a.autoRotateInactivityDelay&&!a.autoRotate&&(a.autoRotate=L,f.lookAt(p,i,d,3e3)),requestAnimationFrame(_t);else if(s&&(s.isLoading()||!0===a.dynamic&&M))requestAnimationFrame(_t);else{x=!1,c=i;var t=a.autoRotateInactivityDelay-(Date.now()-g);t>0?h=setTimeout(function(){a.autoRotate=L,f.lookAt(p,i,d,3e3),vt()},t):a.autoRotateInactivityDelay>=0&&L&&(a.autoRotate=L,f.lookAt(p,i,d,3e3),vt())}}function bt(t,e,i,n){this.w=t,this.x=e,this.y=i,this.z=n}function Tt(e,i,n){var r=function(t,e,i){var n=[e?e*Math.PI/180/2:0,i?i*Math.PI/180/2:0,t?t*Math.PI/180/2:0],r=[Math.cos(n[0]),Math.cos(n[1]),Math.cos(n[2])],a=[Math.sin(n[0]),Math.sin(n[1]),Math.sin(n[2])];return new bt(r[0]*r[1]*r[2]-a[0]*a[1]*a[2],a[0]*r[1]*r[2]-r[0]*a[1]*a[2],r[0]*a[1]*r[2]+a[0]*r[1]*a[2],r[0]*r[1]*a[2]+a[0]*a[1]*r[2])}(e,i,n);r=r.multiply(new bt(Math.sqrt(.5),-Math.sqrt(.5),0,0));var a=t.orientation?-t.orientation*Math.PI/180/2:0;return r.multiply(new bt(Math.cos(a),0,-Math.sin(a),0))}function St(t){var e=Tt(t.alpha,t.beta,t.gamma).toEulerAngles();"number"==typeof A&&A<10?A+=1:10===A?(P=e[2]/Math.PI*180+a.yaw,A=!0,requestAnimationFrame(_t)):(a.pitch=e[0]/Math.PI*180,a.roll=-e[1]/Math.PI*180,a.yaw=-e[2]/Math.PI*180+P)}function wt(){if(a.sceneFadeDuration&&s.fadeImg!==i){s.fadeImg.style.opacity=0;var t=s.fadeImg;delete s.fadeImg,setTimeout(function(){B.removeChild(t),Ft("scenechangefadedone")},a.sceneFadeDuration)}a.compass?W.style.display="inline":W.style.display="none",function(){if(D)return;a.hotSpots?(a.hotSpots=a.hotSpots.sort(function(t,e){return t.pitch<e.pitch}),a.hotSpots.forEach(kt)):a.hotSpots=[];D=!0,Et()}(),H.load.box.style.display="none",o!==i&&(B.removeChild(o),o=i),u=!0,Ft("load"),vt()}function kt(t){t.pitch=Number(t.pitch)||0,t.yaw=Number(t.yaw)||0;var i=e.createElement("div");i.className="pnlm-hotspot-base",t.cssClass?i.className+=" "+t.cssClass:i.className+=" pnlm-hotspot pnlm-sprite pnlm-"+Bt(t.type);var n,r=e.createElement("span");if(t.text&&(r.innerHTML=Bt(t.text)),t.video){var s=e.createElement("video"),o=t.video;a.basePath&&!X(o)&&(o=a.basePath+o),s.src=jt(o),s.controls=!0,s.style.width=t.width+"px",B.appendChild(i),r.appendChild(s)}else if(t.image){o=t.image;a.basePath&&!X(o)&&(o=a.basePath+o),(n=e.createElement("a")).href=jt(t.URL?t.URL:o),n.target="_blank",r.appendChild(n);var u=e.createElement("img");u.src=jt(o),u.style.width=t.width+"px",u.style.paddingTop="5px",B.appendChild(i),n.appendChild(u),r.style.maxWidth="initial"}else t.URL?((n=e.createElement("a")).href=jt(t.URL),n.target="_blank",B.appendChild(n),i.className+=" pnlm-pointer",r.className+=" pnlm-pointer",n.appendChild(i)):(t.sceneId&&(i.onclick=i.ontouchend=function(){return i.clicked||(i.clicked=!0,Dt(t.sceneId,t.targetPitch,t.targetYaw,t.targetHfov)),!1},i.className+=" pnlm-pointer",r.className+=" pnlm-pointer"),B.appendChild(i));t.createTooltipFunc?t.createTooltipFunc(i,t.createTooltipArgs):(t.text||t.video||t.image)&&(i.classList.add("pnlm-tooltip"),i.appendChild(r),r.style.width=r.scrollWidth-20+"px",r.style.marginLeft=-(r.scrollWidth-i.offsetWidth)/2+"px",r.style.marginTop=-r.scrollHeight-12+"px"),t.clickHandlerFunc&&(i.addEventListener("click",function(e){t.clickHandlerFunc(e,t.clickHandlerArgs)},"false"),i.className+=" pnlm-pointer",r.className+=" pnlm-pointer"),t.div=i}function Ct(t){var e=Math.sin(t.pitch*Math.PI/180),i=Math.cos(t.pitch*Math.PI/180),n=Math.sin(a.pitch*Math.PI/180),r=Math.cos(a.pitch*Math.PI/180),o=Math.cos((-t.yaw+a.yaw)*Math.PI/180),u=e*n+i*o*r;if(t.yaw<=90&&t.yaw>-90&&u<=0||(t.yaw>90||t.yaw<=-90)&&u<=0)t.div.style.visibility="hidden";else{var l=Math.sin((-t.yaw+a.yaw)*Math.PI/180),c=Math.tan(a.hfov*Math.PI/360);t.div.style.visibility="visible";var h=s.getCanvas(),d=h.clientWidth,p=h.clientHeight,f=[-d/c*l*i/u/2,-d/c*(e*r-i*o*n)/u/2],m=Math.sin(a.roll*Math.PI/180),g=Math.cos(a.roll*Math.PI/180);(f=[f[0]*g-f[1]*m,f[0]*m+f[1]*g])[0]+=(d-t.div.offsetWidth)/2,f[1]+=(p-t.div.offsetHeight)/2;var y="translate("+f[0]+"px, "+f[1]+"px) translateZ(9999px) rotate("+a.roll+"deg)";t.div.style.webkitTransform=y,t.div.style.MozTransform=y,t.div.style.transform=y}}function Et(){a.hotSpots.forEach(Ct)}function xt(t){var e,i;a={};var n=["haov","vaov","vOffset","northOffset","horizonPitch","horizonRoll"];for(e in U=[],R)R.hasOwnProperty(e)&&(a[e]=R[e]);for(e in r.default)if(r.default.hasOwnProperty(e))if("strings"==e)for(i in r.default.strings)r.default.strings.hasOwnProperty(i)&&(a.strings[i]=Bt(r.default.strings[i]));else a[e]=r.default[e],n.indexOf(e)>=0&&U.push(e);if(null!==t&&""!==t&&r.scenes&&r.scenes[t]){var s=r.scenes[t];for(e in s)if(s.hasOwnProperty(e))if("strings"==e)for(i in s.strings)s.strings.hasOwnProperty(i)&&(a.strings[i]=Bt(s.strings[i]));else a[e]=s[e],n.indexOf(e)>=0&&U.push(e);a.scene=t}for(e in r)if(r.hasOwnProperty(e))if("strings"==e)for(i in r.strings)r.strings.hasOwnProperty(i)&&(a.strings[i]=Bt(r.strings[i]));else a[e]=r[e],n.indexOf(e)>=0&&U.push(e)}function At(t){if((t=t||!1)&&"preview"in a){var n=a.preview;a.basePath&&!X(n)&&(n=a.basePath+n),(o=e.createElement("div")).className="pnlm-preview-img",o.style.backgroundImage="url('"+function(t){return jt(t).replace(/"/g,"%22").replace(/'/g,"%27")}(n)+"')",B.appendChild(o)}var r=a.title,u=a.author;for(var l in t&&("previewTitle"in a&&(a.title=a.previewTitle),"previewAuthor"in a&&(a.author=a.previewAuthor)),a.hasOwnProperty("title")||(H.title.innerHTML=""),a.hasOwnProperty("author")||(H.author.innerHTML=""),a.hasOwnProperty("title")||a.hasOwnProperty("author")||(H.container.style.display="none"),z.load.innerHTML="<p>"+a.strings.loadButtonLabel+"</p>",H.load.boxp.innerHTML=a.strings.loadingLabel,a)if(a.hasOwnProperty(l))switch(l){case"title":H.title.innerHTML=Bt(a[l]),H.container.style.display="inline";break;case"author":H.author.innerHTML=a.strings.bylineLabel.replace("%s",Bt(a[l])),H.container.style.display="inline";break;case"fallback":var c=e.createElement("a");c.href=jt(a[l]),c.target="_blank",c.textContent="Click here to view this panorama in an alternative viewer.";var h=e.createElement("p");h.textContent="Your browser does not support WebGL.",h.appendChild(e.createElement("br")),h.appendChild(c),H.errorMsg.innerHTML="",H.errorMsg.appendChild(h);break;case"hfov":It(Number(a[l]));break;case"autoLoad":!0===a[l]&&s===i&&(H.load.box.style.display="inline",z.load.style.display="none",Y());break;case"showZoomCtrl":a[l]&&0!=a.showControls?z.zoom.style.display="block":z.zoom.style.display="none";break;case"showFullscreenCtrl":a[l]&&0!=a.showControls&&("fullscreen"in e||"mozFullScreen"in e||"webkitIsFullScreen"in e||"msFullscreenElement"in e)?z.fullscreen.style.display="block":z.fullscreen.style.display="none";break;case"hotSpotDebug":a[l]?V.style.display="block":V.style.display="none";break;case"showControls":a[l]||(z.orientation.style.display="none",z.zoom.style.display="none",z.fullscreen.style.display="none");break;case"orientationOnByDefault":a[l]&&(q===i?G=!0:!0===q&&Nt())}t&&(r?a.title=r:delete a.title,u?a.author=u:delete a.author)}function Pt(){if(u&&!k)if(w)e.exitFullscreen?e.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen();else try{n.requestFullscreen?n.requestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen?n.msRequestFullscreen():n.webkitRequestFullScreen()}catch(t){}}function Lt(){var i=t.innerWidth==screen.width&&t.innerHeight==screen.height;e.fullscreen||e.mozFullScreen||e.webkitIsFullScreen||e.msFullscreenElement||i?(z.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"),w=!0):(z.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"),w=!1),s.resize(),It(a.hfov),vt()}function Ot(t){var e=a.minHfov;if("multires"==a.type&&s&&(e=Math.min(e,s.getCanvas().width/(a.multiRes.cubeResolution/90*.9))),e>a.maxHfov)return console.log("HFOV bounds do not make sense (minHfov > maxHfov)."),a.hfov;var i=a.hfov;if(i=t<e?e:t>a.maxHfov?a.maxHfov:t,a.avoidShowingBackground&&s){var n=s.getCanvas();i=Math.min(i,360*Math.atan(Math.tan((a.maxPitch-a.minPitch)/360*Math.PI)/n.height*n.width)/Math.PI)}return i}function It(t){a.hfov=Ot(t)}function Ut(){O={},L=a.autoRotate?a.autoRotate:L,a.autoRotate=!1}function Mt(){k&&(H.load.box.style.display="none",H.errorMsg.style.display="none",k=!1,Ft("errorcleared")),u=!1,z.load.style.display="none",H.load.box.style.display="inline",Y()}function Dt(t,e,n,o,l){var c,h,d,p;if(u=!1,O={},a.sceneFadeDuration&&!l){var f=s.render(a.pitch*Math.PI/180,a.yaw*Math.PI/180,a.hfov*Math.PI/180,{returnImage:!0});if(f!==i)return(c=new Image).className="pnlm-fade-img",c.style.transition="opacity "+a.sceneFadeDuration/1e3+"s",c.style.width="100%",c.style.height="100%",c.onload=function(){Dt(t,e,n,o,!0)},c.src=f,B.appendChild(c),void(s.fadeImg=c)}h="same"===e?a.pitch:e,d="same"===n?a.yaw:"sameAzimuth"===n?a.yaw+(a.northOffset||0)-(r.scenes[t].northOffset||0):n,p="same"===o?a.hfov:o,function(){var t=a.hotSpots;if(D=!1,delete a.hotSpots,t)for(var e=0;e<t.length;e++){for(var i=t[e].div;i.parentNode!=B;)i=i.parentNode;B.removeChild(i),delete t[e].div}}(),xt(t),E.yaw=E.pitch=E.hfov=0,At(),h!==i&&(a.pitch=h),d!==i&&(a.yaw=d),p!==i&&(a.hfov=p),Ft("scenechange",t),Mt()}function Rt(){t.removeEventListener("deviceorientation",St),z.orientation.classList.remove("pnlm-orientation-button-active"),A=!1}function Nt(){A=1,t.addEventListener("deviceorientation",St),z.orientation.classList.add("pnlm-orientation-button-active")}function Bt(t){return r.escapeHTML?String(t).split(/&/g).join("&amp;").split('"').join("&quot;").split("'").join("&#39;").split("<").join("&lt;").split(">").join("&gt;").split("/").join("&#x2f;").split("\n").join("<br>"):String(t).split("\n").join("<br>")}function jt(t){return 0===t.trim().toLowerCase().indexOf("javascript:")?"about:blank":t}function Ft(t){if(t in I)for(var e=I[t].length;e>0;e--)I[t][I[t].length-e].apply(null,[].slice.call(arguments,1))}bt.prototype.multiply=function(t){return new bt(this.w*t.w-this.x*t.x-this.y*t.y-this.z*t.z,this.x*t.w+this.w*t.x+this.y*t.z-this.z*t.y,this.y*t.w+this.w*t.y+this.z*t.x-this.x*t.z,this.z*t.w+this.w*t.z+this.x*t.y-this.y*t.x)},bt.prototype.toEulerAngles=function(){return[Math.atan2(2*(this.w*this.x+this.y*this.z),1-2*(this.x*this.x+this.y*this.y)),Math.asin(2*(this.w*this.y-this.z*this.x)),Math.atan2(2*(this.w*this.z+this.x*this.y),1-2*(this.y*this.y+this.z*this.z))]},this.isLoaded=function(){return Boolean(u)},this.getPitch=function(){return a.pitch},this.setPitch=function(t,e,n,r){return(e=e==i?1e3:Number(e))?O.pitch={startTime:Date.now(),startPosition:a.pitch,endPosition:t,duration:e,callback:n,callbackArgs:r}:a.pitch=t,vt(),this},this.getPitchBounds=function(){return[a.minPitch,a.maxPitch]},this.setPitchBounds=function(t){return a.minPitch=Math.max(-90,Math.min(t[0],90)),a.maxPitch=Math.max(-90,Math.min(t[1],90)),this},this.getYaw=function(){return a.yaw},this.setYaw=function(t,e,n,r){return t=(t+180)%360-180,(e=e==i?1e3:Number(e))?(a.yaw-t>180?t+=360:t-a.yaw>180&&(t-=360),O.yaw={startTime:Date.now(),startPosition:a.yaw,endPosition:t,duration:e,callback:n,callbackArgs:r}):a.yaw=t,vt(),this},this.getYawBounds=function(){return[a.minYaw,a.maxYaw]},this.setYawBounds=function(t){return a.minYaw=Math.max(-180,Math.min(t[0],180)),a.maxYaw=Math.max(-180,Math.min(t[1],180)),this},this.getHfov=function(){return a.hfov},this.setHfov=function(t,e,n,r){return(e=e==i?1e3:Number(e))?O.hfov={startTime:Date.now(),startPosition:a.hfov,endPosition:Ot(t),duration:e,callback:n,callbackArgs:r}:It(t),vt(),this},this.getHfovBounds=function(){return[a.minHfov,a.maxHfov]},this.setHfovBounds=function(t){return a.minHfov=Math.max(0,t[0]),a.maxHfov=Math.max(0,t[1]),this},this.lookAt=function(t,e,n,r,a,s){return r=r==i?1e3:Number(r),t!==i&&(this.setPitch(t,r,a,s),a=i),e!==i&&(this.setYaw(e,r,a,s),a=i),n!==i&&this.setHfov(n,r,a,s),this},this.getNorthOffset=function(){return a.northOffset},this.setNorthOffset=function(t){return a.northOffset=Math.min(360,Math.max(0,t)),vt(),this},this.getHorizonRoll=function(){return a.horizonRoll},this.setHorizonRoll=function(t){return a.horizonRoll=Math.min(90,Math.max(-90,t)),s.setPose(a.horizonPitch*Math.PI/180,a.horizonRoll*Math.PI/180),vt(),this},this.getHorizonPitch=function(){return a.horizonPitch},this.setHorizonPitch=function(t){return a.horizonPitch=Math.min(90,Math.max(-90,t)),s.setPose(a.horizonPitch*Math.PI/180,a.horizonRoll*Math.PI/180),vt(),this},this.startAutoRotate=function(t){return t=t||L||1,a.autoRotate=t,f.lookAt(p,i,d,3e3),vt(),this},this.stopAutoRotate=function(){return L=a.autoRotate?a.autoRotate:L,a.autoRotate=!1,a.autoRotateInactivityDelay=-1,this},this.getRenderer=function(){return s},this.setUpdate=function(t){return M=!0===t,s===i?K():vt(),this},this.mouseEventToCoords=function(t){return tt(t)},this.loadScene=function(t,e,i,n){return!1!==u&&Dt(t,e,i,n),this},this.getScene=function(){return a.scene},this.addScene=function(t,e){return r.scenes[t]=e,this},this.removeScene=function(t){return!(a.scene===t||!r.scenes.hasOwnProperty(t))&&(delete r.scenes[t],!0)},this.toggleFullscreen=function(){return Pt(),this},this.getConfig=function(){return a},this.getContainer=function(){return n},this.addHotSpot=function(t,e){if(e===i&&a.scene===i)a.hotSpots.push(t);else{var n=e!==i?e:a.scene;if(!r.scenes.hasOwnProperty(n))throw"Invalid scene ID!";r.scenes[n].hasOwnProperty("hotSpots")||(r.scenes[n].hotSpots=[],n==a.scene&&(a.hotSpots=r.scenes[n].hotSpots)),r.scenes[n].hotSpots.push(t)}return e!==i&&a.scene!=e||(kt(t),u&&Ct(t)),this},this.removeHotSpot=function(t,e){if(e===i||a.scene==e){if(!a.hotSpots)return!1;for(var n=0;n<a.hotSpots.length;n++)if(a.hotSpots[n].hasOwnProperty("id")&&a.hotSpots[n].id===t){for(var s=a.hotSpots[n].div;s.parentNode!=B;)s=s.parentNode;return B.removeChild(s),delete a.hotSpots[n].div,a.hotSpots.splice(n,1),!0}}else{if(!r.scenes.hasOwnProperty(e))return!1;if(!r.scenes[e].hasOwnProperty("hotSpots"))return!1;for(n=0;n<r.scenes[e].hotSpots.length;n++)if(r.scenes[e].hotSpots[n].hasOwnProperty("id")&&r.scenes[e].hotSpots[n].id===t)return r.scenes[e].hotSpots.splice(n,1),!0}},this.resize=function(){s&&yt()},this.isLoaded=function(){return u},this.isOrientationSupported=function(){return q||!1},this.stopOrientation=function(){Rt()},this.startOrientation=function(){q&&Nt()},this.isOrientationActive=function(){return Boolean(A)},this.on=function(t,e){return I[t]=I[t]||[],I[t].push(e),this},this.off=function(t,e){if(!t)return I={},this;if(e){var i=I[t].indexOf(e);i>=0&&I[t].splice(i,1),0==I[t].length&&delete I[t]}else delete I[t];return this},this.destroy=function(){s&&s.destroy(),C&&(j.removeEventListener("mousedown",J,!1),j.removeEventListener("dblclick",Q,!1),e.removeEventListener("mousemove",et,!1),e.removeEventListener("mouseup",it,!1),n.removeEventListener("mousewheel",ht,!1),n.removeEventListener("DOMMouseScroll",ht,!1),n.removeEventListener("mozfullscreenchange",Lt,!1),n.removeEventListener("webkitfullscreenchange",Lt,!1),n.removeEventListener("msfullscreenchange",Lt,!1),n.removeEventListener("fullscreenchange",Lt,!1),t.removeEventListener("resize",yt,!1),t.removeEventListener("orientationchange",yt,!1),n.removeEventListener("keydown",dt,!1),n.removeEventListener("keyup",ft,!1),n.removeEventListener("blur",pt,!1),e.removeEventListener("mouseleave",it,!1),j.removeEventListener("touchstart",nt,!1),j.removeEventListener("touchmove",rt,!1),j.removeEventListener("touchend",at,!1),j.removeEventListener("pointerdown",ut,!1),j.removeEventListener("pointermove",lt,!1),j.removeEventListener("pointerup",ct,!1),j.removeEventListener("pointerleave",ct,!1)),n.innerHTML="",n.classList.remove("pnlm-container"),N.classList.remove("pnlm-grab"),N.classList.remove("pnlm-grabbing")}}return{viewer:function(t,e){return new n(t,e)}}}(window,document)},function(t,e){window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){window.setTimeout(t,1e3/60)})},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,w,k,C,E,x,A,P,L,O,I,U,M,D,R,N,B,j=Math.pow(2,32)-1;!function(){var t;if(C={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(t in C)C.hasOwnProperty(t)&&(C[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);E=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)]),x=new Uint8Array([0,0,0,1]),P=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]),L=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]),O={video:P,audio:L},M=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),U=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0]),R=D,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B=D,I=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),n=function(t){var e,i,n=[],r=0;for(e=1;e<arguments.length;e++)n.push(arguments[e]);for(e=n.length;e--;)r+=n[e].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(t,4),e=0,r=8;e<n.length;e++)i.set(n[e],r),r+=n[e].byteLength;return i},r=function(){return n(C.dinf,n(C.dref,M))},a=function(t){return n(C.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,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},s=function(){return n(C.ftyp,E,x,E,A)},v=function(t){return n(C.hdlr,O[t])},o=function(t){return n(C.mdat,t)},y=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(e[12]=t.samplerate>>>24&255,e[13]=t.samplerate>>>16&255,e[14]=t.samplerate>>>8&255,e[15]=255&t.samplerate),n(C.mdhd,e)},g=function(t){return n(C.mdia,y(t),v(t.type),l(t))},u=function(t){return n(C.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},l=function(t){return n(C.minf,"video"===t.type?n(C.vmhd,I):n(C.smhd,U),r(),b(t))},c=function(t,e){for(var i=[],r=e.length;r--;)i[r]=S(e[r]);return n.apply(null,[C.moof,u(t)].concat(i))},h=function(t){for(var e=t.length,i=[];e--;)i[e]=f(t[e]);return n.apply(null,[C.moov,p(4294967295)].concat(i).concat(d(t)))},d=function(t){for(var e=t.length,i=[];e--;)i[e]=w(t[e]);return n.apply(null,[C.mvex].concat(i))},p=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,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(C.mvhd,e)},_=function(t){var e,i,r=t.samples||[],a=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)e=r[i].flags,a[i+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return n(C.sdtp,a)},b=function(t){return n(C.stbl,T(t),n(C.stts,B),n(C.stsc,R),n(C.stsz,N),n(C.stco,D))},function(){var t,e;T=function(i){return n(C.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?t(i):e(i))},t=function(t){var e,i=t.sps||[],r=t.pps||[],a=[],s=[];for(e=0;e<i.length;e++)a.push((65280&i[e].byteLength)>>>8),a.push(255&i[e].byteLength),a=a.concat(Array.prototype.slice.call(i[e]));for(e=0;e<r.length;e++)s.push((65280&r[e].byteLength)>>>8),s.push(255&r[e].byteLength),s=s.concat(Array.prototype.slice.call(r[e]));return n(C.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&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.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(C.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([i.length]).concat(a).concat([r.length]).concat(s))),n(C.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},e=function(t){return n(C.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),a(t))}}(),m=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.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&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return n(C.tkhd,e)},S=function(t){var e,i,r,a,s,o;return e=n(C.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(t.baseMediaDecodeTime/(j+1)),o=Math.floor(t.baseMediaDecodeTime%(j+1)),i=n(C.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===t.type?(r=k(t,92),n(C.traf,e,i,r)):(a=_(t),r=k(t,a.length+92),n(C.traf,e,i,r,a))},f=function(t){return t.duration=t.duration||4294967295,n(C.trak,m(t),g(t))},w=function(t){var e=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(e[e.length-1]=0),n(C.trex,e)},function(){var t,e,i;i=function(t,e){var i=0,n=0,r=0,a=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(r=4),void 0!==t[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},e=function(t,e){var r,a,s,o;for(e+=20+16*(a=t.samples||[]).length,r=i(a,e),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(C.trun,new Uint8Array(r))},t=function(t,e){var r,a,s,o;for(e+=20+8*(a=t.samples||[]).length,r=i(a,e),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(C.trun,new Uint8Array(r))},k=function(i,n){return"audio"===i.type?t(i,n):e(i,n)}}(),t.exports={ftyp:s,mdat:o,moof:c,moov:h,initSegment:function(t){var e,i=s(),n=h(t);return(e=new Uint8Array(i.byteLength+n.byteLength)).set(i),e.set(n,i.byteLength),e}}},function(t,e,i){"use strict";var n=i(2),r=i(19),a=function(){a.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new c(0,0),new c(0,1),new c(1,0),new c(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("done",this.trigger.bind(this,"done"))},this)};a.prototype=new n,a.prototype.push=function(t){var e,i,n;if("sei_rbsp"===t.nalUnitType&&(e=r.parseSei(t.escapedRBSP)).payloadType===r.USER_DATA_REGISTERED_ITU_T_T35&&(i=r.parseUserData(e)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=r.parseCaptionPackets(t.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},a.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2&&this.dispatchCea608Packet(t)},this),this.captionPackets_.length=0,this.ccStreams_.forEach(function(t){t.flush()},this)):this.ccStreams_.forEach(function(t){t.flush()},this)},a.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},a.prototype.dispatchCea608Packet=function(t){this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},a.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},a.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var s={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},o=function(t){return null===t?"":(t=s[t]||t,String.fromCharCode(t))},u=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],l=function(){for(var t=[],e=15;e--;)t.push("");return t},c=function(t,e){c.prototype.init.call(this),this.field_=t||0,this.dataChannel_=e||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,n,r,a;if((e=32639&t.ccData)!==this.lastControlCode_){if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),n=e>>>8,r=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===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(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=l();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=l();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=l()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(n,r))a=o((n=(3&n)<<8)|r),this[this.mode_](t.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),a=o((n=(3&n)<<8)|r),this[this.mode_](t.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&r)&&this.addFormatting(t.pts,["i"]),1==(1&r)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=u.indexOf(7968&e);"rollUp"===this.mode_&&this.setRollUp(t.pts,s),s!==this.row_&&(this.clearFormatting(t.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=o(n),a+=o(r),this[this.mode_](t.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};c.prototype=new n,c.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},c.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=l(),this.nonDisplayed_=l(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},c.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_},c.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},c.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},c.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},c.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},c.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},c.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},c.prototype.isNormalChar=function(t){return t>=32&&t<=127},c.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=l(),this.displayed_=l()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},c.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,i)},c.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,e)}},c.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},c.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i},c.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},c.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i},t.exports={CaptionStream:a,Cea608Stream:c}},function(t,e,i){"use strict";t.exports={parseSei:function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,r=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)r+=255,e++;if(r+=t[e++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=t.subarray(e,e+r);break}e+=r,n=0,r=0}return i},parseUserData:function(t){return 181!==t.payload[0]?null:49!=(t.payload[1]<<8|t.payload[2])?null:"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])?null:3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},parseCaptionPackets:function(t,e){var i,n,r,a,s=[];if(!(64&e[0]))return s;for(n=31&e[0],i=0;i<n;i++)a={type:3&e[2+(r=3*i)],pts:t},4&e[r+2]&&(a.ccData=e[r+3]<<8|e[r+4],s.push(a));return s},discardEmulationPreventionBytes:function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);var s=0;for(a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},USER_DATA_REGISTERED_ITU_T_T35:4}},function(t,e,i){"use strict";var n=i(2),r=function(t,e){var i=1;for(t>e&&(i=-1);Math.abs(e-t)>4294967296;)t+=8589934592*i;return t},a=function(t){var e,i;a.prototype.init.call(this),this.type_=t,this.push=function(t){t.type===this.type_&&(void 0===i&&(i=t.dts),t.dts=r(t.dts,i),t.pts=r(t.pts,i),e=t.dts,this.trigger("data",t))},this.flush=function(){i=e,this.trigger("done")},this.discontinuity=function(){i=void 0,e=void 0}};a.prototype=new n,t.exports={TimestampRolloverStream:a,handleRollover:r}},function(t,e){t.exports=function(t,e){var i,n=null;try{i=JSON.parse(t,e)}catch(t){n=t}return[n,i]}},function(t,e,i){t.exports={generator:i(17),probe:i(3),Transmuxer:i(8).Transmuxer,AudioSegmentStream:i(8).AudioSegmentStream,VideoSegmentStream:i(8).VideoSegmentStream,CaptionParser:i(48)}},function(t,e,i){"use strict";var n=i(6),r=i(20).handleRollover,a={};a.ts=i(50),a.aac=i(51);var s=function(t,e,i){for(var n,r,s,o,u=0,l=188,c=!1;l<t.byteLength;)if(71!==t[u]||71!==t[l])u++,l++;else{switch(n=t.subarray(u,l),a.ts.parseType(n,e.pid)){case"pes":r=a.ts.parsePesType(n,e.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(o=a.ts.parsePesTime(n))&&(o.type="audio",i.audio.push(o),c=!0)}if(c)break;u+=188,l+=188}for(u=(l=t.byteLength)-188,c=!1;u>=0;)if(71!==t[u]||71!==t[l])u--,l--;else{switch(n=t.subarray(u,l),a.ts.parseType(n,e.pid)){case"pes":r=a.ts.parsePesType(n,e.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(o=a.ts.parsePesTime(n))&&(o.type="audio",i.audio.push(o),c=!0)}if(c)break;u-=188,l-=188}},o=function(t,e,i){for(var n,r,s,o,u,l,c,h=0,d=188,p=!1,f={data:[],size:0};d<t.byteLength;)if(71!==t[h]||71!==t[d])h++,d++;else{switch(n=t.subarray(h,d),a.ts.parseType(n,e.pid)){case"pes":if(r=a.ts.parsePesType(n,e.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!p&&(o=a.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),p=!0),!i.firstKeyFrame)){if(s&&0!==f.size){for(u=new Uint8Array(f.size),l=0;f.data.length;)c=f.data.shift(),u.set(c,l),l+=c.byteLength;a.ts.videoPacketContainsKeyFrame(u)&&(i.firstKeyFrame=a.ts.parsePesTime(u),i.firstKeyFrame.type="video"),f.size=0}f.data.push(n),f.size+=n.byteLength}}if(p&&i.firstKeyFrame)break;h+=188,d+=188}for(h=(d=t.byteLength)-188,p=!1;h>=0;)if(71!==t[h]||71!==t[d])h--,d--;else{switch(n=t.subarray(h,d),a.ts.parseType(n,e.pid)){case"pes":r=a.ts.parsePesType(n,e.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(o=a.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),p=!0)}if(p)break;h-=188,d-=188}},u=function(t){var e={pid:null,table:null},i={};for(var r in function(t,e){for(var i,n=0,r=188;r<t.byteLength;)if(71!==t[n]||71!==t[r])n++,r++;else{switch(i=t.subarray(n,r),a.ts.parseType(i,e.pid)){case"pat":e.pid||(e.pid=a.ts.parsePat(i));break;case"pmt":e.table||(e.table=a.ts.parsePmt(i))}if(e.pid&&e.table)return;n+=188,r+=188}}(t,e),e.table){if(e.table.hasOwnProperty(r))switch(e.table[r]){case n.H264_STREAM_TYPE:i.video=[],o(t,e,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],s(t,e,i),0===i.audio.length&&delete i.audio}}return i};t.exports={inspect:function(t,e){var i;return(i=function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)}(t)?function(t){for(var e,i=!1,n=0,r=null,s=null,o=0,u=0;t.length-u>=3;){switch(a.aac.parseType(t,u)){case"timed-metadata":if(t.length-u<10){i=!0;break}if((o=a.aac.parseId3TagSize(t,u))>t.length){i=!0;break}null===s&&(e=t.subarray(u,u+o),s=a.aac.parseAacTimestamp(e)),u+=o;break;case"audio":if(t.length-u<7){i=!0;break}if((o=a.aac.parseAdtsSize(t,u))>t.length){i=!0;break}null===r&&(e=t.subarray(u,u+o),r=a.aac.parseSampleRate(e)),n++,u+=o;break;default:u++}if(i)return null}if(null===r||null===s)return null;var l=9e4/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*l,pts:s+1024*n*l}]}}(t):u(t))&&(i.audio||i.video)?(function(t,e){if(t.audio&&t.audio.length){var i=e;void 0===i&&(i=t.audio[0].dts),t.audio.forEach(function(t){t.dts=r(t.dts,i),t.pts=r(t.pts,i),t.dtsTime=t.dts/9e4,t.ptsTime=t.pts/9e4})}if(t.video&&t.video.length){var n=e;if(void 0===n&&(n=t.video[0].dts),t.video.forEach(function(t){t.dts=r(t.dts,n),t.pts=r(t.pts,n),t.dtsTime=t.dts/9e4,t.ptsTime=t.pts/9e4}),t.firstKeyFrame){var a=t.firstKeyFrame;a.dts=r(a.dts,n),a.pts=r(a.pts,n),a.dtsTime=a.dts/9e4,a.ptsTime=a.dts/9e4}}}(i,e),i):null}}},function(t,e,i){t.exports=i(54)},,,function(t,e){},function(t,e){t.exports=function(t){var e=i.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var i=Object.prototype.toString},function(t,e,i){var n=i(30),r=i(31);t.exports=function(t){if(!t)return{};var e={};return r(n(t).split("\n"),function(t){var i=t.indexOf(":"),r=n(t.slice(0,i)).toLowerCase(),a=n(t.slice(i+1));void 0===e[r]?e[r]=a:!function(t){return"[object Array]"===Object.prototype.toString.call(t)}(e[r])?e[r]=[e[r],a]:e[r].push(a)}),e}},function(t,e){(e=t.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}},function(t,e,i){"use strict";var n=i(32),r=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,i){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=i),"[object Array]"===r.call(t)?function(t,e,i){for(var n=0,r=t.length;n<r;n++)a.call(t,n)&&(null==i?e(t[n],n,t):e.call(i,t[n],n,t))}(t,e,s):"string"==typeof t?function(t,e,i){for(var n=0,r=t.length;n<r;n++)null==i?e(t.charAt(n),n,t):e.call(i,t.charAt(n),n,t)}(t,e,s):function(t,e,i){for(var n in t)a.call(t,n)&&(null==i?e(t[n],n,t):e.call(i,t[n],n,t))}(t,e,s)}},function(t,e,i){"use strict";var n=Function.prototype.toString,r=/^\s*class\b/,a=function(t){try{var e=n.call(t);return r.test(e)}catch(t){return!1}},s=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(o)return function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(a(t))return!1;var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var r in n)i.call(n,r)&&(t[r]=n[r])}return t};var i=Object.prototype.hasOwnProperty},function(t,e){var i=Object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function n(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function r(t){function e(t,e,i,n){return 3600*(0|t)+60*(0|e)+(0|i)+(0|n)/1e3}var i=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?e(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?e(i[1],i[2],0,i[4]):e(0,i[1],i[2],i[4]):null}function a(){this.values=i(null)}function s(t,e,i,n){var r=n?t.split(n):[t];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)e(s[0],s[1])}}function o(t,e,i){var o=t;function u(){var e=r(t);if(null===e)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+o);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function l(){t=t.replace(/^\s+/,"")}if(l(),e.startTime=u(),l(),"--\x3e"!==t.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);t=t.substr(3),l(),e.endTime=u(),l(),function(t,e){var n=new a;s(t,function(t,e){switch(t){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===e){n.set(t,i[r].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":var a=e.split(","),s=a[0];n.integer(t,s),n.percent(t,s)&&n.set("snapToLines",!1),n.alt(t,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=e.split(","),n.percent(t,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical",""),e.line=n.get("line","auto"),e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100),e.align=n.get("align","middle"),e.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},e.align),e.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},e.align)}(t,e)}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(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var n=0;n<i.length;++n)if(e===i[n]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var u={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={v:"title",lang:"lang"},h={rt:"ruby"};function d(t,e){function i(){if(!e)return null;var t=e.match(/^([^<]*)(<[^>]*>?)?/);return function(t){return e=e.substr(t.length),t}(t[1]?t[1]:t[2])}function n(t){return u[t]}function a(t){for(;v=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(v[0],n);return t}function s(t,e){return!h[e.localName]||h[e.localName]===t.localName}function o(e,i){var n=l[e];if(!n)return null;var r=t.document.createElement(n);r.localName=n;var a=c[e];return a&&i&&(r[a]=i.trim()),r}for(var d,p=t.document.createElement("div"),f=p,m=[];null!==(d=i());)if("<"!==d[0])f.appendChild(t.document.createTextNode(a(d)));else{if("/"===d[1]){m.length&&m[m.length-1]===d.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=r(d.substr(1,d.length-2));if(y){g=t.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=o(v[1],v[3])))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(t){for(var e=0;e<p.length;e++){var i=p[e];if(t>=i[0]&&t<=i[1])return!0}return!1}function m(){}function g(t,e,i){m.call(this),this.cue=e,this.cueDiv=d(t,e.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=t.document.createElement("div"),n={direction:function(t){var e=[],i="";if(!t||!t.childNodes)return"ltr";function n(t,e){for(var i=e.childNodes.length-1;i>=0;i--)t.push(e.childNodes[i])}function r(t){if(!t||!t.length)return null;var e=t.pop(),i=e.textContent||e.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(t.length=0,a[0]):i}return"ruby"===e.tagName?r(t):e.childNodes?(n(t,e),r(t)):void 0}for(n(e,t);i=r(e);)for(var a=0;a<i.length;a++)if(f(i.charCodeAt(a)))return"rtl";return"ltr"}(this.cueDiv),writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===e.align?"center":e.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(e.positionAlign){case"start":r=e.position;break;case"middle":r=e.position-e.size/2;break;case"end":r=e.position-e.size}""===e.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")})}}function y(t){var e,i,n,r;if(t.div){i=t.div.offsetHeight,n=t.div.offsetWidth,r=t.div.offsetTop;var a=(a=t.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();t=t.div.getBoundingClientRect(),e=a?Math.max(a[0]&&a[0].height||0,t.height/a.length):0}this.left=t.left,this.right=t.right,this.top=t.top||r,this.height=t.height||i,this.bottom=t.bottom||r+(t.height||i),this.width=t.width||n,this.lineHeight=void 0!==e?e:t.lineHeight}function v(t,e,i,n){var r=new y(e),a=e.cue,s=function(t){if("number"==typeof t.line&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,i=e.textTrackList,n=0,r=0;r<i.length&&i[r]!==e;r++)"showing"===i[r].mode&&n++;return-1*++n}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,c=l*Math.round(s),h=i[u]+l,d=o[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),s<0&&(c+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(d,c)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"middle":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(s,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(s,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new y(e)}var f=function(t,e){for(var r,a=new y(t),s=1,o=0;o<e.length;o++){for(;t.overlapsOppositeAxis(i,e[o])||t.within(i)&&t.overlapsAny(n);)t.move(e[o]);if(t.within(i))return t;var u=t.intersectPercentage(i);s>u&&(r=new y(t),s=u),t=new y(a)}return r||a}(r,o);e.move(f.toCSSCompatValues(i))}function _(){}m.prototype.applyStyles=function(t,e){for(var i in e=e||this.div,t)t.hasOwnProperty(i)&&(e.style[i]=t[i])},m.prototype.formatStyle=function(t,e){return 0===t?0:t+e},g.prototype=i(m.prototype),g.prototype.constructor=g,y.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e}},y.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},y.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1},y.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},y.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}},y.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},y.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},y.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,i=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,n=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||n,height:t.height||e,bottom:t.bottom||n+(t.height||e),width:t.width||i}},_.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},_.convertCueToDOMTree=function(t,e){return t&&e?d(t,e):null};_.processCues=function(t,e,i){if(!t||!e||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=t.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(t){for(var e=0;e<t.length;e++)if(t[e].hasBeenReset||!t[e].displayState)return!0;return!1}(e)){var r=[],a=y.getSimpleBoxPosition(n),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var i,o,u=0;u<e.length;u++)o=e[u],i=new g(t,o,s),n.appendChild(i.div),v(0,i,a,r),o.displayState=i.div,r.push(y.getSimpleBoxPosition(i))}()}else for(var o=0;o<e.length;o++)n.appendChild(e[o].displayState)},_.Parser=function(t,e,i){i||(i=e,e={}),e||(e={}),this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},_.Parser.prototype={reportOrThrowError:function(t){if(!(t instanceof n))throw t;this.onparsingerror&&this.onparsingerror(t)},parse:function(t){var e=this;function i(){for(var t=e.buffer,i=0;i<t.length&&"\r"!==t[i]&&"\n"!==t[i];)++i;var n=t.substr(0,i);return"\r"===t[i]&&++i,"\n"===t[i]&&++i,e.buffer=t.substr(i),n}function u(t){t.match(/X-TIMESTAMP-MAP/)?s(t,function(t,i){switch(t){case"X-TIMESTAMP-MAP":!function(t){var i=new a;s(t,function(t,e){switch(t){case"MPEGT":i.integer(t+"S",e);break;case"LOCA":i.set(t+"L",r(e))}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}},/=/):s(t,function(t,i){switch(t){case"Region":!function(t){var i=new a;if(s(t,function(t,e){switch(t){case"id":i.set(t,e);break;case"width":i.percent(t,e);break;case"lines":i.integer(t,e);break;case"regionanchor":case"viewportanchor":var n=e.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(t+"X",r.get("x")),i.set(t+"Y",r.get("y"));break;case"scroll":i.alt(t,e,["up"])}},/=/,/\s/),i.has("id")){var n=new(e.vttjs.VTTRegion||e.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",""),e.onregion&&e.onregion(n),e.regionList.push({id:i.get("id"),region:n})}}(i)}},/:/)}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var l;if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var c=(l=i()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new n(n.Errors.BadSignature);e.state="HEADER"}for(var h=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(h?h=!1:l=i(),e.state){case"HEADER":/:/.test(l)?u(l):l||(e.state="ID");continue;case"NOTE":l||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){e.state="NOTE";break}if(!l)continue;if(e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,""),e.state="CUE",-1===l.indexOf("--\x3e")){e.cue.id=l;continue}case"CUE":try{o(l,e.cue,e.regionList)}catch(t){e.reportOrThrowError(t),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var d=-1!==l.indexOf("--\x3e");if(!l||d&&(h=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+="\n"),e.cue.text+=l;continue;case"BADCUE":l||(e.state="ID");continue}}}catch(t){e.reportOrThrowError(t),"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){try{if(this.buffer+=this.decoder.decode(),(this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state)throw new n(n.Errors.BadSignature)}catch(t){this.reportOrThrowError(t)}return this.onflush&&this.onflush(),this}},t.exports=_},function(t,e){var i="auto",n={"":1,lr:1,rl:1},r={start:1,middle:1,end:1,left:1,right:1};function a(t){return"string"==typeof t&&(!!r[t.toLowerCase()]&&t.toLowerCase())}function s(t,e,r){this.hasBeenReset=!1;var s="",o=!1,u=t,l=e,c=r,h=null,d="",p=!0,f="auto",m="start",g=50,y="middle",v=50,_="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(t){s=""+t}},pauseOnExit:{enumerable:!0,get:function(){return o},set:function(t){o=!!t}},startTime:{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");u=t,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");l=t,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(t){c=""+t,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(t){h=t,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(t){var e=function(t){return"string"==typeof t&&!!n[t.toLowerCase()]&&t.toLowerCase()}(t);if(!1===e)throw new SyntaxError("An invalid or illegal string was specified.");d=e,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(t){p=!!t,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return f},set:function(t){if("number"!=typeof t&&t!==i)throw new SyntaxError("An invalid number or illegal string was specified.");f=t,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(t){var e=a(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");m=e,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return g},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");g=t,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return y},set:function(t){var e=a(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return v},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");v=t,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _},set:function(t){var e=a(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");_=e,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},function(t,e){var i={"":!0,up:!0};function n(t){return"number"==typeof t&&t>=0&&t<=100}t.exports=function(){var t=100,e=3,r=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!n(e))throw new Error("Width must be between 0 and 100.");t=e}},lines:{enumerable:!0,get:function(){return e},set:function(t){if("number"!=typeof t)throw new TypeError("Lines must be set to a number.");e=t}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(t){if(!n(t))throw new Error("RegionAnchorX must be between 0 and 100.");a=t}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(t){if(!n(t))throw new Error("RegionAnchorY must be between 0 and 100.");r=t}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(t){if(!n(t))throw new Error("ViewportAnchorY must be between 0 and 100.");o=t}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(t){if(!n(t))throw new Error("ViewportAnchorX must be between 0 and 100.");s=t}},scroll:{enumerable:!0,get:function(){return u},set:function(t){var e=function(t){return"string"==typeof t&&!!i[t.toLowerCase()]&&t.toLowerCase()}(t);if(!1===e)throw new SyntaxError("An invalid or illegal string was specified.");u=e}}})}},function(t,e){t.exports={toUnsigned:function(t){return t>>>0}}},function(t,e){var i=function(t,e){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=e,i.compositionTimeOffset=t.pts-t.dts,i.duration=t.duration,i.size=4*t.length,i.size+=t.byteLength,t.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i};t.exports={groupNalsIntoFrames:function(t){var e,i,n=[],r=[];for(n.byteLength=0,e=0;e<t.length;e++)"access_unit_delimiter_rbsp"===(i=t[e]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).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},groupFramesIntoGops:function(t){var e,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=t[0].pts,r.dts=t[0].dts,e=0;e<t.length;e++)(i=t[e]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).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},extendFirstKeyFrame:function(t){var e;return!t[0][0].keyFrame&&t.length>1&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t},generateSampleTable:function(t,e){var n,r,a,s,o,u=e||0,l=[];for(n=0;n<t.length;n++)for(s=t[n],r=0;r<s.length;r++)o=s[r],u+=(a=i(o,u)).size,l.push(a);return l},concatenateNalData:function(t){var e,i,n,r,a,s,o=0,u=t.byteLength,l=t.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(e=0;e<t.length;e++)for(r=t[e],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,c.set(s.data,o),o+=s.data.byteLength;return c}}},function(t,e){t.exports={clearDtsInfo:function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(t,e){var i,n=t.minSegmentDts;return e||(n-=t.timelineStartInfo.dts),i=t.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===t.type&&(i*=t.samplerate/9e4,i=Math.floor(i)),i},collectDtsInfo:function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts))}}},function(t,e,i){"use strict";var n,r,a,s=i(2),o=i(18),u=i(6),l=i(20).TimestampRolloverStream,c=i(6);(n=function(){var t=new Uint8Array(188),e=0;n.prototype.init.call(this),this.push=function(i){var n,r=0,a=188;for(e?((n=new Uint8Array(i.byteLength+e)).set(t.subarray(0,e)),n.set(i,e),e=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=188,a+=188);r<n.byteLength&&(t.set(n.subarray(r),0),e=n.byteLength-r)},this.flush=function(){188===e&&71===t[0]&&(this.trigger("data",t),e=0),this.trigger("done")}}).prototype=new s,(r=function(){var t,e,i,n;r.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,t=function(t,n){var r=0;n.payloadUnitStartIndicator&&(r+=t[r]+1),"pat"===n.type?e(t.subarray(r),n):i(t.subarray(r),n)},e=function(t,e){e.section_number=t[7],e.last_section_number=t[8],n.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=n.pmtPid},i=function(t,e){var i,r;if(1&t[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&t[1])<<8|t[2])-4,r=12+((15&t[10])<<8|t[11]);r<i;){var a=t[r],s=(31&t[r+1])<<8|t[r+2];a===u.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===u.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===u.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&t[r+3])<<8|t[r+4])}e.programMapTable=n.programMapTable}},this.push=function(e){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&e[1]),i.pid=31&e[1],i.pid<<=8,i.pid|=e[2],(48&e[3])>>>4>1&&(n+=e[n]+1),0===i.pid)i.type="pat",t(e.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",t(e.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,n,i]):this.processPes_(e,n,i)},this.processPes_=function(t,e,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=t.subarray(e),this.trigger("data",i)}}).prototype=new s,r.STREAM_TYPES={h264:27,adts:15},(a=function(){var t=this,e={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(e,i,n){var r,a,s=new Uint8Array(e.size),o={type:i},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)a=e.data[u],s.set(a.data,l),l+=a.data.byteLength;!function(t,e){var i;e.packetLength=6+(t[4]<<8|t[5]),e.dataAlignmentIndicator=0!=(4&t[6]),192&(i=t[7])&&(e.pts=(14&t[9])<<27|(255&t[10])<<20|(254&t[11])<<12|(255&t[12])<<5|(254&t[13])>>>3,e.pts*=4,e.pts+=(6&t[13])>>>1,e.dts=e.pts,64&i&&(e.dts=(14&t[14])<<27|(255&t[15])<<20|(254&t[16])<<12|(255&t[17])<<5|(254&t[18])>>>3,e.dts*=4,e.dts+=(6&t[18])>>>1)),e.data=t.subarray(9+t[8])}(s,o),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};a.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var t,s;switch(a.streamType){case u.H264_STREAM_TYPE:case c.H264_STREAM_TYPE:t=e,s="video";break;case u.ADTS_STREAM_TYPE:t=i,s="audio";break;case u.METADATA_STREAM_TYPE:t=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(t,s,!0),t.data.push(a),t.size+=a.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),t.trigger("data",e)}})[a.type]()},this.flush=function(){r(e,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}}).prototype=new s;var h={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:n,TransportParseStream:r,ElementaryStream:a,TimestampRolloverStream:l,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,MetadataStream:i(41)};for(var d in u)u.hasOwnProperty(d)&&(h[d]=u[d]);t.exports=h},function(t,e,i){"use strict";var n,r=i(2),a=i(6),s=function(t,e,i){var n,r="";for(n=e;n<i;n++)r+="%"+("00"+t[n].toString(16)).slice(-2);return r},o=function(t,e,i){return decodeURIComponent(s(t,e,i))},u=function(t,e,i){return unescape(s(t,e,i))},l=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},c={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=o(t.data,1,e),t.value=o(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=o(t.data,1,e),t.url=o(t.data,e+1,t.data.length);break}},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=u(t.data,0,e);break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};(n=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},r=0,s=[],o=0;if(n.prototype.init.call(this),this.dispatchType=a.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,n,a,u,h;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(o=0,s.length=0),0===s.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))i.debug&&console.log("Skipping unrecognized metadata packet");else if(s.push(t),o+=t.data.byteLength,1===s.length&&(r=l(t.data.subarray(6,10)),r+=10),!(o<r)){for(e={data:new Uint8Array(r),frames:[],pts:s[0].pts,dts:s[0].dts},h=0;h<r;)e.data.set(s[0].data.subarray(0,r-h),h),h+=s[0].data.byteLength,o-=s[0].data.byteLength,s.shift();n=10,64&e.data[5]&&(n+=4,n+=l(e.data.subarray(10,14)),r-=l(e.data.subarray(16,20)));do{if((a=l(e.data.subarray(n+4,n+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(e.data[n],e.data[n+1],e.data[n+2],e.data[n+3]),data:e.data.subarray(n+10,n+a+10)}).key=u.id,c[u.id]&&(c[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var d=u.data,p=(1&d[3])<<30|d[4]<<22|d[5]<<14|d[6]<<6|d[7]>>>2;p*=4,p+=3&d[7],u.timeStamp=p,void 0===e.pts&&void 0===e.dts&&(e.pts=u.timeStamp,e.dts=u.timeStamp),this.trigger("timestamp",u)}e.frames.push(u),n+=10,n+=a}while(n<r);this.trigger("data",e)}}}).prototype=new r,t.exports=n},function(t,e,i){"use strict";var n,r=i(2),a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(n=function(){var t;n.prototype.init.call(this),this.push=function(e){var i,n,r,s,o,u,l=0,c=0;if("audio"===e.type)for(t?(s=t,(t=new Uint8Array(s.byteLength+e.data.byteLength)).set(s),t.set(e.data,s.byteLength)):t=e.data;l+5<t.length;)if(255===t[l]&&240==(246&t[l+1])){if(n=2*(1&~t[l+1]),i=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,u=9e4*(o=1024*(1+(3&t[l+6])))/a[(60&t[l+2])>>>2],r=l+i,t.byteLength<r)return;if(this.trigger("data",{pts:e.pts+c*u,dts:e.dts+c*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:a[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+n,r)}),t.byteLength===r)return void(t=void 0);c++,t=t.subarray(r)}else l++},this.flush=function(){this.trigger("done")}}).prototype=new r,t.exports=n},function(t,e,i){"use strict";var n,r,a,s=i(2),o=i(44);(r=function(){var t,e,i=0;r.prototype.init.call(this),this.push=function(n){var r;for(e?((r=new Uint8Array(e.byteLength+n.data.byteLength)).set(e),r.set(n.data,e.byteLength),e=r):e=n.data;i<e.byteLength-3;i++)if(1===e[i+2]){t=i+5;break}for(;t<e.byteLength;)switch(e[t]){case 0:if(0!==e[t-1]){t+=2;break}if(0!==e[t-2]){t++;break}i+3!==t-2&&this.trigger("data",e.subarray(i+3,t-2));do{t++}while(1!==e[t]&&t<e.length);i=t-2,t+=3;break;case 1:if(0!==e[t-1]||0!==e[t-2]){t+=3;break}this.trigger("data",e.subarray(i+3,t-2)),i=t-2,t+=3;break;default:t+=3}e=e.subarray(i),t-=i,i=0},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(i+3)),e=null,i=0,this.trigger("done")}}).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 t,e,i,s,u,l,c,h=new r;n.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,i=t.pts,s=t.dts,h.push(t))},h.on("data",function(n){var r={trackId:e,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"}t.trigger("data",r)}),h.on("done",function(){t.trigger("done")}),this.flush=function(){h.flush()},c=function(t,e){var i,n=8,r=8;for(i=0;i<t;i++)0!==r&&(r=(n+e.readExpGolomb()+256)%256),n=0===r?n:r},u=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);var s=0;for(a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},l=function(t){var e,i,n,r,s,u,l,h,d,p,f,m,g,y=0,v=0,_=0,b=0,T=1;if(i=(e=new o(t)).readUnsignedByte(),r=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),a[i]&&(3===(s=e.readUnsignedExpGolomb())&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(f=3!==s?8:12,g=0;g<f;g++)e.readBoolean()&&c(g<6?16:64,e);if(e.skipUnsignedExpGolomb(),0===(u=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===u)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),l=e.readUnsignedExpGolomb(),g=0;g<l;g++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),h=e.readUnsignedExpGolomb(),d=e.readUnsignedExpGolomb(),0===(p=e.readBits(1))&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(y=e.readUnsignedExpGolomb(),v=e.readUnsignedExpGolomb(),_=e.readUnsignedExpGolomb(),b=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){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=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}m&&(T=m[0]/m[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(h+1)-2*y-2*v)*T),height:(2-p)*(d+1)*16-2*_-2*b}}}).prototype=new s,t.exports={H264Stream:n,NalByteStream:r}},function(t,e,i){"use strict";var n;n=function(t){var e=t.byteLength,i=0,n=0;this.length=function(){return 8*e},this.bitsAvailable=function(){return 8*e+n},this.loadWord=function(){var r=t.byteLength-e,a=new Uint8Array(4),s=Math.min(4,e);if(0===s)throw new Error("no bytes available");a.set(t.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,e-=s},this.skipBits=function(t){var r;n>t?(i<<=t,n-=t):(t-=n,t-=8*(r=Math.floor(t/8)),e-=r,this.loadWord(),i<<=t,n-=t)},this.readBits=function(t){var r=Math.min(n,t),a=i>>>32-r;return(n-=r)>0?i<<=r:e>0&&this.loadWord(),(r=t-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var t;for(t=0;t<n;++t)if(0!=(i&2147483648>>>t))return i<<=t,n-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},t.exports=n},function(t,e,i){"use strict";var n,r=i(2);(n=function(){var t=new Uint8Array,e=0;n.prototype.init.call(this),this.setTimestamp=function(t){e=t},this.parseId3TagSize=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&t[e+5])>>4?i+20:i+10},this.parseAdtsSize=function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},this.push=function(i){var n,r,a,s,o=0,u=0;for(t.length?(s=t.length,(t=new Uint8Array(i.byteLength+s)).set(t.subarray(0,s)),t.set(i,s)):t=i;t.length-u>=3;)if(t[u]!=="I".charCodeAt(0)||t[u+1]!=="D".charCodeAt(0)||t[u+2]!=="3".charCodeAt(0))if(!0&t[u]&&240==(240&t[u+1])){if(t.length-u<7)break;if((o=this.parseAdtsSize(t,u))>t.length)break;a={type:"audio",data:t.subarray(u,u+o),pts:e,dts:e},this.trigger("data",a),u+=o}else u++;else{if(t.length-u<10)break;if((o=this.parseId3TagSize(t,u))>t.length)break;r={type:"timed-metadata",data:t.subarray(u,u+o)},this.trigger("data",r),u+=o}n=t.length-u,t=n>0?t.subarray(u):new Uint8Array}}).prototype=new r,t.exports=n},function(t,e){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(t){for(var e=[];t--;)e.push(0);return e},a={96000:[i,[227,64],r(154),[56]],88200:[i,[231],r(170),[56]],64000:[i,[248,192],r(240),[56]],48000:[i,[255,192],r(268),[55,148,128],r(54),[112]],44100:[i,[255,192],r(268),[55,163,128],r(84),[112]],32000:[i,[255,192],r(268),[55,234],r(226),[112]],24000:[i,[255,192],r(268),[55,255,128],r(268),[111,112],r(126),[224]],16000:[i,[255,192],r(268),[55,255,128],r(268),[111,255],r(269),[223,108],r(195),[1,192]],12000:[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]],8000:[n,r(268),[3,121,16],r(47),[7]]};t.exports=function(t){return Object.keys(t).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(t,e){return t.concat(e)},[])),e},{})}(a)},function(t,e){var i,n,r,a,s,o;i=function(t){return 9e4*t},n=function(t,e){return t*e},r=function(t){return t/9e4},a=function(t,e){return t/e},s=function(t,e){return i(a(t,e))},o=function(t,e){return n(r(t),e)},t.exports={secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:a,audioTsToVideoTs:s,videoTsToAudioTs:o}},function(t,e,i){"use strict";var n=i(19).discardEmulationPreventionBytes,r=i(18).CaptionStream,a=i(3),s=i(49),o=function(t,e){for(var i=t,n=0;n<e.length;n++){var r=e[n];if(i<r.size)return r;i-=r.size}return null},u=function(t,e){var i=a.findBox(t,["moof","traf"]),r={},u=[];return a.findBox(t,["mdat"]).forEach(function(t,e){var n=i[e];u.push({mdat:t,traf:n})}),u.forEach(function(t){var i,u=t.mdat,l=t.traf,c=a.findBox(l,["tfhd"]),h=s.parseTfhd(c[0]),d=h.trackId,p=a.findBox(l,["tfdt"]),f=p.length>0?s.parseTfdt(p[0]).baseMediaDecodeTime:0,m=a.findBox(l,["trun"]);e===d&&m.length>0&&(i=function(t,e,i){var r,a,s,u,l=new DataView(t.buffer,t.byteOffset,t.byteLength),c=[];for(a=0;a+4<t.length;a+=s)if(s=l.getUint32(a),a+=4,!(s<=0))switch(31&t[a]){case 6:var h=t.subarray(a+1,a+1+s),d=o(a,e);r={nalUnitType:"sei_rbsp",size:s,data:h,escapedRBSP:n(h),trackId:i},d?(r.pts=d.pts,r.dts=d.dts,u=d):(r.pts=u.pts,r.dts=u.dts),c.push(r)}return c}(u,function(t,e,i){var n=e,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,o=i.trackId,u=[];return t.forEach(function(t){var e=s.parseTrun(t).samples;e.forEach(function(t){void 0===t.duration&&(t.duration=r),void 0===t.size&&(t.size=a),t.trackId=o,t.dts=n,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=n+t.compositionTimeOffset,n+=t.duration}),u=u.concat(e)}),u}(m,f,h),d),r[d]||(r[d]=[]),r[d]=r[d].concat(i))}),r};t.exports=function(){var t,e,i,n,a,s=!1;this.isInitialized=function(){return s},this.init=function(){t=new r,s=!0,t.on("data",function(t){t.startTime=t.startPts/n,t.endTime=t.endPts/n,a.captions.push(t),a.captionStreams[t.stream]=!0})},this.isNewInit=function(t,e){return!(t&&0===t.length||e&&"object"==typeof e&&0===Object.keys(e).length||i===t[0]&&n===e[i])},this.parse=function(t,r,s){var o;if(!this.isInitialized())return null;if(!r||!s)return null;if(this.isNewInit(r,s))i=r[0],n=s[i];else if(!i||!n)return e.push(t),null;for(;e.length>0;){var l=e.shift();this.parse(l,r,s)}return null!==(o=function(t,e,i){return e?{seiNals:u(t,e)[e],timescale:i}:null}(t,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),a):null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach(function(e){t.push(e)})},this.flushStream=function(){if(!this.isInitialized())return null;t.flush()},this.clearParsedCaptions=function(){a.captions=[],a.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){e=[],i=null,n=null,a?this.clearParsedCaptions():a={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},function(t,e,i){"use strict";var n,r,a=i(3).parseType,s=function(t){return new Date(1e3*t-20828448e5)},o=function(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}},u={avc1:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:e.getUint16(6),width:e.getUint16(24),height:e.getUint16(26),horizresolution:e.getUint16(28)+e.getUint16(30)/16,vertresolution:e.getUint16(32)+e.getUint16(34)/16,frameCount:e.getUint16(40),depth:e.getUint16(74),config:n(t.subarray(78,t.byteLength))}},avcC:function(t){var e,i,n,r,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},o=31&t[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;for(e=t[n],n++,r=0;r<e;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;return s},btrt:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:e.getUint32(0),maxBitrate:e.getUint32(4),avgBitrate:e.getUint32(8)}},esds:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={majorBrand:a(t.subarray(0,4)),minorVersion:e.getUint32(4),compatibleBrands:[]},n=8;n<t.byteLength;)i.compatibleBrands.push(a(t.subarray(n,n+4))),n+=4;return i},dinf:function(t){return{boxes:n(t)}},dref:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:n(t.subarray(8))}},hdlr:function(t){var e={version:new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:a(t.subarray(8,12)),name:""},i=8;for(i=24;i<t.byteLength;i++){if(0===t[i]){i++;break}e.name+=String.fromCharCode(t[i])}return e.name=decodeURIComponent(escape(e.name)),e},mdat:function(t){return{byteLength:t.byteLength,nals:function(t){var e,i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=[];for(e=0;e+4<t.length;e+=i)if(i=n.getUint32(e),e+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&t[e]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+t[e]&31)}return r}(t)}},mdhd:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=s(i.getUint32(n)),n+=8,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=s(i.getUint32(n)),n+=4,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,e=i.getUint16(n),r.language+=String.fromCharCode(96+(e>>10)),r.language+=String.fromCharCode(96+((992&e)>>5)),r.language+=String.fromCharCode(96+(31&e)),r},mdia:function(t){return{boxes:n(t)}},mfhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return{boxes:n(t)}},mp4a:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={dataReferenceIndex:e.getUint16(6),channelcount:e.getUint16(16),samplesize:e.getUint16(18),samplerate:e.getUint16(24)+e.getUint16(26)/65536};return t.byteLength>28&&(i.streamDescriptor=n(t.subarray(28))[0]),i},moof:function(t){return{boxes:n(t)}},moov:function(t){return{boxes:n(t)}},mvex:function(t){return{boxes:n(t)}},mvhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(e.getUint32(i)),i+=8,n.modificationTime=s(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=8,n.duration=e.getUint32(i)):(n.creationTime=s(e.getUint32(i)),i+=4,n.modificationTime=s(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=4,n.duration=e.getUint32(i)),i+=4,n.rate=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=e.getUint32(i),n},pdin:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:e.getUint32(4),initialDelay:e.getUint32(8)}},sdtp:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]};for(e=4;e<t.byteLength;e++)i.samples.push({dependsOn:(48&t[e])>>4,isDependedOn:(12&t[e])>>2,hasRedundancy:3&t[e]});return i},sidx:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(e=24;r;e+=12,r--)n.references.push({referenceType:(128&t[e])>>>7,referencedSize:2147483647&i.getUint32(e),subsegmentDuration:i.getUint32(e+4),startsWithSap:!!(128&t[e+8]),sapType:(112&t[e+8])>>>4,sapDeltaTime:268435455&i.getUint32(e+8)});return n},smhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return{boxes:n(t)}},stco:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(e=8;r;e+=4,r--)n.chunkOffsets.push(i.getUint32(e));return n},stsc:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=i.getUint32(4),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]};for(e=8;n;e+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(e),samplesPerChunk:i.getUint32(e+4),sampleDescriptionIndex:i.getUint32(e+8)});return r},stsd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:n(t.subarray(8))}},stsz:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(e=12;e<t.byteLength;e+=4)n.entries.push(i.getUint32(e));return n},stts:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(e=8;r;e+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(e),sampleDelta:i.getUint32(e+4)});return n},styp:function(t){return u.ftyp(t)},tfdt:function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};return 1===e.version&&(e.baseMediaDecodeTime*=Math.pow(2,32),e.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]),e},tfhd:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.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 e=8,r&&(e+=4,n.baseDataOffset=i.getUint32(12),e+=4),a&&(n.sampleDescriptionIndex=i.getUint32(e),e+=4),s&&(n.defaultSampleDuration=i.getUint32(e),e+=4),o&&(n.defaultSampleSize=i.getUint32(e),e+=4),u&&(n.defaultSampleFlags=i.getUint32(e)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(e.getUint32(i)),i+=8,n.modificationTime=s(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=8,n.duration=e.getUint32(i)):(n.creationTime=s(e.getUint32(i)),i+=4,n.modificationTime=s(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=4,n.duration=e.getUint32(i)),i+=4,i+=8,n.layer=e.getUint16(i),i+=2,n.alternateGroup=e.getUint16(i),i+=2,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,n.width=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.height=e.getUint16(i)+e.getUint16(i+2)/16,n},traf:function(t){return{boxes:n(t)}},trak:function(t){return{boxes:n(t)}},trex:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4),defaultSampleDescriptionIndex:e.getUint32(8),defaultSampleDuration:e.getUint32(12),defaultSampleSize:e.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:e.getUint16(22)}},trun:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],u=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],h=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&h&&(e={flags:o(t.subarray(d,d+4))},d+=4,s&&(e.duration=n.getUint32(d),d+=4),u&&(e.size=n.getUint32(d),d+=4),c&&(e.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(e),h--);h--;)e={},s&&(e.duration=n.getUint32(d),d+=4),u&&(e.size=n.getUint32(d),d+=4),l&&(e.flags=o(t.subarray(d,d+4)),d+=4),c&&(e.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(e);return i},"url ":function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:e.getUint16(4),opcolor:new Uint16Array([e.getUint16(6),e.getUint16(8),e.getUint16(10)])}}};n=function(t){for(var e,i,n,r,s,o=0,l=[],c=new ArrayBuffer(t.length),h=new Uint8Array(c),d=0;d<t.length;++d)h[d]=t[d];for(e=new DataView(c);o<t.byteLength;)i=e.getUint32(o),n=a(t.subarray(o+4,o+8)),r=i>1?o+i:t.byteLength,(s=(u[n]||function(t){return{data:t}})(t.subarray(o+8,r))).size=i,s.type=n,l.push(s),o=r;return l},r=function(t,e){var i;return e=e||0,i=new Array(2*e+1).join(" "),t.map(function(t,n){return i+t.type+"\n"+Object.keys(t).filter(function(t){return"type"!==t&&"boxes"!==t}).map(function(e){var n=i+"  "+e+": ",r=t[e];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map(function(t){return" "+("00"+t.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map(function(t){return i+"  "+t}).join("\n")+"\n"+i+"  >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map(function(t,e){return 0===e?t:i+"  "+t}).join("\n")}).join("\n")+(t.boxes?"\n"+r(t.boxes,e+1):"")}).join("\n")},t.exports={inspect:n,textify:r,parseTfdt:u.tfdt,parseHdlr:u.hdlr,parseTfhd:u.tfhd,parseTrun:u.trun}},function(t,e,i){"use strict";var n=i(6),r=function(t){var e=31&t[1];return e<<=8,e|=t[2]},a=function(t){return!!(64&t[1])},s=function(t){var e=0;return(48&t[3])>>>4>1&&(e+=t[4]+1),e},o=function(t){switch(t){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}};t.exports={parseType:function(t,e){var i=r(t);return 0===i?"pat":i===e?"pmt":e?"pes":null},parsePat:function(t){var e=a(t),i=4+s(t);return e&&(i+=t[i]+1),(31&t[i+10])<<8|t[i+11]},parsePmt:function(t){var e={},i=a(t),n=4+s(t);if(i&&(n+=t[n]+1),1&t[n+5]){var r;r=3+((15&t[n+1])<<8|t[n+2])-4;for(var o=12+((15&t[n+10])<<8|t[n+11]);o<r;){var u=n+o;e[(31&t[u+1])<<8|t[u+2]]=t[u],o+=5+((15&t[u+3])<<8|t[u+4])}return e}},parsePayloadUnitStartIndicator:a,parsePesType:function(t,e){switch(e[r(t)]){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}},parsePesTime:function(t){if(!a(t))return null;var e=4+s(t);if(e>=t.byteLength)return null;var i,n=null;return 192&(i=t[e+7])&&((n={}).pts=(14&t[e+9])<<27|(255&t[e+10])<<20|(254&t[e+11])<<12|(255&t[e+12])<<5|(254&t[e+13])>>>3,n.pts*=4,n.pts+=(6&t[e+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&t[e+14])<<27|(255&t[e+15])<<20|(254&t[e+16])<<12|(255&t[e+17])<<5|(254&t[e+18])>>>3,n.dts*=4,n.dts+=(6&t[e+18])>>>1)),n},videoPacketContainsKeyFrame:function(t){for(var e=4+s(t),i=t.subarray(e),n=0,r=0,a=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),a}}},function(t,e,i){"use strict";var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},a=function(t,e,i){return unescape(function(t,e,i){var n,r="";for(n=e;n<i;n++)r+="%"+("00"+t[n].toString(16)).slice(-2);return r}(t,e,i))};t.exports={parseId3TagSize:function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&t[e+5])>>4?i+20:i+10},parseAdtsSize:function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},parseType:function(t,e){return t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&t[e]&&240==(240&t[e+1])?"audio":null},parseSampleRate:function(t){for(var e=0;e+5<t.length;){if(255===t[e]&&240==(246&t[e+1]))return n[(60&t[e+2])>>>2];e++}return null},parseAacTimestamp:function(t){var e,i,n;e=10,64&t[5]&&(e+=4,e+=r(t.subarray(10,14)));do{if((i=r(t.subarray(e+4,e+8)))<1)return null;if("PRIV"===String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3])){n=t.subarray(e+10,e+i+10);for(var s=0;s<n.byteLength;s++)if(0===n[s]){if("com.apple.streaming.transportStreamTimestamp"===a(n,0,s)){var o=n.subarray(s+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]}break}}e+=10,e+=i}while(e<t.byteLength);return null}}},function(t,e,i){},,function(t,e,i){"use strict";i.r(e);var n,r,a=i(4),s=i.n(a);i(11),i(12),i(13),i(14),i(15);var o=(r=n=function(t){function e(i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i));return n.renderImage=function(t){var e=n.props.children,i=[].concat(e),r=[];Array.isArray(i)&&i.map(function(t){switch(t.props.type){case"info":return r.push({id:Math.random().toString(36).substr(2,9),type:t.props.type,pitch:t.props.pitch?t.props.pitch:10,yaw:t.props.yaw?t.props.yaw:10,text:t.props.text?t.props.text:"",URL:t.props.URL?t.props.URL:""});case"custom":return r.push({id:Math.random().toString(36).substr(2,9),pitch:t.props.pitch?t.props.pitch:10,yaw:t.props.yaw?t.props.yaw:10,cssClass:t.props.cssClass?t.props.cssClass:"tooltipcss",createTooltipFunc:t.props.tooltip?t.props.tooltip:n.hotspotTooltip,createTooltipArgs:t.props.tooltipArg?t.props.tooltipArg:{},clickHandlerFunc:t.props.handleClick?t.props.handleClick:n.handleClickHotspot,clickHandlerArgs:t.props.handleClickArg?t.props.handleClickArg:{name:"test"}});default:return[]}});var a={type:"equirectangular",panorama:n.props.image,haov:n.props.haov,vaov:n.props.vaov,vOffset:n.props.vOffset,yaw:n.props.yaw,pitch:n.props.pitch,hfov:n.props.hfov,minHfov:n.props.minHfov,maxHfov:n.props.maxHfov,minPitch:n.props.minPitch,maxPitch:n.props.maxPitch,minYaw:n.props.minYaw,maxYaw:n.props.maxYaw,autoRotate:n.props.autoRotate,compass:n.props.compass,preview:n.props.preview,previewTitle:n.props.previewTitle,previewAuthor:n.props.previewAuthor,author:n.props.author,title:n.props.title,autoLoad:n.props.autoLoad,orientationOnByDefault:n.props.orientationOnByDefault,showZoomCtrl:n.props.showZoomCtrl,keyboardZoom:n.props.keyboardZoom,mouseZoom:n.props.mouseZoom,draggable:n.props.draggable,disableKeyboardCtrl:n.props.disableKeyboardCtrl,showFullscreenCtrl:n.props.showFullscreenCtrl,showControls:n.props.showControls,hotSpotDebug:n.props.hotspotDebug,hotSpots:r,onRender:n.props.onRender};Object.keys(a).forEach(function(t){return""===a[t]&&delete a[t]}),"update"===t&&n.panorama.destroy(),n.panorama=pannellum.viewer(n.props.id?n.props.id:n.state.id,a),n.panorama.on("load",n.props.onLoad),n.panorama.on("scenechange",n.props.onScenechange),n.panorama.on("scenechangefadedone",n.props.onScenechangefadedone),n.panorama.on("error",n.props.onError),n.panorama.on("errorcleared",n.props.onErrorcleared),n.panorama.on("mousedown",n.props.onMousedown),n.panorama.on("mouseup",n.props.onMouseup),n.panorama.on("touchstart",n.props.onTouchstart),n.panorama.on("touchend",n.props.onTouchend)},n.componentDidMount=function(){n.renderImage("mount")},n.handleClickHotspot=function(t,e){console.log("hotspot clicked",e.name)},n.hotspotTooltip=function(t,e){t.setAttribute("id","textInfo");var i=document.createElement("div");i.classList.add("hotspot");var n=document.createElement("div");n.classList.add("out");var r=document.createElement("div");r.classList.add("in"),document.createElement("div").classList.add("image"),t.appendChild(i),i.appendChild(r),i.appendChild(n)},n.getViewer=function(){return n.panorama},n.forceRender=function(){n.renderImage("update")},n.state={id:Math.random().toString(36).substr(2,9)},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidUpdate=function(t,e,i){t.image===this.props.image&&t.width===this.props.width&&t.height===this.props.height&&t.compass===this.props.compass&&t.title===this.props.title&&t.author===this.props.author&&t.preview===this.props.preview&&t.previewTitle===this.props.previewTitle&&t.previewAuthor===this.props.previewAuthor&&t.showZoomCtrl===this.props.showZoomCtrl&&t.showFullscreenCtrl===this.props.showFullscreenCtrl&&t.showControls===this.props.showControls&&t.children.length===this.props.children.length||this.renderImage("update"),t.maxYaw===this.props.maxYaw&&t.minYaw===this.props.minYaw&&t.maxPitch===this.props.maxPitch&&t.minPitch===this.props.minPitch&&t.maxHfov===this.props.maxHfov&&t.minHfov===this.props.minHfov||(this.panorama.setYawBounds([this.props.minYaw,this.props.maxYaw]),this.panorama.setPitchBounds([this.props.minPitch,this.props.maxPitch]),this.panorama.setHfovBounds([this.props.minHfov,this.props.maxHfov])),t.yaw!==this.props.yaw&&this.panorama.setYaw(this.props.yaw),t.pitch!==this.props.pitch&&this.panorama.setPitch(this.props.pitch),t.hfov!==this.props.hfov&&this.panorama.setHfov(this.props.hfov)},e.prototype.render=function(){var t=this,e=this.props,i={width:e.width,height:e.height};return s.a.createElement("div",{id:this.props.id?this.props.id:this.state.id,style:i,ref:function(e){return t.imageNode=e}})},e}(a.PureComponent),n.defaultProps={children:[],width:"100%",height:"400px",image:"",haov:360,vaov:180,vOffset:0,yaw:0,pitch:0,hfov:100,minHfov:50,maxHfov:150,minPitch:-90,maxPitch:90,minYaw:-180,maxYaw:180,autoRotate:0,compass:!1,preview:"",previewTitle:"",previewAuthor:"",title:"",author:"",autoLoad:!1,orientationOnByDefault:!1,showZoomCtrl:!0,keyboardZoom:!0,mouseZoom:!0,draggable:!0,disableKeyboardCtrl:!1,showFullscreenCtrl:!0,showControls:!0,onLoad:function(){},onScenechange:function(){},onScenechangefadedone:function(){},onError:function(){},onErrorcleared:function(){},onMousedown:function(){},onMouseup:function(){},onTouchstart:function(){},onTouchend:function(){},hotspotDebug:!1,onRender:null},r);o.Hotspot=function(){},o.Hotspot=function(){};var u=o,l=i(0),c=i.n(l),h=i(1),d=i.n(h),p=i(7),f=i.n(p),m=i(9),g=i.n(m),y=i(10),v=i.n(y),_=i(21),b=i.n(_),T=i(5),S=i.n(T),w=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},k=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},C=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},E=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},x=function(){function t(){w(this,t),this.listeners={}}return t.prototype.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},t.prototype.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t].splice(i,1),i>-1},t.prototype.trigger=function(t){var e=this.listeners[t],i=void 0,n=void 0,r=void 0;if(e)if(2===arguments.length)for(n=e.length,i=0;i<n;++i)e[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=e.length,i=0;i<n;++i)e[i].apply(this,r)},t.prototype.dispose=function(){this.listeners={}},t.prototype.pipe=function(t){this.on("data",function(e){t.push(e)})},t}(),A=function(t){function e(){w(this,e);var i=E(this,t.call(this));return i.buffer="",i}return C(e,t),e.prototype.push=function(t){var e=void 0;for(this.buffer+=t,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},e}(x),P=function(t){for(var e=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},n=e.length,r=void 0;n--;)""!==e[n]&&((r=/([^=]*)=(.*)/.exec(e[n]).slice(1))[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},L=function(t){function e(){w(this,e);var i=E(this,t.call(this));return i.customParsers=[],i}return C(e,t),e.prototype.push=function(t){var e=void 0,i=void 0;if(0!==(t=t.replace(/^[\u0000\s]+|[\u0000\s]+$/g,"")).length)if("#"===t[0]){for(var n=0;n<this.customParsers.length;n++)if(this.customParsers[n].call(this,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),e=/^#EXTM3U/.exec(t))this.trigger("data",{type:"tag",tagType:"m3u"});else{if(e=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(t))return i={type:"tag",tagType:"inf"},e[1]&&(i.duration=parseFloat(e[1])),e[2]&&(i.title=e[2]),void this.trigger("data",i);if(e=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"targetduration"},e[1]&&(i.duration=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"totalduration"},e[1]&&(i.duration=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"version"},e[1]&&(i.version=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return i={type:"tag",tagType:"media-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return i={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(t))return i={type:"tag",tagType:"playlist-type"},e[1]&&(i.playlistType=e[1]),void this.trigger("data",i);if(e=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(t))return i={type:"tag",tagType:"byterange"},e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),void this.trigger("data",i);if(e=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(t))return i={type:"tag",tagType:"allow-cache"},e[1]&&(i.allowed=!/NO/.test(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-MAP:?(.*)$/.exec(t)){if(i={type:"tag",tagType:"map"},e[1]){var r=P(e[1]);if(r.URI&&(i.uri=r.URI),r.BYTERANGE){var a=r.BYTERANGE.split("@"),s=a[0],o=a[1];i.byterange={},s&&(i.byterange.length=parseInt(s,10)),o&&(i.byterange.offset=parseInt(o,10))}}this.trigger("data",i)}else if(e=/^#EXT-X-STREAM-INF:?(.*)$/.exec(t)){if(i={type:"tag",tagType:"stream-inf"},e[1]){if(i.attributes=P(e[1]),i.attributes.RESOLUTION){var u=i.attributes.RESOLUTION.split("x"),l={};u[0]&&(l.width=parseInt(u[0],10)),u[1]&&(l.height=parseInt(u[1],10)),i.attributes.RESOLUTION=l}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(e=/^#EXT-X-MEDIA:?(.*)$/.exec(t))return i={type:"tag",tagType:"media"},e[1]&&(i.attributes=P(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-ENDLIST/.exec(t))this.trigger("data",{type:"tag",tagType:"endlist"});else if(e=/^#EXT-X-DISCONTINUITY/.exec(t))this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(e=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(t))return i={type:"tag",tagType:"program-date-time"},e[1]&&(i.dateTimeString=e[1],i.dateTimeObject=new Date(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-KEY:?(.*)$/.exec(t))return i={type:"tag",tagType:"key"},e[1]&&(i.attributes=P(e[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(e=/^#EXT-X-START:?(.*)$/.exec(t))return i={type:"tag",tagType:"start"},e[1]&&(i.attributes=P(e[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(e=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(t))return i={type:"tag",tagType:"cue-out-cont"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i);if(e=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(t))return i={type:"tag",tagType:"cue-out"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i);if(e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(t))return i={type:"tag",tagType:"cue-in"},e[1]?i.data=e[1]:i.data="",void this.trigger("data",i);this.trigger("data",{type:"tag",data:t.slice(4)})}}}else this.trigger("data",{type:"comment",text:t.slice(1)})}else this.trigger("data",{type:"uri",uri:t})},e.prototype.addParser=function(t){var e=this,i=t.expression,n=t.customType,r=t.dataParser,a=t.segment;"function"!=typeof r&&(r=function(t){return t}),this.customParsers.push(function(t){if(i.exec(t))return e.trigger("data",{type:"custom",data:r(t),customType:n,segment:a}),!0})},e}(x),O=function(t){function e(){w(this,e);var i=E(this,t.call(this));i.lineStream=new A,i.parseStream=new L,i.lineStream.pipe(i.parseStream);var n=i,r=[],a={},s=void 0,o=void 0,u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},l=0;return i.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},i.parseStream.on("data",function(t){var e=void 0,i=void 0;({tag:function(){(({"allow-cache":function(){this.manifest.allowCache=t.allowed,"allowed"in t||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var e={};"length"in t&&(a.byterange=e,e.length=t.length,"offset"in t||(this.trigger("info",{message:"defaulting offset to zero"}),t.offset=0)),"offset"in t&&(a.byterange=e,e.offset=t.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"})),t.duration>0&&(a.duration=t.duration),0===t.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){t.attributes?"NONE"!==t.attributes.METHOD?t.attributes.URI?(t.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI},void 0!==t.attributes.IV&&(o.iv=t.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(t.number)?this.manifest.mediaSequence=t.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number})},"discontinuity-sequence":function(){isFinite(t.number)?(this.manifest.discontinuitySequence=t.number,l=t.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number})},"playlist-type":function(){/VOD|EVENT/.test(t.playlistType)?this.manifest.playlistType=t.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist})},map:function(){s={},t.uri&&(s.uri=t.uri),t.byterange&&(s.byterange=t.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||u,t.attributes?(a.attributes||(a.attributes={}),k(a.attributes,t.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME){var n=this.manifest.mediaGroups[t.attributes.TYPE];n[t.attributes["GROUP-ID"]]=n[t.attributes["GROUP-ID"]]||{},e=n[t.attributes["GROUP-ID"]],(i={default:/yes/i.test(t.attributes.DEFAULT)}).default?i.autoselect=!0:i.autoselect=/yes/i.test(t.attributes.AUTOSELECT),t.attributes.LANGUAGE&&(i.language=t.attributes.LANGUAGE),t.attributes.URI&&(i.uri=t.attributes.URI),t.attributes["INSTREAM-ID"]&&(i.instreamId=t.attributes["INSTREAM-ID"]),t.attributes.CHARACTERISTICS&&(i.characteristics=t.attributes.CHARACTERISTICS),t.attributes.FORCED&&(i.forced=/yes/i.test(t.attributes.FORCED)),e[t.attributes.NAME]=i}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){l+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=t.dateTimeString,this.manifest.dateTimeObject=t.dateTimeObject),a.dateTimeString=t.dateTimeString,a.dateTimeObject=t.dateTimeObject},targetduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):this.manifest.targetDuration=t.duration},totalduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+t.duration}):this.manifest.totalDuration=t.duration},start:function(){t.attributes&&!isNaN(t.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=t.data},"cue-out-cont":function(){a.cueOutCont=t.data},"cue-in":function(){a.cueIn=t.data}})[t.tagType]||function(){}).call(n)},uri:function(){a.uri=t.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=l,s&&(a.map=s),a={}},comment:function(){},custom:function(){t.segment?(a.custom=a.custom||{},a.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[t.customType]=t.data)}})[t.type].call(n)}),i}return C(e,t),e.prototype.push=function(t){this.lineStream.push(t)},e.prototype.end=function(){this.lineStream.push("\n")},e.prototype.addParser=function(t){this.parseStream.addParser(t)},e}(x),I=function(t){var e,i=t.attributes,n=t.segments,r={attributes:(e={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},e["PROGRAM-ID"]=1,e),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M=function(t){return!!t&&"object"===(void 0===t?"undefined":U(t))},D=function t(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.reduce(function(e,i){return Object.keys(i).forEach(function(n){Array.isArray(e[n])&&Array.isArray(i[n])?e[n]=e[n].concat(i[n]):M(e[n])&&M(i[n])?e[n]=t(e[n],i[n]):e[n]=i[n]}),e},{})},R=function(t,e){return/^[a-z]+:/i.test(e)?e:(/\/\//i.test(t)||(t=S.a.buildAbsoluteURL(c.a.location.href,t)),S.a.buildAbsoluteURL(t,e))},N=function(t){var e=t.baseUrl,i=void 0===e?"":e,n=t.source,r=void 0===n?"":n,a=t.range,s=void 0===a?"":a,o={uri:r,resolvedUri:R(i||"",r)};if(s){var u=s.split("-"),l=parseInt(u[0],10),c=parseInt(u[1],10);o.byterange={length:c-l,offset:l}}return o},B=function(t,e,i){var n=t.NOW,r=t.clientOffset,a=t.availabilityStartTime,s=t.timescale,o=void 0===s?1:s,u=t.start,l=void 0===u?0:u,c=t.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((h*o-e)/i)},j=function(t,e){for(var i=t.type,n=void 0===i?"static":i,r=t.minimumUpdatePeriod,a=void 0===r?0:r,s=t.media,o=void 0===s?"":s,u=t.sourceDuration,l=t.timescale,c=void 0===l?1:l,h=t.startNumber,d=void 0===h?1:h,p=t.periodIndex,f=[],m=-1,g=0;g<e.length;g++){var y=e[g],v=y.d,_=y.r||0,b=y.t||0;m<0&&(m=b),b&&b>m&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===e.length?"dynamic"===n&&a>0&&o.indexOf("$Number$")>0?B(t,m,v):(u*c-m)/v:(e[S].t-m)/v}else T=_+1;for(var w=d+f.length+T,k=d+f.length;k<w;)f.push({number:k,duration:v/c,time:m,timeline:p}),m+=v,k++}return f},F=function(t){return t.reduce(function(t,e){return t.concat(e)},[])},H=function(t){if(!t.length)return[];for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e},V={static:function(t){var e=t.duration,i=t.timescale,n=void 0===i?1:i,r=t.sourceDuration;return{start:0,end:Math.ceil(r/(e/n))}},dynamic:function(t){var e=t.NOW,i=t.clientOffset,n=t.availabilityStartTime,r=t.timescale,a=void 0===r?1:r,s=t.duration,o=t.start,u=void 0===o?0:o,l=t.minimumUpdatePeriod,c=void 0===l?0:l,h=t.timeShiftBufferDepth,d=void 0===h?1/0:h,p=(e+i)/1e3,f=n+u,m=p+c-f,g=Math.ceil(m*a/s),y=Math.floor((p-f-d)*a/s),v=Math.floor((p-f)*a/s);return{start:Math.max(0,y),end:Math.min(g,v)}}},z=function(t){var e=t.type,i=void 0===e?"static":e,n=t.duration,r=t.timescale,a=void 0===r?1:r,s=t.sourceDuration,o=V[i](t),u=function(t,e){for(var i=[],n=t;n<e;n++)i.push(n);return i}(o.start,o.end).map(function(t){return function(e,i){var n=t.duration,r=t.timescale,a=void 0===r?1:r,s=t.periodIndex,o=t.startNumber;return{number:(void 0===o?1:o)+e,duration:n/a,timeline:s,time:i*n}}}(t));if("static"===i){var l=u.length-1;u[l].duration=s-n/a*l}return u},q=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,G=function(t,e){return t.replace(q,function(t){return function(e,i,n,r){if("$$"===e)return"$";if(void 0===t[i])return e;var a=""+t[i];return"RepresentationID"===i?a:(r=n?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}}(e))},W=function(t,e){var i={RepresentationID:t.id,Bandwidth:t.bandwidth||0},n=t.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=N({baseUrl:t.baseUrl,source:G(r.sourceURL,i),range:r.range});return function(t,e){return t.duration||e?t.duration?z(t):j(t,e):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodIndex}]}(t,e).map(function(e){i.Number=e.number,i.Time=e.time;var n=G(t.media||"",i);return{uri:n,timeline:e.timeline,duration:e.duration,resolvedUri:R(t.baseUrl||"",n),map:a,number:e.number}})},Y="INVALID_NUMBER_OF_PERIOD",X="DASH_EMPTY_MANIFEST",K="DASH_INVALID_XML",$="NO_BASE_URL",Z="SEGMENT_TIME_UNSPECIFIED",J="UNSUPPORTED_UTC_TIMING_SCHEME",Q=function(t,e){var i=t.duration,n=t.segmentUrls,r=void 0===n?[]:n;if(!i&&!e||i&&e)throw new Error(Z);var a=r.map(function(e){return function(t,e){var i=t.baseUrl,n=t.initialization,r=void 0===n?{}:n,a=N({baseUrl:i,source:r.sourceURL,range:r.range}),s=N({baseUrl:i,source:e.media,range:e.mediaRange});return s.map=a,s}(t,e)}),s=void 0;return i&&(s=z(t)),e&&(s=j(t,e)),s.map(function(t,e){if(a[e]){var i=a[e];return i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i}}).filter(function(t){return t})},tt=function(t){var e=t.baseUrl,i=t.initialization,n=void 0===i?{}:i,r=t.sourceDuration,a=t.timescale,s=void 0===a?1:a,o=t.indexRange,u=void 0===o?"":o,l=t.duration;if(!e)throw new Error($);var c=N({baseUrl:e,source:n.sourceURL,range:n.range}),h=N({baseUrl:e,source:e,range:u});if(h.map=c,l){var d=z(t);d.length&&(h.duration=d[0].duration,h.timeline=d[0].timeline)}else r&&(h.duration=r/s,h.timeline=0);return h.number=0,[h]},et=function(t){var e=t.attributes,i=t.segmentInfo,n=void 0,r=void 0;if(i.template?(r=W,n=D(e,i.template)):i.base?(r=tt,n=D(e,i.base)):i.list&&(r=Q,n=D(e,i.list)),!r)return{attributes:e};var a=r(n,i.timeline);if(n.duration){var s=n,o=s.duration,u=s.timescale,l=void 0===u?1:u;n.duration=o/l}else a.length?n.duration=a.reduce(function(t,e){return Math.max(t,Math.ceil(e.duration))},0):n.duration=0;return{attributes:n,segments:a}},it=function(t,e){return H(t.childNodes).filter(function(t){return t.tagName===e})},nt=function(t){return t.textContent.trim()},rt=function(t){var e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!e)return 0;var i=e.slice(1),n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},at={mediaPresentationDuration:function(t){return rt(t)},availabilityStartTime:function(t){return function(t){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)}(t)/1e3},minimumUpdatePeriod:function(t){return rt(t)},timeShiftBufferDepth:function(t){return rt(t)},start:function(t){return rt(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},duration:function(t){var e=parseInt(t,10);return isNaN(e)?rt(t):e},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},st=function(t){return t&&t.attributes?H(t.attributes).reduce(function(t,e){var i=at[e.name]||at.DEFAULT;return t[e.name]=i(e.value),t},{}):{}};var ot={"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"},ut=function(t,e){return e.length?F(t.map(function(t){return e.map(function(e){return R(t,nt(e))})})):t},lt=function(t){var e=it(t,"SegmentTemplate")[0],i=it(t,"SegmentList")[0],n=i&&it(i,"SegmentURL").map(function(t){return D({tag:"SegmentURL"},st(t))}),r=it(t,"SegmentBase")[0],a=i||e,s=a&&it(a,"SegmentTimeline")[0],o=i||r||e,u=o&&it(o,"Initialization")[0],l=e&&st(e);l&&u?l.initialization=u&&st(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:s&&it(s,"S").map(function(t){return st(t)}),list:i&&D(st(i),{segmentUrls:n,initialization:st(u)}),base:r&&D(st(r),{initialization:st(u)})};return Object.keys(c).forEach(function(t){c[t]||delete c[t]}),c},ct=function(t){return t.reduce(function(t,e){var i=st(e),n=ot[i.schemeIdUri];if(n){t[n]={attributes:i};var r=it(e,"cenc:pssh")[0];if(r){var a=nt(r),s=a&&function(t){for(var e=c.a.atob(t),i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i}(a);t[n].pssh=s}}return t},{})},ht=function(t,e,i){return function(n){var r=st(n),a=ut(e,it(n,"BaseURL")),s=it(n,"Role")[0],o={role:st(s)},u=D(t,r,o),l=ct(it(n,"ContentProtection"));Object.keys(l).length&&(u=D(u,{contentProtection:l}));var c=lt(n),h=it(n,"Representation"),d=D(i,c);return F(h.map(function(t,e,i){return function(n){var r=it(n,"BaseURL"),a=ut(e,r),s=D(t,st(n)),o=lt(n);return a.map(function(t){return{segmentInfo:D(i,o),attributes:D(s,{baseUrl:t})}})}}(u,a,d)))}},dt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.manifestUri,n=void 0===i?"":i,r=e.NOW,a=void 0===r?Date.now():r,s=e.clientOffset,o=void 0===s?0:s,u=it(t,"Period");if(1!==u.length)throw new Error(Y);var l=st(t),c=ut([n],it(t,"BaseURL"));return l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=a,l.clientOffset=o,F(u.map(function(t,e){return function(i,n){var r=ut(e,it(i,"BaseURL")),a=st(i),s=D(t,a,{periodIndex:n}),o=it(i,"AdaptationSet"),u=lt(i);return F(o.map(ht(s,r,u)))}}(l,c)))},pt=function(t){if(""===t)throw new Error(X);var e=(new c.a.DOMParser).parseFromString(t,"application/xml"),i=e&&"MPD"===e.documentElement.tagName?e.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(K);return i},ft=function(t,e){return function(t){var e;if(!t.length)return{};var i=t[0].attributes,n=i.sourceDuration,r=i.minimumUpdatePeriod,a=void 0===r?0:r,s=t.filter(function(t){var e=t.attributes;return"video/mp4"===e.mimeType||"video"===e.contentType}).map(I),o=t.filter(function(t){var e=t.attributes;return"audio/mp4"===e.mimeType||"audio"===e.contentType}),u=t.filter(function(t){var e=t.attributes;return"text/vtt"===e.mimeType||"text"===e.contentType}),l={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(e={AUDIO:{},VIDEO:{}},e["CLOSED-CAPTIONS"]={},e.SUBTITLES={},e),uri:"",duration:n,playlists:s,minimumUpdatePeriod:1e3*a};return o.length&&(l.mediaGroups.AUDIO.audio=function(t){return t.reduce(function(t,e){var i=e.attributes.role&&e.attributes.role.value||"main",n=e.attributes.lang||"",r="main";return n&&(r=e.attributes.lang+" ("+i+")"),t[r]&&t[r].playlists[0].attributes.BANDWIDTH>e.attributes.bandwidth?t:(t[r]={language:n,autoselect:!0,default:"main"===i,playlists:[function(t){var e,i=t.attributes,n=t.segments,r={attributes:(e={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},e["PROGRAM-ID"]=1,e),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r}(e)],uri:""},t)},{})}(o)),u.length&&(l.mediaGroups.SUBTITLES.subs=function(t){return t.reduce(function(t,e){var i=e.attributes.lang||"text";return t[i]?t:(t[i]={language:i,default:!1,autoselect:!1,playlists:[function(t){var e,i=t.attributes,n=t.segments;return void 0===n&&(n=[{uri:i.baseUrl,timeline:i.periodIndex,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration),{attributes:(e={NAME:i.id,BANDWIDTH:i.bandwidth},e["PROGRAM-ID"]=1,e),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:i.baseUrl||"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1}}(e)],uri:""},t)},{})}(u)),l}(function(t){return t.map(et)}(dt(pt(t),e)))},mt=function(t){return function(t){var e=it(t,"UTCTiming")[0];if(!e)return null;var i=st(e);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(J)}return i}(pt(t))},gt=i(3),yt=i.n(gt),vt=i(22),_t=i(23),bt=i.n(_t);var Tt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},St=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),wt=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},kt=function(){var t=[[[],[],[],[],[]],[[],[],[],[],[]]],e=t[0],i=t[1],n=e[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=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(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)e[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)e[a]=e[a].slice(0),i[a]=i[a].slice(0);return t},Ct=null,Et=function(){function t(e){Tt(this,t),Ct||(Ct=kt()),this._tables=[[Ct[0][0].slice(),Ct[0][1].slice(),Ct[0][2].slice(),Ct[0][3].slice(),Ct[0][4].slice()],[Ct[1][0].slice(),Ct[1][1].slice(),Ct[1][2].slice(),Ct[1][3].slice(),Ct[1][4].slice()]];var i=void 0,n=void 0,r=void 0,a=void 0,s=void 0,o=this._tables[0][4],u=this._tables[1],l=e.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(a=e.slice(0),s=[],this._key=[a,s],i=l;i<4*l+28;i++)r=a[i-1],(i%l==0||8===l&&i%l==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%l==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),a[i]=a[i-l]^r;for(n=0;i;n++,i--)r=a[3&n?i:i-4],s[n]=i<=4||n<4?r:u[0][o[r>>>24]]^u[1][o[r>>16&255]]^u[2][o[r>>8&255]]^u[3][o[255&r]]}return t.prototype.decrypt=function(t,e,i,n,r,a){var s=this._key[1],o=t^s[0],u=n^s[1],l=i^s[2],c=e^s[3],h=void 0,d=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++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=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=h,u=d,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++],h=o,o=u,u=l,l=c,c=h},t}(),xt=function(){function t(){Tt(this,t),this.listeners={}}return t.prototype.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},t.prototype.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t].splice(i,1),i>-1},t.prototype.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,n=0;n<i;++n)e[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=e.length,s=0;s<a;++s)e[s].apply(this,r)},t.prototype.dispose=function(){this.listeners={}},t.prototype.pipe=function(t){this.on("data",function(e){t.push(e)})},t}(),At=function(t){function e(){Tt(this,e);var i=wt(this,t.call(this,xt));return i.jobs=[],i.delay=1,i.timeout_=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},e.prototype.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},e}(xt),Pt=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},Lt=function(t,e,i){var n=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),r=new Et(Array.prototype.slice.call(e)),a=new Uint8Array(t.byteLength),s=new Int32Array(a.buffer),o=void 0,u=void 0,l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(o=i[0],u=i[1],l=i[2],c=i[3],m=0;m<n.length;m+=4)h=Pt(n[m]),d=Pt(n[m+1]),p=Pt(n[m+2]),f=Pt(n[m+3]),r.decrypt(h,d,p,f,s,m),s[m]=Pt(s[m]^o),s[m+1]=Pt(s[m+1]^u),s[m+2]=Pt(s[m+2]^l),s[m+3]=Pt(s[m+3]^c),o=h,u=d,l=p,c=f;return a},Ot=function(){function t(e,i,n,r){Tt(this,t);var a=t.STEP,s=new Int32Array(e.buffer),o=new Uint8Array(e.byteLength),u=0;for(this.asyncStream_=new At,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o)),u=a;u<s.length;u+=a)n=new Uint32Array([Pt(s[u-4]),Pt(s[u-3]),Pt(s[u-2]),Pt(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o));this.asyncStream_.push(function(){r(null,function(t){return t.subarray(0,t.byteLength-t[t.byteLength-1])}(o))})}return t.prototype.decryptChunk_=function(t,e,i,n){return function(){var r=Lt(t,e,i);n.set(r,t.byteOffset)}},St(t,null,[{key:"STEP",get:function(){return 32e3}}]),t}(),It="7.2.2",Ut=void 0,Mt="info",Dt=[],Rt=function(t,e){var i=Ut.levels[Mt],n=new RegExp("^("+i+")$");if("log"!==t&&e.unshift(t.toUpperCase()+":"),Dt&&Dt.push([].concat(e)),e.unshift("VIDEOJS:"),c.a.console){var r=c.a.console[t];r||"debug"!==t||(r=c.a.console.info||c.a.console.log),r&&i&&n.test(t)&&r[Array.isArray(e)?"apply":"call"](c.a.console,e)}};(Ut=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];Rt("log",e)}).levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:Mt},Ut.level=function(t){if("string"==typeof t){if(!Ut.levels.hasOwnProperty(t))throw new Error('"'+t+'" in not a valid log level');Mt=t}return Mt},Ut.history=function(){return Dt?[].concat(Dt):[]},Ut.history.clear=function(){Dt&&(Dt.length=0)},Ut.history.disable=function(){null!==Dt&&(Dt.length=0,Dt=null)},Ut.history.enable=function(){null===Dt&&(Dt=[])},Ut.error=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return Rt("error",e)},Ut.warn=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return Rt("warn",e)},Ut.debug=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return Rt("debug",e)};var Nt=Ut,Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ft=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Ht=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Vt=function(t,e){return t.raw=e,t},zt=Object.prototype.toString,qt=function(t){return Yt(t)?Object.keys(t):[]};function Gt(t,e){qt(t).forEach(function(i){return e(t[i],i)})}function Wt(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[t].concat(i)):(i.forEach(function(e){e&&Gt(e,function(e,i){t[i]=e})}),t)}function Yt(t){return!!t&&"object"===(void 0===t?"undefined":Bt(t))}function Xt(t){return Yt(t)&&"[object Object]"===zt.call(t)&&t.constructor===Object}function Kt(t,e){if(!t||!e)return"";if("function"==typeof c.a.getComputedStyle){var i=c.a.getComputedStyle(t);return i?i[e]:""}return""}var $t=Vt(["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 Zt(t){return"string"==typeof t&&/\S/.test(t)}function Jt(t){if(/\s/.test(t))throw new Error("class has illegal whitespace characters")}function Qt(){return d.a===c.a.document}function te(t){return Yt(t)&&1===t.nodeType}function ee(){try{return c.a.parent!==c.a.self}catch(t){return!0}}function ie(t){return function(e,i){if(!Zt(e))return d.a[t](null);Zt(i)&&(i=d.a.querySelector(i));var n=te(i)?i:d.a;return n[t]&&n[t](e)}}function ne(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],r=d.a.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(t){var i=e[t];-1!==t.indexOf("aria-")||"role"===t||"type"===t?(Nt.warn(f()($t,t,i)),r.setAttribute(t,i)):"textContent"===t?re(r,i):r[t]=i}),Object.getOwnPropertyNames(i).forEach(function(t){r.setAttribute(t,i[t])}),n&&we(r,n),r}function re(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function ae(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function se(t,e){return Jt(e),t.classList?t.classList.contains(e):function(t){return new RegExp("(^|\\s)"+t+"($|\\s)")}(e).test(t.className)}function oe(t,e){return t.classList?t.classList.add(e):se(t,e)||(t.className=(t.className+" "+e).trim()),t}function ue(t,e){return t.classList?t.classList.remove(e):(Jt(e),t.className=t.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),t}function le(t,e,i){var n=se(t,e);if("function"==typeof i&&(i=i(t,e)),"boolean"!=typeof i&&(i=!n),i!==n)return i?oe(t,e):ue(t,e),t}function ce(t,e){Object.getOwnPropertyNames(e).forEach(function(i){var n=e[i];null===n||void 0===n||!1===n?t.removeAttribute(i):t.setAttribute(i,!0===n?"":n)})}function he(t){var e={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&t.attributes.length>0)for(var n=t.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof t[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),e[a]=s}return e}function de(t,e){return t.getAttribute(e)}function pe(t,e,i){t.setAttribute(e,i)}function fe(t,e){t.removeAttribute(e)}function me(){d.a.body.focus(),d.a.onselectstart=function(){return!1}}function ge(){d.a.onselectstart=function(){return!0}}function ye(t){if(t&&t.getBoundingClientRect&&t.parentNode){var e=t.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(t){void 0!==e[t]&&(i[t]=e[t])}),i.height||(i.height=parseFloat(Kt(t,"height"))),i.width||(i.width=parseFloat(Kt(t,"width"))),i}}function ve(t){var e=void 0;if(t.getBoundingClientRect&&t.parentNode&&(e=t.getBoundingClientRect()),!e)return{left:0,top:0};var i=d.a.documentElement,n=d.a.body,r=i.clientLeft||n.clientLeft||0,a=c.a.pageXOffset||n.scrollLeft,s=e.left+a-r,o=i.clientTop||n.clientTop||0,u=c.a.pageYOffset||n.scrollTop,l=e.top+u-o;return{left:Math.round(s),top:Math.round(l)}}function _e(t,e){var i={},n=ve(t),r=t.offsetWidth,a=t.offsetHeight,s=n.top,o=n.left,u=e.pageY,l=e.pageX;return e.changedTouches&&(l=e.changedTouches[0].pageX,u=e.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 be(t){return Yt(t)&&3===t.nodeType}function Te(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function Se(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map(function(t){return"function"==typeof t&&(t=t()),te(t)||be(t)?t:"string"==typeof t&&/\S/.test(t)?d.a.createTextNode(t):void 0}).filter(function(t){return t})}function we(t,e){return Se(e).forEach(function(e){return t.appendChild(e)}),t}function ke(t,e){return we(Te(t),e)}function Ce(t){return void 0===t.button&&void 0===t.buttons||(0===t.button&&void 0===t.buttons||0===t.button&&1===t.buttons)}var Ee=ie("querySelector"),xe=ie("querySelectorAll"),Ae=Object.freeze({isReal:Qt,isEl:te,isInFrame:ee,createEl:ne,textContent:re,prependTo:ae,hasClass:se,addClass:oe,removeClass:ue,toggleClass:le,setAttributes:ce,getAttributes:he,getAttribute:de,setAttribute:pe,removeAttribute:fe,blockTextSelection:me,unblockTextSelection:ge,getBoundingClientRect:ye,findPosition:ve,getPointerPosition:_e,isTextNode:be,emptyEl:Te,normalizeContent:Se,appendContent:we,insertContent:ke,isSingleLeftClick:Ce,$:Ee,$$:xe}),Pe=1;function Le(){return Pe++}var Oe={},Ie="vdata"+(new Date).getTime();function Ue(t){var e=t[Ie];return e||(e=t[Ie]=Le()),Oe[e]||(Oe[e]={}),Oe[e]}function Me(t){var e=t[Ie];return!!e&&!!Object.getOwnPropertyNames(Oe[e]).length}function De(t){var e=t[Ie];if(e){delete Oe[e];try{delete t[Ie]}catch(e){t.removeAttribute?t.removeAttribute(Ie):t[Ie]=null}}}function Re(t,e){var i=Ue(t);0===i.handlers[e].length&&(delete i.handlers[e],t.removeEventListener?t.removeEventListener(e,i.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&De(t)}function Ne(t,e,i,n){i.forEach(function(i){t(e,i,n)})}function Be(t){function e(){return!0}function i(){return!1}if(!t||!t.isPropagationStopped){var n=t||c.a.event;for(var r in t={},n)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&n.preventDefault||(t[r]=n[r]));if(t.target||(t.target=t.srcElement||d.a),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){n.preventDefault&&n.preventDefault(),t.returnValue=!1,n.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),t.cancelBubble=!0,n.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=i,t.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=i,null!==t.clientX&&void 0!==t.clientX){var a=d.a.documentElement,s=d.a.body;t.pageX=t.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),t.pageY=t.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}t.which=t.charCode||t.keyCode,null!==t.button&&void 0!==t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t}var je=!1;!function(){try{var t=Object.defineProperty({},"passive",{get:function(){je=!0}});c.a.addEventListener("test",null,t),c.a.removeEventListener("test",null,t)}catch(t){}}();var Fe=["touchstart","touchmove"];function He(t,e,i){if(Array.isArray(e))return Ne(He,t,e,i);var n=Ue(t);if(n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),i.guid||(i.guid=Le()),n.handlers[e].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(e,i){if(!n.disabled){e=Be(e);var r=n.handlers[e.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!e.isImmediatePropagationStopped();s++)try{a[s].call(t,e,i)}catch(t){Nt.error(t)}}}),1===n.handlers[e].length)if(t.addEventListener){var r=!1;je&&Fe.indexOf(e)>-1&&(r={passive:!0}),t.addEventListener(e,n.dispatcher,r)}else t.attachEvent&&t.attachEvent("on"+e,n.dispatcher)}function Ve(t,e,i){if(Me(t)){var n=Ue(t);if(n.handlers){if(Array.isArray(e))return Ne(Ve,t,e,i);var r=function(t,e){n.handlers[e]=[],Re(t,e)};if(void 0!==e){var a=n.handlers[e];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);Re(t,e)}else r(t,e)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(t,o)}}}function ze(t,e,i){var n=Me(t)?Ue(t):{},r=t.parentNode||t.ownerDocument;if("string"==typeof e?e={type:e,target:t}:e.target||(e.target=t),e=Be(e),n.dispatcher&&n.dispatcher.call(t,e,i),r&&!e.isPropagationStopped()&&!0===e.bubbles)ze.call(null,r,e,i);else if(!r&&!e.defaultPrevented){var a=Ue(e.target);e.target[e.type]&&(a.disabled=!0,"function"==typeof e.target[e.type]&&e.target[e.type](),a.disabled=!1)}return!e.defaultPrevented}function qe(t,e,i){if(Array.isArray(e))return Ne(qe,t,e,i);var n=function n(){Ve(t,e,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Le(),He(t,e,n)}var Ge=Object.freeze({fixEvent:Be,on:He,off:Ve,trigger:ze,one:qe}),We=!1,Ye=void 0,Xe=function(){if(Qt()&&!1!==Ye.options.autoSetup){var t=Array.prototype.slice.call(d.a.getElementsByTagName("video")),e=Array.prototype.slice.call(d.a.getElementsByTagName("audio")),i=Array.prototype.slice.call(d.a.getElementsByTagName("video-js")),n=t.concat(e,i);if(n&&n.length>0)for(var r=0,a=n.length;r<a;r++){var s=n[r];if(!s||!s.getAttribute){Ke(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&Ye(s)}else We||Ke(1)}};function Ke(t,e){e&&(Ye=e),c.a.setTimeout(Xe,t)}Qt()&&"complete"===d.a.readyState?We=!0:qe(c.a,"load",function(){We=!0});var $e=function(t){var e=d.a.createElement("style");return e.className=t,e},Ze=function(t,e){t.styleSheet?t.styleSheet.cssText=e:t.textContent=e},Je=function(t,e,i){e.guid||(e.guid=Le());var n=function(){return e.apply(t,arguments)};return n.guid=i?i+"_"+e.guid:e.guid,n},Qe=function(t,e){var i=Date.now();return function(){var n=Date.now();n-i>=e&&(t.apply(void 0,arguments),i=n)}},ti=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.a,r=void 0,a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||t.apply(a,s)};!r&&i&&t.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,e)};return a.cancel=function(){n.clearTimeout(r),r=null},a},ei=function(){};ei.prototype.allowedEvents_={},ei.prototype.on=function(t,e){var i=this.addEventListener;this.addEventListener=function(){},He(this,t,e),this.addEventListener=i},ei.prototype.addEventListener=ei.prototype.on,ei.prototype.off=function(t,e){Ve(this,t,e)},ei.prototype.removeEventListener=ei.prototype.off,ei.prototype.one=function(t,e){var i=this.addEventListener;this.addEventListener=function(){},qe(this,t,e),this.addEventListener=i},ei.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=Be(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),ze(this,t)},ei.prototype.dispatchEvent=ei.prototype.trigger;var ii=void 0;ei.prototype.queueTrigger=function(t){var e=this;ii||(ii=new Map);var i=t.type||t,n=ii.get(this);n||(n=new Map,ii.set(this,n));var r=n.get(i);n.delete(i),c.a.clearTimeout(r);var a=c.a.setTimeout(function(){0===n.size&&(n=null,ii.delete(e)),e.trigger(t)},0);n.set(i,a)};var ni=function(t){return t instanceof ei||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},ri=function(t){return"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length},ai=function(t){if(!t.nodeName&&!ni(t))throw new Error("Invalid target; must be a DOM node or evented object.")},si=function(t){if(!ri(t))throw new Error("Invalid event type; must be a non-empty string or array.")},oi=function(t){if("function"!=typeof t)throw new Error("Invalid listener; must be a function.")},ui=function(t,e){var i=e.length<3||e[0]===t||e[0]===t.eventBusEl_,n=void 0,r=void 0,a=void 0;return i?(n=t.eventBusEl_,e.length>=3&&e.shift(),r=e[0],a=e[1]):(n=e[0],r=e[1],a=e[2]),ai(n),si(r),oi(a),{isTargetingSelf:i,target:n,type:r,listener:a=Je(t,a)}},li=function(t,e,i,n){ai(t),t.nodeName?Ge[e](t,i,n):t[e](i,n)},ci={on:function(){for(var t=this,e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];var r=ui(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(li(s,"on",o,u),!a){var l=function(){return t.off(s,o,u)};l.guid=u.guid;var c=function(){return t.off("dispose",l)};c.guid=u.guid,li(this,"on","dispose",l),li(s,"on","dispose",c)}},one:function(){for(var t=this,e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];var r=ui(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)li(s,"one",o,u);else{var l=function e(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];t.off(s,o,e),u.apply(null,n)};l.guid=u.guid,li(s,"one",o,l)}},off:function(t,e,i){if(!t||ri(t))Ve(this.eventBusEl_,t,e);else{var n=t,r=e;ai(n),si(r),oi(i),i=Je(this,i),this.off("dispose",i),n.nodeName?(Ve(n,r,i),Ve(n,"dispose",i)):ni(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(t,e){return ze(this.eventBusEl_,t,e)}};function hi(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).eventBusKey;if(e){if(!t[e].nodeName)throw new Error('The eventBusKey "'+e+'" does not refer to an element.');t.eventBusEl_=t[e]}else t.eventBusEl_=ne("span",{className:"vjs-event-bus"});return Wt(t,ci),t.on("dispose",function(){t.off(),c.a.setTimeout(function(){t.eventBusEl_=null},0)}),t}var di={state:{},setState:function(t){var e=this;"function"==typeof t&&(t=t());var i=void 0;return Gt(t,function(t,n){e.state[n]!==t&&((i=i||{})[n]={from:e.state[n],to:t}),e.state[n]=t}),i&&ni(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function pi(t,e){return Wt(t,di),t.state=Wt({},t.state,e),"function"==typeof t.handleStateChanged&&ni(t)&&t.on("statechanged",t.handleStateChanged),t}function fi(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function mi(){for(var t={},e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.forEach(function(e){e&&Gt(e,function(e,i){Xt(e)?(Xt(t[i])||(t[i]={}),t[i]=mi(t[i],e)):t[i]=e})}),t}var gi=function(){function t(e,i,n){if(jt(this,t),!e&&this.play?this.player_=e=this:this.player_=e,this.options_=mi({},this.options_),i=this.options_=mi(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var r=e&&e.id&&e.id()||"no_player";this.id_=r+"_component_"+Le()}this.name_=i.name||null,i.el?this.el_=i.el:!1!==i.createEl&&(this.el_=this.createEl()),!1!==i.evented&&hi(this,{eventBusKey:this.el_?"el_":null}),pi(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==i.initChildren&&this.initChildren(),this.ready(n),!1!==i.reportTouchActivity&&this.enableTouchActivity()}return t.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),De(this.el_),this.el_=null),this.player_=null},t.prototype.player=function(){return this.player_},t.prototype.options=function(t){return Nt.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),t?(this.options_=mi(this.options_,t),this.options_):this.options_},t.prototype.el=function(){return this.el_},t.prototype.createEl=function(t,e,i){return ne(t,e,i)},t.prototype.localize=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,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[t]?u=a[t]:o&&o[t]&&(u=o[t]),e&&(u=u.replace(/\{(\d+)\}/g,function(t,i){var n=e[i-1],r=n;return void 0===n&&(r=t),r})),u},t.prototype.contentEl=function(){return this.contentEl_||this.el_},t.prototype.id=function(){return this.id_},t.prototype.name=function(){return this.name_},t.prototype.children=function(){return this.children_},t.prototype.getChildById=function(t){return this.childIndex_[t]},t.prototype.getChild=function(t){if(t)return t=fi(t),this.childNameIndex_[t]},t.prototype.addChild=function(e){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 e){a=fi(e);var s=i.componentClass||a;i.name=a;var o=t.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=e;if(this.children_.splice(n,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&fi(r.name()))&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children[n]||null;this.contentEl().insertBefore(r.el(),u)}return r},t.prototype.removeChild=function(t){if("string"==typeof t&&(t=this.getChild(t)),t&&this.children_){for(var e=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===t){e=!0,this.children_.splice(i,1);break}if(e){this.childIndex_[t.id()]=null,this.childNameIndex_[t.name()]=null;var n=t.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el())}}},t.prototype.initChildren=function(){var e=this,i=this.options_.children;if(i){var n=this.options_,r=void 0,a=t.getComponent("Tech");(r=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(t){return!r.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(t){var n=void 0,r=void 0;return"string"==typeof t?r=i[n=t]||e.options_[n]||{}:(n=t.name,r=t),{name:n,opts:r}}).filter(function(e){var i=t.getComponent(e.opts.componentClass||fi(e.name));return i&&!a.isTech(i)}).forEach(function(t){var i=t.name,r=t.opts;if(void 0!==n[i]&&(r=n[i]),!1!==r){!0===r&&(r={}),r.playerOptions=e.options_.playerOptions;var a=e.addChild(i,r);a&&(e[i]=a)}})}},t.prototype.buildCSSClass=function(){return""},t.prototype.ready=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return this.isReady_?void(e?t.call(this):this.setTimeout(t,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(t))},t.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var t=this.readyQueue_;this.readyQueue_=[],t&&t.length>0&&t.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)},t.prototype.$=function(t,e){return Ee(t,e||this.contentEl())},t.prototype.$$=function(t,e){return xe(t,e||this.contentEl())},t.prototype.hasClass=function(t){return se(this.el_,t)},t.prototype.addClass=function(t){oe(this.el_,t)},t.prototype.removeClass=function(t){ue(this.el_,t)},t.prototype.toggleClass=function(t,e){le(this.el_,t,e)},t.prototype.show=function(){this.removeClass("vjs-hidden")},t.prototype.hide=function(){this.addClass("vjs-hidden")},t.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},t.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.prototype.getAttribute=function(t){return de(this.el_,t)},t.prototype.setAttribute=function(t,e){pe(this.el_,t,e)},t.prototype.removeAttribute=function(t){fe(this.el_,t)},t.prototype.width=function(t,e){return this.dimension("width",t,e)},t.prototype.height=function(t,e){return this.dimension("height",t,e)},t.prototype.dimensions=function(t,e){this.width(t,!0),this.height(e)},t.prototype.dimension=function(t,e,i){if(void 0!==e)return null!==e&&e==e||(e=0),-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?this.el_.style[t]=e:this.el_.style[t]="auto"===e?"":e+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[t],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+fi(t)],10)},t.prototype.currentDimension=function(t){var e=0;if("width"!==t&&"height"!==t)throw new Error("currentDimension only accepts width or height value");if("function"==typeof c.a.getComputedStyle){var i=c.a.getComputedStyle(this.el_);e=i.getPropertyValue(t)||i[t]}if(0===(e=parseFloat(e))){var n="offset"+fi(t);e=this.el_[n]}return e},t.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.prototype.currentWidth=function(){return this.currentDimension("width")},t.prototype.currentHeight=function(){return this.currentDimension("height")},t.prototype.focus=function(){this.el_.focus()},t.prototype.blur=function(){this.el_.blur()},t.prototype.emitTapEvents=function(){var t=0,e=null,i=void 0;this.on("touchstart",function(n){1===n.touches.length&&(e={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=(new Date).getTime(),i=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)i=!1;else if(e){var n=t.touches[0].pageX-e.pageX,r=t.touches[0].pageY-e.pageY;Math.sqrt(n*n+r*r)>10&&(i=!1)}});var n=function(){i=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){(e=null,!0===i)&&((new Date).getTime()-t<200&&(n.preventDefault(),this.trigger("tap")))})},t.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t=Je(this.player(),this.player().reportUserActivity),e=void 0;this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.prototype.setTimeout=function(t,e){var i,n,r=this;return t=Je(this,t),i=c.a.setTimeout(function(){r.off("dispose",n),t()},e),(n=function(){return r.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",n),i},t.prototype.clearTimeout=function(t){c.a.clearTimeout(t);var e=function(){};return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.prototype.setInterval=function(t,e){var i=this;t=Je(this,t);var n=c.a.setInterval(t,e),r=function(){return i.clearInterval(n)};return r.guid="vjs-interval-"+n,this.on("dispose",r),n},t.prototype.clearInterval=function(t){c.a.clearInterval(t);var e=function(){};return e.guid="vjs-interval-"+t,this.off("dispose",e),t},t.prototype.requestAnimationFrame=function(t){var e,i,n=this;return this.supportsRaf_?(t=Je(this,t),e=c.a.requestAnimationFrame(function(){n.off("dispose",i),t()}),(i=function(){return n.cancelAnimationFrame(e)}).guid="vjs-raf-"+e,this.on("dispose",i),e):this.setTimeout(t,1e3/60)},t.prototype.cancelAnimationFrame=function(t){if(this.supportsRaf_){c.a.cancelAnimationFrame(t);var e=function(){};return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.clearTimeout(t)},t.registerComponent=function(e,i){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var n=t.getComponent("Tech"),r=n&&n.isTech(i),a=t===i||t.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, "'+e+'"; '+s+".")}e=fi(e),t.components_||(t.components_={});var o=t.getComponent("Player");if("Player"===e&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(t){return u[t]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=i,i},t.getComponent=function(e){if(e)return e=fi(e),t.components_&&t.components_[e]?t.components_[e]:void 0},t}();gi.prototype.supportsRaf_="function"==typeof c.a.requestAnimationFrame&&"function"==typeof c.a.cancelAnimationFrame,gi.registerComponent("Component",gi);var yi=c.a.navigator&&c.a.navigator.userAgent||"",vi=/AppleWebKit\/([\d.]+)/i.exec(yi),_i=vi?parseFloat(vi.pop()):null,bi=/iPad/i.test(yi),Ti=/iPhone/i.test(yi)&&!bi,Si=/iPod/i.test(yi),wi=Ti||bi||Si,ki=function(){var t=yi.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Ci=/Android/i.test(yi),Ei=function(){var t=yi.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var e=t[1]&&parseFloat(t[1]),i=t[2]&&parseFloat(t[2]);return e&&i?parseFloat(t[1]+"."+t[2]):e||null}(),xi=Ci&&Ei<5&&_i<537,Ai=/Firefox/i.test(yi),Pi=/Edge/i.test(yi),Li=!Pi&&(/Chrome/i.test(yi)||/CriOS/i.test(yi)),Oi=function(){var t=yi.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Ii=function(){var t=/MSIE\s(\d+)\.\d/.exec(yi),e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(yi)&&/rv:11.0/.test(yi)&&(e=11),e}(),Ui=/Safari/i.test(yi)&&!Li&&!Ci&&!Pi,Mi=(Ui||wi)&&!Li,Di=Qt()&&("ontouchstart"in c.a||c.a.navigator.maxTouchPoints||c.a.DocumentTouch&&c.a.document instanceof c.a.DocumentTouch),Ri=Object.freeze({IS_IPAD:bi,IS_IPHONE:Ti,IS_IPOD:Si,IS_IOS:wi,IOS_VERSION:ki,IS_ANDROID:Ci,ANDROID_VERSION:Ei,IS_NATIVE_ANDROID:xi,IS_FIREFOX:Ai,IS_EDGE:Pi,IS_CHROME:Li,CHROME_VERSION:Oi,IE_VERSION:Ii,IS_SAFARI:Ui,IS_ANY_SAFARI:Mi,TOUCH_ENABLED:Di});function Ni(t,e,i,n){return function(t,e,i){if("number"!=typeof e||e<0||e>i)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+i+").")}(t,n,i.length-1),i[n][e]}function Bi(t){return void 0===t||0===t.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:Ni.bind(null,"start",0,t),end:Ni.bind(null,"end",1,t)}}function ji(t,e){return Array.isArray(t)?Bi(t):void 0===t||void 0===e?Bi():Bi([[t,e]])}function Fi(t,e){var i=0,n=void 0,r=void 0;if(!e)return 0;t&&t.length||(t=ji(0,0));for(var a=0;a<t.length;a++)n=t.start(a),(r=t.end(a))>e&&(r=e),i+=r-n;return i/e}for(var Hi={},Vi=[["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"]],zi=Vi[0],qi=void 0,Gi=0;Gi<Vi.length;Gi++)if(Vi[Gi][1]in d.a){qi=Vi[Gi];break}if(qi)for(var Wi=0;Wi<qi.length;Wi++)Hi[zi[Wi]]=qi[Wi];function Yi(t){if(t instanceof Yi)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:Yt(t)&&("number"==typeof t.code&&(this.code=t.code),Wt(this,t)),this.message||(this.message=Yi.defaultMessages[this.code]||"")}Yi.prototype.code=0,Yi.prototype.message="",Yi.prototype.status=null,Yi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Yi.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 Xi=0;Xi<Yi.errorTypes.length;Xi++)Yi[Yi.errorTypes[Xi]]=Xi,Yi.prototype[Yi.errorTypes[Xi]]=Xi;function Ki(t){return void 0!==t&&null!==t&&"function"==typeof t.then}function $i(t){Ki(t)&&t.then(null,function(t){})}var Zi=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(e,i,n){return t[i]&&(e[i]=t[i]),e},{cues:t.cues&&Array.prototype.map.call(t.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},Ji=function(t){var e=t.$$("track"),i=Array.prototype.map.call(e,function(t){return t.track});return Array.prototype.map.call(e,function(t){var e=Zi(t.track);return t.src&&(e.src=t.src),e}).concat(Array.prototype.filter.call(t.textTracks(),function(t){return-1===i.indexOf(t)}).map(Zi))},Qi=function(t,e){return t.forEach(function(t){var i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(function(t){return i.addCue(t)})}),e.textTracks()},tn="vjs-modal-dialog",en=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=ne("div",{className:tn+"-content"},{role:"document"}),r.descEl_=ne("p",{className:tn+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),re(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},e.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,t.prototype.dispose.call(this)},e.prototype.buildCSSClass=function(){return tn+" vjs-hidden "+t.prototype.buildCSSClass.call(this)},e.prototype.handleKeyPress=function(t){27===t.which&&this.closeable()&&this.close()},e.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},e.prototype.description=function(){var t=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),t},e.prototype.open=function(){if(!this.opened_){var t=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!t.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&t.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",Je(this,this.handleKeyPress)),this.hadControls_=t.controls(),t.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},e.prototype.opened=function(t){return"boolean"==typeof t&&this[t?"open":"close"](),this.opened_},e.prototype.close=function(){if(this.opened_){var t=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&t.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Je(this,this.handleKeyPress)),this.hadControls_&&t.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},e.prototype.closeable=function(t){if("boolean"==typeof t){var e=this.closeable_=!!t,i=this.getChild("closeButton");if(e&&!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)}!e&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},e.prototype.fill=function(){this.fillWith(this.content())},e.prototype.fillWith=function(t){var e=this.contentEl(),i=e.parentNode,n=e.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(e),this.empty(),ke(e,t),this.trigger("modalfill"),n?i.insertBefore(e,n):i.appendChild(e);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},e.prototype.empty=function(){this.trigger("beforemodalempty"),Te(this.contentEl()),this.trigger("modalempty")},e.prototype.content=function(t){return void 0!==t&&(this.content_=t),this.content_},e.prototype.conditionalFocus_=function(){var t=d.a.activeElement,e=this.player_.el_;this.previouslyActiveEl_=null,(e.contains(t)||e===t)&&(this.previouslyActiveEl_=t,this.focus(),this.on(d.a,"keydown",this.handleKeyDown))},e.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(d.a,"keydown",this.handleKeyDown)},e.prototype.handleKeyDown=function(t){if(9===t.which){for(var e=this.focusableEls_(),i=this.el_.querySelector(":focus"),n=void 0,r=0;r<e.length;r++)if(i===e[r]){n=r;break}d.a.activeElement===this.el_&&(n=0),t.shiftKey&&0===n?(e[e.length-1].focus(),t.preventDefault()):t.shiftKey||n!==e.length-1||(e[0].focus(),t.preventDefault())}},e.prototype.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,function(t){return(t instanceof c.a.HTMLAnchorElement||t instanceof c.a.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof c.a.HTMLInputElement||t instanceof c.a.HTMLSelectElement||t instanceof c.a.HTMLTextAreaElement||t instanceof c.a.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof c.a.HTMLIFrameElement||t instanceof c.a.HTMLObjectElement||t instanceof c.a.HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")})},e}(gi);en.prototype.options_={pauseOnOpen:!0,temporary:!0},gi.registerComponent("ModalDialog",en);var nn=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];jt(this,e);var n=Ht(this,t.call(this));n.tracks_=[],Object.defineProperty(n,"length",{get:function(){return this.tracks_.length}});for(var r=0;r<i.length;r++)n.addTrack(i[r]);return n}return Ft(e,t),e.prototype.addTrack=function(t){var e=this.tracks_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.tracks_[e]}}),-1===this.tracks_.indexOf(t)&&(this.tracks_.push(t),this.trigger({track:t,type:"addtrack"}))},e.prototype.removeTrack=function(t){for(var e=void 0,i=0,n=this.length;i<n;i++)if(this[i]===t){(e=this[i]).off&&e.off(),this.tracks_.splice(i,1);break}e&&this.trigger({track:e,type:"removetrack"})},e.prototype.getTrackById=function(t){for(var e=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===t){e=r;break}}return e},e}(ei);for(var rn in nn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},nn.prototype.allowedEvents_)nn.prototype["on"+rn]=null;var an=function(t,e){for(var i=0;i<t.length;i++)Object.keys(t[i]).length&&e.id!==t[i].id&&(t[i].enabled=!1)},sn=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];jt(this,e);for(var n=i.length-1;n>=0;n--)if(i[n].enabled){an(i,i[n]);break}var r=Ht(this,t.call(this,i));return r.changing_=!1,r}return Ft(e,t),e.prototype.addTrack=function(e){var i=this;e.enabled&&an(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&e.addEventListener("enabledchange",function(){i.changing_||(i.changing_=!0,an(i,e),i.changing_=!1,i.trigger("change"))})},e}(nn),on=function(t,e){for(var i=0;i<t.length;i++)Object.keys(t[i]).length&&e.id!==t[i].id&&(t[i].selected=!1)},un=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];jt(this,e);for(var n=i.length-1;n>=0;n--)if(i[n].selected){on(i,i[n]);break}var r=Ht(this,t.call(this,i));return r.changing_=!1,Object.defineProperty(r,"selectedIndex",{get:function(){for(var t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set:function(){}}),r}return Ft(e,t),e.prototype.addTrack=function(e){var i=this;e.selected&&on(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&e.addEventListener("selectedchange",function(){i.changing_||(i.changing_=!0,on(i,e),i.changing_=!1,i.trigger("change"))})},e}(nn),ln=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.addTrack=function(e){t.prototype.addTrack.call(this,e),e.addEventListener("modechange",Je(this,function(){this.queueTrigger("change")}));-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",Je(this,function(){this.trigger("selectedlanguagechange")}))},e}(nn),cn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];jt(this,t),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var i=0,n=e.length;i<n;i++)this.addTrackElement_(e[i])}return t.prototype.addTrackElement_=function(t){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),-1===this.trackElements_.indexOf(t)&&this.trackElements_.push(t)},t.prototype.getTrackElementByTrack_=function(t){for(var e=void 0,i=0,n=this.trackElements_.length;i<n;i++)if(t===this.trackElements_[i].track){e=this.trackElements_[i];break}return e},t.prototype.removeTrackElement_=function(t){for(var e=0,i=this.trackElements_.length;e<i;e++)if(t===this.trackElements_[e]){this.trackElements_.splice(e,1);break}},t}(),hn=function(){function t(e){jt(this,t),t.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get:function(){return this.length_}})}return t.prototype.setCues_=function(t){var e=this.length||0,i=0,n=t.length;this.cues_=t,this.length_=t.length;var r=function(t){""+t in this||Object.defineProperty(this,""+t,{get:function(){return this.cues_[t]}})};if(e<n)for(i=e;i<n;i++)r.call(this,i)},t.prototype.getCueById=function(t){for(var e=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===t){e=r;break}}return e},t}(),dn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},pn={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},fn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},mn={disabled:"disabled",hidden:"hidden",showing:"showing"},gn=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};jt(this,e);var n=Ht(this,t.call(this)),r={id:i.id||"vjs_track_"+Le(),kind:i.kind||"",label:i.label||"",language:i.language||""},a=function(t){Object.defineProperty(n,t,{get:function(){return r[t]},set:function(){}})};for(var s in r)a(s);return n}return Ft(e,t),e}(ei),yn=function(t){var e=["protocol","hostname","port","pathname","search","hash","host"],i=d.a.createElement("a");i.href=t;var n=""===i.host&&"file:"!==i.protocol,r=void 0;n&&((r=d.a.createElement("div")).innerHTML='<a href="'+t+'"></a>',i=r.firstChild,r.setAttribute("style","display:none; position:absolute;"),d.a.body.appendChild(r));for(var a={},s=0;s<e.length;s++)a[e[s]]=i[e[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=c.a.location.protocol),n&&d.a.body.removeChild(r),a},vn=function(t){if(!t.match(/^https?:\/\//)){var e=d.a.createElement("div");e.innerHTML='<a href="'+t+'">x</a>',t=e.firstChild.href}return t},_n=function(t){if("string"==typeof t){var e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(t);if(e)return e.pop().toLowerCase()}return""},bn=function(t){var e=c.a.location,i=yn(t);return(":"===i.protocol?e.protocol:i.protocol)+i.host!==e.protocol+e.host},Tn=Object.freeze({parseUrl:yn,getAbsoluteURL:vn,getFileExtension:_n,isCrossOrigin:bn}),Sn=function(t,e){var i=new c.a.WebVTT.Parser(c.a,c.a.vttjs,c.a.WebVTT.StringDecoder()),n=[];i.oncue=function(t){e.addCue(t)},i.onparsingerror=function(t){n.push(t)},i.onflush=function(){e.trigger({type:"loadeddata",target:e})},i.parse(t),n.length>0&&(c.a.console&&c.a.console.groupCollapsed&&c.a.console.groupCollapsed("Text Track parsing errors for "+e.src),n.forEach(function(t){return Nt.error(t)}),c.a.console&&c.a.console.groupEnd&&c.a.console.groupEnd()),i.flush()},wn=function(t,e){var i={uri:t},n=bn(t);n&&(i.cors=n),g()(i,Je(this,function(t,i,n){if(t)return Nt.error(t,i);if(e.loaded_=!0,"function"!=typeof c.a.WebVTT){if(e.tech_){var r=function(){return Sn(n,e)};e.tech_.on("vttjsloaded",r),e.tech_.on("vttjserror",function(){Nt.error("vttjs failed to load, stopping trying to process "+e.src),e.tech_.off("vttjsloaded",r)})}}else Sn(n,e)}))},kn=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(jt(this,e),!i.tech)throw new Error("A tech was not provided.");var n=mi(i,{kind:fn[i.kind]||"subtitles",language:i.language||i.srclang||""}),r=mn[n.mode]||"disabled",a=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden");var s=Ht(this,t.call(this,n));s.tech_=n.tech,s.cues_=[],s.activeCues_=[];var o=new hn(s.cues_),u=new hn(s.activeCues_),l=!1,c=Je(s,function(){this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)});return"disabled"!==r&&s.tech_.ready(function(){s.tech_.on("timeupdate",c)},!0),Object.defineProperties(s,{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(t){var e=this;mn[t]&&("showing"===(r=t)&&this.tech_.ready(function(){e.tech_.on("timeupdate",c)},!0),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?o:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var t=this.tech_.currentTime(),e=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];r.startTime<=t&&r.endTime>=t?e.push(r):r.startTime===r.endTime&&r.startTime<=t&&r.startTime+.5>=t&&e.push(r)}if(l=!1,e.length!==this.activeCues_.length)l=!0;else for(var a=0;a<e.length;a++)-1===this.activeCues_.indexOf(e[a])&&(l=!0);return this.activeCues_=e,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(s.src=n.src,wn(n.src,s)):s.loaded_=!0,s}return Ft(e,t),e.prototype.addCue=function(t){var e=t;if(c.a.vttjs&&!(t instanceof c.a.vttjs.VTTCue)){for(var i in e=new c.a.vttjs.VTTCue(t.startTime,t.endTime,t.text),t)i in e||(e[i]=t[i]);e.id=t.id,e.originalCue_=t}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(e);this.cues_.push(e),this.cues.setCues_(this.cues_)},e.prototype.removeCue=function(t){for(var e=this.cues_.length;e--;){var i=this.cues_[e];if(i===t||i.originalCue_&&i.originalCue_===t){this.cues_.splice(e,1),this.cues.setCues_(this.cues_);break}}},e}(gn);kn.prototype.allowedEvents_={cuechange:"cuechange"};var Cn=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};jt(this,e);var n=mi(i,{kind:pn[i.kind]||""}),r=Ht(this,t.call(this,n)),a=!1;return Object.defineProperty(r,"enabled",{get:function(){return a},set:function(t){"boolean"==typeof t&&t!==a&&(a=t,this.trigger("enabledchange"))}}),n.enabled&&(r.enabled=n.enabled),r.loaded_=!0,r}return Ft(e,t),e}(gn),En=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};jt(this,e);var n=mi(i,{kind:dn[i.kind]||""}),r=Ht(this,t.call(this,n)),a=!1;return Object.defineProperty(r,"selected",{get:function(){return a},set:function(t){"boolean"==typeof t&&t!==a&&(a=t,this.trigger("selectedchange"))}}),n.selected&&(r.selected=n.selected),r}return Ft(e,t),e}(gn),xn=0,An=2,Pn=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};jt(this,e);var n=Ht(this,t.call(this)),r=void 0,a=new kn(i);return n.kind=a.kind,n.src=a.src,n.srclang=a.language,n.label=a.label,n.default=a.default,Object.defineProperties(n,{readyState:{get:function(){return r}},track:{get:function(){return a}}}),r=xn,a.addEventListener("loadeddata",function(){r=An,n.trigger({type:"load",target:n})}),n}return Ft(e,t),e}(ei);Pn.prototype.allowedEvents_={load:"load"},Pn.NONE=xn,Pn.LOADING=1,Pn.LOADED=An,Pn.ERROR=3;var Ln={audio:{ListClass:sn,TrackClass:Cn,capitalName:"Audio"},video:{ListClass:un,TrackClass:En,capitalName:"Video"},text:{ListClass:ln,TrackClass:kn,capitalName:"Text"}};Object.keys(Ln).forEach(function(t){Ln[t].getterName=t+"Tracks",Ln[t].privateName=t+"Tracks_"});var On={remoteText:{ListClass:ln,TrackClass:kn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:cn,TrackClass:Pn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},In=mi(Ln,On);On.names=Object.keys(On),Ln.names=Object.keys(Ln),In.names=[].concat(On.names).concat(Ln.names);var Un=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};jt(this,e),i.reportTouchActivity=!1;var r=Ht(this,t.call(this,null,i,n));return r.hasStarted_=!1,r.on("playing",function(){this.hasStarted_=!0}),r.on("loadstart",function(){this.hasStarted_=!1}),In.names.forEach(function(t){var e=In[t];i&&i[e.getterName]&&(r[e.privateName]=i[e.getterName])}),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(t){!1===i["native"+t+"Tracks"]&&(r["featuresNative"+t+"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 In.text.ListClass,r.initTrackListeners(),i.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}return Ft(e,t),e.prototype.triggerSourceset=function(t){var e=this;this.isReady_||this.one("ready",function(){return e.setTimeout(function(){return e.triggerSourceset(t)},1)}),this.trigger({src:t,type:"sourceset"})},e.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},e.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},e.prototype.trackProgress=function(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Je(this,function(){var t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,1===t&&this.stopTrackingProgress()}),500)},e.prototype.onDurationChange=function(t){this.duration_=this.duration()},e.prototype.buffered=function(){return ji(0,0)},e.prototype.bufferedPercent=function(){return Fi(this.buffered(),this.duration_)},e.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},e.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},e.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},e.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},e.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.dispose=function(){this.clearTracks(Ln.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},e.prototype.clearTracks=function(t){var e=this;(t=[].concat(t)).forEach(function(t){for(var i=e[t+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===t&&e.removeRemoteTextTrack(r),i.removeTrack(r)}})},e.prototype.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],e=t.length;e--;){var i=t[e];this.removeRemoteTextTrack(i)}},e.prototype.reset=function(){},e.prototype.error=function(t){return void 0!==t&&(this.error_=new Yi(t),this.trigger("error")),this.error_},e.prototype.played=function(){return this.hasStarted_?ji(0,0):ji()},e.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.initTrackListeners=function(){var t=this;Ln.names.forEach(function(e){var i=Ln[e],n=function(){t.trigger(e+"trackchange")},r=t[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),t.on("dispose",function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})},e.prototype.addWebVttScript_=function(){var t=this;if(!c.a.WebVTT)if(d.a.body.contains(this.el())){if(!this.options_["vtt.js"]&&Xt(v.a)&&Object.keys(v.a).length>0)return void this.trigger("vttjsloaded");var e=d.a.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){e.onload=null,e.onerror=null}),c.a.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)},e.prototype.emulateTextTracks=function(){var t=this,e=this.textTracks(),i=this.remoteTextTracks(),n=function(t){return e.addTrack(t.track)},r=function(t){return e.removeTrack(t.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return t.trigger("texttrackchange")},s=function(){a();for(var t=0;t<e.length;t++){var i=e[t];i.removeEventListener("cuechange",a),"showing"===i.mode&&i.addEventListener("cuechange",a)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",function(){i.off("addtrack",n),i.off("removetrack",r),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(var t=0;t<e.length;t++){e[t].removeEventListener("cuechange",a)}})},e.prototype.addTextTrack=function(t,e,i){if(!t)throw new Error("TextTrack kind is required but was not provided");return function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=t.textTracks();r.kind=e,i&&(r.label=i),n&&(r.language=n),r.tech=t;var s=new In.text.TrackClass(r);return a.addTrack(s),s}(this,t,e,i)},e.prototype.createRemoteTextTrack=function(t){var e=mi(t,{tech:this});return new On.remoteTextEl.TrackClass(e)},e.prototype.addRemoteTextTrack=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.createRemoteTextTrack(e);return!0!==i&&!1!==i&&(Nt.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 t.autoRemoteTextTracks_.addTrack(n.track)}),n},e.prototype.removeRemoteTextTrack=function(t){var e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e),this.remoteTextTracks().removeTrack(t),this.autoRemoteTextTracks_.removeTrack(t)},e.prototype.getVideoPlaybackQuality=function(){return{}},e.prototype.setPoster=function(){},e.prototype.playsinline=function(){},e.prototype.setPlaysinline=function(){},e.prototype.overrideNativeAudioTracks=function(){},e.prototype.overrideNativeVideoTracks=function(){},e.prototype.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(t,i){return e.canPlayType(t.type)},e.isTech=function(t){return t.prototype instanceof e||t instanceof e||t===e},e.registerTech=function(t,i){if(e.techs_||(e.techs_={}),!e.isTech(i))throw new Error("Tech "+t+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return t=fi(t),e.techs_[t]=i,"Tech"!==t&&e.defaultTechOrder_.push(t),i},e.getTech=function(t){if(t)return t=fi(t),e.techs_&&e.techs_[t]?e.techs_[t]:c.a&&c.a.videojs&&c.a.videojs[t]?(Nt.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),c.a.videojs[t]):void 0},e}(gi);In.names.forEach(function(t){var e=In[t];Un.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),Un.prototype.featuresVolumeControl=!0,Un.prototype.featuresMuteControl=!0,Un.prototype.featuresFullscreenResize=!1,Un.prototype.featuresPlaybackRate=!1,Un.prototype.featuresProgressEvents=!1,Un.prototype.featuresSourceset=!1,Un.prototype.featuresTimeupdateEvents=!1,Un.prototype.featuresNativeTextTracks=!1,Un.withSourceHandlers=function(t){t.registerSourceHandler=function(e,i){var n=t.sourceHandlers;n||(n=t.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,e)},t.canPlayType=function(e){for(var i=t.sourceHandlers||[],n=void 0,r=0;r<i.length;r++)if(n=i[r].canPlayType(e))return n;return""},t.selectSourceHandler=function(e,i){for(var n=t.sourceHandlers||[],r=0;r<n.length;r++)if(n[r].canHandleSource(e,i))return n[r];return null},t.canPlaySource=function(e,i){var n=t.selectSourceHandler(e,i);return n?n.canHandleSource(e,i):""};["seekable","seeking","duration"].forEach(function(t){var e=this[t];"function"==typeof e&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):e.apply(this,arguments)})},t.prototype),t.prototype.setSource=function(e){var i=t.selectSourceHandler(e,this.options_);i||(t.nativeSourceHandler?i=t.nativeSourceHandler:Nt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==t.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=i.handleSource(e,this,this.options_),this.on("dispose",this.disposeSourceHandler)},t.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)}},gi.registerComponent("Tech",Un),Un.registerTech("Tech",Un),Un.defaultTechOrder_=[];var Mn={},Dn={},Rn={};function Nn(t,e,i){t.setTimeout(function(){return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];var n=arguments[2];var r=arguments[3];var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];var o=i[0],u=i.slice(1);if("string"==typeof o)t(e,Mn[o],n,r,a,s);else if(o){var l=function(t,e){var i=Dn[t.id()],n=null;if(void 0===i||null===i)return n=e(t),Dn[t.id()]=[[e,n]],n;for(var r=0;r<i.length;r++){var a=i[r],s=a[0],o=a[1];s===e&&(n=o)}null===n&&(n=e(t),i.push([e,n]));return n}(r,o);if(!l.setSource)return a.push(l),t(e,u,n,r,a,s);l.setSource(Wt({},e),function(i,o){if(i)return t(e,u,n,r,a,s);a.push(l),t(o,e.type===o.type?u:Mn[o.type],n,r,a,s)})}else u.length?t(e,u,n,r,a,s):s?n(e,a):t(e,Mn["*"],n,r,a,!0)}(e,Mn[e.type],i,t)},1)}function Bn(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+fi(i),a=t.reduce(Vn(r),n),s=a===Rn,o=s?null:e[i](a);return function(t,e,i,n){for(var r=t.length-1;r>=0;r--){var a=t[r];a[e]&&a[e](n,i)}}(t,i,o,s),o}var jn={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Fn={setCurrentTime:1},Hn={play:1,pause:1};function Vn(t){return function(e,i){return e===Rn?Rn:i[t]?i[t](e):e}}var zn={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"},qn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=_n(t);return zn[e.toLowerCase()]||""};function Gn(t){var e=qn(t.src);return!t.type&&e&&(t.type=e),t}var Wn=function(t){function e(i,n,r){jt(this,e);var a=mi({createEl:!1},n),s=Ht(this,t.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=fi(u[o]),c=Un.getTech(l);if(l||(c=gi.getComponent(l)),c&&c.isSupported()){i.loadTech_(l);break}}return s}return Ft(e,t),e}(gi);gi.registerComponent("MediaLoader",Wn);var Yn=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.emitTapEvents(),r.enable(),r}return Ft(e,t),e.prototype.createEl=function(){var e=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=Wt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===e&&Nt.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=Wt({role:"button"},n),this.tabIndex_=i.tabIndex;var r=t.prototype.createEl.call(this,e,i,n);return this.createControlTextEl(r),r},e.prototype.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},e.prototype.createControlTextEl=function(t){return this.controlTextEl_=ne("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_},e.prototype.controlText=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===t)return this.controlText_||"Need Text";var i=this.localize(t);this.controlText_=t,re(this.controlTextEl_,i),this.nonIconControl||e.setAttribute("title",i)},e.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+t.prototype.buildCSSClass.call(this)},e.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},e.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},e.prototype.handleClick=function(t){},e.prototype.handleFocus=function(t){He(d.a,"keydown",Je(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.trigger("click")):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e.prototype.handleBlur=function(t){Ve(d.a,"keydown",Je(this,this.handleKeyPress))},e}(gi);gi.registerComponent("ClickableComponent",Yn);var Xn=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.update(),i.on("posterchange",Je(r,r.update)),r}return Ft(e,t),e.prototype.dispose=function(){this.player().off("posterchange",this.update),t.prototype.dispose.call(this)},e.prototype.createEl=function(){return ne("div",{className:"vjs-poster",tabIndex:-1})},e.prototype.update=function(t){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},e.prototype.setSrc=function(t){var e="";t&&(e='url("'+t+'")'),this.el_.style.backgroundImage=e},e.prototype.handleClick=function(t){this.player_.controls()&&(this.player_.paused()?$i(this.player_.play()):this.player_.pause())},e}(Yn);gi.registerComponent("PosterImage",Xn);var Kn={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 $n(t,e){var i=void 0;if(4===t.length)i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(7!==t.length)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");i=t.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+e+")"}function Zn(t,e,i){try{t.style[e]=i}catch(t){return}}var Jn=function(t){function e(i,n,r){jt(this,e);var a=Ht(this,t.call(this,i,n,r));return i.on("loadstart",Je(a,a.toggleDisplay)),i.on("texttrackchange",Je(a,a.updateDisplay)),i.on("loadstart",Je(a,a.preselectTrack)),i.ready(Je(a,function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",Je(this,this.updateDisplay));for(var t=this.options_.playerOptions.tracks||[],e=0;e<t.length;e++)this.player_.addRemoteTextTrack(t[e],!0);this.preselectTrack()}})),a}return Ft(e,t),e.prototype.preselectTrack=function(){for(var t={captions:1,subtitles:1},e=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage,n=void 0,r=void 0,a=void 0,s=0;s<e.length;s++){var o=e[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 t&&!r&&(r=o):n=o)}a?a.mode="showing":r?r.mode="showing":n&&(n.mode="showing")},e.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},e.prototype.clearDisplay=function(){"function"==typeof c.a.WebVTT&&c.a.WebVTT.processCues(c.a,[],this.el_)},e.prototype.updateDisplay=function(){var t=this.player_.textTracks();this.clearDisplay();for(var e=null,i=null,n=t.length;n--;){var r=t[n];"showing"===r.mode&&("descriptions"===r.kind?e=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):e&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(e))},e.prototype.updateForTrack=function(t){if("function"==typeof c.a.WebVTT&&t.activeCues){for(var e=[],i=0;i<t.activeCues.length;i++)e.push(t.activeCues[i]);if(c.a.WebVTT.processCues(c.a,e,this.el_),this.player_.textTrackSettings)for(var n=this.player_.textTrackSettings.getValues(),r=e.length;r--;){var a=e[r];if(a){var s=a.displayState;if(n.color&&(s.firstChild.style.color=n.color),n.textOpacity&&Zn(s.firstChild,"color",$n(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Zn(s.firstChild,"backgroundColor",$n(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Zn(s,"backgroundColor",$n(n.windowColor,n.windowOpacity)):s.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===n.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),n.fontPercent&&1!==n.fontPercent){var o=c.a.parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Kn[n.fontFamily])}}}},e}(gi);gi.registerComponent("TextTrackDisplay",Jn);var Qn=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(){var e=this.player_.isAudio(),i=this.localize(e?"Audio Player":"Video Player"),n=ne("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=t.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},e}(gi);gi.registerComponent("LoadingSpinner",Qn);var tr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=Wt({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},e),i=Wt({type:"button"},i);var n=gi.prototype.createEl.call(this,"button",e,i);return this.createControlTextEl(n),n},e.prototype.addChild=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return Nt.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),gi.prototype.addChild.call(this,t,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},e.prototype.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},e.prototype.handleKeyPress=function(e){32!==e.which&&13!==e.which&&t.prototype.handleKeyPress.call(this,e)},e}(Yn);gi.registerComponent("Button",tr);var er=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-big-play-button"},e.prototype.handleClick=function(t){var e=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY)$i(e);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Ki(e)?e.then(r,function(){}):this.setTimeout(r,1)}else this.player_.focus()}},e.prototype.handleKeyPress=function(e){this.mouseused_=!1,t.prototype.handleKeyPress.call(this,e)},e.prototype.handleMouseDown=function(t){this.mouseused_=!0},e}(tr);er.prototype.controlText_="Play Video",gi.registerComponent("BigPlayButton",er);var ir=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.controlText(n&&n.controlText||r.localize("Close")),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},e}(tr);gi.registerComponent("CloseButton",ir);var nr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.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 Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},e.prototype.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},e.prototype.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},e.prototype.handleEnded=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},e}(tr);nr.prototype.controlText_="Play",gi.registerComponent("PlayToggle",nr);var rr=function(t,e){t=t<0?0:t;var i=Math.floor(t%60),n=Math.floor(t/60%60),r=Math.floor(t/3600),a=Math.floor(e/60%60),s=Math.floor(e/3600);return(isNaN(t)||t===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)},ar=rr;function sr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return ar(t,e)}var or=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.throttledUpdateContent=Qe(Je(r,r.updateContent),25),r.on(i,"timeupdate",r.throttledUpdateContent),r}return Ft(e,t),e.prototype.createEl=function(e){var i=this.buildCSSClass(),n=t.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_=ne("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},e.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},e.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=d.a.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},e.prototype.formatTime_=function(t){return sr(t)},e.prototype.updateFormattedTime_=function(t){var e=this.formatTime_(t);e!==this.formattedTime_&&(this.formattedTime_=e,this.requestAnimationFrame(this.updateTextNode_))},e.prototype.updateContent=function(t){},e}(gi);or.prototype.labelText_="Time",or.prototype.controlText_="Time",gi.registerComponent("TimeDisplay",or);var ur=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.on(i,"ended",r.handleEnded),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-current-time"},e.prototype.updateContent=function(t){var e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(e)},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},e}(or);ur.prototype.labelText_="Current Time",ur.prototype.controlText_="Current Time",gi.registerComponent("CurrentTimeDisplay",ur);var lr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.on(i,"durationchange",r.updateContent),r.on(i,"loadedmetadata",r.throttledUpdateContent),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-duration"},e.prototype.updateContent=function(t){var e=this.player_.duration();e&&this.duration_!==e&&(this.duration_=e,this.updateFormattedTime_(e))},e}(or);lr.prototype.labelText_="Duration",lr.prototype.controlText_="Duration",gi.registerComponent("DurationDisplay",lr);var cr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},e}(gi);gi.registerComponent("TimeDivider",cr);var hr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.on(i,"durationchange",r.throttledUpdateContent),r.on(i,"ended",r.handleEnded),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-remaining-time"},e.prototype.formatTime_=function(e){return"-"+t.prototype.formatTime_.call(this,e)},e.prototype.updateContent=function(t){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(0)},e}(or);hr.prototype.labelText_="Remaining Time",hr.prototype.controlText_="Remaining Time",gi.registerComponent("RemainingTimeDisplay",hr);var dr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}return Ft(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ne("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},e}(gi);gi.registerComponent("LiveDisplay",dr);var pr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return Ft(e,t),e.prototype.enabled=function(){return this.enabled_},e.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)},e.prototype.disable=function(){if(this.enabled()){var t=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(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},e.prototype.createEl=function(e){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=Wt({tabIndex:0},i),n=Wt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),t.prototype.createEl.call(this,e,i,n)},e.prototype.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||Li||t.preventDefault(),me(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchmove",this.handleMouseMove),this.on(e,"touchend",this.handleMouseUp),this.handleMouseMove(t)},e.prototype.handleMouseMove=function(t){},e.prototype.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;ge(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.update()},e.prototype.update=function(){if(this.el_){var t=this.getPercent(),e=this.bar;if(e){("number"!=typeof t||t!=t||t<0||t===1/0)&&(t=0);var i=(100*t).toFixed(2)+"%",n=e.el().style;return this.vertical()?n.height=i:n.width=i,t}}},e.prototype.calculateDistance=function(t){var e=_e(this.el_,t);return this.vertical()?e.y:e.x},e.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepBack()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepForward())},e.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleClick=function(t){t.stopImmediatePropagation(),t.preventDefault()},e.prototype.vertical=function(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(gi);gi.registerComponent("Slider",pr);var fr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.partEls_=[],r.on(i,"progress",r.update),r}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},e.prototype.dispose=function(){this.partEls_=null,t.prototype.dispose.call(this)},e.prototype.update=function(t){var e=this.player_.buffered(),i=this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,a=function(t,e){var i=t/e||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=a(n,i);for(var s=0;s<e.length;s++){var o=e.start(s),u=e.end(s),l=r[s];l||(l=this.el_.appendChild(ne()),r[s]=l),l.style.left=a(o,n),l.style.width=a(u-o,n)}for(var c=r.length;c>e.length;c--)this.el_.removeChild(r[c-1]);r.length=e.length},e}(gi);gi.registerComponent("LoadProgressBar",fr);var mr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},e.prototype.update=function(t,e,i){var n=ye(this.el_),r=ye(this.player_.el()),a=t.width*e;if(r&&n){var s=t.left-r.left+a,o=t.width-a+(r.right-t.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",re(this.el_,i)}},e}(gi);gi.registerComponent("TimeTooltip",mr);var gr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(){return t.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>"})},e.prototype.update=function(t,e){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var n=sr(i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),i.player_.duration()),r=i.getChild("timeTooltip");r&&r.update(t,e,n)})},e}(gi);gr.prototype.options_={children:[]},wi||Ci||gr.prototype.options_.children.push("timeTooltip"),gi.registerComponent("PlayProgressBar",gr);var yr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.update=Qe(Je(r,r.update),25),r}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},e.prototype.update=function(t,e){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var n=i.player_.duration(),r=sr(e*n,n);i.el_.style.left=t.width*e+"px",i.getChild("timeTooltip").update(t,e,r)})},e}(gi);yr.prototype.options_={children:["timeTooltip"]},gi.registerComponent("MouseTimeDisplay",yr);var vr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.setEventHandlers_(),r}return Ft(e,t),e.prototype.setEventHandlers_=function(){var t=this;this.update=Qe(Je(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){t.clearInterval(t.updateInterval),t.updateInterval=t.setInterval(function(){t.requestAnimationFrame(function(){t.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){t.clearInterval(t.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update_=function(t,e){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[sr(t,i),sr(i,i)],"{1} of {2}")),this.bar.update(ye(this.el_),e)},e.prototype.update=function(e){var i=t.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},e.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},e.prototype.handleEnded=function(t){this.update_(this.player_.duration(),1)},e.prototype.getPercent=function(){var t=this.getCurrentTime_()/this.player_.duration();return t>=1?1:t||0},e.prototype.handleMouseDown=function(e){Ce(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},e.prototype.handleMouseMove=function(t){if(Ce(t)){var e=this.calculateDistance(t)*this.player_.duration();e===this.player_.duration()&&(e-=.1),this.player_.currentTime(e)}},e.prototype.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},e.prototype.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&$i(this.player_.play())},e.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},e.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},e.prototype.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.handleAction(e)):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e}(pr);vr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},wi||Ci||vr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),vr.prototype.playerEvent="timeupdate",gi.registerComponent("SeekBar",vr);var _r=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.handleMouseMove=Qe(Je(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=Qe(Je(r,r.handleMouseSeek),25),r.enable(),r}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},e.prototype.handleMouseMove=function(t){var e=this.getChild("seekBar");if(e){var i=e.getChild("mouseTimeDisplay"),n=e.el(),r=ye(n),a=_e(n,t).x;a>1?a=1:a<0&&(a=0),i&&i.update(r,a)}},e.prototype.handleMouseSeek=function(t){var e=this.getChild("seekBar");e&&e.handleMouseMove(t)},e.prototype.enabled=function(){return this.enabled_},e.prototype.disable=function(){this.children().forEach(function(t){return t.disable&&t.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},e.prototype.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(t),this.on(e,"mousemove",this.throttledHandleMouseSeek),this.on(e,"touchmove",this.throttledHandleMouseSeek),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(t),this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e}(gi);_r.prototype.options_={children:["seekBar"]},gi.registerComponent("ProgressControl",_r);var br=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.on(i,"fullscreenchange",r.handleFullscreenChange),!1===d.a[Hi.fullscreenEnabled]&&r.disable(),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},e.prototype.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(tr);br.prototype.controlText_="Fullscreen",gi.registerComponent("FullscreenToggle",br);var Tr=function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Sr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},e}(gi);gi.registerComponent("VolumeLevel",Sr);var wr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.on("slideractive",r.updateLastVolume_),r.on(i,"volumechange",r.updateARIAAttributes),i.ready(function(){return r.updateARIAAttributes()}),r}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},e.prototype.handleMouseDown=function(e){Ce(e)&&t.prototype.handleMouseDown.call(this,e)},e.prototype.handleMouseMove=function(t){Ce(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},e.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},e.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},e.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},e.prototype.updateARIAAttributes=function(t){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e),this.el_.setAttribute("aria-valuetext",e+"%")},e.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},e.prototype.updateLastVolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",function(){0===t.player_.volume()&&t.player_.lastVolume_(e)})},e}(pr);wr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},wr.prototype.playerEvent="volumechange",gi.registerComponent("VolumeBar",wr);var kr=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};jt(this,e),n.vertical=n.vertical||!1,(void 0===n.volumeBar||Xt(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical);var r=Ht(this,t.call(this,i,n));return Tr(r,i),r.throttledHandleMouseMove=Qe(Je(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 Ft(e,t),e.prototype.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove),this.on(e,"touchmove",this.throttledHandleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove),this.off(e,"touchmove",this.throttledHandleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},e}(gi);kr.prototype.options_={children:["volumeBar"]},gi.registerComponent("VolumeControl",kr);var Cr=function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Er=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return Cr(r,i),r.on(i,["loadstart","volumechange"],r.update),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){var e=this.player_.volume(),i=this.player_.lastVolume_();if(0===e){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},e.prototype.update=function(t){this.updateIcon_(),this.updateControlText_()},e.prototype.updateIcon_=function(){var t=this.player_.volume(),e=3;wi&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var i=0;i<4;i++)ue(this.el_,"vjs-vol-"+i);oe(this.el_,"vjs-vol-"+e)},e.prototype.updateControlText_=function(){var t=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},e}(tr);Er.prototype.controlText_="Mute",gi.registerComponent("MuteToggle",Er);var xr=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};jt(this,e),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||Xt(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline);var r=Ht(this,t.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 Ft(e,t),e.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},e.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},e.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")},e.prototype.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},e}(gi);xr.prototype.options_={children:["muteToggle","volumeControl"]},gi.registerComponent("VolumePanel",xr);var Ar=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return Ft(e,t),e.prototype.addItem=function(t){this.addChild(t),t.on("click",Je(this,function(e){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus())}))},e.prototype.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=ne(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),He(i,"click",function(t){t.preventDefault(),t.stopImmediatePropagation()}),i},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepForward()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepBack())},e.prototype.stepForward=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_+1),this.focus(t)},e.prototype.stepBack=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_-1),this.focus(t)},e.prototype.focus=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.children().slice();e.length&&e[0].className&&/vjs-menu-title/.test(e[0].className)&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedChild_=t,e[t].el_.focus())},e}(gi);gi.registerComponent("Menu",Ar);var Pr=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};jt(this,e);var r=Ht(this,t.call(this,i,n));r.menuButton_=new tr(i,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var a=tr.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 Ft(e,t),e.prototype.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},e.prototype.createMenu=function(){var t=new Ar(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=ne("li",{className:"vjs-menu-title",innerHTML:fi(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,t.children_.unshift(e),ae(e,t.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)t.addItem(this.items[i]);return t},e.prototype.createItems=function(){},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},e.prototype.buildWrapperCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+tr.prototype.buildCSSClass()+" "+t.prototype.buildCSSClass.call(this)},e.prototype.buildCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+t.prototype.buildCSSClass.call(this)},e.prototype.controlText=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(t,e)},e.prototype.handleClick=function(t){this.one(this.menu.contentEl(),"mouseleave",Je(this,function(t){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},e.prototype.focus=function(){this.menuButton_.focus()},e.prototype.blur=function(){this.menuButton_.blur()},e.prototype.handleFocus=function(){He(d.a,"keydown",Je(this,this.handleKeyPress))},e.prototype.handleBlur=function(){Ve(d.a,"keydown",Je(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(t){27===t.which||9===t.which?(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus())):38!==t.which&&40!==t.which||this.buttonPressed_||(this.pressButton(),t.preventDefault())},e.prototype.handleSubmenuKeyPress=function(t){27!==t.which&&9!==t.which||(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus()))},e.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),wi&&ee())return;this.menu.focus()}},e.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},e.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},e.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(gi);gi.registerComponent("MenuButton",Pr);var Lr=function(t){function e(i,n){jt(this,e);var r=n.tracks,a=Ht(this,t.call(this,i,n));if(a.items.length<=1&&a.hide(),!r)return Ht(a);var s=Je(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 Ft(e,t),e}(Pr);gi.registerComponent("TrackButton",Lr);var Or=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.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 Ft(e,t),e.prototype.createEl=function(e,i,n){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",Wt({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},e.prototype.handleClick=function(t){this.selected(!0)},e.prototype.selected=function(t){this.selectable&&(t?(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))},e}(Yn);gi.registerComponent("MenuItem",Or);var Ir=function(t){function e(i,n){jt(this,e);var r=n.track,a=i.textTracks();n.label=r.label||r.language||"Unknown",n.selected="showing"===r.mode;var s=Ht(this,t.call(this,i,n));s.track=r;var o=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];s.handleTracksChange.apply(s,e)},u=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];s.handleSelectedLanguageChange.apply(s,e)};if(i.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),s.on("dispose",function(){i.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)}),void 0===a.onchange){var l=void 0;s.on(["tap","click"],function(){if("object"!==Bt(c.a.Event))try{l=new c.a.Event("change")}catch(t){}l||(l=d.a.createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(l)})}return s.handleTracksChange(),s}return Ft(e,t),e.prototype.handleClick=function(e){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),t.prototype.handleClick.call(this,e),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")}},e.prototype.handleTracksChange=function(t){var e="showing"===this.track.mode;e!==this.isSelected_&&this.selected(e)},e.prototype.handleSelectedLanguageChange=function(t){if("showing"===this.track.mode){var e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},e.prototype.dispose=function(){this.track=null,t.prototype.dispose.call(this)},e}(Or);gi.registerComponent("TextTrackMenuItem",Ir);var Ur=function(t){function e(i,n){return jt(this,e),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,Ht(this,t.call(this,i,n))}return Ft(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),i=!0,n=0,r=e.length;n<r;n++){var a=e[n];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},e.prototype.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),i=!0,n=0,r=e.length;n<r;n++){var a=e[n];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(Ir);gi.registerComponent("OffTextTrackMenuItem",Ur);var Mr=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return jt(this,e),n.tracks=i.textTracks(),Ht(this,t.call(this,i,n))}return Ft(e,t),e.prototype.createItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ir,i=void 0;this.label_&&(i=this.label_+" off"),t.push(new Ur(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 e(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),t.push(s)}}return t},e}(Lr);gi.registerComponent("TextTrackButton",Mr);var Dr=function(t){function e(i,n){jt(this,e);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=Ht(this,t.call(this,i,n));return o.track=r,o.cue=a,r.addEventListener("cuechange",Je(o,o.update)),o}return Ft(e,t),e.prototype.handleClick=function(e){t.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},e.prototype.update=function(t){var e=this.cue,i=this.player_.currentTime();this.selected(e.startTime<=i&&i<e.endTime)},e}(Or);gi.registerComponent("ChaptersTrackMenuItem",Dr);var Rr=function(t){function e(i,n,r){return jt(this,e),Ht(this,t.call(this,i,n,r))}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.update=function(e){this.track_&&(!e||"addtrack"!==e.type&&"removetrack"!==e.type)||this.setTrack(this.findChaptersTrack()),t.prototype.update.call(this)},e.prototype.setTrack=function(t){if(this.track_!==t){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=t,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},e.prototype.findChaptersTrack=function(){for(var t=this.player_.textTracks()||[],e=t.length-1;e>=0;e--){var i=t[e];if(i.kind===this.kind_)return i}},e.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(fi(this.kind_))},e.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},e.prototype.createItems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var i=0,n=e.length;i<n;i++){var r=e[i],a=new Dr(this.player_,{track:this.track_,cue:r});t.push(a)}return t},e}(Mr);Rr.prototype.kind_="chapters",Rr.prototype.controlText_="Chapters",gi.registerComponent("ChaptersButton",Rr);var Nr=function(t){function e(i,n,r){jt(this,e);var a=Ht(this,t.call(this,i,n,r)),s=i.textTracks(),o=Je(a,a.handleTracksChange);return s.addEventListener("change",o),a.on("dispose",function(){s.removeEventListener("change",o)}),a}return Ft(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),i=!1,n=0,r=e.length;n<r;n++){var a=e[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},e.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(Mr);Nr.prototype.kind_="descriptions",Nr.prototype.controlText_="Descriptions",gi.registerComponent("DescriptionsButton",Nr);var Br=function(t){function e(i,n,r){return jt(this,e),Ht(this,t.call(this,i,n,r))}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(Mr);Br.prototype.kind_="subtitles",Br.prototype.controlText_="Subtitles",gi.registerComponent("SubtitlesButton",Br);var jr=function(t){function e(i,n){jt(this,e),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=Ht(this,t.call(this,i,n));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return Ft(e,t),e.prototype.handleClick=function(t){this.player().getChild("textTrackSettings").open()},e}(Ir);gi.registerComponent("CaptionSettingsMenuItem",jr);var Fr=function(t){function e(i,n,r){return jt(this,e),Ht(this,t.call(this,i,n,r))}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-captions-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new jr(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e)},e}(Mr);Fr.prototype.kind_="captions",Fr.prototype.controlText_="Captions",gi.registerComponent("CaptionsButton",Fr);var Hr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(e,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"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>",t.prototype.createEl.call(this,e,Wt({innerHTML:r},i),n)},e}(Ir);gi.registerComponent("SubsCapsMenuItem",Hr);var Vr=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};jt(this,e);var r=Ht(this,t.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(fi(r.label_)),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new jr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,Hr)},e}(Mr);Vr.prototype.kinds_=["captions","subtitles"],Vr.prototype.controlText_="Subtitles",gi.registerComponent("SubsCapsButton",Vr);var zr=function(t){function e(i,n){jt(this,e);var r=n.track,a=i.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled;var s=Ht(this,t.call(this,i,n));s.track=r,s.addClass("vjs-"+r.kind+"-menu-item");var o=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];s.handleTracksChange.apply(s,e)};return a.addEventListener("change",o),s.on("dispose",function(){a.removeEventListener("change",o)}),s}return Ft(e,t),e.prototype.createEl=function(e,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"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>",t.prototype.createEl.call(this,e,Wt({innerHTML:r},i),n)},e.prototype.handleClick=function(e){var i=this.player_.audioTracks();t.prototype.handleClick.call(this,e);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},e.prototype.handleTracksChange=function(t){this.selected(this.track.enabled)},e}(Or);gi.registerComponent("AudioTrackMenuItem",zr);var qr=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return jt(this,e),n.tracks=i.audioTracks(),Ht(this,t.call(this,i,n))}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var e=this.player_.audioTracks(),i=0;i<e.length;i++){var n=e[i];t.push(new zr(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return t},e}(Lr);qr.prototype.controlText_="Audio Track",gi.registerComponent("AudioTrackButton",qr);var Gr=function(t){function e(i,n){jt(this,e);var r=n.rate,a=parseFloat(r,10);n.label=r,n.selected=1===a,n.selectable=!0,n.multiSelectable=!1;var s=Ht(this,t.call(this,i,n));return s.label=r,s.rate=a,s.on(i,"ratechange",s.update),s}return Ft(e,t),e.prototype.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},e.prototype.update=function(t){this.selected(this.player().playbackRate()===this.rate)},e}(Or);Gr.prototype.contentElType="button",gi.registerComponent("PlaybackRateMenuItem",Gr);var Wr=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.updateVisibility(),r.updateLabel(),r.on(i,"loadstart",r.updateVisibility),r.on(i,"ratechange",r.updateLabel),r}return Ft(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=ne("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},e.prototype.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},e.prototype.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createMenu=function(){var t=new Ar(this.player()),e=this.playbackRates();if(e)for(var i=e.length-1;i>=0;i--)t.addChild(new Gr(this.player(),{rate:e[i]+"x"}));return t},e.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},e.prototype.handleClick=function(t){for(var e=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>e){n=i[r];break}this.player().playbackRate(n)},e.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},e.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},e.prototype.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},e.prototype.updateLabel=function(t){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},e}(Pr);Wr.prototype.controlText_="Playback Rate",gi.registerComponent("PlaybackRateMenuButton",Wr);var Yr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},e}(gi);gi.registerComponent("Spacer",Yr);var Xr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML=" ",e},e}(Yr);gi.registerComponent("CustomControlSpacer",Xr);var Kr=function(t){function e(){return jt(this,e),Ht(this,t.apply(this,arguments))}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e}(gi);Kr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},gi.registerComponent("ControlBar",Kr);var $r=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n));return r.on(i,"error",r.open),r}return Ft(e,t),e.prototype.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},e.prototype.content=function(){var t=this.player().error();return t?this.localize(t.message):""},e}(en);$r.prototype.options_=mi(en.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),gi.registerComponent("ErrorDisplay",$r);var Zr=["#000","Black"],Jr=["#00F","Blue"],Qr=["#0FF","Cyan"],ta=["#0F0","Green"],ea=["#F0F","Magenta"],ia=["#F00","Red"],na=["#FFF","White"],ra=["#FF0","Yellow"],aa=["1","Opaque"],sa=["0.5","Semi-Transparent"],oa=["0","Transparent"],ua={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Zr,na,ia,ta,Jr,ra,ea,Qr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[aa,sa,oa]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[na,Zr,ia,ta,Jr,ra,ea,Qr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return"1.00"===t?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[aa,sa]},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:[oa,sa,aa]}};function la(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}ua.windowColor.options=ua.backgroundColor.options;var ca=function(t){function e(i,n){jt(this,e),n.temporary=!1;var r=Ht(this,t.call(this,i,n));return r.updateDisplay=Je(r,r.updateDisplay),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=ne("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()}),Gt(ua,function(t){r.on(r.$(t.selector),"change",r.updateDisplay)}),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}return Ft(e,t),e.prototype.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},e.prototype.createElSelect_=function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",r=ua[t],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(t){var i=a+"-"+t[1].replace(/\W+/g,"");return['<option id="'+i+'" value="'+t[0]+'" ','aria-labelledby="'+s+" "+i+'">',e.localize(t[1]),"</option>"].join("")})).concat("</select>").join("")},e.prototype.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElBgColor_=function(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElWinColor_=function(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElColors_=function(){return ne("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},e.prototype.createElFont_=function(){return ne("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},e.prototype.createElControls_=function(){var t=this.localize("restore all settings to the default values");return ne("div",{className:"vjs-track-settings-controls",innerHTML:['<button class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},e.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},e.prototype.label=function(){return this.localize("Caption Settings Dialog")},e.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},e.prototype.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},e.prototype.getValues=function(){var t=this;return function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return qt(t).reduce(function(i,n){return e(i,t[n],n)},i)}(ua,function(e,i,n){var r=function(t,e){return la(t.options[t.options.selectedIndex].value,e)}(t.$(i.selector),i.parser);return void 0!==r&&(e[n]=r),e},{})},e.prototype.setValues=function(t){var e=this;Gt(ua,function(i,n){!function(t,e,i){if(e)for(var n=0;n<t.options.length;n++)if(la(t.options[n].value,i)===e){t.selectedIndex=n;break}}(e.$(i.selector),t[n],i.parser)})},e.prototype.setDefaults=function(){var t=this;Gt(ua,function(e){var i=e.hasOwnProperty("default")?e.default:0;t.$(e.selector).selectedIndex=i})},e.prototype.restoreSettings=function(){var t=void 0;try{t=JSON.parse(c.a.localStorage.getItem("vjs-text-track-settings"))}catch(t){Nt.warn(t)}t&&this.setValues(t)},e.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?c.a.localStorage.setItem("vjs-text-track-settings",JSON.stringify(t)):c.a.localStorage.removeItem("vjs-text-track-settings")}catch(t){Nt.warn(t)}}},e.prototype.updateDisplay=function(){var t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()},e.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(d.a,"keydown",this.handleKeyDown);var t=this.player_.controlBar,e=t&&t.subsCapsButton,i=t&&t.captionsButton;e?e.focus():i&&i.focus()},e}(en);gi.registerComponent("TextTrackSettings",ca);var ha=function(t){function e(i,n){jt(this,e);var r=n.ResizeObserver||c.a.ResizeObserver;null===n.ResizeObserver&&(r=!1);var a=mi({createEl:!r,reportTouchActivity:!1},n),s=Ht(this,t.call(this,i,a));return s.ResizeObserver=n.ResizeObserver||c.a.ResizeObserver,s.loadListener_=null,s.resizeObserver_=null,s.debouncedHandler_=ti(function(){s.resizeHandler()},100,!1,i),r?(s.resizeObserver_=new s.ResizeObserver(s.debouncedHandler_),s.resizeObserver_.observe(i.el())):(s.loadListener_=function(){s.el_.contentWindow&&He(s.el_.contentWindow,"resize",s.debouncedHandler_),s.off("load",s.loadListener_)},s.on("load",s.loadListener_)),s}return Ft(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},e.prototype.resizeHandler=function(){this.player_.trigger("playerresize")},e.prototype.dispose=function(){this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&Ve(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,t.prototype.dispose.call(this)},e}(gi);gi.registerComponent("ResizeManager",ha);var da=function(t){var e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;var i=t.$$("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]),t.triggerSourceset(r),!0)},pa=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var e=d.a.createElement(this.nodeName.toLowerCase());e.innerHTML=t;for(var i=d.a.createDocumentFragment();e.childNodes.length;)i.appendChild(e.childNodes[0]);return this.innerText="",c.a.Element.prototype.appendChild.call(this,i),this.innerHTML}}),fa=function(t,e){for(var i={},n=0;n<t.length&&!((i=Object.getOwnPropertyDescriptor(t[n],e))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},ma=function(t){var e=t.el();if(!e.resetSourceWatch_){var i={},n=function(t){return fa([t.el(),c.a.HTMLMediaElement.prototype,c.a.Element.prototype,pa],"innerHTML")}(t),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(e,r);return da(t),s}};["append","appendChild","insertAdjacentHTML"].forEach(function(t){e[t]&&(i[t]=e[t],e[t]=r(i[t]))}),Object.defineProperty(e,"innerHTML",mi(n,{set:r(n.set)})),e.resetSourceWatch_=function(){e.resetSourceWatch_=null,Object.keys(i).forEach(function(t){e[t]=i[t]}),Object.defineProperty(e,"innerHTML",n)},t.one("sourceset",e.resetSourceWatch_)}},ga=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?vn(c.a.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return c.a.Element.prototype.setAttribute.call(this,"src",t),t}}),ya=function(t){if(t.featuresSourceset){var e=t.el();if(!e.resetSourceset_){var i=function(t){return fa([t.el(),c.a.HTMLMediaElement.prototype,ga],"src")}(t),n=e.setAttribute,r=e.load;Object.defineProperty(e,"src",mi(i,{set:function(n){var r=i.set.call(e,n);return t.triggerSourceset(e.src),r}})),e.setAttribute=function(i,r){var a=n.call(e,i,r);return/src/i.test(i)&&t.triggerSourceset(e.src),a},e.load=function(){var i=r.call(e);return da(t)||(t.triggerSourceset(""),ma(t)),i},e.currentSrc?t.triggerSourceset(e.currentSrc):da(t)||ma(t),e.resetSourceset_=function(){e.resetSourceset_=null,e.load=r,e.setAttribute=n,Object.defineProperty(e,"src",i),e.resetSourceWatch_&&e.resetSourceWatch_()}}}},va=Vt(["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."]),_a=function(t){function e(i,n){jt(this,e);var r=Ht(this,t.call(this,i,n)),a=i.source,s=!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()){for(var o=r.el_.childNodes,u=o.length,l=[];u--;){var c=o[u];"track"===c.nodeName.toLowerCase()&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(c),r.remoteTextTracks().addTrack(c.track),r.textTracks().addTrack(c.track),s||r.el_.hasAttribute("crossorigin")||!bn(c.src)||(s=!0)):l.push(c))}for(var h=0;h<l.length;h++)r.el_.removeChild(l[h])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&s&&Nt.warn(f()(va)),r.restoreMetadataTracksInIOSNativePlayer_(),(Di||Ti||xi)&&!0===i.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}return Ft(e,t),e.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},e.prototype.setupSourcesetHandling_=function(){ya(this)},e.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var t=this.textTracks(),e=void 0,i=function(){e=[];for(var i=0;i<t.length;i++){var n=t[i];"metadata"===n.kind&&e.push({track:n,storedMode:n.mode})}};i(),t.addEventListener("change",i),this.on("dispose",function(){return t.removeEventListener("change",i)});var n=function i(){for(var n=0;n<e.length;n++){var r=e[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",i)};this.on("webkitbeginfullscreen",function(){t.removeEventListener("change",i),t.removeEventListener("change",n),t.addEventListener("change",n)}),this.on("webkitendfullscreen",function(){t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",n)})},e.prototype.overrideNative_=function(t,e){var i=this;if(e===this["featuresNative"+t+"Tracks"]){var n=t.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach(function(t){i.el()[n+"Tracks"].removeEventListener(t,i[n+"TracksListeners_"][t])}),this["featuresNative"+t+"Tracks"]=!e,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},e.prototype.overrideNativeAudioTracks=function(t){this.overrideNative_("Audio",t)},e.prototype.overrideNativeVideoTracks=function(t){this.overrideNative_("Video",t)},e.prototype.proxyNativeTracksForType_=function(t){var e=this,i=Ln[t],n=this.el()[i.getterName],r=this[i.getterName]();if(this["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var a={change:function(t){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(t){r.addTrack(t.track)},removetrack:function(t){r.removeTrack(t.track)}},s=function(){for(var t=[],e=0;e<r.length;e++){for(var i=!1,a=0;a<n.length;a++)if(n[a]===r[e]){i=!0;break}i||t.push(r[e])}for(;t.length;)r.removeTrack(t.shift())};this[i.getterName+"Listeners_"]=a,Object.keys(a).forEach(function(t){var i=a[t];n.addEventListener(t,i),e.on("dispose",function(e){return n.removeEventListener(t,i)})}),this.on("loadstart",s),this.on("dispose",function(t){return e.off("loadstart",s)})}},e.prototype.proxyNativeTracks_=function(){var t=this;Ln.names.forEach(function(e){t.proxyNativeTracksForType_(e)})},e.prototype.createEl=function(){var t=this.options_.tag;if(!t||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(t){var i=t.cloneNode(!0);t.parentNode&&t.parentNode.insertBefore(i,t),e.disposeMediaElement(t),t=i}else{t=d.a.createElement("video");var n=mi({},this.options_.tag&&he(this.options_.tag));Di&&!0===this.options_.nativeControlsForTouch||delete n.controls,ce(t,Wt(n,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}void 0!==this.options_.preload&&pe(t,"preload",this.options_.preload);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var s=r[a],o=this.options_[s];void 0!==o&&(o?pe(t,s,s):fe(t,s),t[s]=o)}return t},e.prototype.handleLateInit_=function(t){if(0!==t.networkState&&3!==t.networkState){if(0===t.readyState){var e=!1,i=function(){e=!0};this.on("loadstart",i);var n=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",n),e||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),t.readyState>=2&&r.push("loadeddata"),t.readyState>=3&&r.push("canplay"),t.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(t){this.trigger(t)},this)})}},e.prototype.setCurrentTime=function(t){try{this.el_.currentTime=t}catch(t){Nt(t,"Video is not ready. (Video.js)")}},e.prototype.duration=function(){var t=this;if(this.el_.duration===1/0&&Ci&&Li&&0===this.el_.currentTime){return this.on("timeupdate",function e(){t.el_.currentTime>0&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",e))}),NaN}return this.el_.duration||NaN},e.prototype.width=function(){return this.el_.offsetWidth},e.prototype.height=function(){return this.el_.offsetHeight},e.prototype.proxyWebkitFullscreen_=function(){var t=this;if("webkitDisplayingFullscreen"in this.el_){var e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",function(){t.off("webkitbeginfullscreen",i),t.off("webkitendfullscreen",e)})}},e.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=c.a.navigator&&c.a.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},e.prototype.enterFullScreen=function(){var t=this.el_;t.paused&&t.networkState<=t.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){t.pause(),t.webkitEnterFullScreen()},0)):t.webkitEnterFullScreen()},e.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},e.prototype.src=function(t){if(void 0===t)return this.el_.src;this.setSrc(t)},e.prototype.reset=function(){e.resetMediaElement(this.el_)},e.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},e.prototype.setControls=function(t){this.el_.controls=!!t},e.prototype.addTextTrack=function(e,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,n):t.prototype.addTextTrack.call(this,e,i,n)},e.prototype.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var i=d.a.createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i},e.prototype.addRemoteTextTrack=function(e,i){var n=t.prototype.addRemoteTextTrack.call(this,e,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},e.prototype.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)e!==i[n]&&e!==i[n].track||this.el().removeChild(i[n])},e.prototype.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var t={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),c.a.performance&&"function"==typeof c.a.performance.now?t.creationTime=c.a.performance.now():c.a.performance&&c.a.performance.timing&&"number"==typeof c.a.performance.timing.navigationStart&&(t.creationTime=c.a.Date.now()-c.a.performance.timing.navigationStart),t},e}(Un);if(Qt()){_a.TEST_VID=d.a.createElement("video");var ba=d.a.createElement("track");ba.kind="captions",ba.srclang="en",ba.label="English",_a.TEST_VID.appendChild(ba)}_a.isSupported=function(){try{_a.TEST_VID.volume=.5}catch(t){return!1}return!(!_a.TEST_VID||!_a.TEST_VID.canPlayType)},_a.canPlayType=function(t){return _a.TEST_VID.canPlayType(t)},_a.canPlaySource=function(t,e){return _a.canPlayType(t.type)},_a.canControlVolume=function(){try{var t=_a.TEST_VID.volume;return _a.TEST_VID.volume=t/2+.1,t!==_a.TEST_VID.volume}catch(t){return!1}},_a.canMuteVolume=function(){try{var t=_a.TEST_VID.muted;return _a.TEST_VID.muted=!t,_a.TEST_VID.muted?pe(_a.TEST_VID,"muted","muted"):fe(_a.TEST_VID,"muted"),t!==_a.TEST_VID.muted}catch(t){return!1}},_a.canControlPlaybackRate=function(){if(Ci&&Li&&Oi<58)return!1;try{var t=_a.TEST_VID.playbackRate;return _a.TEST_VID.playbackRate=t/2+.1,t!==_a.TEST_VID.playbackRate}catch(t){return!1}},_a.canOverrideAttributes=function(){try{var t=function(){};Object.defineProperty(d.a.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(d.a.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(d.a.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(d.a.createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return!1}return!0},_a.supportsNativeTextTracks=function(){return Mi||wi&&Li},_a.supportsNativeVideoTracks=function(){return!(!_a.TEST_VID||!_a.TEST_VID.videoTracks)},_a.supportsNativeAudioTracks=function(){return!(!_a.TEST_VID||!_a.TEST_VID.audioTracks)},_a.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],_a.prototype.featuresVolumeControl=_a.canControlVolume(),_a.prototype.featuresMuteControl=_a.canMuteVolume(),_a.prototype.featuresPlaybackRate=_a.canControlPlaybackRate(),_a.prototype.featuresSourceset=_a.canOverrideAttributes(),_a.prototype.movingMediaElementInDOM=!wi,_a.prototype.featuresFullscreenResize=!0,_a.prototype.featuresProgressEvents=!0,_a.prototype.featuresTimeupdateEvents=!0,_a.prototype.featuresNativeTextTracks=_a.supportsNativeTextTracks(),_a.prototype.featuresNativeVideoTracks=_a.supportsNativeVideoTracks(),_a.prototype.featuresNativeAudioTracks=_a.supportsNativeAudioTracks();var Ta=_a.TEST_VID&&_a.TEST_VID.constructor.prototype.canPlayType,Sa=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;_a.patchCanPlayType=function(){Ei>=4&&!Ai&&!Li&&(_a.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&Sa.test(t)?"maybe":Ta.call(this,t)})},_a.unpatchCanPlayType=function(){var t=_a.TEST_VID.constructor.prototype.canPlayType;return _a.TEST_VID.constructor.prototype.canPlayType=Ta,t},_a.patchCanPlayType(),_a.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},_a.resetMediaElement=function(t){if(t){for(var e=t.querySelectorAll("source"),i=e.length;i--;)t.removeChild(e[i]);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){_a.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){_a.prototype["set"+fi(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(t){_a.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(t){_a.prototype["set"+fi(t)]=function(e){this.el_[t]=e}}),["pause","load","play"].forEach(function(t){_a.prototype[t]=function(){return this.el_[t]()}}),Un.withSourceHandlers(_a),_a.nativeSourceHandler={},_a.nativeSourceHandler.canPlayType=function(t){try{return _a.TEST_VID.canPlayType(t)}catch(t){return""}},_a.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return _a.nativeSourceHandler.canPlayType(t.type);if(t.src){var i=_n(t.src);return _a.nativeSourceHandler.canPlayType("video/"+i)}return""},_a.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)},_a.nativeSourceHandler.dispose=function(){},_a.registerSourceHandler(_a.nativeSourceHandler),Un.registerTech("Html5",_a);var wa=Vt(["\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      "]),ka=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ca={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ea=function(t){function e(i,n,r){if(jt(this,e),i.id=i.id||n.id||"vjs_video_"+Le(),(n=Wt(e.getTagSettings(i),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 for(var s=i;s&&1===s.nodeType;){if(he(s).hasOwnProperty("lang")){n.language=s.getAttribute("lang");break}s=s.parentNode}var o=Ht(this,t.call(this,null,n,r));if(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&&he(i),o.language(o.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach(function(t){u[t.toLowerCase()]=n.languages[t]}),o.languages_=u}else o.languages_=e.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(),hi(o,{eventBusKey:"el_"});var l=mi(o.options_);if(n.plugins){var c=n.plugins;Object.keys(c).forEach(function(t){if("function"!=typeof this[t])throw new Error('plugin "'+t+'" does not exist');this[t](c[t])},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"),wi||o.addClass("vjs-workinghover"),e.players[o.id_]=o;var h=It.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.changingSrc_=!1,o.playWaitingForReady_=!1,o.playOnLoadstart_=null,o}return Ft(e,t),e.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.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),function(t){Dn[t.id()]=null}(this),t.prototype.dispose.call(this)},e.prototype.createEl=function(){var e=this.tag,i=void 0,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?i=this.el_=e.parentNode:r||(i=this.el_=t.prototype.createEl.call(this,"div"));var a=he(e);if(r){for(i=this.el_=e,e=this.tag=d.a.createElement("video");i.children.length;)e.appendChild(i.firstChild);se(i,"video-js")||oe(i,"video-js"),i.appendChild(e),n=this.playerElIngest_=i,Object.keys(i).forEach(function(t){e[t]=i[t]})}if(e.setAttribute("tabindex","-1"),Ii&&e.setAttribute("role","application"),e.removeAttribute("width"),e.removeAttribute("height"),Object.getOwnPropertyNames(a).forEach(function(t){r&&"class"===t||i.setAttribute(t,a[t]),r&&e.setAttribute(t,a[t])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused"),!0!==c.a.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=$e("vjs-styles-dimensions");var s=Ee(".vjs-styles-defaults"),o=Ee("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.width(this.options_.width),this.height(this.options_.height),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var u=e.getElementsByTagName("a"),l=0;l<u.length;l++){var h=u.item(l);oe(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!n&&e.parentNode.insertBefore(i,e),ae(e,i),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_=i,i},e.prototype.width=function(t){return this.dimension("width",t)},e.prototype.height=function(t){return this.dimension("height",t)},e.prototype.dimension=function(t,e){var i=t+"_";if(void 0===e)return this[i]||0;if(""===e)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(e);isNaN(n)?Nt.error('Improper value "'+e+'" supplied for for '+t):(this[i]=n,this.updateStyleEl_())},e.prototype.fluid=function(t){if(void 0===t)return!!this.fluid_;this.fluid_=!!t,t?this.addClass("vjs-fluid"):this.removeClass("vjs-fluid"),this.updateStyleEl_()},e.prototype.aspectRatio=function(t){if(void 0===t)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(t))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=t,this.fluid(!0),this.updateStyleEl_()},e.prototype.updateStyleEl_=function(){if(!0!==c.a.VIDEOJS_NO_DYNAMIC_STYLE){var t=void 0,e=void 0,i=void 0,n=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,e=void 0!==this.height_?this.height_:t*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Ze(this.styleEl_,"\n      ."+i+" {\n        width: "+t+"px;\n        height: "+e+"px;\n      }\n\n      ."+i+".vjs-fluid {\n        padding-top: "+100*r+"%;\n      }\n    ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},e.prototype.loadTech_=function(t,e){var i=this;this.tech_&&this.unloadTech_();var n=fi(t),r=t.charAt(0).toLowerCase()+t.slice(1);"Html5"!==n&&this.tag&&(Un.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a={source:e,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+n+"_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};In.names.forEach(function(t){var e=In[t];a[e.getterName]=i[e.privateName]}),Wt(a,this.options_[n]),Wt(a,this.options_[r]),Wt(a,this.options_[t.toLowerCase()]),this.tag&&(a.tag=this.tag),e&&e.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);var s=Un.getTech(t);if(!s)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new s(a),this.tech_.ready(Je(this,this.handleTechReady_),!0),Qi(this.textTracksJson_||[],this.tech_),ka.forEach(function(t){i.on(i.tech_,t,i["handleTech"+fi(t)+"_"])}),Object.keys(Ca).forEach(function(t){i.on(i.tech_,t,function(e){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Ca[t]+"_"].bind(i),event:e}):i["handleTech"+Ca[t]+"_"](e)})}),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||ae(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},e.prototype.unloadTech_=function(){var t=this;In.names.forEach(function(e){var i=In[e];t[i.privateName]=t[i.getterName]()}),this.textTracksJson_=Ji(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},e.prototype.tech=function(t){return void 0===t&&Nt.warn(f()(wa)),this.tech_},e.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),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_)},e.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_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},e.prototype.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},e.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())},e.prototype.manualAutoplay_=function(t){var e=this;if(this.tech_&&"string"==typeof t){var i=function(){var t=e.muted();e.muted(!0);var i=e.play();if(i&&i.then&&i.catch)return i.catch(function(i){e.muted(t)})},n=void 0;if("any"===t?(n=this.play())&&n.then&&n.catch&&n.catch(function(){return i()}):n="muted"===t?i():this.play(),n&&n.then&&n.catch)return n.then(function(){e.trigger({type:"autoplay-success",autoplay:t})}).catch(function(i){e.trigger({type:"autoplay-failure",autoplay:t})})}},e.prototype.updateSourceCaches_=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t,i="";if("string"!=typeof e&&(e=t.src,i=t.type),!/^blob:/.test(e)){this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],e&&!i&&(i=function(t,e){if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;var i=t.cache_.sources.filter(function(t){return t.src===e});if(i.length)return i[0].type;for(var n=t.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===e)return a.type}return qn(e)}(this,e)),this.cache_.source=mi({},t,{src:e,type:i});for(var n=this.cache_.sources.filter(function(t){return t.src&&t.src===e}),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=he(a[o]);r.push(u),u.src&&u.src===e&&s.push(u.src)}s.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=e}},e.prototype.handleTechSourceset_=function(t){var e=this;if(!this.changingSrc_&&(this.updateSourceCaches_(t.src),!t.src)){this.tech_.one(["sourceset","loadstart"],function t(i){"sourceset"!==i.type&&e.updateSourceCaches_(e.techGet_("currentSrc")),e.tech_.off(["sourceset","loadstart"],t)})}this.trigger({src:t.src,type:"sourceset"})},e.prototype.hasStarted=function(t){if(void 0===t)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},e.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},e.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(t){return t.callback(t.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},e.prototype.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return t.removeClass("vjs-waiting")})},e.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},e.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},e.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},e.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},e.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},e.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(Nt.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")},e.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},e.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},e.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},e.prototype.handleTechClick_=function(t){Ce(t)&&this.controls_&&(this.paused()?$i(this.play()):this.pause())},e.prototype.handleTechDoubleClick_=function(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(e){return e.contains(t.target)})||(this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},e.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},e.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},e.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},e.prototype.handleTechTouchEnd_=function(t){t.preventDefault()},e.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},e.prototype.handleStageClick_=function(){this.reportUserActivity()},e.prototype.handleTechFullscreenChange_=function(t,e){e&&this.isFullscreen(e.isFullscreen),this.trigger("fullscreenchange")},e.prototype.handleTechError_=function(){var t=this.tech_.error();this.error(t)},e.prototype.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},e.prototype.getCache=function(){return this.cache_},e.prototype.techCall_=function(t,e){this.ready(function(){if(t in Fn)return function(t,e,i,n){return e[i](t.reduce(Vn(i),n))}(this.middleware_,this.tech_,t,e);if(t in Hn)return Bn(this.middleware_,this.tech_,t,e);try{this.tech_&&this.tech_[t](e)}catch(t){throw Nt(t),t}},!0)},e.prototype.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in jn)return function(t,e,i){return t.reduceRight(Vn(i),e[i]())}(this.middleware_,this.tech_,t);if(t in Hn)return Bn(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(e){if(void 0===this.tech_[t])throw Nt("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw Nt("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw Nt(e),e}}},e.prototype.play=function(){var t=this,e=this.options_.Promise||c.a.Promise;return e?new e(function(e){t.play_(e)}):this.play_()},e.prototype.play_=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$i;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void e(this.techGet_("play"));this.playOnLoadstart_=function(){t.playOnLoadstart_=null,e(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){t.playWaitingForReady_=!1,e(t.play())})}},e.prototype.pause=function(){this.techCall_("pause")},e.prototype.paused=function(){return!1!==this.techGet_("paused")},e.prototype.played=function(){return this.techGet_("played")||ji(0,0)},e.prototype.scrubbing=function(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},e.prototype.currentTime=function(t){return void 0!==t?(t<0&&(t=0),void this.techCall_("setCurrentTime",t)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},e.prototype.duration=function(t){if(void 0===t)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&(this.cache_.duration=t,t===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange"))},e.prototype.remainingTime=function(){return this.duration()-this.currentTime()},e.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},e.prototype.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=ji(0,0)),t},e.prototype.bufferedPercent=function(){return Fi(this.buffered(),this.duration())},e.prototype.bufferedEnd=function(){var t=this.buffered(),e=this.duration(),i=t.end(t.length-1);return i>e&&(i=e),i},e.prototype.volume=function(t){var e=void 0;return void 0!==t?(e=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=e,this.techCall_("setVolume",e),void(e>0&&this.lastVolume_(e))):(e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e)},e.prototype.muted=function(t){if(void 0===t)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)},e.prototype.defaultMuted=function(t){return void 0!==t?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},e.prototype.lastVolume_=function(t){if(void 0===t||0===t)return this.cache_.lastVolume;this.cache_.lastVolume=t},e.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},e.prototype.isFullscreen=function(t){if(void 0===t)return!!this.isFullscreen_;this.isFullscreen_=!!t},e.prototype.requestFullscreen=function(){var t=Hi;this.isFullscreen(!0),t.requestFullscreen?(He(d.a,t.fullscreenchange,Je(this,function e(i){this.isFullscreen(d.a[t.fullscreenElement]),!1===this.isFullscreen()&&Ve(d.a,t.fullscreenchange,e),this.trigger("fullscreenchange")})),this.el_[t.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},e.prototype.exitFullscreen=function(){var t=Hi;this.isFullscreen(!1),t.requestFullscreen?d.a[t.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},e.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=d.a.documentElement.style.overflow,He(d.a,"keydown",Je(this,this.fullWindowOnEscKey)),d.a.documentElement.style.overflow="hidden",oe(d.a.body,"vjs-full-window"),this.trigger("enterFullWindow")},e.prototype.fullWindowOnEscKey=function(t){27===t.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},e.prototype.exitFullWindow=function(){this.isFullWindow=!1,Ve(d.a,"keydown",this.fullWindowOnEscKey),d.a.documentElement.style.overflow=this.docOrigOverflow,ue(d.a.body,"vjs-full-window"),this.trigger("exitFullWindow")},e.prototype.canPlayType=function(t){for(var e=void 0,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=Un.getTech(r);if(a||(a=gi.getComponent(r)),a){if(a.isSupported()&&(e=a.canPlayType(t)))return e}else Nt.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},e.prototype.selectSource=function(t){var e=this,i=this.options_.techOrder.map(function(t){return[t,Un.getTech(t)]}).filter(function(t){var e=t[0],i=t[1];return i?i.isSupported():(Nt.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),n=function(t,e,i){var n=void 0;return t.some(function(t){return e.some(function(e){if(n=i(t,e))return!0})}),n},r=function(t,i){var n=t[0];if(t[1].canPlaySource(i,e.options_[n.toLowerCase()]))return{source:i,tech:n}};return(this.options_.sourceOrder?n(t,i,function(t){return function(e,i){return t(i,e)}}(r)):n(i,t,r))||!1},e.prototype.src=function(t){var e=this;if(void 0===t)return this.cache_.src||"";var i=function t(e){if(Array.isArray(e)){var i=[];e.forEach(function(e){e=t(e),Array.isArray(e)?i=i.concat(e):Yt(e)&&i.push(e)}),e=i}else e="string"==typeof e&&e.trim()?[Gn({src:e})]:Yt(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Gn(e)]:[];return e}(t);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),Nn(this,i[0],function(t,n){if(e.middleware_=n,e.cache_.sources=i,e.updateSourceCaches_(t),e.src_(t))return i.length>1?e.src(i.slice(1)):(e.changingSrc_=!1,e.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void e.triggerReady());!function(t,e){t.forEach(function(t){return t.setTech&&t.setTech(e)})}(n,e.tech_)})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},e.prototype.src_=function(t){var e=this,i=this.selectSource([t]);return!i||(function(t,e){return fi(t)===fi(e)}(i.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready(function(){e.changingSrc_=!1}),!1))},e.prototype.load=function(){this.techCall_("load")},e.prototype.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},e.prototype.currentSources=function(){var t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),this.cache_.sources||e},e.prototype.currentSource=function(){return this.cache_.source||{}},e.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},e.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},e.prototype.preload=function(t){return void 0!==t?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},e.prototype.autoplay=function(t){if(void 0===t)return this.options_.autoplay||!1;var e=void 0;"string"==typeof t&&/(any|play|muted)/.test(t)?(this.options_.autoplay=t,this.manualAutoplay_(t),e=!1):this.options_.autoplay=!!t,e=e||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",e)},e.prototype.playsinline=function(t){return void 0!==t?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},e.prototype.loop=function(t){return void 0!==t?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},e.prototype.poster=function(t){if(void 0===t)return this.poster_;t||(t=""),t!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))},e.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var t=this.tech_.poster()||"";t!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},e.prototype.controls=function(t){if(void 0===t)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),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_()))},e.prototype.usingNativeControls=function(t){if(void 0===t)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},e.prototype.error=function(t){return void 0===t?this.error_||null:null===t?(this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new Yi(t),this.addClass("vjs-error"),Nt.error("(CODE:"+this.error_.code+" "+Yi.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},e.prototype.reportUserActivity=function(t){this.userActivity_=!0},e.prototype.userActive=function(t){if(void 0===t)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,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(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},e.prototype.listenForUserActivity_=function(){var t=void 0,e=void 0,i=void 0,n=Je(this,this.reportUserActivity);this.on("mousedown",function(){n(),this.clearInterval(t),t=this.setInterval(n,250)}),this.on("mousemove",function(t){t.screenX===e&&t.screenY===i||(e=t.screenX,i=t.screenY,n())}),this.on("mouseup",function(e){n(),this.clearInterval(t)}),this.on("keydown",n),this.on("keyup",n);var r=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(r);var t=this.options_.inactivityTimeout;t<=0||(r=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},t))}},250)},e.prototype.playbackRate=function(t){if(void 0===t)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)},e.prototype.defaultPlaybackRate=function(t){return void 0!==t?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},e.prototype.isAudio=function(t){if(void 0===t)return!!this.isAudio_;this.isAudio_=!!t},e.prototype.addTextTrack=function(t,e,i){if(this.tech_)return this.tech_.addTextTrack(t,e,i)},e.prototype.addRemoteTextTrack=function(t,e){if(this.tech_)return this.tech_.addRemoteTextTrack(t,e)},e.prototype.removeRemoteTextTrack=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).track,e=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(e)},e.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},e.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},e.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},e.prototype.language=function(t){if(void 0===t)return this.language_;this.language_=String(t).toLowerCase()},e.prototype.languages=function(){return mi(e.prototype.options_.languages,this.languages_)},e.prototype.toJSON=function(){var t=mi(this.options_),e=t.tracks;t.tracks=[];for(var i=0;i<e.length;i++){var n=e[i];(n=mi(n)).player=void 0,t.tracks[i]=n}return t},e.prototype.createModal=function(t,e){var i=this;(e=e||{}).content=t||"";var n=new en(this,e);return this.addChild(n),n.on("dispose",function(){i.removeChild(n)}),n.open(),n},e.getTagSettings=function(t){var e={sources:[],tracks:[]},i=he(t),n=i["data-setup"];if(se(t,"vjs-fluid")&&(i.fluid=!0),null!==n){var r=b()(n||"{}"),a=r[0],s=r[1];a&&Nt.error(a),Wt(i,s)}if(Wt(e,i),t.hasChildNodes())for(var o=t.childNodes,u=0,l=o.length;u<l;u++){var c=o[u],h=c.nodeName.toLowerCase();"source"===h?e.sources.push(he(c)):"track"===h&&e.tracks.push(he(c))}return e},e.prototype.flexNotSupported_=function(){var t=d.a.createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},e}(gi);In.names.forEach(function(t){var e=In[t];Ea.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Ea.players={};var xa=c.a.navigator;Ea.prototype.options_={techOrder:Un.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:xa&&(xa.languages&&xa.languages[0]||xa.userLanguage||xa.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media."},["ended","seeking","seekable","networkState","readyState"].forEach(function(t){Ea.prototype[t]=function(){return this.techGet_(t)}}),ka.forEach(function(t){Ea.prototype["handleTech"+fi(t)+"_"]=function(){return this.trigger(t)}}),gi.registerComponent("Player",Ea);var Aa={},Pa=function(t){return Aa.hasOwnProperty(t)},La=function(t){return Pa(t)?Aa[t]:void 0},Oa=function(t,e){t.activePlugins_=t.activePlugins_||{},t.activePlugins_[e]=!0},Ia=function(t,e,i){var n=(i?"before":"")+"pluginsetup";t.trigger(n,e),t.trigger(n+":"+e.name,e)},Ua=function(t,e){return e.prototype.name=t,function(){Ia(this,{name:t,plugin:e,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(e,[null].concat([this].concat(n))));return this[t]=function(){return a},Ia(this,a.getEventHash()),a}},Ma=function(){function t(e){if(jt(this,t),this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,hi(this),delete this.trigger,pi(this,this.constructor.defaultState),Oa(e,this.name),this.dispose=Je(this,this.dispose),e.on("dispose",this.dispose)}return t.prototype.version=function(){return this.constructor.VERSION},t.prototype.getEventHash=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.name=this.name,t.plugin=this.constructor,t.instance=this,t},t.prototype.trigger=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ze(this.eventBusEl_,t,this.getEventHash(e))},t.prototype.handleStateChanged=function(t){},t.prototype.dispose=function(){var t=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e.activePlugins_[t]=!1,this.player=this.state=null,e[t]=Ua(t,Aa[t])},t.isBasic=function(e){var i="string"==typeof e?La(e):e;return"function"==typeof i&&!t.prototype.isPrototypeOf(i.prototype)},t.registerPlugin=function(e,i){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+(void 0===e?"undefined":Bt(e))+".");if(Pa(e))Nt.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(Ea.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof i)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+(void 0===i?"undefined":Bt(i))+".");return Aa[e]=i,"plugin"!==e&&(t.isBasic(i)?Ea.prototype[e]=function(t,e){var i=function(){Ia(this,{name:t,plugin:e,instance:null},!0);var i=e.apply(this,arguments);return Oa(this,t),Ia(this,{name:t,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(t){i[t]=e[t]}),i}(e,i):Ea.prototype[e]=Ua(e,i)),i},t.deregisterPlugin=function(t){if("plugin"===t)throw new Error("Cannot de-register base plugin.");Pa(t)&&(delete Aa[t],delete Ea.prototype[t])},t.getPlugins=function(){var t=void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(Aa)).forEach(function(e){var i=La(e);i&&((t=t||{})[e]=i)}),t},t.getPluginVersion=function(t){var e=La(t);return e&&e.VERSION||""},t}();Ma.getPlugin=La,Ma.BASE_PLUGIN_NAME="plugin",Ma.registerPlugin("plugin",Ma),Ea.prototype.usingPlugin=function(t){return!!this.activePlugins_&&!0===this.activePlugins_[t]},Ea.prototype.hasPlugin=function(t){return!!Pa(t)};var Da=function(t){return 0===t.indexOf("#")?t.slice(1):t};function Ra(t,e,i){var n=Ra.getPlayer(t);if(n)return e&&Nt.warn('Player "'+t+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"==typeof t?Ee("#"+Da(t)):t;if(!te(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");d.a.body.contains(r)||Nt.warn("The element supplied is not included in the DOM"),e=e||{},Ra.hooks("beforesetup").forEach(function(t){var i=t(r,mi(e));Yt(i)&&!Array.isArray(i)?e=mi(e,i):Nt.error("please return an object in beforesetup hooks")});var a=gi.getComponent("Player");return n=new a(r,e,i),Ra.hooks("setup").forEach(function(t){return t(n)}),n}if(Ra.hooks_={},Ra.hooks=function(t,e){return Ra.hooks_[t]=Ra.hooks_[t]||[],e&&(Ra.hooks_[t]=Ra.hooks_[t].concat(e)),Ra.hooks_[t]},Ra.hook=function(t,e){Ra.hooks(t,e)},Ra.hookOnce=function(t,e){Ra.hooks(t,[].concat(e).map(function(e){return function i(){return Ra.removeHook(t,i),e.apply(void 0,arguments)}}))},Ra.removeHook=function(t,e){var i=Ra.hooks(t).indexOf(e);return!(i<=-1)&&(Ra.hooks_[t]=Ra.hooks_[t].slice(),Ra.hooks_[t].splice(i,1),!0)},!0!==c.a.VIDEOJS_NO_DYNAMIC_STYLE&&Qt()){var Na=Ee(".vjs-styles-defaults");if(!Na){Na=$e("vjs-styles-defaults");var Ba=Ee("head");Ba&&Ba.insertBefore(Na,Ba.firstChild),Ze(Na,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ")}}Ke(1,Ra),Ra.VERSION=It,Ra.options=Ea.prototype.options_,Ra.getPlayers=function(){return Ea.players},Ra.getPlayer=function(t){var e=Ea.players,i=void 0;if("string"==typeof t){var n=Da(t),r=e[n];if(r)return r;i=Ee("#"+n)}else i=t;if(te(i)){var a=i,s=a.player,o=a.playerId;if(s||e[o])return s||e[o]}},Ra.getAllPlayers=function(){return Object.keys(Ea.players).map(function(t){return Ea.players[t]}).filter(Boolean)},Ra.players=Ea.players,Ra.getComponent=gi.getComponent,Ra.registerComponent=function(t,e){Un.isTech(e)&&Nt.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),gi.registerComponent.call(gi,t,e)},Ra.getTech=Un.getTech,Ra.registerTech=Un.registerTech,Ra.use=function(t,e){Mn[t]=Mn[t]||[],Mn[t].push(e)},Object.defineProperty(Ra,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ra.middleware,"TERMINATOR",{value:Rn,writeable:!1,enumerable:!0}),Ra.browser=Ri,Ra.TOUCH_ENABLED=Di,Ra.extend=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(){t.apply(this,arguments)},n={};for(var r in"object"===(void 0===e?"undefined":Bt(e))?(e.constructor!==Object.prototype.constructor&&(i=e.constructor),n=e):"function"==typeof e&&(i=e),function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":Bt(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.super_=e)}(i,t),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i},Ra.mergeOptions=mi,Ra.bind=Je,Ra.registerPlugin=Ma.registerPlugin,Ra.deregisterPlugin=Ma.deregisterPlugin,Ra.plugin=function(t,e){return Nt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ma.registerPlugin(t,e)},Ra.getPlugins=Ma.getPlugins,Ra.getPlugin=Ma.getPlugin,Ra.getPluginVersion=Ma.getPluginVersion,Ra.addLanguage=function(t,e){var i;return t=(""+t).toLowerCase(),Ra.options.languages=mi(Ra.options.languages,((i={})[t]=e,i)),Ra.options.languages[t]},Ra.log=Nt,Ra.createTimeRange=Ra.createTimeRanges=ji,Ra.formatTime=sr,Ra.setFormatTime=function(t){ar=t},Ra.resetFormatTime=function(){ar=rr},Ra.parseUrl=yn,Ra.isCrossOrigin=bn,Ra.EventTarget=ei,Ra.on=He,Ra.one=qe,Ra.off=Ve,Ra.trigger=ze,Ra.xhr=g.a,Ra.TextTrack=kn,Ra.AudioTrack=Cn,Ra.VideoTrack=En,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){Ra[t]=function(){return Nt.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),Ae[t].apply(null,arguments)}}),Ra.computedStyle=Kt,Ra.dom=Ae,Ra.url=Tn;
  /**
   * @videojs/http-streaming
   * @version 1.2.4
   * @copyright 2018 Brightcove, Inc
   * @license Apache-2.0
   */
  var ja=function(t,e){return/^[a-z]+:/i.test(e)?e:(/\/\//i.test(t)||(t=S.a.buildAbsoluteURL(c.a.location.href,t)),S.a.buildAbsoluteURL(t,e))},Fa=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ha=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Va=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":Bt(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},za=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":Bt(e))&&"function"!=typeof e?t:e},qa=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){r=!0,a=t}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Ga=Ra.mergeOptions,Wa=Ra.EventTarget,Ya=Ra.log,Xa=function(t,e){["AUDIO","SUBTITLES"].forEach(function(i){for(var n in t.mediaGroups[i])for(var r in t.mediaGroups[i][n]){var a=t.mediaGroups[i][n][r];e(a,i,n,r)}})},Ka=function(t,e){var i=Ga(t,{}),n=i.playlists[e.uri];if(!n)return null;if(n.segments&&e.segments&&n.segments.length===e.segments.length&&n.mediaSequence===e.mediaSequence)return null;var r=Ga(n,e);n.segments&&(r.segments=function(t,e,i){var n=e.slice();i=i||0;for(var r=Math.min(t.length,e.length+i),a=i;a<r;a++)n[a-i]=Ga(t[a],n[a-i]);return n}(n.segments,e.segments,e.mediaSequence-n.mediaSequence)),r.segments.forEach(function(t){!function(t,e){t.resolvedUri||(t.resolvedUri=ja(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=ja(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=ja(e,t.map.uri))}(t,r.resolvedUri)});for(var a=0;a<i.playlists.length;a++)i.playlists[a].uri===e.uri&&(i.playlists[a]=r);return i.playlists[e.uri]=r,i},$a=function(t){for(var e=t.playlists.length;e--;){var i=t.playlists[e];t.playlists[i.uri]=i,i.resolvedUri=ja(t.uri,i.uri),i.id=e,i.attributes||(i.attributes={},Ya.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Za=function(t){Xa(t,function(e){e.uri&&(e.resolvedUri=ja(t.uri,e.uri))})},Ja=function(t,e){var i=t.segments[t.segments.length-1];return e&&i&&i.duration?1e3*i.duration:500*(t.targetDuration||10)},Qa=function(t){function e(t,i,n){Fa(this,e);var r=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));if(r.srcUrl=t,r.hls_=i,r.withCredentials=n,!r.srcUrl)throw new Error("A non-empty playlist URL is required");return r.state="HAVE_NOTHING",r.on("mediaupdatetimeout",function(){"HAVE_METADATA"===r.state&&(r.state="HAVE_CURRENT_METADATA",r.request=r.hls_.xhr({uri:ja(r.master.uri,r.media().uri),withCredentials:r.withCredentials},function(t,e){if(r.request)return t?r.playlistRequestError(r.request,r.media().uri,"HAVE_METADATA"):void r.haveMetadata(r.request,r.media().uri)}))}),r}return Va(e,Wa),Ha(e,[{key:"playlistRequestError",value:function(t,e,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[e],status:t.status,message:"HLS playlist request error at URL: "+e,responseText:t.responseText,code:t.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(t,e){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new O;n.push(t.responseText),n.end(),n.manifest.uri=e,n.manifest.attributes=n.manifest.attributes||{};var r=Ka(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||(c.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=c.a.setTimeout(function(){i.trigger("mediaupdatetimeout")},Ja(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),c.a.clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}}},{key:"media",value:function(t){var e=this;if(!t)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 t){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}var n=!this.media_||t.uri!==this.media_.uri;if(this.master.playlists[t.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(n){if(this.state="SWITCHING_MEDIA",this.request){if(ja(this.master.uri,t.uri)===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:ja(this.master.uri,t.uri),withCredentials:this.withCredentials},function(n,r){if(e.request){if(n)return e.playlistRequestError(e.request,t.uri,i);e.haveMetadata(r,t.uri),"HAVE_MASTER"===i?e.trigger("loadedmetadata"):e.trigger("mediachange")}})}}},{key:"pause",value:function(){this.stopRequest(),c.a.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(t){var e=this;c.a.clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(t){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=c.a.setTimeout(function(){return e.load()},n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var t=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,i){if(t.request){if(t.request=null,e)return t.error={status:i.status,message:"HLS playlist request error at URL: "+t.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");var n=new O;return n.push(i.responseText),n.end(),t.state="HAVE_MASTER",n.manifest.uri=t.srcUrl,n.manifest.playlists?(t.master=n.manifest,$a(t.master),Za(t.master),t.trigger("loadedplaylist"),void(t.request||t.media(n.manifest.playlists[0]))):(t.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:c.a.location.href,playlists:[{uri:t.srcUrl,id:0}]},t.master.playlists[t.srcUrl]=t.master.playlists[0],t.master.playlists[0].resolvedUri=t.srcUrl,t.master.playlists[0].attributes=t.master.playlists[0].attributes||{},t.haveMetadata(i,t.srcUrl),t.trigger("loadedmetadata"))}})}}]),e}(),ts=Ra.createTimeRange,es=function(t,e,i){var n,r;return void 0===e&&(e=t.mediaSequence+t.segments.length),e<t.mediaSequence?0:(n=function(t,e){var i=0,n=e-t.mediaSequence,r=t.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=t.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(t,e)).precise?n.result:(r=function(t,e){for(var i=0,n=void 0,r=e-t.mediaSequence;r<t.segments.length;r++){if(void 0!==(n=t.segments[r]).start)return{result:n.start-i,precise:!0};if(i+=n.duration,void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}}(t,e)).precise?r.result:n.result+i},is=function(t,e,i){if(!t)return 0;if("number"!=typeof i&&(i=0),void 0===e){if(t.totalDuration)return t.totalDuration;if(!t.endList)return c.a.Infinity}return es(t,e,i)},ns=function(t,e,i){var n=0;if(e>i){var r=[i,e];e=r[0],i=r[1]}if(e<0){for(var a=e;a<Math.min(0,i);a++)n+=t.targetDuration;e=0}for(var s=e;s<i;s++)n+=t.segments[s].duration;return n},rs=function(t){if(!t.segments.length)return 0;for(var e=t.segments.length-1,i=t.segments[e].duration||t.targetDuration,n=i+2*t.targetDuration;e--&&!((i+=t.segments[e].duration)>=n););return Math.max(0,e)},as=function(t,e,i){if(!t||!t.segments)return null;if(t.endList)return is(t);if(null===e)return null;e=e||0;var n=i?rs(t):t.segments.length;return es(t,t.mediaSequence+n,e)},ss=function(t){return t-Math.floor(t)==0},os=function(t,e){if(ss(e))return e+.1*t;for(var i=e.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),a=e*r;if(ss(a)||n===i)return(a+t)/r}},us=os.bind(null,1),ls=os.bind(null,-1),cs=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},hs=function(t){return t.excludeUntil&&t.excludeUntil===1/0},ds=function(t){var e=cs(t);return!t.disabled&&!e},ps=function(t,e){return e.attributes&&e.attributes[t]},fs=function(t,e){if(1===t.playlists.length)return!0;var i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===t.playlists.filter(function(t){return!!ds(t)&&(t.attributes.BANDWIDTH||0)<i}).length},ms={duration:is,seekable:function(t,e){var i=e||0,n=as(t,e,!0);return null===n?ts():ts(i,n)},safeLiveIndex:rs,getMediaInfoForTime:function(t,e,i,n){var r=void 0,a=void 0,s=t.segments.length,o=e-n;if(o<0){if(i>0)for(r=i-1;r>=0;r--)if(a=t.segments[r],(o+=ls(a.duration))>0)return{mediaIndex:r,startTime:n-ns(t,i,r)};return{mediaIndex:0,startTime:e}}if(i<0){for(r=i;r<0;r++)if((o-=t.targetDuration)<0)return{mediaIndex:0,startTime:e};i=0}for(r=i;r<s;r++)if(a=t.segments[r],(o-=us(a.duration))<0)return{mediaIndex:r,startTime:n+ns(t,i,r)};return{mediaIndex:s-1,startTime:e}},isEnabled:ds,isDisabled:function(t){return t.disabled},isBlacklisted:cs,isIncompatible:hs,playlistEnd:as,isAes:function(t){for(var e=0;e<t.segments.length;e++)if(t.segments[e].key)return!0;return!1},isFmp4:function(t){for(var e=0;e<t.segments.length;e++)if(t.segments[e].map)return!0;return!1},hasAttribute:ps,estimateSegmentRequestTime:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return ps("BANDWIDTH",i)?(t*i.attributes.BANDWIDTH-8*n)/e:NaN},isLowestEnabledRendition:fs},gs=Ra.xhr,ys=Ra.mergeOptions,vs=function(){return function t(e,i){e=ys({timeout:45e3},e);var n=t.beforeRequest||Ra.Hls.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(e);r&&(e=r)}var a=gs(e,function(t,e){var n=a.response;!t&&n&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=n.byteLength||n.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3))),e.headers&&(a.responseHeaders=e.headers),t&&"ETIMEDOUT"===t.code&&(a.timedout=!0),t||a.aborted||200===e.statusCode||206===e.statusCode||0===e.statusCode||(t=new Error("XHR Failed with a response of: "+(a&&(n||a.responseText)))),i(t,a)}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=e.uri,a.requestTime=Date.now(),a}},_s=function(t,e){return t.start(e)+"-"+t.end(e)},bs=function(t,e){var i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")},Ts=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},Ss=function(t){var e={};return Object.keys(t).forEach(function(i){var n=t[i];ArrayBuffer.isView(n)?e[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[i]=n}),e},ws=function(t){var e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")},ks=function(t){for(var e=Array.prototype.slice.call(t),i="",n=0;n<e.length/16;n++)i+=e.slice(16*n,16*n+16).map(bs).join("")+" "+e.slice(16*n,16*n+16).map(Ts).join("")+"\n";return i},Cs=Object.freeze({createTransferableMessage:Ss,initSegmentId:ws,hexDump:ks,tagDump:function(t){var e=t.bytes;return ks(e)},textRanges:function(t){var e="",i=void 0;for(i=0;i<t.length;i++)e+=_s(t,i)+" ";return e}}),Es=function(t,e){var i=[],n=void 0;if(t&&t.length)for(n=0;n<t.length;n++)e(t.start(n),t.end(n))&&i.push([t.start(n),t.end(n)]);return Ra.createTimeRanges(i)},xs=function(t,e){return Es(t,function(t,i){return t-1/30<=e&&i+1/30>=e})},As=function(t,e){return Es(t,function(t){return t-1/30>=e})},Ps=function(t){var e=[];if(!t||!t.length)return"";for(var i=0;i<t.length;i++)e.push(t.start(i)+" => "+t.end(i));return e.join(", ")},Ls=function(t){for(var e=[],i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e},Os=function(t,e,i){var n=void 0,r=void 0;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime<=e&&r.endTime>=t&&i.removeCue(r)},Is=function(t){return isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t},Us=function(t,e,i){var n=c.a.WebKitDataCue||c.a.VTTCue;if(e&&e.forEach(function(t){var e=t.stream;this.inbandTextTracks_[e].addCue(new n(t.startTime+this.timestampOffset,t.endTime+this.timestampOffset,t.text))},t),i){var r=Is(t.mediaSource_.duration);if(i.forEach(function(t){var e=t.cueTime+this.timestampOffset;t.frames.forEach(function(t){var i=new n(e,e,t.value||t.url||t.data||"");i.frame=t,i.value=t,function(t){Object.defineProperties(t.frame,{id:{get:function(){return Ra.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return Ra.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return Ra.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})}(i),this.metadataTrack_.addCue(i)},this)},t),t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var a=t.metadataTrack_.cues,s=[],o=0;o<a.length;o++)a[o]&&s.push(a[o]);var u=s.reduce(function(t,e){var i=t[e.startTime]||[];return i.push(e),t[e.startTime]=i,t},{}),l=Object.keys(u).sort(function(t,e){return Number(t)-Number(e)});l.forEach(function(t,e){var i=u[t],n=Number(l[e+1])||r;i.forEach(function(t){t.endTime=n})})}}},Ms="undefined"!=typeof window?window:{},Ds="undefined"==typeof Symbol?"__target":Symbol(),Rs="application/javascript",Ns=Ms.BlobBuilder||Ms.WebKitBlobBuilder||Ms.MozBlobBuilder||Ms.MSBlobBuilder,Bs=Ms.URL||Ms.webkitURL||Bs&&Bs.msURL,js=Ms.Worker;function Fs(t,e){return function(i){var n=this;if(!e)return new js(t);if(js&&!i){var r=qs(e.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Ds]=new js(r),function(t,e){if(!t||!e)return;var i=t.terminate;t.objURL=e,t.terminate=function(){t.objURL&&Bs.revokeObjectURL(t.objURL),i.call(t)}}(this[Ds],r),this[Ds]}var a={postMessage:function(t){n.onmessage&&setTimeout(function(){n.onmessage({data:t,target:a})})}};e.call(a),this.postMessage=function(t){setTimeout(function(){a.onmessage({data:t,target:n})})},this.isThisThread=!0}}if(js){var Hs,Vs=qs("self.onmessage = function () {}"),zs=new Uint8Array(1);try{(Hs=new js(Vs)).postMessage(zs,[zs.buffer])}catch(t){js=null}finally{Bs.revokeObjectURL(Vs),Hs&&Hs.terminate()}}function qs(t){try{return Bs.createObjectURL(new Blob([t],{type:Rs}))}catch(i){var e=new Ns;return e.append(t),Bs.createObjectURL(e.getBlob(type))}}var Gs=new Fs("./transmuxer-worker.worker.js",function(t,e){var i=this;!function(){var t,e,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,w,k,C,E,x,A,P,L,O,I,U,M,D,R,N=Math.pow(2,32)-1;!function(){var t;if(w={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(t in w)w.hasOwnProperty(t)&&(w[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),E=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=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]),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]),P={video:x,audio:A},I=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]),U=new Uint8Array([0,0,0,0,0,0,0,0]),M=U,D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=U,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(t){var e,i,n=[],r=0;for(e=1;e<arguments.length;e++)n.push(arguments[e]);for(e=n.length;e--;)r+=n[e].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(t,4),e=0,r=8;e<n.length;e++)i.set(n[e],r),r+=n[e].byteLength;return i},e=function(){return t(w.dinf,t(w.dref,I))},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,k,C,k,E)},g=function(e){return t(w.hdlr,P[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(i){return t(w.minf,"video"===i.type?t(w.vmhd,L):t(w.smhd,O),e(),v(i))},u=function(e,i){for(var n=[],r=i.length;r--;)n[r]=b(i[r]);return t.apply(null,[w.moof,s(e)].concat(n))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[w.moov,h(4294967295)].concat(n).concat(c(e)))},c=function(e){for(var i=e.length,n=[];i--;)n[i]=T(e[i]);return t.apply(null,[w.mvex].concat(n))},h=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,R),t(w.stsc,M),t(w.stsz,D),t(w.stco,U))},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=e.sps||[],r=e.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));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]));return t(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([n.length]).concat(a).concat([r.length]).concat(s))),t(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},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;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])),s=Math.floor(e.baseMediaDecodeTime/(N+1)),o=Math.floor(e.baseMediaDecodeTime%(N+1)),n=t(w.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=S(e,92),t(w.traf,i,n,r)):(a=y(e),r=S(e,a.length+92),t(w.traf,i,n,r,a))},d=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(t,e){var i=0,n=0,r=0,a=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(r=4),void 0!==t[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},i=function(e,i){var r,a,s,o;for(i+=20+16*(a=e.samples||[]).length,r=n(a,i),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 t(w.trun,new Uint8Array(r))},e=function(e,i){var r,a,s,o;for(i+=20+8*(a=e.samples||[]).length,r=n(a,i),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 t(w.trun,new Uint8Array(r))},S=function(t,n){return"audio"===t.type?e(t,n):i(t,n)}}();var B,j,F={ftyp:r,mdat:a,moof:u,moov:l,initSegment:function(t){var e,i=r(),n=l(t);return(e=new Uint8Array(i.byteLength+n.byteLength)).set(i),e.set(n,i.byteLength),e}},H=function(t){return t>>>0},V={findBox:B=function(t,e){var i,n,r,a,s,o=[];if(!e.length)return null;for(i=0;i<t.byteLength;)n=H(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),r=j(t.subarray(i+4,i+8)),a=n>1?i+n:t.byteLength,r===e[0]&&(1===e.length?o.push(t.subarray(i+8,a)):(s=B(t.subarray(i+8,a),e.slice(1))).length&&(o=o.concat(s))),i=a;return o},parseType:j=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),e+=String.fromCharCode(t[2]),e+=String.fromCharCode(t[3])},timescale:function(t){return B(t,["moov","trak"]).reduce(function(t,e){var i,n,r,a,s;return(i=B(e,["tkhd"])[0])?(n=i[0],a=H(i[r=0===n?12:20]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),(s=B(e,["mdia","mdhd"])[0])?(r=0===(n=s[0])?12:20,t[a]=H(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),t):null):null},{})},startTime:function(t,e){var i,n,r;return i=B(e,["moof","traf"]),n=[].concat.apply([],i.map(function(e){return B(e,["tfhd"]).map(function(i){var n,r;return n=H(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=t[n]||9e4,(B(e,["tfdt"]).map(function(t){var e,i;return e=t[0],i=H(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),1===e&&(i*=Math.pow(2,32),i+=H(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),i})[0]||1/0)/r})})),r=Math.min.apply(null,n),isFinite(r)?r:0},videoTrackIds:function(t){var e=[];return B(t,["moov","trak"]).forEach(function(t){var i=B(t,["mdia","hdlr"]),n=B(t,["tkhd"]);i.forEach(function(t,i){var r,a,s=j(t.subarray(8,12)),o=n[i];"vide"===s&&(a=0===(r=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?r.getUint32(12):r.getUint32(20),e.push(a))})}),e}},z=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i)},this.off=function(e,i){var n;return!!t[e]&&(n=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(n,1),n>-1)},this.trigger=function(e){var i,n,r,a;if(i=t[e])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(){t={}}}};z.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),t},z.prototype.push=function(t){this.trigger("data",t)},z.prototype.flush=function(t){this.trigger("done",t)};var q=z,G=function(t,e){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=e,i.compositionTimeOffset=t.pts-t.dts,i.duration=t.duration,i.size=4*t.length,i.size+=t.byteLength,t.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},W=function(t){var e,i,n=[],r=[];for(n.byteLength=0,e=0;e<t.length;e++)"access_unit_delimiter_rbsp"===(i=t[e]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).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},Y=function(t){var e,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=t[0].pts,r.dts=t[0].dts,e=0;e<t.length;e++)(i=t[e]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).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},X=function(t){var e;return!t[0][0].keyFrame&&t.length>1&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t},K=function(t,e){var i,n,r,a,s,o=e||0,u=[];for(i=0;i<t.length;i++)for(a=t[i],n=0;n<a.length;n++)s=a[n],o+=(r=G(s,o)).size,u.push(r);return u},$=function(t){var e,i,n,r,a,s,o=0,u=t.byteLength,l=t.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(e=0;e<t.length;e++)for(r=t[e],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,c.set(s.data,o),o+=s.data.byteLength;return c},Z=function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},J=function(t,e){var i,n=t.minSegmentDts;return e||(n-=t.timelineStartInfo.dts),i=t.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===t.type&&(i*=t.samplerate/9e4,i=Math.floor(i)),i},Q=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts))},tt=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,r=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)r+=255,e++;if(r+=t[e++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=t.subarray(e,e+r);break}e+=r,n=0,r=0}return i},et=function(t){return 181!==t.payload[0]?null:49!=(t.payload[1]<<8|t.payload[2])?null:"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])?null:3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},it=function(t,e){var i,n,r,a,s=[];if(!(64&e[0]))return s;for(n=31&e[0],i=0;i<n;i++)a={type:3&e[2+(r=3*i)],pts:t},4&e[r+2]&&(a.ccData=e[r+3]<<8|e[r+4],s.push(a));return s},nt=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);var s=0;for(a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},rt=4,at=function t(){t.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new ct(0,0),new ct(0,1),new ct(1,0),new ct(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("done",this.trigger.bind(this,"done"))},this)};(at.prototype=new q).push=function(t){var e,i,n;if("sei_rbsp"===t.nalUnitType&&(e=tt(t.escapedRBSP)).payloadType===rt&&(i=et(e)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=it(t.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},at.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2&&this.dispatchCea608Packet(t)},this),this.captionPackets_.length=0,this.ccStreams_.forEach(function(t){t.flush()},this)):this.ccStreams_.forEach(function(t){t.flush()},this)},at.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},at.prototype.dispatchCea608Packet=function(t){this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},at.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},at.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)};var st={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},ot=function(t){return null===t?"":(t=st[t]||t,String.fromCharCode(t))},ut=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],lt=function(){for(var t=[],e=15;e--;)t.push("");return t},ct=function t(e,i){t.prototype.init.call(this),this.field_=e||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,n,r,a;if((e=32639&t.ccData)!==this.lastControlCode_){if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),n=e>>>8,r=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===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(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=lt();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=lt();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=lt()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(n,r))a=ot((n=(3&n)<<8)|r),this[this.mode_](t.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),a=ot((n=(3&n)<<8)|r),this[this.mode_](t.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&r)&&this.addFormatting(t.pts,["i"]),1==(1&r)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=ut.indexOf(7968&e);"rollUp"===this.mode_&&this.setRollUp(t.pts,s),s!==this.row_&&(this.clearFormatting(t.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=ot(n),a+=ot(r),this[this.mode_](t.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};ct.prototype=new q,ct.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},ct.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=lt(),this.nonDisplayed_=lt(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},ct.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_},ct.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},ct.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},ct.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},ct.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},ct.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},ct.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},ct.prototype.isNormalChar=function(t){return t>=32&&t<=127},ct.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=lt(),this.displayed_=lt()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},ct.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,i)},ct.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,e)}},ct.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},ct.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i},ct.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},ct.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i};var ht={CaptionStream:at,Cea608Stream:ct},dt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},pt=function(t,e){var i=1;for(t>e&&(i=-1);Math.abs(e-t)>4294967296;)t+=8589934592*i;return t},ft=function t(e){var i,n;t.prototype.init.call(this),this.type_=e,this.push=function(t){t.type===this.type_&&(void 0===n&&(n=t.dts),t.dts=pt(t.dts,n),t.pts=pt(t.pts,n),i=t.dts,this.trigger("data",t))},this.flush=function(){n=i,this.trigger("done")},this.discontinuity=function(){n=void 0,i=void 0}};ft.prototype=new q;var mt,gt=ft,yt=function(t,e,i){var n,r="";for(n=e;n<i;n++)r+="%"+("00"+t[n].toString(16)).slice(-2);return r},vt=function(t,e,i){return decodeURIComponent(yt(t,e,i))},_t=function(t,e,i){return unescape(yt(t,e,i))},bt=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},Tt={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=vt(t.data,1,e),t.value=vt(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=vt(t.data,1,e),t.url=vt(t.data,e+1,t.data.length);break}},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=_t(t.data,0,e);break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};(mt=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},n=0,r=[],a=0;if(mt.prototype.init.call(this),this.dispatchType=dt.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,s,o,u,l;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))i.debug&&console.log("Skipping unrecognized metadata packet");else if(r.push(t),a+=t.data.byteLength,1===r.length&&(n=bt(t.data.subarray(6,10)),n+=10),!(a<n)){for(e={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)e.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();s=10,64&e.data[5]&&(s+=4,s+=bt(e.data.subarray(10,14)),n-=bt(e.data.subarray(16,20)));do{if((o=bt(e.data.subarray(s+4,s+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(e.data[s],e.data[s+1],e.data[s+2],e.data[s+3]),data:e.data.subarray(s+10,s+o+10)}).key=u.id,Tt[u.id]&&(Tt[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,h=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;h*=4,h+=3&c[7],u.timeStamp=h,void 0===e.pts&&void 0===e.dts&&(e.pts=u.timeStamp,e.dts=u.timeStamp),this.trigger("timestamp",u)}e.frames.push(u),s+=10,s+=o}while(s<n);this.trigger("data",e)}}}).prototype=new q;var St,wt,kt,Ct=mt,Et=gt;(St=function(){var t=new Uint8Array(188),e=0;St.prototype.init.call(this),this.push=function(i){var n,r=0,a=188;for(e?((n=new Uint8Array(i.byteLength+e)).set(t.subarray(0,e)),n.set(i,e),e=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=188,a+=188);r<n.byteLength&&(t.set(n.subarray(r),0),e=n.byteLength-r)},this.flush=function(){188===e&&71===t[0]&&(this.trigger("data",t),e=0),this.trigger("done")}}).prototype=new q,(wt=function(){var t,e,i,n;wt.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,t=function(t,n){var r=0;n.payloadUnitStartIndicator&&(r+=t[r]+1),"pat"===n.type?e(t.subarray(r),n):i(t.subarray(r),n)},e=function(t,e){e.section_number=t[7],e.last_section_number=t[8],n.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=n.pmtPid},i=function(t,e){var i,r;if(1&t[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&t[1])<<8|t[2])-4,r=12+((15&t[10])<<8|t[11]);r<i;){var a=t[r],s=(31&t[r+1])<<8|t[r+2];a===dt.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===dt.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===dt.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&t[r+3])<<8|t[r+4])}e.programMapTable=n.programMapTable}},this.push=function(e){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&e[1]),i.pid=31&e[1],i.pid<<=8,i.pid|=e[2],(48&e[3])>>>4>1&&(n+=e[n]+1),0===i.pid)i.type="pat",t(e.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",t(e.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,n,i]):this.processPes_(e,n,i)},this.processPes_=function(t,e,i){i.pid===this.programMapTable.video?i.streamType=dt.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=dt.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i)}}).prototype=new q,wt.STREAM_TYPES={h264:27,adts:15},(kt=function(){var t=this,e={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(e,i,n){var r,a,s=new Uint8Array(e.size),o={type:i},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)a=e.data[u],s.set(a.data,l),l+=a.data.byteLength;!function(t,e){var i;e.packetLength=6+(t[4]<<8|t[5]),e.dataAlignmentIndicator=0!=(4&t[6]),192&(i=t[7])&&(e.pts=(14&t[9])<<27|(255&t[10])<<20|(254&t[11])<<12|(255&t[12])<<5|(254&t[13])>>>3,e.pts*=4,e.pts+=(6&t[13])>>>1,e.dts=e.pts,64&i&&(e.dts=(14&t[14])<<27|(255&t[15])<<20|(254&t[16])<<12|(255&t[17])<<5|(254&t[18])>>>3,e.dts*=4,e.dts+=(6&t[18])>>>1)),e.data=t.subarray(9+t[8])}(s,o),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};kt.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var t,s;switch(a.streamType){case dt.H264_STREAM_TYPE:case dt.H264_STREAM_TYPE:t=e,s="video";break;case dt.ADTS_STREAM_TYPE:t=i,s="audio";break;case dt.METADATA_STREAM_TYPE:t=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(t,s,!0),t.data.push(a),t.size+=a.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),t.trigger("data",e)}})[a.type]()},this.flush=function(){r(e,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}}).prototype=new q;var xt={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:St,TransportParseStream:wt,ElementaryStream:kt,TimestampRolloverStream:Et,CaptionStream:ht.CaptionStream,Cea608Stream:ht.Cea608Stream,MetadataStream:Ct};for(var At in dt)dt.hasOwnProperty(At)&&(xt[At]=dt[At]);var Pt,Lt=xt,Ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(Pt=function(){var t;Pt.prototype.init.call(this),this.push=function(e){var i,n,r,a,s,o,u=0,l=0;if("audio"===e.type)for(t?(a=t,(t=new Uint8Array(a.byteLength+e.data.byteLength)).set(a),t.set(e.data,a.byteLength)):t=e.data;u+5<t.length;)if(255===t[u]&&240==(246&t[u+1])){if(n=2*(1&~t[u+1]),i=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,o=9e4*(s=1024*(1+(3&t[u+6])))/Ot[(60&t[u+2])>>>2],r=u+i,t.byteLength<r)return;if(this.trigger("data",{pts:e.pts+l*o,dts:e.dts+l*o,sampleCount:s,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:Ot[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+n,r)}),t.byteLength===r)return void(t=void 0);l++,t=t.subarray(r)}else u++},this.flush=function(){this.trigger("done")}}).prototype=new q;var It,Ut,Mt,Dt=Pt,Rt=function(t){var e=t.byteLength,i=0,n=0;this.length=function(){return 8*e},this.bitsAvailable=function(){return 8*e+n},this.loadWord=function(){var r=t.byteLength-e,a=new Uint8Array(4),s=Math.min(4,e);if(0===s)throw new Error("no bytes available");a.set(t.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,e-=s},this.skipBits=function(t){var r;n>t?(i<<=t,n-=t):(t-=n,t-=8*(r=Math.floor(t/8)),e-=r,this.loadWord(),i<<=t,n-=t)},this.readBits=function(t){var r=Math.min(n,t),a=i>>>32-r;return(n-=r)>0?i<<=r:e>0&&this.loadWord(),(r=t-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var t;for(t=0;t<n;++t)if(0!=(i&2147483648>>>t))return i<<=t,n-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Ut=function(){var t,e,i=0;Ut.prototype.init.call(this),this.push=function(n){var r;for(e?((r=new Uint8Array(e.byteLength+n.data.byteLength)).set(e),r.set(n.data,e.byteLength),e=r):e=n.data;i<e.byteLength-3;i++)if(1===e[i+2]){t=i+5;break}for(;t<e.byteLength;)switch(e[t]){case 0:if(0!==e[t-1]){t+=2;break}if(0!==e[t-2]){t++;break}i+3!==t-2&&this.trigger("data",e.subarray(i+3,t-2));do{t++}while(1!==e[t]&&t<e.length);i=t-2,t+=3;break;case 1:if(0!==e[t-1]||0!==e[t-2]){t+=3;break}this.trigger("data",e.subarray(i+3,t-2)),i=t-2,t+=3;break;default:t+=3}e=e.subarray(i),t-=i,i=0},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(i+3)),e=null,i=0,this.trigger("done")}}).prototype=new q,Mt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(It=function(){var t,e,i,n,r,a,s,o=new Ut;It.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,i=t.pts,n=t.dts,o.push(t))},o.on("data",function(s){var o={trackId:e,pts:i,dts:n,data:s};switch(31&s[0]){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"}t.trigger("data",o)}),o.on("done",function(){t.trigger("done")}),this.flush=function(){o.flush()},s=function(t,e){var i,n=8,r=8;for(i=0;i<t;i++)0!==r&&(r=(n+e.readExpGolomb()+256)%256),n=0===r?n:r},r=function(t){for(var e,i,n=t.byteLength,r=[],a=1;a<n-2;)0===t[a]&&0===t[a+1]&&3===t[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return t;e=n-r.length,i=new Uint8Array(e);var s=0;for(a=0;a<e;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=t[s];return i},a=function(t){var e,i,n,r,a,o,u,l,c,h,d,p,f,m=0,g=0,y=0,v=0,_=1;if(i=(e=new Rt(t)).readUnsignedByte(),r=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),Mt[i]&&(3===(a=e.readUnsignedExpGolomb())&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(d=3!==a?8:12,f=0;f<d;f++)e.readBoolean()&&s(f<6?16:64,e);if(e.skipUnsignedExpGolomb(),0===(o=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===o)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),u=e.readUnsignedExpGolomb(),f=0;f<u;f++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),l=e.readUnsignedExpGolomb(),c=e.readUnsignedExpGolomb(),0===(h=e.readBits(1))&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(m=e.readUnsignedExpGolomb(),g=e.readUnsignedExpGolomb(),y=e.readUnsignedExpGolomb(),v=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){case 1:p=[1,1];break;case 2:p=[12,11];break;case 3:p=[10,11];break;case 4:p=[16,11];break;case 5:p=[40,33];break;case 6:p=[24,11];break;case 7:p=[20,11];break;case 8:p=[32,11];break;case 9:p=[80,33];break;case 10:p=[18,11];break;case 11:p=[15,11];break;case 12:p=[64,33];break;case 13:p=[160,99];break;case 14:p=[4,3];break;case 15:p=[3,2];break;case 16:p=[2,1];break;case 255:p=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}p&&(_=p[0]/p[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(l+1)-2*m-2*g)*_),height:(2-h)*(c+1)*16-2*y-2*v}}}).prototype=new q;var Nt,jt={H264Stream:It,NalByteStream:Ut};(Nt=function(){var t=new Uint8Array,e=0;Nt.prototype.init.call(this),this.setTimestamp=function(t){e=t},this.parseId3TagSize=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&t[e+5])>>4?i+20:i+10},this.parseAdtsSize=function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},this.push=function(i){var n,r,a,s,o=0,u=0;for(t.length?(s=t.length,(t=new Uint8Array(i.byteLength+s)).set(t.subarray(0,s)),t.set(i,s)):t=i;t.length-u>=3;)if(t[u]!=="I".charCodeAt(0)||t[u+1]!=="D".charCodeAt(0)||t[u+2]!=="3".charCodeAt(0))if(!0&t[u]&&240==(240&t[u+1])){if(t.length-u<7)break;if((o=this.parseAdtsSize(t,u))>t.length)break;a={type:"audio",data:t.subarray(u,u+o),pts:e,dts:e},this.trigger("data",a),u+=o}else u++;else{if(t.length-u<10)break;if((o=this.parseId3TagSize(t,u))>t.length)break;r={type:"timed-metadata",data:t.subarray(u,u+o)},this.trigger("data",r),u+=o}n=t.length-u,t=n>0?t.subarray(u):new Uint8Array}}).prototype=new q;var Ft,Ht,Vt,zt,qt,Gt,Wt,Yt,Xt,Kt,$t,Zt=Nt,Jt=[33,16,5,32,164,27],Qt=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],te=function(t){for(var e=[];t--;)e.push(0);return e},ee=function(t){return Object.keys(t).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(t,e){return t.concat(e)},[])),e},{})}({96000:[Jt,[227,64],te(154),[56]],88200:[Jt,[231],te(170),[56]],64000:[Jt,[248,192],te(240),[56]],48000:[Jt,[255,192],te(268),[55,148,128],te(54),[112]],44100:[Jt,[255,192],te(268),[55,163,128],te(84),[112]],32000:[Jt,[255,192],te(268),[55,234],te(226),[112]],24000:[Jt,[255,192],te(268),[55,255,128],te(268),[111,112],te(126),[224]],16000:[Jt,[255,192],te(268),[55,255,128],te(268),[111,255],te(269),[223,108],te(195),[1,192]],12000:[Qt,te(268),[3,127,248],te(268),[6,255,240],te(268),[13,255,224],te(268),[27,253,128],te(259),[56]],11025:[Qt,te(268),[3,127,248],te(268),[6,255,240],te(268),[13,255,224],te(268),[27,255,192],te(268),[55,175,128],te(108),[112]],8000:[Qt,te(268),[3,121,16],te(47),[7]]}),ie=(Ft=function(t){return 9e4*t},Ht=function(t,e){return t*e},Vt=function(t){return t/9e4},zt=function(t,e){return t/e},function(t,e){return Ft(zt(t,e))}),ne=function(t,e){return Ht(Vt(t),e)},re=jt.H264Stream,ae=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],se=["width","height","profileIdc","levelIdc","profileCompatibility"];Xt=function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)},Kt=function(t,e){var i;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},$t=function(t){var e,i=0;for(e=0;e<t.length;e++)i+=t[e].data.byteLength;return i},(Gt=function(t,e){var i=[],n=0,r=0,a=0,s=1/0;e=e||{},Gt.prototype.init.call(this),this.push=function(e){Q(t,e),t&&ae.forEach(function(i){t[i]=e[i]}),i.push(e)},this.setEarliestDts=function(e){r=e-t.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(t){s=t},this.setAudioAppendStart=function(t){a=t},this.flush=function(){var r,a,s,o;0!==i.length?(r=this.trimAdtsFramesByEarliestDts_(i),t.baseMediaDecodeTime=J(t,e.keepOriginalTimestamps),this.prefixWithSilence_(t,r),t.samples=this.generateSampleTable_(r),s=F.mdat(this.concatenateFrameData_(r)),i=[],a=F.moof(n,[t]),o=new Uint8Array(a.byteLength+s.byteLength),n++,o.set(a),o.set(s,a.byteLength),Z(t),this.trigger("data",{track:t,boxes:o}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.prefixWithSilence_=function(t,e){var i,n,r,o,u=0,l=0,c=0;if(e.length&&(i=ie(t.baseMediaDecodeTime,t.samplerate),n=Math.ceil(9e4/(t.samplerate/1024)),a&&s&&(u=i-Math.max(a,s),c=(l=Math.floor(u/n))*n),!(l<1||c>45e3))){for((r=ee[t.samplerate])||(r=e[0].data),o=0;o<l;o++)e.splice(o,0,{data:r});t.baseMediaDecodeTime-=Math.floor(ne(c,t.samplerate))}},this.trimAdtsFramesByEarliestDts_=function(e){return t.minSegmentDts>=r?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=r&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},this.generateSampleTable_=function(t){var e,i,n=[];for(e=0;e<t.length;e++)i=t[e],n.push({size:i.data.byteLength,duration:1024});return n},this.concatenateFrameData_=function(t){var e,i,n=0,r=new Uint8Array($t(t));for(e=0;e<t.length;e++)i=t[e],r.set(i.data,n),n+=i.data.byteLength;return r}}).prototype=new q,(qt=function(t,e){var i,n,r=0,a=[],s=[];e=e||{},qt.prototype.init.call(this),delete t.minPTS,this.gopCache_=[],this.push=function(e){Q(t,e),"seq_parameter_set_rbsp"!==e.nalUnitType||i||(i=e.config,t.sps=[e.data],se.forEach(function(e){t[e]=i[e]},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||n||(n=e.data,t.pps=[e.data]),a.push(e)},this.flush=function(){for(var i,n,o,u,l,c;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=W(a),(o=Y(i))[0][0].keyFrame||((n=this.getGopForFusion_(a[0],t))?(o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=X(o)),s.length){var h;if(!(h=e.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Z(t),o=h}Q(t,o),t.samples=K(o),l=F.mdat($(o)),t.baseMediaDecodeTime=J(t,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})),this.gopCache_.unshift({gop:o.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime),this.trigger("timelineStartInfo",t.timelineStartInfo),u=F.moof(r,[t]),c=new Uint8Array(u.byteLength+l.byteLength),r++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:t,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){Z(t),i=void 0,n=void 0},this.getGopForFusion_=function(e){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,t.pps&&Kt(t.pps[0],a.pps[0])&&t.sps&&Kt(t.sps[0],a.sps[0])&&(r.dts<t.timelineStartInfo.dts||(i=e.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(t){var e,i,n,r,a,o,u,l;for(a=t.byteLength,o=t.nalCount,u=t.duration,e=i=0;e<s.length&&i<t.length&&(n=s[e],r=t[i],n.pts!==r.pts);)r.pts>n.pts?e++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===i?t:i===t.length?null:((l=t.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(t){var e,i,n,r,a,o,u;for(e=s.length-1,i=t.length-1,a=null,o=!1;e>=0&&i>=0;){if(n=s[e],r=t[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?e--:(e===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(0===(u=o?i:a))return t;var l=t.slice(u),c=l.reduce(function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t},{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(t){s=t}}).prototype=new q,(Yt=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==t.remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Yt.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBoxes.push(t.boxes),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track),void("audio"===t.track.type&&(this.audioTrack=t.track)))}}).prototype=new q,Yt.prototype.flush=function(t){var e,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)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,se.forEach(function(t){s.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,ae.forEach(function(t){s.info[t]=this.audioTrack[t]},this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=F.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++)(e=this.pendingCaptions[r]).startTime=e.startPts-o,e.startTime/=9e4,e.endTime=e.endPts-o,e.endTime/=9e4,s.captionStreams[e.stream]=!0,s.captions.push(e);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).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)},(Wt=function(t){var e,i,n=this,r=!0;Wt.prototype.init.call(this),t=t||{},this.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var e={};this.transmuxPipeline_=e,e.type="aac",e.metadataStream=new Lt.MetadataStream,e.aacStream=new Zt,e.audioTimestampRolloverStream=new Lt.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new Lt.TimestampRolloverStream("timed-metadata"),e.adtsStream=new Dt,e.coalesceStream=new Yt(t,e.metadataStream),e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)}),e.aacStream.on("data",function(r){"timed-metadata"!==r.type||e.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new Gt(i,t),e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream))}),e.coalesceStream.on("data",this.trigger.bind(this,"data")),e.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new Lt.MetadataStream,r.packetStream=new Lt.TransportPacketStream,r.parseStream=new Lt.TransportParseStream,r.elementaryStream=new Lt.ElementaryStream,r.videoTimestampRolloverStream=new Lt.TimestampRolloverStream("video"),r.audioTimestampRolloverStream=new Lt.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new Lt.TimestampRolloverStream("timed-metadata"),r.adtsStream=new Dt,r.h264Stream=new re,r.captionStream=new Lt.CaptionStream,r.coalesceStream=new Yt(t,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream),r.elementaryStream.pipe(r.videoTimestampRolloverStream).pipe(r.h264Stream),r.elementaryStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.elementaryStream.pipe(r.timedMetadataTimestampRolloverStream).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){for(s=a.tracks.length;s--;)e||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(e=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;e&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new qt(e,t),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts))}),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(t){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Gt(i,t),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream))}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(t){var n=this.transmuxPipeline_;this.baseMediaDecodeTime=t,i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Z(i),i.timelineStartInfo.baseMediaDecodeTime=t,n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),e&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[],n.videoTimestampRolloverStream.discontinuity()),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,Z(e),n.captionStream.reset(),e.timelineStartInfo.baseMediaDecodeTime=t),n.timedMetadataTimestampRolloverStream&&n.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){if(r){var e=Xt(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new q;var oe,ue,le={Transmuxer:Wt,VideoSegmentStream:qt,AudioSegmentStream:Gt,AUDIO_PROPERTIES:ae,VIDEO_PROPERTIES:se},ce=V.parseType,he=function(t){return new Date(1e3*t-20828448e5)},de=function(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}},pe={avc1:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:e.getUint16(6),width:e.getUint16(24),height:e.getUint16(26),horizresolution:e.getUint16(28)+e.getUint16(30)/16,vertresolution:e.getUint16(32)+e.getUint16(34)/16,frameCount:e.getUint16(40),depth:e.getUint16(74),config:oe(t.subarray(78,t.byteLength))}},avcC:function(t){var e,i,n,r,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},o=31&t[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;for(e=t[n],n++,r=0;r<e;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;return s},btrt:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:e.getUint32(0),maxBitrate:e.getUint32(4),avgBitrate:e.getUint32(8)}},esds:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={majorBrand:ce(t.subarray(0,4)),minorVersion:e.getUint32(4),compatibleBrands:[]},n=8;n<t.byteLength;)i.compatibleBrands.push(ce(t.subarray(n,n+4))),n+=4;return i},dinf:function(t){return{boxes:oe(t)}},dref:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:oe(t.subarray(8))}},hdlr:function(t){var e={version:new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:ce(t.subarray(8,12)),name:""},i=8;for(i=24;i<t.byteLength;i++){if(0===t[i]){i++;break}e.name+=String.fromCharCode(t[i])}return e.name=decodeURIComponent(escape(e.name)),e},mdat:function(t){return{byteLength:t.byteLength,nals:function(t){var e,i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=[];for(e=0;e+4<t.length;e+=i)if(i=n.getUint32(e),e+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&t[e]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+t[e]&31)}return r}(t)}},mdhd:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=he(i.getUint32(n)),n+=8,r.modificationTime=he(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=he(i.getUint32(n)),n+=4,r.modificationTime=he(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,e=i.getUint16(n),r.language+=String.fromCharCode(96+(e>>10)),r.language+=String.fromCharCode(96+((992&e)>>5)),r.language+=String.fromCharCode(96+(31&e)),r},mdia:function(t){return{boxes:oe(t)}},mfhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return{boxes:oe(t)}},mp4a:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={dataReferenceIndex:e.getUint16(6),channelcount:e.getUint16(16),samplesize:e.getUint16(18),samplerate:e.getUint16(24)+e.getUint16(26)/65536};return t.byteLength>28&&(i.streamDescriptor=oe(t.subarray(28))[0]),i},moof:function(t){return{boxes:oe(t)}},moov:function(t){return{boxes:oe(t)}},mvex:function(t){return{boxes:oe(t)}},mvhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=he(e.getUint32(i)),i+=8,n.modificationTime=he(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=8,n.duration=e.getUint32(i)):(n.creationTime=he(e.getUint32(i)),i+=4,n.modificationTime=he(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=4,n.duration=e.getUint32(i)),i+=4,n.rate=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=e.getUint32(i),n},pdin:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:e.getUint32(4),initialDelay:e.getUint32(8)}},sdtp:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]};for(e=4;e<t.byteLength;e++)i.samples.push({dependsOn:(48&t[e])>>4,isDependedOn:(12&t[e])>>2,hasRedundancy:3&t[e]});return i},sidx:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(e=24;r;e+=12,r--)n.references.push({referenceType:(128&t[e])>>>7,referencedSize:2147483647&i.getUint32(e),subsegmentDuration:i.getUint32(e+4),startsWithSap:!!(128&t[e+8]),sapType:(112&t[e+8])>>>4,sapDeltaTime:268435455&i.getUint32(e+8)});return n},smhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return{boxes:oe(t)}},stco:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(e=8;r;e+=4,r--)n.chunkOffsets.push(i.getUint32(e));return n},stsc:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=i.getUint32(4),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]};for(e=8;n;e+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(e),samplesPerChunk:i.getUint32(e+4),sampleDescriptionIndex:i.getUint32(e+8)});return r},stsd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:oe(t.subarray(8))}},stsz:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(e=12;e<t.byteLength;e+=4)n.entries.push(i.getUint32(e));return n},stts:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(e=8;r;e+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(e),sampleDelta:i.getUint32(e+4)});return n},styp:function(t){return pe.ftyp(t)},tfdt:function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:t[4]<<24|t[5]<<16|t[6]<<8|t[7]};return 1===e.version&&(e.baseMediaDecodeTime*=Math.pow(2,32),e.baseMediaDecodeTime+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]),e},tfhd:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.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 e=8,r&&(e+=4,n.baseDataOffset=i.getUint32(12),e+=4),a&&(n.sampleDescriptionIndex=i.getUint32(e),e+=4),s&&(n.defaultSampleDuration=i.getUint32(e),e+=4),o&&(n.defaultSampleSize=i.getUint32(e),e+=4),u&&(n.defaultSampleFlags=i.getUint32(e)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=he(e.getUint32(i)),i+=8,n.modificationTime=he(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=8,n.duration=e.getUint32(i)):(n.creationTime=he(e.getUint32(i)),i+=4,n.modificationTime=he(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=4,n.duration=e.getUint32(i)),i+=4,i+=8,n.layer=e.getUint16(i),i+=2,n.alternateGroup=e.getUint16(i),i+=2,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,n.width=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.height=e.getUint16(i)+e.getUint16(i+2)/16,n},traf:function(t){return{boxes:oe(t)}},trak:function(t){return{boxes:oe(t)}},trex:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4),defaultSampleDescriptionIndex:e.getUint32(8),defaultSampleDuration:e.getUint32(12),defaultSampleSize:e.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:e.getUint16(22)}},trun:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},n=new DataView(t.buffer,t.byteOffset,t.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),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),a&&c&&(e={flags:de(t.subarray(h,h+4))},h+=4,s&&(e.duration=n.getUint32(h),h+=4),o&&(e.size=n.getUint32(h),h+=4),l&&(e.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(e),c--);c--;)e={},s&&(e.duration=n.getUint32(h),h+=4),o&&(e.size=n.getUint32(h),h+=4),u&&(e.flags=de(t.subarray(h,h+4)),h+=4),l&&(e.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(e);return i},"url ":function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:e.getUint16(4),opcolor:new Uint16Array([e.getUint16(6),e.getUint16(8),e.getUint16(10)])}}},fe={inspect:oe=function(t){for(var e,i,n,r,a,s=0,o=[],u=new ArrayBuffer(t.length),l=new Uint8Array(u),c=0;c<t.length;++c)l[c]=t[c];for(e=new DataView(u);s<t.byteLength;)i=e.getUint32(s),n=ce(t.subarray(s+4,s+8)),r=i>1?s+i:t.byteLength,(a=(pe[n]||function(t){return{data:t}})(t.subarray(s+8,r))).size=i,a.type=n,o.push(a),s=r;return o},textify:ue=function(t,e){var i;return e=e||0,i=new Array(2*e+1).join(" "),t.map(function(t,n){return i+t.type+"\n"+Object.keys(t).filter(function(t){return"type"!==t&&"boxes"!==t}).map(function(e){var n=i+"  "+e+": ",r=t[e];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map(function(t){return" "+("00"+t.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map(function(t){return i+"  "+t}).join("\n")+"\n"+i+"  >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map(function(t,e){return 0===e?t:i+"  "+t}).join("\n")}).join("\n")+(t.boxes?"\n"+ue(t.boxes,e+1):"")}).join("\n")},parseTfdt:pe.tfdt,parseHdlr:pe.hdlr,parseTfhd:pe.tfhd,parseTrun:pe.trun},me=nt,ge=ht.CaptionStream,ye=function(t,e){for(var i=t,n=0;n<e.length;n++){var r=e[n];if(i<r.size)return r;i-=r.size}return null},ve=function(t,e){var i=V.findBox(t,["moof","traf"]),n={},r=[];return V.findBox(t,["mdat"]).forEach(function(t,e){var n=i[e];r.push({mdat:t,traf:n})}),r.forEach(function(t){var i,r=t.mdat,a=t.traf,s=V.findBox(a,["tfhd"]),o=fe.parseTfhd(s[0]),u=o.trackId,l=V.findBox(a,["tfdt"]),c=l.length>0?fe.parseTfdt(l[0]).baseMediaDecodeTime:0,h=V.findBox(a,["trun"]);e===u&&h.length>0&&(i=function(t,e,i){var n,r,a,s,o=new DataView(t.buffer,t.byteOffset,t.byteLength),u=[];for(r=0;r+4<t.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&t[r]){case 6:var l=t.subarray(r+1,r+1+a),c=ye(r,e);n={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:me(l),trackId:i},c?(n.pts=c.pts,n.dts=c.dts,s=c):(n.pts=s.pts,n.dts=s.dts),u.push(n)}return u}(r,function(t,e,i){var n=e,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,s=i.trackId,o=[];return t.forEach(function(t){var e=fe.parseTrun(t).samples;e.forEach(function(t){void 0===t.duration&&(t.duration=r),void 0===t.size&&(t.size=a),t.trackId=s,t.dts=n,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=n+t.compositionTimeOffset,n+=t.duration}),o=o.concat(e)}),o}(h,c,o),u),n[u]||(n[u]=[]),n[u]=n[u].concat(i))}),n},_e={generator:F,probe:V,Transmuxer:le.Transmuxer,AudioSegmentStream:le.AudioSegmentStream,VideoSegmentStream:le.VideoSegmentStream,CaptionParser:function(){var t,e,i,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(){t=new ge,a=!0,t.on("data",function(t){t.startTime=t.startPts/n,t.endTime=t.endPts/n,r.captions.push(t),r.captionStreams[t.stream]=!0})},this.isNewInit=function(t,e){return!(t&&0===t.length||e&&"object"===(void 0===e?"undefined":Bt(e))&&0===Object.keys(e).length||i===t[0]&&n===e[i])},this.parse=function(t,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(!i||!n)return e.push(t),null;for(;e.length>0;){var u=e.shift();this.parse(u,a,s)}return null!==(o=function(t,e,i){return e?{seiNals:ve(t,e)[e],timescale:i}:null}(t,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach(function(e){t.push(e)})},this.flushStream=function(){if(!this.isInitialized())return null;t.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){e=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},be=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Te=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Se=function(){function t(e,i){be(this,t),this.options=i||{},this.self=e,this.init()}return Te(t,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _e.Transmuxer(this.options),function(t,e){e.on("data",function(e){var i=e.initSegment;e.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=e.data;e.data=n.buffer,t.postMessage({action:"data",segment:e,byteOffset:n.byteOffset,byteLength:n.byteLength},[e.data])}),e.captionStream&&e.captionStream.on("data",function(e){t.postMessage({action:"caption",data:e})}),e.on("done",function(e){t.postMessage({action:"done"})}),e.on("gopInfo",function(e){t.postMessage({action:"gopInfo",gopInfo:e})})}(this.self,this.transmuxer)}},{key:"push",value:function(t){var e=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(e)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(t){var e=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*e))}},{key:"setAudioAppendStart",value:function(t){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*t.appendStart))}},{key:"flush",value:function(t){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())}}]),t}();new function(t){t.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Se(t,e.data.options):(this.messageHandlers||(this.messageHandlers=new Se(t)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}(i)}()}),Ws={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},Ys=function(t){return t.map(function(t){return t.replace(/avc1\.(\d+)\.(\d+)/i,function(t,e,i){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})})},Xs=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i={codecCount:0};return i.codecCount=e.split(",").length,i.codecCount=i.codecCount||2,(t=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e))&&(i.videoCodec=t[2],i.videoObjectTypeIndicator=t[3]),i.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),i.audioProfile=i.audioProfile&&i.audioProfile[2],i},Ks=function(t,e,i){return t+"/"+e+'; codecs="'+i.filter(function(t){return!!t}).join(", ")+'"'},$s=function(t,e){var i=function(t){return t.segments&&t.segments.length&&t.segments[0].map?"mp4":"mp2t"}(e),n=function(t){var e=t.attributes||{};return e.CODECS?Xs(e.CODECS):Ws}(e),r=e.attributes||{},a=!0,s=!1;if(!e)return[];if(t.mediaGroups.AUDIO&&r.AUDIO){var o=t.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in s=!0,a=!1,o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}s&&!n.audioProfile&&(a||(n.audioProfile=function(t,e){if(!t.mediaGroups.AUDIO||!e)return null;var i=t.mediaGroups.AUDIO[e];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return Xs(r.playlists[0].attributes.CODECS).audioProfile}return null}(t,r.AUDIO)),n.audioProfile||(Ra.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=Ws.audioProfile));var l={};n.videoCodec&&(l.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(l.audio="mp4a.40."+n.audioProfile);var c=Ks("audio",i,[l.audio]),h=Ks("video",i,[l.video]),d=Ks("video",i,[l.video,l.audio]);return s?!a&&l.video?[h,c]:a||l.video?[d,c]:[c,c]:l.video?[d]:[c]},Zs=function(t){return/mp4a\.\d+.\d+/i.test(t)},Js=function(t){return/avc1\.[\da-f]+/i.test(t)},Qs=function(t,e,i){var n=null,r=null,a=0,s=[],o=[];if(!t&&!e)return Ra.createTimeRange();if(!t)return e.buffered;if(!e)return t.buffered;if(i)return t.buffered;if(0===t.buffered.length&&0===e.buffered.length)return Ra.createTimeRange();for(var u=t.buffered,l=e.buffered,c=u.length;c--;)s.push({time:u.start(c),type:"start"}),s.push({time:u.end(c),type:"end"});for(c=l.length;c--;)s.push({time:l.start(c),type:"start"}),s.push({time:l.end(c),type:"end"});for(s.sort(function(t,e){return t.time-e.time}),c=0;c<s.length;c++)"start"===s[c].type?2===++a&&(n=s[c].time):"end"===s[c].type&&1===--a&&(r=s[c].time),null!==n&&null!==r&&(o.push([n,r]),n=null,r=null);return Ra.createTimeRanges(o)},to=function(t){function e(t,i){Fa(this,e);var n=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Ra.EventTarget));n.timestampOffset_=0,n.pendingBuffers_=[],n.bufferUpdating_=!1,n.mediaSource_=t,n.codecs_=i,n.audioCodec_=null,n.videoCodec_=null,n.audioDisabled_=!1,n.appendAudioInitSegment_=!0,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Ra.browser.IE_VERSION>=11;var r={remux:!1,alignGopsAtEnd:n.safeAppend_};return n.codecs_.forEach(function(t){Zs(t)?n.audioCodec_=t:Js(t)&&(n.videoCodec_=t)}),n.transmuxer_=new Gs,n.transmuxer_.postMessage({action:"init",options:r}),n.transmuxer_.onmessage=function(t){return"data"===t.data.action?n.data_(t):"done"===t.data.action?n.done_(t):"gopInfo"===t.data.action?n.appendGopInfo_(t):void 0},Object.defineProperty(n,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(t){"number"==typeof t&&t>=0&&(this.timestampOffset_=t,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t}))}}),Object.defineProperty(n,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(t){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=t),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=t)}}),Object.defineProperty(n,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(n,"buffered",{get:function(){return Qs(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),n}return Va(e,t),Ha(e,[{key:"data_",value:function(t){var e=t.data.segment;e.data=new Uint8Array(e.data,t.data.byteOffset,t.data.byteLength),e.initSegment=new Uint8Array(e.initSegment.data,e.initSegment.byteOffset,e.initSegment.byteLength),function(t,e,i){var n=e.player_;if(i.captions&&i.captions.length)for(var r in t.inbandTextTracks_||(t.inbandTextTracks_={}),i.captionStreams)if(!t.inbandTextTracks_[r]){n.tech_.trigger({type:"usage",name:"hls-608"});var a=n.textTracks().getTrackById(r);t.inbandTextTracks_[r]=a||n.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}i.metadata&&i.metadata.length&&!t.metadataTrack_&&(t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)}(this,this.mediaSource_,e),this.pendingBuffers_.push(e)}},{key:"done_",value:function(t){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var t=this,e=["audio","video"];e.forEach(function(i){if(t[i+"Codec_"]&&!t[i+"Buffer_"]){var n=null;if(t.mediaSource_[i+"Buffer_"])(n=t.mediaSource_[i+"Buffer_"]).updating=!1;else{var r=i+'/mp4;codecs="'+t[i+"Codec_"]+'"';n=function(t,e){var i=t.addSourceBuffer(e),n=Object.create(null);n.updating=!1,n.realBuffer_=i;var r=function(t){"function"==typeof i[t]?n[t]=function(){return i[t].apply(i,arguments)}:void 0===n[t]&&Object.defineProperty(n,t,{get:function(){return i[t]},set:function(e){return i[t]=e}})};for(var a in i)r(a);return n}(t.mediaSource_.nativeMediaSource_,r),t.mediaSource_[i+"Buffer_"]=n}t[i+"Buffer_"]=n,["update","updatestart","updateend"].forEach(function(r){n.addEventListener(r,function(){if("audio"!==i||!t.audioDisabled_)return"updateend"===r&&(t[i+"Buffer_"].updating=!1),e.every(function(e){return!("audio"!==e||!t.audioDisabled_)||(i===e||!t[e+"Buffer_"]||!t[e+"Buffer_"].updating)})?t.trigger(r):void 0})})}})}},{key:"appendBuffer",value:function(t){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var e=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:e.end(e.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:function(t,e,i){if(void 0===e||null===e||!t.length)return[];var n=Math.ceil(9e4*(e-i+3)),r=void 0;for(r=0;r<t.length&&!(t[r].pts>n);r++);return t.slice(r)}(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength},[t.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(t){this.gopBuffer_=function(t,e,i){if(!e.length)return t;if(i)return e.slice();for(var n=e[0].pts,r=0;r<t.length&&!(t[r].pts>=n);r++);return t.slice(0,r).concat(e)}(this.gopBuffer_,t.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(t,e){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(t,e),this.gopBuffer_=function(t,e,i,n){for(var r=Math.ceil(9e4*(e-n)),a=Math.ceil(9e4*(i-n)),s=t.slice(),o=t.length;o--&&!(t[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(t[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,t,e,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(t,e)),Os(t,e,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)Os(t,e,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var t={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};t=this.pendingBuffers_.reduce(function(t,e){var i=e.type,n=e.data,r=e.initSegment;return t[i].segments.push(n),t[i].bytes+=n.byteLength,t[i].initSegment=r,e.captions&&(t.captions=t.captions.concat(e.captions)),e.info&&(t[i].info=e.info),e.metadata&&(t.metadata=t.metadata.concat(e.metadata)),t},t),this.videoBuffer_||this.audioBuffer_||(0===t.video.bytes&&(this.videoCodec_=null),0===t.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),t.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:t.audio.info}),t.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:t.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(t.audio.segments.unshift(t.audio.initSegment),t.audio.bytes+=t.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var e=!1;this.videoBuffer_&&t.video.bytes?(t.video.segments.unshift(t.video.initSegment),t.video.bytes+=t.video.initSegment.byteLength,this.concatAndAppendSegments_(t.video,this.videoBuffer_),Us(this,t.captions,t.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(e=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(t.audio,this.audioBuffer_),this.pendingBuffers_.length=0,e&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(t,e){var i=0,n=void 0;if(t.bytes){n=new Uint8Array(t.bytes),t.segments.forEach(function(t){n.set(t,i),i+=t.byteLength});try{e.updating=!0,e.appendBuffer(n)}catch(t){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:t.message,originalError:t})}}}},{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}}]),e}(Ra.EventTarget),eo=function(t){function e(){Fa(this,e);var t=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this)),i=void 0;for(i in t.nativeMediaSource_=new c.a.MediaSource,t.nativeMediaSource_)i in e.prototype||"function"!=typeof t.nativeMediaSource_[i]||(t[i]=t.nativeMediaSource_[i].bind(t.nativeMediaSource_));return t.duration_=NaN,Object.defineProperty(t,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(t){this.duration_=t,t===1/0||(this.nativeMediaSource_.duration=t)}}),Object.defineProperty(t,"seekable",{get:function(){return this.duration_===1/0?Ra.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(t,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(t,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),t.sourceBuffers=[],t.activeSourceBuffers_=[],t.updateActiveSourceBuffers_=function(){if(t.activeSourceBuffers_.length=0,1===t.sourceBuffers.length){var e=t.sourceBuffers[0];return e.appendAudioInitSegment_=!0,e.audioDisabled_=!e.audioCodec_,void t.activeSourceBuffers_.push(e)}for(var i=!1,n=!0,r=0;r<t.player_.audioTracks().length;r++){var a=t.player_.audioTracks()[r];if(a.enabled&&"main"!==a.kind){i=!0,n=!1;break}}t.sourceBuffers.forEach(function(e,r){if(e.appendAudioInitSegment_=!0,e.videoCodec_&&e.audioCodec_)e.audioDisabled_=i;else if(e.videoCodec_&&!e.audioCodec_)e.audioDisabled_=!0,n=!1;else if(!e.videoCodec_&&e.audioCodec_&&(e.audioDisabled_=r?n:!n,e.audioDisabled_))return;t.activeSourceBuffers_.push(e)})},t.onPlayerMediachange_=function(){t.sourceBuffers.forEach(function(t){t.appendAudioInitSegment_=!0})},t.onHlsReset_=function(){t.sourceBuffers.forEach(function(t){t.transmuxer_&&t.transmuxer_.postMessage({action:"resetCaptions"})})},t.onHlsSegmentTimeMapping_=function(e){t.sourceBuffers.forEach(function(t){return t.timeMapping_=e.mapping})},["sourceopen","sourceclose","sourceended"].forEach(function(t){this.nativeMediaSource_.addEventListener(t,this.trigger.bind(this))},t),t.on("sourceopen",function(e){var i=d.a.querySelector('[src="'+t.url_+'"]');i&&(t.player_=Ra(i.parentNode),t.player_.tech_.on("hls-reset",t.onHlsReset_),t.player_.tech_.on("hls-segment-time-mapping",t.onHlsSegmentTimeMapping_),t.player_.audioTracks&&t.player_.audioTracks()&&(t.player_.audioTracks().on("change",t.updateActiveSourceBuffers_),t.player_.audioTracks().on("addtrack",t.updateActiveSourceBuffers_),t.player_.audioTracks().on("removetrack",t.updateActiveSourceBuffers_)),t.player_.on("mediachange",t.onPlayerMediachange_))}),t.on("sourceended",function(e){for(var i=Is(t.duration),n=0;n<t.sourceBuffers.length;n++){var r=t.sourceBuffers[n],a=r.metadataTrack_&&r.metadataTrack_.cues;a&&a.length&&(a[a.length-1].endTime=i)}}),t.on("sourceclose",function(t){this.sourceBuffers.forEach(function(t){t.transmuxer_&&t.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_)))}),t}return Va(e,t),Ha(e,[{key:"addSeekableRange_",value:function(t,e){var i=void 0;if(this.duration!==1/0)throw(i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",i.code=11,i;(e>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=e)}},{key:"addSourceBuffer",value:function(t){var e=void 0,i=function(t){var e={type:"",parameters:{}},i=t.trim().split(";");return e.type=i.shift().trim(),i.forEach(function(t){var i=t.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),r=i[1].replace(/"/g,"").trim();e.parameters[n]=r}}),e}(t);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(n=Ys(n)).filter(function(t){return Zs(t)||Js(t)})),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),e=new to(this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),e.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else e=this.nativeMediaSource_.addSourceBuffer(t);return this.sourceBuffers.push(e),e}}]),e}(Ra.EventTarget),io=0;Ra.mediaSources={};var no=function(t,e){var i=Ra.mediaSources[t];if(!i)throw new Error("Media Source not found (Video.js)");i.trigger({type:"sourceopen",swfId:e})},ro=function(){return!!c.a.MediaSource&&!!c.a.MediaSource.isTypeSupported&&c.a.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},ao=function(){if(this.MediaSource={open:no,supportsNativeMediaSources:ro},ro())return new eo;throw new Error("Cannot use create a virtual MediaSource for this video")};ao.open=no,ao.supportsNativeMediaSources=ro;var so={createObjectURL:function(t){var e=void 0;return t instanceof eo?(e=c.a.URL.createObjectURL(t.nativeMediaSource_),t.url_=e,e):t instanceof eo?(e="blob:vjs-media-source/"+io,io++,Ra.mediaSources[e]=t,e):(e=c.a.URL.createObjectURL(t),t.url_=e,e)}};Ra.MediaSource=ao,Ra.URL=so;var oo=Ra.EventTarget,uo=Ra.mergeOptions,lo=function(t,e){for(var i=uo(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod}),n=0;n<e.playlists.length;n++){var r=Ka(i,e.playlists[n]);r&&(i=r)}return Xa(e,function(t,e,n,r){if(t.playlists&&t.playlists.length){var a=t.playlists[0].uri,s=Ka(i,t.playlists[0]);s&&((i=s).mediaGroups[e][n][r].playlists[0]=i.playlists[a])}}),i},co=function(t){function e(t,i,n,r){Fa(this,e);var a=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));if(a.hls_=i,a.withCredentials=n,!t)throw new Error("A non-empty playlist URL or playlist is required");return a.on("minimumUpdatePeriod",function(){a.refreshXml_()}),a.on("mediaupdatetimeout",function(){a.refreshMedia_()}),"string"==typeof t?(a.srcUrl=t,a.state="HAVE_NOTHING",za(a)):(a.masterPlaylistLoader_=r,a.state="HAVE_METADATA",a.started=!0,a.media(t),c.a.setTimeout(function(){a.trigger("loadedmetadata")},0),a)}return Va(e,oo),Ha(e,[{key:"dispose",value:function(){this.stopRequest(),c.a.clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}}},{key:"media",value:function(t){if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var e=this.state;if("string"==typeof t){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}var i=!this.media_||t.uri!==this.media_.uri;this.state="HAVE_METADATA",i&&(this.media_&&this.trigger("mediachanging"),this.media_=t,this.refreshMedia_(),"HAVE_MASTER"!==e&&this.trigger("mediachange"))}},{key:"pause",value:function(){this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(){this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var t=ft(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});t.uri=this.srcUrl;for(var e=0;e<t.playlists.length;e++){var i="placeholder-uri-"+e;t.playlists[e].uri=i,t.playlists[i]=t.playlists[e]}return Xa(t,function(e,i,n,r){if(e.playlists&&e.playlists.length){var a="placeholder-uri-"+i+"-"+n+"-"+r;e.playlists[0].uri=a,t.playlists[a]=e.playlists[0]}}),$a(t),Za(t),t}},{key:"start",value:function(){var t=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,i){if(t.request){if(t.request=null,e)return t.error={status:i.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");t.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?t.masterLoaded_=Date.parse(i.responseHeaders.date):t.masterLoaded_=Date.now(),t.syncClientServerClock_(t.onClientServerClockSync_.bind(t))}})}},{key:"syncClientServerClock_",value:function(t){var e=this,i=mt(this.masterXml_);return null===i?(this.clientOffset_=this.masterLoaded_-Date.now(),t()):"DIRECT"===i.method?(this.clientOffset_=i.value-Date.now(),t()):void(this.request=this.hls_.xhr({uri:ja(this.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},function(n,r){if(e.request){if(n)return e.clientOffset_=e.masterLoaded_-Date.now(),t();var a=void 0;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):e.masterLoaded_:Date.parse(r.responseText),e.clientOffset_=a-Date.now(),t()}}))}},{key:"onClientServerClockSync_",value:function(){var t=this;this.master=this.parseMasterXml(),this.state="HAVE_MASTER",this.trigger("loadedplaylist"),this.media_||this.media(this.master.playlists[0]),c.a.setTimeout(function(){t.trigger("loadedmetadata")},0),this.master.minimumUpdatePeriod&&c.a.setTimeout(function(){t.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod)}},{key:"refreshXml_",value:function(){var t=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(e,i){if(t.request){if(t.request=null,e)return t.error={status:i.status,message:"DASH playlist request error at URL: "+t.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");t.masterXml_=i.responseText;var n=t.parseMasterXml();t.master=lo(t.master,n),c.a.setTimeout(function(){t.trigger("minimumUpdatePeriod")},t.master.minimumUpdatePeriod)}})}},{key:"refreshMedia_",value:function(){var t=this,e=void 0,i=void 0;this.masterPlaylistLoader_?(e=this.masterPlaylistLoader_.master,i=this.masterPlaylistLoader_.parseMasterXml()):(e=this.master,i=this.parseMasterXml());var n=lo(e,i);n?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=n:this.master=n,this.media_=n.playlists[this.media_.uri]):this.trigger("playlistunchanged"),this.media().endList||(this.mediaUpdateTimeout=c.a.setTimeout(function(){t.trigger("mediaupdatetimeout")},Ja(this.media(),!!n))),this.trigger("loadedplaylist")}}]),e}(),ho=function(t){return Ra.log.debug?Ra.log.debug.bind(Ra,"VHS:",t+" >"):function(){}};function po(){}var fo=function(){function t(e,i,n,r){Fa(this,t),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=e,this.processedAppend_=!1,this.type_=n,this.mimeType_=i,this.logger_=ho("SourceUpdater["+n+"]["+i+"]"),"closed"===e.readyState?e.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,i,r)):this.createSourceBuffer_(i,r)}return Ha(t,[{key:"createSourceBuffer_",value:function(t,e){var i=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(t),this.logger_("created SourceBuffer"),e&&(e.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?e.on("sourcebufferadded",function(){i.start_()}):this.start_()}},{key:"start_",value:function(){var t=this;this.started_=!0,this.onUpdateendCallback_=function(){var e=t.pendingCallback_;t.pendingCallback_=null,t.logger_("buffered ["+Ps(t.buffered())+"]"),e&&e(),t.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(t){var e=this;this.processedAppend_&&this.queueCallback_(function(){e.sourceBuffer_.abort()},t)}},{key:"appendBuffer",value:function(t,e){var i=this;this.processedAppend_=!0,this.queueCallback_(function(){i.sourceBuffer_.appendBuffer(t)},e)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:Ra.createTimeRanges()}},{key:"remove",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:po;this.processedAppend_&&this.queueCallback_(function(){i.logger_("remove ["+t+" => "+e+"]"),i.sourceBuffer_.remove(t,e)},n)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(t){var e=this;return void 0!==t&&(this.queueCallback_(function(){e.sourceBuffer_.timestampOffset=t}),this.timestampOffset_=t),this.timestampOffset_}},{key:"queueCallback_",value:function(t,e){this.callbacks_.push([t.bind(this),e]),this.runCallback_()}},{key:"runCallback_",value:function(){var t=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(t=this.callbacks_.shift(),this.pendingCallback_=t[1],t[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),t}(),mo={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},go=2,yo=-101,vo=-102,_o=function(t){var e={};return t.byterange&&(e.Range=function(t){var e;return e=t.offset+t.length-1,"bytes="+t.offset+"-"+e}(t.byterange)),e},bo=function(t){t.forEach(function(t){t.abort()})},To=function(t,e){return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:yo,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:vo,xhr:e}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:go,xhr:e}:null},So=function(t,e,i){var n=[],r=0;return function(a,s){if(a&&(bo(t),n.push(a)),(r+=1)===t.length){if(s.endOfAllRequests=Date.now(),n.length>0){var o=function(t){return t.reduce(function(t,e){return e.code>t.code?e:t})}(n);return i(o,s)}return s.encryptedBytes?function(t,e,i){t.addEventListener("message",function n(r){if(r.data.source===e.requestId){t.removeEventListener("message",n);var a=r.data.decrypted;return e.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength),i(null,e)}}),t.postMessage(Ss({source:e.requestId,encrypted:e.encryptedBytes,key:e.key.bytes,iv:e.key.iv}),[e.encryptedBytes.buffer,e.key.bytes.buffer])}(e,s,i):i(null,s)}}},wo=function(t,e){return function(i){return t.stats=Ra.mergeOptions(t.stats,function(t){var e=t.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=t.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i}(i)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),e(i,t)}},ko=function(t,e,i,n,r,a,s){var o=[],u=So(o,i,s);if(r.key){var l=t(Ra.mergeOptions(e,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),function(t,e){return function(i,n){var r=n.response,a=To(i,n);if(a)return e(a,t);if(16!==r.byteLength)return e({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:go,xhr:n},t);var s=new DataView(r);return t.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]),e(null,t)}}(r,u));o.push(l)}if(r.map&&!r.map.bytes){var c=t(Ra.mergeOptions(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:_o(r.map)}),function(t,e,i){return function(n,r){var a=r.response,s=To(n,r);return s?i(s,t):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:go,xhr:r},t):(t.map.bytes=new Uint8Array(r.response),e.isInitialized()||e.init(),t.map.timescales=yt.a.timescale(t.map.bytes),t.map.videoTrackIds=yt.a.videoTrackIds(t.map.bytes),i(null,t))}}(r,n,u));o.push(c)}var h=t(Ra.mergeOptions(e,{uri:r.resolvedUri,responseType:"arraybuffer",headers:_o(r)}),function(t,e,i){return function(n,r){var a=r.response,s=To(n,r),o=void 0;return s?i(s,t):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:go,xhr:r},t):(t.stats=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}}(r),t.key?t.encryptedBytes=new Uint8Array(r.response):t.bytes=new Uint8Array(r.response),t.map&&t.map.bytes&&(e.isInitialized()||e.init(),(o=e.parse(t.bytes,t.map.videoTrackIds,t.map.timescales))&&o.captions&&(t.captionStreams=o.captionStreams,t.fmp4Captions=o.captions)),i(null,t))}}(r,n,u));return h.addEventListener("progress",wo(r,a)),o.push(h),function(){return bo(o)}},Co=function(t,e){var i;return t&&(i=c.a.getComputedStyle(t))?i[e]:""},Eo=function(t,e){var i=t.slice();t.sort(function(t,n){var r=e(t,n);return 0===r?i.indexOf(t)-i.indexOf(n):r})},xo=function(t,e){var i=void 0,n=void 0;return t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||c.a.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),i-(n=n||c.a.Number.MAX_VALUE)},Ao=function(t,e,i){if(!t||!e)return!1;var n=i===t.segments.length;return t.endList&&"open"===e.readyState&&n},Po=function(t){return"number"==typeof t&&isFinite(t)},Lo=function(t){function e(t){Fa(this,e);var i=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));if(!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 i.bandwidth=t.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.hasPlayed_=t.hasPlayed,i.currentTime_=t.currentTime,i.seekable_=t.seekable,i.seeking_=t.seeking,i.duration_=t.duration,i.mediaSource_=t.mediaSource,i.hls_=t.hls,i.loaderType_=t.loaderType,i.startingMedia_=void 0,i.segmentMetadataTrack_=t.segmentMetadataTrack,i.goalBufferLength_=t.goalBufferLength,i.sourceType_=t.sourceType,i.inbandTextTracks_=t.inbandTextTracks,i.state_="INIT",i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.mimeType_=null,i.sourceUpdater_=null,i.xhrOptions_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.captionParser_=new vt.CaptionParser,i.decrypter_=t.decrypter,i.syncController_=t.syncController,i.syncPoint_={segmentIndex:0,time:0},i.syncController_.on("syncinfoupdate",function(){return i.trigger("syncinfoupdate")}),i.mediaSource_.addEventListener("sourceopen",function(){return i.ended_=!1}),i.fetchAtBuffer_=!1,i.logger_=ho("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(i,"state",{get:function(){return this.state_},set:function(t){t!==this.state_&&(this.logger_(this.state_+" -> "+t),this.state_=t)}}),i}return Va(e,t),Ha(e,[{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_(),this.captionParser_.reset()}},{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(t){return void 0!==t&&(this.error_=t),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():Ra.createTimeRanges()}},{key:"initSegment",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return null;var i=ws(t),n=this.initSegments_[i];return e&&!n&&t.bytes&&(this.initSegments_[i]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,timescales:t.timescales,videoTrackIds:t.videoTrackIds}),n||t}},{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 fo(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=e,this.hasPlayed_()||(t.syncInfo={mediaSequence:t.mediaSequence,time:0});var r=i?i.id:null;if(this.logger_("playlist update ["+r+" => "+t.id+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(i&&i.uri===t.uri){var a=t.mediaSequence-i.mediaSequence;this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex&&(this.mediaIndex-=a),n&&(n.mediaIndex-=a,n.mediaIndex>=0&&(n.segment=t.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,t)}else null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(c.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(t,e){this.mimeType_||(this.mimeType_=t,this.sourceBufferEmitter_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(t){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),t),this.captionParser_.clearAllCaptions(),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(t,e,i){if(this.sourceUpdater_&&this.sourceUpdater_.remove(t,e,i),Os(t,e,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)Os(t,e,this.inbandTextTracks_[n])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&c.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=c.a.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&c.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=c.a.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){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)Ao(this.playlist_,this.mediaSource_,t.mediaIndex)?this.endOfStream():(t.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((t.timeline!==this.currentTimeline_||null!==t.startOfSegment&&t.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),t.timestampOffset=t.startOfSegment,this.captionParser_.clearAllCaptions()),this.loadSegment_(t))}}},{key:"checkBuffer_",value:function(t,e,i,n,r,a){var s=0,o=void 0;t.length&&(s=t.end(t.length-1));var u=Math.max(0,s-r);if(!e.segments.length)return null;if(u>=this.goalBufferLength_())return null;if(!n&&u>=1)return null;if(null===a)return i=this.getSyncSegmentCandidate_(e),this.generateSegmentInfo_(e,i,null,!0);if(null!==i){var l=e.segments[i];return o=l&&l.end?l.end:s,this.generateSegmentInfo_(e,i+1,o,!1)}if(this.fetchAtBuffer_){var c=ms.getMediaInfoForTime(e,s,a.segmentIndex,a.time);i=c.mediaIndex,o=c.startTime}else{var h=ms.getMediaInfoForTime(e,r,a.segmentIndex,a.time);i=h.mediaIndex,o=h.startTime}return this.generateSegmentInfo_(e,i,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(t){var e=this;if(-1===this.currentTimeline_)return 0;var i=t.segments.map(function(t,e){return{timeline:t.timeline,segmentIndex:e}}).filter(function(t){return t.timeline===e.currentTimeline_});return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(t.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(t,e,i,n){if(e<0||e>=t.segments.length)return null;var r=t.segments[e];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:e,isSyncRequest:n,startOfSegment:i,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(t){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3)return!1;var e=this.currentTime_(),i=t.bandwidth,n=this.pendingSegment_.duration,r=ms.estimateSegmentRequestTime(n,i,this.playlist_,t.bytesReceived),a=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((t.length?t.end(t.length-1):0)-e)/i}(this.buffered_(),e,this.hls_.tech_.playbackRate())-1;if(r<=a)return!1;var s=function(t){var e=t.master,i=t.currentTime,n=t.bandwidth,r=t.duration,a=t.segmentDuration,s=t.timeUntilRebuffer,o=t.currentTimeline,u=t.syncController,l=e.playlists.filter(function(t){return!ms.isIncompatible(t)}),c=l.filter(ms.isEnabled);c.length||(c=l.filter(function(t){return!ms.isDisabled(t)}));var h=c.filter(ms.hasAttribute.bind(null,"BANDWIDTH")).map(function(t){var e=u.getSyncPoint(t,r,o,i)?1:2;return{playlist:t,rebufferingImpact:ms.estimateSegmentRequestTime(a,n,t)*e-s}}),d=h.filter(function(t){return t.rebufferingImpact<=0});return Eo(d,function(t,e){return xo(e.playlist,t.playlist)}),d.length?d[0]:(Eo(h,function(t,e){return t.rebufferingImpact-e.rebufferingImpact}),h[0]||null)}({master:this.hls_.playlists.master,currentTime:e,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;return a<=1/30&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u?!1:(this.bandwidth=s.playlist.attributes.BANDWIDTH*mo.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(t,e){this.pendingSegment_&&e.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(e.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(t){this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),t.abortRequests=ko(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(t),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(t){var e=function(t,e,i){var n=void 0;return n=t.length&&t.start(0)>0&&t.start(0)<e?t.start(0):e-30,Math.min(n,e-i)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);e>0&&this.remove(0,e)}},{key:"createSimplifiedSegmentObj_",value:function(t){var e=t.segment,i={resolvedUri:e.resolvedUri,byterange:e.byterange,requestId:t.requestId};if(e.key){var n=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);i.key={resolvedUri:e.key.resolvedUri,iv:n}}return e.map&&(i.map=this.initSegment(e.map)),i}},{key:"segmentRequestFinished_",value:function(t,e){if(this.mediaRequests+=1,e.stats&&(this.mediaBytesTransferred+=e.stats.bytesReceived,this.mediaTransferDuration+=e.stats.roundTripTime),this.pendingSegment_){if(e.requestId===this.pendingSegment_.requestId){if(t)return this.pendingSegment_=null,this.state="READY",t.code===vo?void(this.mediaRequestsAborted+=1):(this.pause(),t.code===yo?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(t),void this.trigger("error")));this.bandwidth=e.stats.bandwidth,this.roundTrip=e.stats.roundTripTime,e.map&&(e.map=this.initSegment(e.map,!0)),this.processSegmentResponse_(e)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(t){var e=this.pendingSegment_;e.bytes=t.bytes,t.map&&(e.segment.map.bytes=t.map.bytes),e.endOfAllRequests=t.endOfAllRequests,t.fmp4Captions&&(!function(t,e,i){for(var n in i)if(!t[n]){e.trigger({type:"usage",name:"hls-608"});var r=e.textTracks().getTrackById(n);t[n]=r||e.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}(this.inbandTextTracks_,this.hls_.tech_,t.captionStreams),function(t){var e=t.inbandTextTracks,i=t.captionArray,n=t.timestampOffset;if(i){var r=window.WebKitDataCue||window.VTTCue;i.forEach(function(t){var i=t.stream,a=t.startTime,s=t.endTime;e[i]&&(a+=n,s+=n,e[i].addCue(new r(a,s,t.text)))})}}({inbandTextTracks:this.inbandTextTracks_,captionArray:t.fmp4Captions,timestampOffset:0}),this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_){var e=this.pendingSegment_,i=e.segment,n=this.syncController_.probeSegmentInfo(e);void 0===this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r=function(t,e,i){return"main"===t&&e&&i?i.containsAudio||i.containsVideo?e.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.":!e.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}(this.loaderType_,this.startingMedia_,n);if(r)return this.error({message:r,blacklistDuration:1/0}),void this.trigger("error");if(e.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==e.timestampOffset&&e.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(e.timestampOffset),this.trigger("timestampoffset"));var a=this.syncController_.mappingForTimeline(e.timeline);if(null!==a&&this.trigger({type:"segmenttimemapping",mapping:a}),this.state="APPENDING",i.map){var s=ws(i.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==s){var o=this.initSegment(i.map);this.sourceUpdater_.appendBuffer(o.bytes,function(){t.activeInitSegmentId_=s})}}e.byteLength=e.bytes.byteLength,"number"==typeof i.start&&"number"==typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.logger_(function(t){var e=t.segment,i=e.start,n=e.end,r=t.playlist,a=r.mediaSequence,s=r.id,o=r.segments,u=void 0===o?[]:o,l=t.mediaIndex,c=t.timeline;return["appending ["+l+"] of ["+a+", "+(a+u.length)+"] from playlist ["+s+"]","["+i+" => "+n+"] in timeline ["+c+"]"].join(" ")}(e)),this.sourceUpdater_.appendBuffer(e.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_,e=t.segment,i=null!==this.mediaIndex;(this.pendingSegment_=null,this.recordThroughput_(t),this.addSegmentMetadataCue_(t),this.state="READY",this.mediaIndex=t.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate"),e.end&&this.currentTime_()-e.end>3*t.playlist.targetDuration)?this.resetEverything():(i&&this.trigger("bandwidthupdate"),this.trigger("progress"),Ao(t.playlist,this.mediaSource_,t.mediaIndex+1)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(t){var e=this.throughput.rate,i=Date.now()-t.endOfAllRequests+1,n=Math.floor(t.byteLength/i*8*1e3);this.throughput.rate+=(n-e)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){if(this.segmentMetadataTrack_){var e=t.segment,i=e.start,n=e.end;if(Po(i)&&Po(n)){Os(i,n,this.segmentMetadataTrack_);var r=c.a.WebKitDataCue||c.a.VTTCue,a={bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.uri,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}}}]),e}(Ra.EventTarget),Oo=function(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))},Io=new Uint8Array("\n\n".split("").map(function(t){return t.charCodeAt(0)})),Uo=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fa(this,e);var n=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return n.mediaSource_=null,n.subtitlesTrack_=null,n}return Va(e,Lo),Ha(e,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return Ra.createTimeRanges();var t=this.subtitlesTrack_.cues,e=t[0].startTime,i=t[t.length-1].startTime;return Ra.createTimeRanges([[e,i]])}},{key:"initSegment",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return null;var i=ws(t),n=this.initSegments_[i];if(e&&!n&&t.bytes){var r=Io.byteLength+t.bytes.byteLength,a=new Uint8Array(r);a.set(t.bytes),a.set(Io,t.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:a}}return n||t}},{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(t){return void 0===t?this.subtitlesTrack_:(this.subtitlesTrack_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}},{key:"remove",value:function(t,e){Os(t,e,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var t=this;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=this.skipEmptySegments_(e)){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){return this.syncController_.one("timestampoffset",function(){t.state="READY",t.paused()||t.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}},{key:"skipEmptySegments_",value:function(t){for(;t&&t.segment.empty;)t=this.generateSegmentInfo_(t.playlist,t.mediaIndex+1,t.startOfSegment+t.duration,t.isSyncRequest);return t}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var e=this.pendingSegment_,i=e.segment;if("function"!=typeof c.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=function(){t.handleSegment_()};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",n),void this.subtitlesTrack_.tech_.one("vttjserror",function(){t.subtitlesTrack_.tech_.off("vttjsloaded",n),t.error({message:"Error loading vtt.js"}),t.state="READY",t.pause(),t.trigger("error")})}i.requested=!0;try{this.parseVTTCues_(e)}catch(t){return this.error({message:t.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(e,this.syncController_.timelines[e.timeline],this.playlist_),e.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");e.byteLength=e.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,e.cues.length&&this.remove(e.cues[0].endTime,e.cues[e.cues.length-1].endTime),e.cues.forEach(function(e){t.subtitlesTrack_.addCue(e)}),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(t){var e=void 0,i=!1;"function"==typeof c.a.TextDecoder?e=new c.a.TextDecoder("utf8"):(e=c.a.WebVTT.StringDecoder(),i=!0);var n=new c.a.WebVTT.Parser(c.a,c.a.vttjs,e);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=t.cues.push.bind(t.cues),n.ontimestampmap=function(e){return t.timestampmap=e},n.onparsingerror=function(t){Ra.log.warn("Error encountered when parsing cues: "+t.message)},t.segment.map){var r=t.segment.map.bytes;i&&(r=Oo(r)),n.parse(r)}var a=t.bytes;i&&(a=Oo(a)),n.parse(a),n.flush()}},{key:"updateTimeMapping_",value:function(t,e,i){var n=t.segment;if(e)if(t.cues.length){var r=t.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+e.mapping;if(t.cues.forEach(function(t){t.startTime+=a,t.endTime+=a}),!i.syncInfo){var s=t.cues[0].startTime,o=t.cues[t.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0}}]),e}(),Mo=function(t,e){for(var i=t.cues,n=0;n<i.length;n++){var r=i[n];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},Do=bt.a.inspect,Ro=[{name:"VOD",run:function(t,e,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0}}return null}},{name:"ProgramDateTime",run:function(t,e,i,n,r){if(!t.datetimeToDisplayTime)return null;var a=e.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+t.datetimeToDisplayTime,h=Math.abs(r-c);if(null!==o&&o<h)break;o=h,s={time:c,segmentIndex:u}}}return s}},{name:"Segment",run:function(t,e,i,n,r){var a=e.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===n&&void 0!==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(t,e,i,n,r){var a=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length)for(var s=null,o=0;o<e.discontinuityStarts.length;o++){var u=e.discontinuityStarts[o],l=e.discontinuitySequence+o+1,c=t.discontinuities[l];if(c){var h=Math.abs(r-c.time);if(null!==s&&s<h)break;(!a||null===s||s>=h)&&(s=h,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(t,e,i,n,r){return e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence}:null}}],No=function(t){function e(){Fa(this,e);var t=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.inspectCache_=void 0,t.timelines=[],t.discontinuities=[],t.datetimeToDisplayTime=null,t.logger_=ho("SyncController"),t}return Va(e,t),Ha(e,[{key:"getSyncPoint",value:function(t,e,i,n){var r=this.runStrategies_(t,e,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(t,e){if(!t||!t.segments)return null;var i=this.runStrategies_(t,e,t.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+ns(t,n.segmentIndex,0))}},{key:"runStrategies_",value:function(t,e,i,n){for(var r=[],a=0;a<Ro.length;a++){var s=Ro[a],o=s.run(this,t,e,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(t,e){for(var i=t[0].syncPoint,n=Math.abs(t[0].syncPoint[e.key]-e.value),r=t[0].strategy,a=1;a<t.length;a++){var s=Math.abs(t[a].syncPoint[e.key]-e.value);s<n&&(n=s,i=t[a].syncPoint,r=t[a].strategy)}return this.logger_("syncPoint for ["+e.key+": "+e.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+"]"),i}},{key:"saveExpiredSegmentInfo",value:function(t,e){for(var i=e.mediaSequence-t.mediaSequence-1;i>=0;i--){var n=t.segments[i];if(n&&void 0!==n.start){e.syncInfo={mediaSequence:t.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+e.syncInfo.time+", mediaSequence: "+e.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(t){if(!this.datetimeToDisplayTime&&t.segments&&t.segments.length&&t.segments[0].dateTimeObject){var e=t.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-e}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(t){var e=t.segment,i=t.playlist,n=void 0;return(n=e.map?this.probeMp4Segment_(t):this.probeTsSegment_(t))&&this.calculateSegmentTimeMapping_(t,n)&&(this.saveDiscontinuitySyncInfo_(t),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:e.start})),n}},{key:"probeMp4Segment_",value:function(t){var e=t.segment,i=yt.a.timescale(e.map.bytes),n=yt.a.startTime(i,t.bytes);return null!==t.timestampOffset&&(t.timestampOffset-=n),{start:n,end:n+e.duration}}},{key:"probeTsSegment_",value:function(t){var e=Do(t.bytes,this.inspectCache_),i=void 0,n=void 0;return e?(e.video&&2===e.video.length?(this.inspectCache_=e.video[1].dts,i=e.video[0].dtsTime,n=e.video[1].dtsTime):e.audio&&2===e.audio.length&&(this.inspectCache_=e.audio[1].dts,i=e.audio[0].dtsTime,n=e.audio[1].dtsTime),{start:i,end:n,containsVideo:e.video&&2===e.video.length,containsAudio:e.audio&&2===e.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(t){return void 0===this.timelines[t]?null:this.timelines[t].time}},{key:"mappingForTimeline",value:function(t){return void 0===this.timelines[t]?null:this.timelines[t].mapping}},{key:"calculateSegmentTimeMapping_",value:function(t,e){var i=t.segment,n=this.timelines[t.timeline];if(null!==t.timestampOffset)n={time:t.startOfSegment,mapping:t.startOfSegment-e.start},this.timelines[t.timeline]=n,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+t.timeline+": [time: "+n.time+"] [mapping: "+n.mapping+"]"),i.start=t.startOfSegment,i.end=e.end+n.mapping;else{if(!n)return!1;i.start=e.start+n.mapping,i.end=e.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(t){var e=t.playlist,i=t.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(e.discontinuityStarts&&e.discontinuityStarts.length)for(var n=0;n<e.discontinuityStarts.length;n++){var r=e.discontinuityStarts[n],a=e.discontinuitySequence+n+1,s=r-t.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?i.start-ns(e,t.mediaIndex,r):i.end+ns(e,t.mediaIndex+1,r),this.discontinuities[a]={time:u,accuracy:o}}}}}]),e}(Ra.EventTarget),Bo=new Fs("./decrypter-worker.worker.js",function(t,e){var i=this;!function(){var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":Bt(e))&&"function"!=typeof e?t:e},r=function(){var t=[[[],[],[],[],[]],[[],[],[],[],[]]],e=t[0],i=t[1],n=e[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=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(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)e[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)e[a]=e[a].slice(0),i[a]=i[a].slice(0);return t},a=null,s=function(){function e(i){t(this,e),a||(a=r()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var n=void 0,s=void 0,o=void 0,u=void 0,l=void 0,c=this._tables[0][4],h=this._tables[1],d=i.length,p=1;if(4!==d&&6!==d&&8!==d)throw new Error("Invalid aes key size");for(u=i.slice(0),l=[],this._key=[u,l],n=d;n<4*d+28;n++)o=u[n-1],(n%d==0||8===d&&n%d==4)&&(o=c[o>>>24]<<24^c[o>>16&255]<<16^c[o>>8&255]<<8^c[255&o],n%d==0&&(o=o<<8^o>>>24^p<<24,p=p<<1^283*(p>>7))),u[n]=u[n-d]^o;for(s=0;n;s++,n--)o=u[3&s?n:n-4],l[s]=n<=4||s<4?o:h[0][c[o>>>24]]^h[1][c[o>>16&255]]^h[2][c[o>>8&255]]^h[3][c[255&o]]}return e.prototype.decrypt=function(t,e,i,n,r,a){var s=this._key[1],o=t^s[0],u=n^s[1],l=i^s[2],c=e^s[3],h=void 0,d=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++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=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=h,u=d,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++],h=o,o=u,u=l,l=c,c=h},e}(),o=function(){function e(){t(this,e),this.listeners={}}return e.prototype.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.prototype.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t].splice(i,1),i>-1},e.prototype.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,n=0;n<i;++n)e[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=e.length,s=0;s<a;++s)e[s].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(t){this.on("data",function(e){t.push(e)})},e}(),u=function(e){function i(){t(this,i);var r=n(this,e.call(this,o));return r.jobs=[],r.delay=1,r.timeout_=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":Bt(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(i,e),i.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.prototype.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},i}(o),l=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},c=function(){function i(e,n,r,a){t(this,i);var s=i.STEP,o=new Int32Array(e.buffer),c=new Uint8Array(e.byteLength),h=0;for(this.asyncStream_=new u,this.asyncStream_.push(this.decryptChunk_(o.subarray(h,h+s),n,r,c)),h=s;h<o.length;h+=s)r=new Uint32Array([l(o[h-4]),l(o[h-3]),l(o[h-2]),l(o[h-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(h,h+s),n,r,c));this.asyncStream_.push(function(){a(null,function(t){return t.subarray(0,t.byteLength-t[t.byteLength-1])}(c))})}return i.prototype.decryptChunk_=function(t,e,i,n){return function(){var r=function(t,e,i){var n=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),r=new s(Array.prototype.slice.call(e)),a=new Uint8Array(t.byteLength),o=new Int32Array(a.buffer),u=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=void 0;for(u=i[0],c=i[1],h=i[2],d=i[3],y=0;y<n.length;y+=4)p=l(n[y]),f=l(n[y+1]),m=l(n[y+2]),g=l(n[y+3]),r.decrypt(p,f,m,g,o,y),o[y]=l(o[y]^u),o[y+1]=l(o[y+1]^c),o[y+2]=l(o[y+2]^h),o[y+3]=l(o[y+3]^d),u=p,c=f,h=m,d=g;return a}(t,e,i);n.set(r,t.byteOffset)}},e(i,null,[{key:"STEP",get:function(){return 32e3}}]),i}();new function(t){t.onmessage=function(e){var i=e.data,n=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength),r=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4),a=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new c(n,r,a,function(e,n){t.postMessage(function(t){var e={};return Object.keys(t).forEach(function(i){var n=t[i];ArrayBuffer.isView(n)?e[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[i]=n}),e}({source:i.source,decrypted:n}),[n.buffer])})}}(i)}()}),jo=function(t){var e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Fo=function(t,e){t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Ho=function(t,e){e.activePlaylistLoader=t,t.load()},Vo={AUDIO:function(t,e){return function(){var i=e.segmentLoaders[t],n=e.mediaTypes[t],r=e.blacklistCurrentPlaylist;Fo(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter(function(t){return t.default})[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Ra.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(t,e){return function(){var i=e.segmentLoaders[t],n=e.mediaTypes[t];Ra.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Fo(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},zo={AUDIO:function(t,e,i){if(e){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[t];e.on("loadedmetadata",function(){var t=e.media();a.playlist(t,r),(!n.paused()||t.endList&&"none"!==n.preload())&&a.load()}),e.on("loadedplaylist",function(){a.playlist(e.media(),r),n.paused()||a.load()}),e.on("error",Vo[t](t,i))}},SUBTITLES:function(t,e,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[t],s=i.mediaTypes[t];e.on("loadedmetadata",function(){var t=e.media();a.playlist(t,r),a.track(s.activeTrack()),(!n.paused()||t.endList&&"none"!==n.preload())&&a.load()}),e.on("loadedplaylist",function(){a.playlist(e.media(),r),n.paused()||a.load()}),e.on("error",Vo[t](t,i))}},qo=function(t,e){return function(i){return i.attributes[t]===e}},Go=function(t){return function(e){return e.resolvedUri===t}},Wo={AUDIO:function(t,e){var i=e.hls,n=e.sourceType,r=e.segmentLoaders[t],a=e.requestOptions.withCredentials,s=e.master,o=s.mediaGroups,u=s.playlists,l=e.mediaTypes[t],c=l.groups,h=l.tracks,d=e.masterPlaylistLoader;for(var p in o[t]&&0!==Object.keys(o[t]).length||(o[t]={main:{default:{default:!0}}}),o[t]){c[p]||(c[p]=[]);var f=u.filter(qo(t,p));for(var m in o[t][p]){var g=o[t][p][m];f.filter(Go(g.resolvedUri)).length&&delete g.resolvedUri;var y=void 0;if(y=g.resolvedUri?new Qa(g.resolvedUri,i,a):g.playlists&&"dash"===n?new co(g.playlists[0],i,a,d):null,g=Ra.mergeOptions({id:m,playlistLoader:y},g),zo[t](t,g.playlistLoader,e),c[p].push(g),void 0===h[m]){var v=new Ra.AudioTrack({id:m,kind:jo(g),enabled:!1,language:g.language,default:g.default,label:m});h[m]=v}}}r.on("error",Vo[t](t,e))},SUBTITLES:function(t,e){var i=e.tech,n=e.hls,r=e.sourceType,a=e.segmentLoaders[t],s=e.requestOptions.withCredentials,o=e.master.mediaGroups,u=e.mediaTypes[t],l=u.groups,c=u.tracks,h=e.masterPlaylistLoader;for(var d in o[t])for(var p in l[d]||(l[d]=[]),o[t][d])if(!o[t][d][p].forced){var f=o[t][d][p],m=void 0;if("hls"===r?m=new Qa(f.resolvedUri,n,s):"dash"===r&&(m=new co(f.playlists[0],n,s,h)),f=Ra.mergeOptions({id:p,playlistLoader:m},f),zo[t](t,f.playlistLoader,e),l[d].push(f),void 0===c[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",enabled:!1,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",Vo[t](t,e))},"CLOSED-CAPTIONS":function(t,e){var i=e.tech,n=e.master.mediaGroups,r=e.mediaTypes[t],a=r.groups,s=r.tracks;for(var o in n[t])for(var u in a[o]||(a[o]=[]),n[t][o]){var l=n[t][o][u];if(l.instreamId.match(/CC\d/)&&(a[o].push(Ra.mergeOptions({id:u},l)),void 0===s[u])){var c=i.addRemoteTextTrack({id:l.instreamId,kind:"captions",enabled:!1,language:l.language,label:u},!1).track;s[u]=c}}}},Yo={AUDIO:function(t,e){return function(){var i=e.mediaTypes[t].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(t,e){return function(){var i=e.mediaTypes[t].tracks;for(var n in i)if("showing"===i[n].mode)return i[n];return null}}},Xo=function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){Wo[e](e,t)});var e=t.mediaTypes,i=t.masterPlaylistLoader,n=t.tech,r=t.hls;["AUDIO","SUBTITLES"].forEach(function(i){e[i].activeGroup=function(t,e){return function(i){var n=e.masterPlaylistLoader,r=e.mediaTypes[t].groups,a=n.media();if(!a)return null;var s=null;return a.attributes[t]&&(s=r[a.attributes[t]]),s=s||r.main,void 0===i?s:null===i?null:s.filter(function(t){return t.id===i.id})[0]||null}}(i,t),e[i].activeTrack=Yo[i](i,t),e[i].onGroupChanged=function(t,e){return function(){var i=e.segmentLoaders,n=i[t],r=i.main,a=e.mediaTypes[t],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Fo(n,a),o&&(o.playlistLoader?(n.resyncLoader(),Ho(o.playlistLoader,a)):u&&r.resetEverything())}}(i,t),e[i].onTrackChanged=function(t,e){return function(){var i=e.segmentLoaders,n=i[t],r=i.main,a=e.mediaTypes[t],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Fo(n,a),o&&(o.playlistLoader?u!==o.playlistLoader?(n.track&&n.track(s),n.resetEverything(),Ho(o.playlistLoader,a)):Ho(o.playlistLoader,a):r.resetEverything())}}(i,t)});var a=e.AUDIO.activeGroup(),s=(a.filter(function(t){return t.default})[0]||a[0]).id;e.AUDIO.tracks[s].enabled=!0,e.AUDIO.onTrackChanged(),i.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(t){return e[t].onGroupChanged()})});var o=function(){e.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})};for(var u in n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),n.clearTracks("audio"),e.AUDIO.tracks)n.audioTracks().addTrack(e.AUDIO.tracks[u])},Ko=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:po,activeTrack:po,onGroupChanged:po,onTrackChanged:po}}),t},$o=void 0,Zo=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],Jo=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},Qo=function(t){function e(t){Fa(this,e);var i=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this)),n=t.url,r=t.withCredentials,a=t.tech,s=t.bandwidth,o=t.externHls,u=t.useCueTags,l=t.blacklistDuration,c=t.enableLowInitialPlaylist,h=t.sourceType,d=t.seekTo;if(!n)throw new Error("A non-empty playlist URL is required");$o=o,i.withCredentials=r,i.tech_=a,i.hls_=a.hls,i.seekTo_=d,i.sourceType_=h,i.useCueTags_=u,i.blacklistDuration=l,i.enableLowInitialPlaylist=c,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:i.withCredentials,timeout:null},i.mediaTypes_=Ko(),i.mediaSource=new Ra.MediaSource,i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_.bind(i)),i.seekable_=Ra.createTimeRanges(),i.hasPlayed_=function(){return!1},i.syncController_=new No(t),i.segmentMetadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new Bo,i.inbandTextTracks_={};var p={hls:i.hls_,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.mediaSource.duration},hasPlayed:function(){return i.hasPlayed_()},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:s,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_};return i.masterPlaylistLoader_="dash"===i.sourceType_?new co(n,i.hls_,i.withCredentials):new Qa(n,i.hls_,i.withCredentials),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new Lo(Ra.mergeOptions(p,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new Lo(Ra.mergeOptions(p,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new Uo(Ra.mergeOptions(p,{loaderType:"vtt"}),t),i.setupSegmentLoaderListeners_(),Zo.forEach(function(t){i[t+"_"]=Jo.bind(i,t)}),i.logger_=ho("MPC"),i.masterPlaylistLoader_.load(),i}return Va(e,t),Ha(e,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var t=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var e=t.masterPlaylistLoader_.media(),i=1.5*t.masterPlaylistLoader_.targetDuration*1e3;fs(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=i,e.endList&&"none"!==t.tech_.preload()&&(t.mainSegmentLoader_.playlist(e,t.requestOptions_),t.mainSegmentLoader_.load()),Xo({sourceType:t.sourceType_,segmentLoaders:{AUDIO:t.audioSegmentLoader_,SUBTITLES:t.subtitleSegmentLoader_,main:t.mainSegmentLoader_},tech:t.tech_,requestOptions:t.requestOptions_,masterPlaylistLoader:t.masterPlaylistLoader_,hls:t.hls_,master:t.master(),mediaTypes:t.mediaTypes_,blacklistCurrentPlaylist:t.blacklistCurrentPlaylist.bind(t)}),t.triggerPresenceUsage_(t.master(),e);try{t.setupSourceBuffers_()}catch(e){return Ra.log.warn("Failed to create SourceBuffers",e),t.mediaSource.endOfStream("decode")}t.setupFirstPlay(),t.trigger("selectedinitialmedia")}),this.masterPlaylistLoader_.on("loadedplaylist",function(){var e=t.masterPlaylistLoader_.media();if(!e){t.excludeUnsupportedVariants_();var i=void 0;return t.enableLowInitialPlaylist&&(i=t.selectInitialPlaylist()),i||(i=t.selectPlaylist()),t.initialMedia_=i,void t.masterPlaylistLoader_.media(t.initialMedia_)}if(t.useCueTags_&&t.updateAdCues_(e),t.mainSegmentLoader_.playlist(e,t.requestOptions_),t.updateDuration(),t.tech_.paused()||(t.mainSegmentLoader_.load(),t.audioSegmentLoader_&&t.audioSegmentLoader_.load()),!e.endList){var n=function(){var e=t.seekable();0!==e.length&&t.mediaSource.addSeekableRange_(e.start(0),e.end(0))};if(t.duration()!==1/0){t.tech_.one("durationchange",function e(){t.duration()===1/0?n():t.tech_.one("durationchange",e)})}else n()}}),this.masterPlaylistLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){t.mainSegmentLoader_.abort(),t.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var e=t.masterPlaylistLoader_.media(),i=1.5*t.masterPlaylistLoader_.targetDuration*1e3;fs(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=i,t.mainSegmentLoader_.playlist(e,t.requestOptions_),t.mainSegmentLoader_.load(),t.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var e=t.masterPlaylistLoader_.media();t.stuckAtPlaylistEnd_(e)&&(t.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),t.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){t.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})}},{key:"triggerPresenceUsage_",value:function(t,e){var i=t.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var a in i.AUDIO)for(var s in i.AUDIO[a]){i.AUDIO[a][s].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"}),$o.Playlist.isAes(e)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),$o.Playlist.isFmp4(e)&&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 t=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var e=t.selectPlaylist(),i=t.masterPlaylistLoader_.media(),n=t.tech_.buffered(),r=n.length?n.end(n.length-1)-t.tech_.currentTime():0,a=t.bufferLowWaterLine();(!i.endList||t.duration()<mo.MAX_BUFFER_LOW_WATER_LINE||e.attributes.BANDWIDTH<i.attributes.BANDWIDTH||r>=a)&&t.masterPlaylistLoader_.media(e),t.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){t.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("ended",function(){t.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(){t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)}),this.mainSegmentLoader_.on("reseteverything",function(){t.tech_.trigger("hls-reset")}),this.mainSegmentLoader_.on("segmenttimemapping",function(e){t.tech_.trigger({type:"hls-segment-time-mapping",mapping:e.mapping})}),this.audioSegmentLoader_.on("ended",function(){t.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:"smoothQualityChange_",value:function(){var t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var t=this,e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetEverything(function(){t.tech_.setCurrentTime(t.tech_.currentTime())}))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0)?this.seekTo_(t.end(t.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var t=this,e=this.masterPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_())return!1;if(!e.endList){var i=this.seekable();if(!i.length)return!1;if(Ra.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){t.trigger("firstplay"),t.seekTo_(i.end(0)),t.hasPlayed_=function(){return!0}}),!1;this.trigger("firstplay"),this.seekTo_(i.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(t){return Ra.log.warn("Failed to create Source Buffers",t),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var t=this.tech_.play();void 0!==t&&"function"==typeof t.then&&t.then(null,function(t){})}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var t=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?t&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),t&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(t){if(!this.seekable().length)return!1;var e=this.syncController_.getExpiredTime(t,this.mediaSource.duration);if(null===e)return!1;var i=$o.Playlist.playlistEnd(t,e),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=.1;var a=r.end(r.length-1);return a-n<=.1&&i-a<=.1}},{key:"blacklistCurrentPlaylist",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=void 0;if(n=e.playlist||this.masterPlaylistLoader_.media(),i=i||e.blacklistDuration||this.blacklistDuration,!n){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(t){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(ds).length;return r?(Ra.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)):(n.excludeUntil=Date.now()+1e3*i,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),t=this.selectPlaylist(),Ra.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(t))}},{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(t){var e=xs(this.tech_.buffered(),t);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?e&&e.length?t:(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:$o.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var t=void 0,e=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&0!==(t=$o.Playlist.seekable(i,n)).length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(i,this.mediaSource.duration)))return;if(0===(e=$o.Playlist.seekable(i,n)).length)return}e?e.start(0)>t.end(0)||t.start(0)>e.end(0)?this.seekable_=t:this.seekable_=Ra.createTimeRanges([[e.start(0)>t.start(0)?e.start(0):t.start(0),e.end(0)<t.end(0)?e.end(0):t.end(0)]]):this.seekable_=t,this.logger_("seekable updated ["+Ps(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var t=this,e=this.mediaSource.duration,i=$o.Playlist.duration(this.masterPlaylistLoader_.media()),n=this.tech_.buffered(),r=function e(){t.mediaSource.duration=i,t.tech_.trigger("durationchange"),t.mediaSource.removeEventListener("sourceopen",e)};n.length>0&&(i=Math.max(i,n.end(n.length-1))),e!==i&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",r):r())}},{key:"dispose",value:function(){var t=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach(function(e){var i=t.mediaTypes_[e].groups;for(var n in i)i[n].forEach(function(t){t.playlistLoader&&t.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 t,e=this.masterPlaylistLoader_.media();if(e&&"open"===this.mediaSource.readyState){if((t=$s(this.masterPlaylistLoader_.master,e)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(t),this.excludeIncompatibleVariants_(e)}}},{key:"configureLoaderMimeTypes_",value:function(t){var e=t.length>1&&-1===t[0].indexOf(",")&&t[0]!==t[1]?new Ra.EventTarget:null;this.mainSegmentLoader_.mimeType(t[0],e),t[1]&&this.audioSegmentLoader_.mimeType(t[1],e)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach(function(t){t.attributes.CODECS&&c.a.MediaSource&&c.a.MediaSource.isTypeSupported&&!c.a.MediaSource.isTypeSupported('video/mp4; codecs="'+function(t){return t.replace(/avc1\.(\d+)\.(\d+)/i,function(t){return Ys([t])[0]})}(t.attributes.CODECS)+'"')&&(t.excludeUntil=1/0)})}},{key:"excludeIncompatibleVariants_",value:function(t){var e=2,i=null,n=void 0;t.attributes.CODECS&&(n=Xs(t.attributes.CODECS),i=n.videoCodec,e=n.codecCount),this.master().playlists.forEach(function(t){var n={codecCount:2,videoCodec:null};t.attributes.CODECS&&(n=Xs(t.attributes.CODECS)),n.codecCount!==e&&(t.excludeUntil=1/0),n.videoCodec!==i&&(t.excludeUntil=1/0)})}},{key:"updateAdCues_",value:function(t){var e=0,i=this.seekable();i.length&&(e=i.start(0)),function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t.segments)for(var n=i,r=void 0,a=0;a<t.segments.length;a++){var s=t.segments[a];if(r||(r=Mo(e,n+s.duration/2)),r){if("cueIn"in s){r.endTime=n,r.adEndTime=n,n+=s.duration,r=null;continue}if(n<r.endTime){n+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&((r=new c.a.VTTCue(n,n+s.duration,s.cueOut)).adStartTime=n,r.adEndTime=n+parseFloat(s.cueOut),e.addCue(r)),"cueOutCont"in s){var o,u,l=s.cueOutCont.split("/").map(parseFloat),h=qa(l,2);o=h[0],u=h[1],(r=new c.a.VTTCue(n,n+s.duration,"")).adStartTime=n-o,r.adEndTime=r.adStartTime+u,e.addCue(r)}n+=s.duration}}(t,this.cueTagsTrack_,e)}},{key:"goalBufferLength",value:function(){var t=this.tech_.currentTime(),e=mo.GOAL_BUFFER_LENGTH,i=mo.GOAL_BUFFER_LENGTH_RATE,n=Math.max(e,mo.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,n)}},{key:"bufferLowWaterLine",value:function(){var t=this.tech_.currentTime(),e=mo.BUFFER_LOW_WATER_LINE,i=mo.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(e,mo.MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,n)}}]),e}(Ra.EventTarget),tu=function t(e,i,n){Fa(this,t);var r=e.masterPlaylistController_.fastQualityChange_.bind(e.masterPlaylistController_);if(i.attributes.RESOLUTION){var a=i.attributes.RESOLUTION;this.width=a.width,this.height=a.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=n,this.enabled=function(t,e,i){return function(n){var r=t.master.playlists[e],a=hs(r),s=ds(r);return void 0===n?s:(n?delete r.disabled:r.disabled=!0,n===s||a||(i(),n?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),n)}}(e.playlists,i.uri,r)},eu=["seeking","seeked","pause","playing","error"],iu=function(){function t(e){var i=this;Fa(this,t),this.tech_=e.tech,this.seekable=e.seekable,this.seekTo=e.seekTo,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=ho("PlaybackWatcher"),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.techWaiting_()},a=function(){return i.cancelTimer_()},s=function(){return i.fixesBadSeeks_()};this.tech_.on("seekablechanged",s),this.tech_.on("waiting",r),this.tech_.on(eu,a),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",s),i.tech_.off("waiting",r),i.tech_.off(eu,a),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&c.a.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}return Ha(t,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&c.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=c.a.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 t=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+.1>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&t===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):t===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=t)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var t=this.tech_.seeking(),e=this.seekable(),i=this.tech_.currentTime(),n=void 0;t&&this.afterSeekableWindow_(e,i)&&(n=e.end(e.length-1));t&&this.beforeSeekableWindow_(e,i)&&(n=e.start(0)+.1);return void 0!==n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Ps(e)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var t=this.tech_.currentTime(),e=this.tech_.buffered(),i=xs(e,t);return i.length&&t+3<=i.end(0)?(this.cancelTimer_(),this.seekTo(t),this.logger_("Stopped at "+t+" 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 t=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(t,e)){var i=t.end(t.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.seekTo(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),r=As(n,e);if(this.videoUnderflow_(r,n,e))return this.cancelTimer_(),this.seekTo(e),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(r.length>0){var a=r.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+a+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,e),!0}return!1}},{key:"afterSeekableWindow_",value:function(t,e){return!!t.length&&e>t.end(t.length-1)+.1}},{key:"beforeSeekableWindow_",value:function(t,e){return!!(t.length&&t.start(0)>0&&e<t.start(0)-.1)}},{key:"videoUnderflow_",value:function(t,e,i){if(0===t.length){var n=this.gapFromVideoUnderflow_(e,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(t){var e=this.tech_.buffered(),i=this.tech_.currentTime(),n=As(e,i);this.cancelTimer_(),0!==n.length&&i===t&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",n.start(0)),this.seekTo(n.start(0)+1/30),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(t,e){for(var i=function(t){if(t.length<2)return Ra.createTimeRanges();for(var e=[],i=1;i<t.length;i++){var n=t.end(i-1),r=t.start(i);e.push([n,r])}return Ra.createTimeRanges(e)}(t),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(e-r<4&&e-r>2)return{start:r,end:a}}return null}}]),t}(),nu={errorInterval:30,getSource:function(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},ru=function(t){!function t(e,i){var n=0,r=0,a=Ra.mergeOptions(nu,i);e.ready(function(){e.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){r&&e.currentTime(r)},o=function(t){null!==t&&void 0!==t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",s),e.src(t),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())},u=function(){if(Date.now()-n<1e3*a.errorInterval)e.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(a.getSource&&"function"==typeof a.getSource)return n=Date.now(),a.getSource.call(e,o);Ra.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function t(){e.off("loadedmetadata",s),e.off("error",u),e.off("dispose",t)};e.on("error",u),e.on("dispose",l),e.reloadSourceOnError=function(i){l(),t(e,i)}}(this,t)};Ra.use("*",function(t){return{setSource:function(t,e){e(null,t)},setCurrentTime:function(e){return t.vhs&&t.currentSource().src===t.vhs.source_.src&&t.vhs.setCurrentTime(e),e}}});var au={PlaylistLoader:Qa,Playlist:ms,Decrypter:Ot,AsyncStream:At,decrypt:Lt,utils:Cs,STANDARD_PLAYLIST_SELECTOR:function(){return function(t,e,i,n){var r=t.playlists.map(function(t){var e,i;return e=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,i=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height,{bandwidth:t.attributes.BANDWIDTH||c.a.Number.MAX_VALUE,width:e,height:i,playlist:t}});Eo(r,function(t,e){return t.bandwidth-e.bandwidth});var a=(r=r.filter(function(t){return!ms.isIncompatible(t.playlist)})).filter(function(t){return ms.isEnabled(t.playlist)});a.length||(a=r.filter(function(t){return!ms.isDisabled(t.playlist)}));var s=a.filter(function(t){return t.bandwidth*mo.BANDWIDTH_VARIANCE<e}),o=s[s.length-1],u=s.filter(function(t){return t.bandwidth===o.bandwidth})[0],l=s.filter(function(t){return t.width&&t.height});Eo(l,function(t,e){return t.width-e.width});var h=l.filter(function(t){return t.width===i&&t.height===n});o=h[h.length-1];var d=h.filter(function(t){return t.bandwidth===o.bandwidth})[0],p=void 0,f=void 0,m=void 0;d||(f=(p=l.filter(function(t){return t.width>i||t.height>n})).filter(function(t){return t.width===p[0].width&&t.height===p[0].height}),o=f[f.length-1],m=f.filter(function(t){return t.bandwidth===o.bandwidth})[0]);var g=m||d||u||a[0]||r[0];return g?g.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(Co(this.tech_.el(),"width"),10),parseInt(Co(this.tech_.el(),"height"),10))},INITIAL_PLAYLIST_SELECTOR:function(){var t=this.playlists.master.playlists.filter(ms.isEnabled);return Eo(t,function(t,e){return xo(t,e)}),t.filter(function(t){return Xs(t.attributes.CODECS).videoCodec})[0]||null},comparePlaylistBandwidth:xo,comparePlaylistResolution:function(t,e){var i=void 0,n=void 0;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||c.a.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),i===(n=n||c.a.Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-n},xhr:vs()};["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(t){Object.defineProperty(au,t,{get:function(){return Ra.log.warn("using Hls."+t+" is UNSAFE be sure you know what you are doing"),mo[t]},set:function(e){Ra.log.warn("using Hls."+t+" is UNSAFE be sure you know what you are doing"),"number"!=typeof e||e<0?Ra.log.warn("value of Hls."+t+" must be greater than or equal to 0"):mo[t]=e}})});var su=function(t){if(/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(t))return"hls";return/^application\/dash\+xml/i.test(t)?"dash":null},ou=function(t,e){for(var i=e.media(),n=-1,r=0;r<t.length;r++)if(t[r].id===i.uri){n=r;break}t.selectedIndex_=n,t.trigger({selectedIndex:n,type:"change"})};au.canPlaySource=function(){return Ra.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var uu=function(t){if("dash"===t.options_.sourceType){var e=Ra.players[t.tech_.options_.playerId];if(e.eme){var i=function(t,e,i){if(!t)return t;var n={};for(var r in t)n[r]={audioContentType:'audio/mp4; codecs="'+i.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+e.attributes.CODECS+'"'},e.contentProtection&&e.contentProtection[r]&&e.contentProtection[r].pssh&&(n[r].pssh=e.contentProtection[r].pssh),"string"==typeof t[r]&&(n[r].url=t[r]);return Ra.mergeOptions(t,n)}(t.source_.keySystems,t.playlists.media(),t.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());i&&(e.currentSource().keySystems=i)}}};au.supportsNativeHls=function(){var t=d.a.createElement("video");if(!Ra.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(t.canPlayType(e))})}(),au.supportsNativeDash=!!Ra.getTech("Html5").isSupported()&&/maybe|probably/i.test(d.a.createElement("video").canPlayType("application/dash+xml")),au.supportsTypeNatively=function(t){return"hls"===t?au.supportsNativeHls:"dash"===t&&au.supportsNativeDash},au.isSupported=function(){return Ra.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var lu=Ra.getComponent("Component"),cu=function(t){function e(t,i,n){Fa(this,e);var r=za(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,i,n.hls));if(i.options_&&i.options_.playerId){var a=Ra(i.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return Ra.log.warn("player.hls is deprecated. Use player.tech().hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),r}}),a.vhs=r,a.dash=r}if(r.tech_=i,r.source_=t,r.stats={},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(d.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(t){var e=d.a.fullscreenElement||d.a.webkitFullscreenElement||d.a.mozFullScreenElement||d.a.msFullscreenElement;e&&e.contains(r.tech_.el())&&r.masterPlaylistController_.smoothQualityChange_()}),r.on(r.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),r.on(r.tech_,"play",r.play),r}return Va(e,lu),Ha(e,[{key:"setOptions_",value:function(){var t=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=4194304),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&4194304===this.options_.bandwidth,["withCredentials","bandwidth"].forEach(function(e){void 0!==t.source_[e]&&(t.options_[e]=t.source_[e])}),this.bandwidth=this.options_.bandwidth}},{key:"src",value:function(t,e){var i=this;t&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=au,this.options_.sourceType=su(e),this.options_.seekTo=function(t){i.tech_.setCurrentTime(t),i.setCurrentTime(t)},this.masterPlaylistController_=new Qo(this.options_),this.playbackWatcher_=new iu(Ra.mergeOptions(this.options_,{seekable:function(){return i.seekable()}})),this.masterPlaylistController_.on("error",function(){Ra.players[i.tech_.options_.playerId].error(i.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):au.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=au.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(t){this.masterPlaylistController_.selectPlaylist=t.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(t){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=t,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(t){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=t,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var t=1/(this.bandwidth||1),e=void 0;return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Ra.log.error('The "systemBandwidth" property is read-only')}}}),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},buffered:{get:function(){return Ls(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 Ls(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.masterPlaylistController_.on("selectedinitialmedia",function(){!function(t){var e=t.playlists;t.representations=function(){return e.master.playlists.filter(function(t){return!hs(t)}).map(function(e,i){return new tu(t,e,e.uri)})}}(i),uu(i)}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.tech_.ready(function(){return i.setupQualityLevels_()}),this.tech_.el()&&this.tech_.src(Ra.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var t=this,e=Ra.players[this.tech_.options_.playerId];e&&e.qualityLevels&&(this.qualityLevels_=e.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(t,e){e.representations().forEach(function(e){t.addQualityLevel(e)}),ou(t,e.playlists)}(t.qualityLevels_,t)}),this.playlists.on("mediachange",function(){ou(t.qualityLevels_,t.playlists)}))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(t){this.masterPlaylistController_.setCurrentTime(t)}},{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(),function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,i,n)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(n):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"dispose",this).call(this)}}]),e}(),hu={name:"videojs-http-streaming",VERSION:"1.2.4",canHandleSource:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ra.mergeOptions(Ra.options,e);return hu.canPlayType(t.type,i)},handleSource:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ra.mergeOptions(Ra.options,i);return e.hls=new cu(t,e,n),e.hls.xhr=vs(),e.hls.src(t.src,t.type),e.hls},canPlayType:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ra.mergeOptions(Ra.options,e).hls.overrideNative,n=su(t);return n&&(!au.supportsTypeNatively(n)||i)?"maybe":""}};void 0!==Ra.MediaSource&&void 0!==Ra.URL||(Ra.MediaSource=ao,Ra.URL=so),ao.supportsNativeMediaSources()&&Ra.getTech("Html5").registerSourceHandler(hu,0),Ra.HlsHandler=cu,Ra.HlsSourceHandler=hu,Ra.Hls=au,Ra.use||Ra.registerComponent("Hls",au),Ra.options.hls=Ra.options.hls||{},Ra.registerPlugin?Ra.registerPlugin("reloadSourceOnError",ru):Ra.plugin("reloadSourceOnError",ru);var du,pu,fu=Ra;i(52);!function(t,e,i){fu.registerPlugin("pannellum",function(e){var n=this,r=n.el(),a=r.getElementsByTagName("video")[0],s=t.createElement("div");(e=e||{}).type="equirectangular",e.dynamic=!0,e.showZoomCtrl=!1,e.showFullscreenCtrl=!1,e.autoLoad=!0,e.panorama=a,s.style.visibility="hidden",n.pnlmViewer=i.viewer(s,e),r.insertBefore(s,r.firstChild),a.style.display="none",n.on("play",function(){a.readyState>1&&n.pnlmViewer.setUpdate(!0)}),n.on("canplay",function(){n.paused()||n.pnlmViewer.setUpdate(!0)}),n.on("pause",function(){n.pnlmViewer.setUpdate(!1)}),n.on("loadeddata",function(){s.style.visibility="visible"}),n.on("seeking",function(){n.paused()&&n.pnlmViewer.setUpdate(!0)}),n.on("seeked",function(){n.paused()&&n.pnlmViewer.setUpdate(!1)})})}(document,0,pannellum);var mu=(pu=du=function(t){function e(i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i));return n.renderVideo=function(t){var e=n.props.children,i=[].concat(e),r=[];if(Array.isArray(i)&&i.map(function(t){switch(t.props.type){case"info":return r.push({id:Math.random().toString(36).substr(2,9),type:t.props.type,pitch:t.props.pitch?t.props.pitch:10,yaw:t.props.yaw?t.props.yaw:10,text:t.props.text?t.props.text:"",URL:t.props.URL?t.props.URL:""});case"custom":return r.push({id:Math.random().toString(36).substr(2,9),pitch:t.props.pitch?t.props.pitch:10,yaw:t.props.yaw?t.props.yaw:10,cssClass:t.props.cssClass?t.props.cssClass:"tooltipcss",createTooltipFunc:t.props.tooltip?t.props.tooltip:n.hotspotTooltip,createTooltipArgs:t.props.tooltipArg?t.props.tooltipArg:{},clickHandlerFunc:t.props.handleClick?t.props.handleClick:n.handleClickHotspot,clickHandlerArgs:t.props.handleClickArg?t.props.handleClickArg:{name:"test"}});default:return[]}}),"update"===t){n.video=fu(n.videoNode);var a=[].concat(n.video.pnlmViewer.getConfig().hotSpots);return n.video.pnlmViewer.setYaw(n.props.yaw),n.video.pnlmViewer.setPitch(n.props.pitch),n.video.pnlmViewer.setHfov(n.props.hfov),n.video.pnlmViewer.setHfovBounds([n.props.minHfov,n.props.maxHfov]),a.map(function(t){return n.video.pnlmViewer.removeHotSpot(t.id)}),r.map(function(t){return n.video.pnlmViewer.addHotSpot(t)}),n.video.src({type:"video/mp4",src:n.props.video}),n.video.play()}n.video=fu(n.videoNode,{loop:n.props.loop,autoplay:n.props.autoplay,controls:n.props.controls,muted:n.props.muted,plugins:{pannellum:{yaw:n.props.yaw,pitch:n.props.pitch,hfov:n.props.hfov,minHfov:n.props.minHfov,maxHfov:n.props.maxHfov,minPitch:n.props.minPitch,maxPitch:n.props.maxPitch,minYaw:n.props.minYaw,maxYaw:n.props.maxYaw,hotSpotDebug:n.props.hotspotDebug,autoRotate:n.props.autoRotate,mouseZoom:n.props.mouseZoom,hotSpots:r}}}),n.video.src({type:"video/mp4",src:n.props.video}),n.video.play()},n.componentDidMount=function(){n.renderVideo("mount")},n.handleClickHotspot=function(t,e){console.log("hotspot clicked",e.name)},n.hotspotTooltip=function(t,e){t.setAttribute("id","textInfo");var i=document.createElement("div");i.classList.add("hotspot");var n=document.createElement("div");n.classList.add("out");var r=document.createElement("div");r.classList.add("in"),document.createElement("div").classList.add("image"),t.appendChild(i),i.appendChild(r),i.appendChild(n)},n.getViewer=function(){return n.video.pnlmViewer},n.state={id:Math.random().toString(36).substr(2,9)},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidUpdate=function(t){this.renderVideo("update")},e.prototype.componentWillUnmount=function(){fu(this.videoNode).dispose()},e.prototype.render=function(){var t=this,e=this.props,i=e.width,n=e.height,r=(e.video,{width:i,height:n});return s.a.createElement("div",{"data-vjs-player":!0},s.a.createElement("video",{id:this.props.id?this.props.id:this.state.id,className:"video-js vjs-default-skin vjs-big-play-centered",ref:function(e){return t.videoNode=e},preload:"none",crossOrigin:"anonymous",style:r}))},e}(a.Component),du.defaultProps={children:[],width:"100%",height:"400px",video:"",yaw:0,pitch:0,hfov:100,minHfov:50,maxHfov:150,minPitch:-90,maxPitch:90,minYaw:-180,maxYaw:180,hotspotDebug:!1,autoRotate:0,mouseZoom:!0,loop:!1,autoplay:!0,controls:!1,muted:!0},pu);i.d(e,"Pannellum",function(){return u}),i.d(e,"PannellumVideo",function(){return mu})}]).default});
  //# sourceMappingURL=pannellum-react.min.js.map