/*! videojs-contrib-hls - v0.17.1 - 2015-06-08 * Copyright (c) 2015 Brightcove; Licensed */ !function(a,b,c,d){"use strict";var e,f,g,h=1.1,i=500;f=function(a){return a.retries&&a.retries>=2},b.Hls=b.Flash.extend({init:function(a,c,d){var e=c.source,f=a.options();a.hls=this,delete c.source,c.swf=f.flash.swf,b.Flash.call(this,a,c,d),c.source=e,this.bytesReceived=0,this.currentTime=b.Hls.prototype.currentTime,this.setCurrentTime=b.Hls.prototype.setCurrentTime,this.segmentBuffer_=[],this.startCheckingBuffer_(),b.Hls.prototype.src.call(this,c.source&&c.source.src)}}),b.options.techOrder.unshift("hls"),b.Hls.GOAL_BUFFER_LENGTH=30,b.Hls.prototype.src=function(a){var c,f,g,h=this,i=this.player(),j=i.options().hls||{};a&&(this.src_&&this.resetSrc_(),this.src_=a,c=new b.MediaSource,g={src:b.URL.createObjectURL(c),type:"video/flv"},this.mediaSource=c,this.segmentBuffer_=[],this.segmentParser_=new b.Hls.SegmentParser,this.setupMetadataCueTranslation_(),this.mediaSource.addEventListener("sourceopen",b.bind(this,this.handleSourceOpen)),this.playlists&&this.playlists.dispose(),this.mediaIndex=0,this.playlists=new b.Hls.PlaylistLoader(this.src_,j.withCredentials),this.playlists.on("loadedmetadata",b.bind(this,function(){var a,c,e,g,h,j,k,l;k=function(){this.fillBuffer(),i.trigger("loadedmetadata")},f=this.playlists.media(),this.bandwidth===d&&this.setBandwidth({bandwidth:5*this.playlists.bandwidth}),a=this.selectPlaylist(),e=f.attributes&&f.attributes.BANDWIDTH||0,g=a.attributes&&a.attributes.BANDWIDTH||0,h=f.segments&&f.segments[this.mediaIndex].duration||f.targetDuration,j=h*g/this.bandwidth,j||(j=1/0),l=10,g>e&&l>=j?(this.playlists.media(a),c=b.bind(this,function(){k.call(this),this.playlists.off("loadedplaylist",c)}),this.playlists.on("loadedplaylist",c)):k.call(this)})),this.playlists.on("error",b.bind(this,function(){i.error(this.playlists.error)})),this.playlists.on("loadedplaylist",b.bind(this,function(){var a=this.playlists.media();a&&(this.updateDuration(this.playlists.media()),this.mediaIndex=b.Hls.translateMediaIndex(this.mediaIndex,f,a),f=a,this.fetchKeys_())})),this.playlists.on("mediachange",b.bind(this,function(){e&&this.cancelKeyXhr(),i.trigger("mediachange")})),this.player().ready(function(){h.el()&&h.el().vjs_src(g.src)}))},b.Hls.getMediaIndexForLive_=function(a){if(!a.segments)return 0;for(var b=a.segments.length,c=0,d=3*(a.targetDuration||10);d>c&&b>0;)c+=a.segments[b-1].duration,b--;return b},b.Hls.prototype.handleSourceOpen=function(){var a=this.player(),b=this.mediaSource.addSourceBuffer('video/flv; codecs="vp6,aac"');this.sourceBuffer=b,a.options().autoplay&&a.play(),b.appendBuffer(this.segmentParser_.getFlvHeader())},b.Hls.prototype.setupMetadataCueTranslation_=function(){var c,d=this,e=d.segmentParser_.metadataStream;d.player().addTextTrack&&(e.on("data",function(f){var g,h,i,j,k,l,m;if(!c)for(c=d.player().addTextTrack("metadata","Timed Metadata"),c.inBandMetadataTrackDispatchType=b.Hls.SegmentParser.STREAM_TYPES.metadata.toString(16).toUpperCase(),g=0;g=e&&c.removeCue(c.cues[f])}))},b.Hls.prototype.play=function(){var a;return this.ended()&&(this.mediaIndex=0),this.duration()===1/0&&this.playlists.media()&&!this.player().hasClass("vjs-has-started")&&(a=this.playlists.media(),this.mediaIndex=b.Hls.getMediaIndexForLive_(a),this.setCurrentTime(b.Hls.Playlist.seekable(a).end(0))),b.Flash.prototype.play.apply(this,arguments)},b.Hls.prototype.currentTime=function(){return this.lastSeekedTime_?this.lastSeekedTime_:this.el()&&this.el().vjs_getProperty?this.el().vjs_getProperty("currentTime"):0},b.Hls.prototype.setCurrentTime=function(a){return this.playlists&&this.playlists.media()&&this.playlists.media().segments?(this.lastSeekedTime_=a,this.mediaIndex=b.Hls.getMediaIndexByTime(this.playlists.media(),a),this.sourceBuffer.abort(),this.cancelSegmentXhr(),e&&(e.aborted=!0,this.cancelKeyXhr()),this.segmentBuffer_=[],void this.fillBuffer(1e3*a)):0},b.Hls.prototype.duration=function(){var a=this.playlists;return a?b.Hls.Playlist.duration(a.media()):0},b.Hls.prototype.seekable=function(){var a,c,d;return this.playlists&&(d=this.playlists.media())?(a=b.Hls.Playlist.seekable(d),c=this.playlists.expiredPostDiscontinuity_-this.playlists.expiredPreDiscontinuity_,b.createTimeRange(c,c+(a.end(0)-a.start(0)))):b.createTimeRange()},b.Hls.prototype.updateDuration=function(a){var c=this.player(),d=c.duration(),e=b.Hls.Playlist.duration(a);d!==e&&c.trigger("durationchange")},b.Hls.prototype.resetSrc_=function(){this.cancelSegmentXhr(),this.cancelKeyXhr(),this.sourceBuffer&&this.sourceBuffer.abort()},b.Hls.prototype.cancelKeyXhr=function(){e&&(e.onreadystatechange=null,e.abort(),e=null)},b.Hls.prototype.cancelSegmentXhr=function(){this.segmentXhr_&&(this.segmentXhr_.onreadystatechange=null,this.segmentXhr_.abort(),this.segmentXhr_=null)},b.Hls.prototype.dispose=function(){this.stopCheckingBuffer_(),this.playlists&&this.playlists.dispose(),this.resetSrc_(),b.Flash.prototype.dispose.call(this)},b.Hls.prototype.selectPlaylist=function(){var a,c,d,e,f,g,i=this.player(),j=this.playlists.master.playlists.slice(),k=[],l=j.length;for(j.sort(b.Hls.comparePlaylistBandwidth);l--;)c=j[l],c.attributes&&c.attributes.BANDWIDTH&&(a=c.attributes.BANDWIDTH*h,a=b.Hls.GOAL_BUFFER_LENGTH||(d=this.playlistUriToUrl(c.uri),this.loadSegment(d,a)))))},b.Hls.prototype.playlistUriToUrl=function(a){var b;return b=this.playlists.media().uri===this.src_?g(this.src_,a):g(g(this.src_,this.playlists.media().uri||""),a)},b.Hls.prototype.setBandwidth=function(a){var b=this;b.segmentXhrTime=a.roundTripTime,b.bandwidth=a.bandwidth,b.bytesReceived+=a.bytesReceived||0,b.trigger("bandwidthupdate")},b.Hls.prototype.loadSegment=function(a,c){var d=this,e=this.player(),f=e.options().hls||{};this.segmentXhr_=b.Hls.xhr({url:a,responseType:"arraybuffer",withCredentials:f.withCredentials},function(a,b){var f;return d.segmentXhr_=null,a?"timeout"===a?(d.bandwidth=1,d.playlists.media(d.selectPlaylist())):(d.error={status:this.status,message:"HLS segment request error at URL: "+b,code:this.status>=500?4:2},void d.mediaIndex++):void(this.response&&(d.setBandwidth(this),f={mediaIndex:d.mediaIndex,playlist:d.playlists.media(),offset:c,bytes:null,encryptedBytes:null,decrypter:null},f.playlist.segments[f.mediaIndex].key?f.encryptedBytes=new Uint8Array(this.response):f.bytes=new Uint8Array(this.response),d.segmentBuffer_.push(f),e.trigger("progress"),d.drainBuffer(),d.mediaIndex++,d.playlists.media(d.selectPlaylist())))})},b.Hls.prototype.drainBuffer=function(a){var c,d,e,g,h,i,j,k,l,m,n=0,o=0,p=this.segmentBuffer_;if(p.length&&this.sourceBuffer&&!this.sourceBuffer.updating){if(c=p[0],d=c.mediaIndex,e=c.playlist,g=c.offset,i=c.bytes,j=e.segments[d],j.key&&!i)return f(j.key)?p.shift():j.key.bytes?c.decrypter?void 0:(l=j.key.iv||new Uint32Array([0,0,0,d+e.mediaSequence]),k=new b.Hls.Decrypter(c.encryptedBytes,j.key.bytes,l,function(a,b){c.bytes=b}),void(c.decrypter=k)):this.fetchKeys_();for(a=a||{},o=this.playlists.expiredPreDiscontinuity_,o+=this.playlists.expiredPostDiscontinuity_,o+=b.Hls.Playlist.duration(e,e.mediaSequence,e.mediaSequence+d),o*=1e3,j.discontinuity?(this.segmentParser_.mediaTimelineOffset=.001*o,this.segmentParser_.timestampOffset=null):null===this.segmentParser_.mediaTimelineOffset&&(this.segmentParser_.mediaTimelineOffset=.001*o),this.segmentParser_.parseSegmentBinaryData(i),this.segmentParser_.flushTags(),h=[];this.segmentParser_.tagsAvailable();)h.push(this.segmentParser_.getNextTag());if(h.length>0&&(j.preciseDuration=.001*b.Hls.FlvTag.durationFromTags(h)),this.updateDuration(this.playlists.media()),"number"==typeof g){for(m=g-o+h[0].pts;h[n].ptsd.segments.length||0>e?b.Hls.getMediaIndexForLive_(d)+1:e):0},b.Hls.getMediaIndexByTime=function(a,b){var c,d,e,f;for(e=[],c=0;c=e[d].start&&bc;c++)d+=a.segments[c].duration;return d},b.Hls.comparePlaylistBandwidth=function(b,c){var d,e;return b.attributes&&b.attributes.BANDWIDTH&&(d=b.attributes.BANDWIDTH),d=d||a.Number.MAX_VALUE,c.attributes&&c.attributes.BANDWIDTH&&(e=c.attributes.BANDWIDTH),e=e||a.Number.MAX_VALUE,d-e},b.Hls.comparePlaylistResolution=function(b,c){var d,e;return b.attributes&&b.attributes.RESOLUTION&&b.attributes.RESOLUTION.width&&(d=b.attributes.RESOLUTION.width),d=d||a.Number.MAX_VALUE,c.attributes&&c.attributes.RESOLUTION&&c.attributes.RESOLUTION.width&&(e=c.attributes.RESOLUTION.width),e=e||a.Number.MAX_VALUE,d===e&&b.attributes.BANDWIDTH&&c.attributes.BANDWIDTH?b.attributes.BANDWIDTH-c.attributes.BANDWIDTH:d-e},g=b.Hls.resolveUrl=function(a,b){var d,e,f=c.querySelector("base"),g=c.querySelector("head"),h=c.createElement("a"),i=f;return f?d=f.href:i=g.appendChild(c.createElement("base")),i.href=a,h.href=b,e=h.href,f?f.href=d:g.removeChild(i),e}}(window,window.videojs,document),function(a,b){var c=function(){this.init=function(){var a={};this.on=function(b,c){a[b]||(a[b]=[]),a[b].push(c)},this.off=function(b,c){var d;return a[b]?(d=a[b].indexOf(c),a[b].splice(d,1),d>-1):!1},this.trigger=function(b){var c,d,e,f;if(c=a[b])for(f=Array.prototype.slice.call(arguments,1),e=c.length,d=0;e>d;++d)c[d].apply(this,f)},this.dispose=function(){a={}}}};c.prototype.pipe=function(a){this.on("data",function(b){a.push(b)})},a.Hls.Stream=c}(window.videojs),function(a){a.videojs=a.videojs||{},a.videojs.Hls=a.videojs.Hls||{};var b=a.videojs.Hls;b.FlvTag=function(a,c){var d,e=0,f=function(a,b){var c,d=a.position+b;d0)throw new Error("Attempted to create new NAL wihout closing the old one");e=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(a){var b,c;this.length===e+4?this.length-=4:e>0&&(b=e+4,c=this.length-b,this.position=e,this.view.setUint32(this.position,c),this.position=this.length,a&&a.push(this.bytes.subarray(b,b+c))),e=0},this.writeMetaDataDouble=function(a,b){var c;if(f(this,2+a.length+9),this.view.setUint16(this.position,a.length),this.position+=2,"width"===a)this.bytes.set(g,this.position),this.position+=5;else if("height"===a)this.bytes.set(h,this.position),this.position+=6;else if("videocodecid"===a)this.bytes.set(i,this.position),this.position+=12;else for(c=0;c>>16,this.bytes[14]=(65280&a)>>>8,this.bytes[15]=(255&a)>>>0;break;case b.FlvTag.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=c?0:1;break;case b.FlvTag.METADATA_TAG:this.position=11,this.view.setUint8(this.position,2),this.position++,this.view.setUint16(this.position,10),this.position+=2,this.bytes.set([111,110,77,101,116,97,68,97,116,97],this.position),this.position+=10,this.bytes[this.position]=8,this.position++,this.view.setUint32(this.position,e),this.position=this.length,this.bytes.set([0,0,9],this.position),this.position+=3,this.length=this.position}return d=this.length-11,this.bytes[1]=(16711680&d)>>>16,this.bytes[2]=(65280&d)>>>8,this.bytes[3]=(255&d)>>>0,this.bytes[4]=(16711680&this.dts)>>>16,this.bytes[5]=(65280&this.dts)>>>8,this.bytes[6]=(255&this.dts)>>>0,this.bytes[7]=(4278190080&this.dts)>>>24,this.bytes[8]=0,this.bytes[9]=0,this.bytes[10]=0,f(this,4),this.view.setUint32(this.length,this.length),this.length+=4,this.position+=4,this.bytes=this.bytes.subarray(0,this.length),this.frameTime=b.FlvTag.frameTime(this.bytes),console.assert(this.bytes.byteLength===this.length),this}},b.FlvTag.AUDIO_TAG=8,b.FlvTag.VIDEO_TAG=9,b.FlvTag.METADATA_TAG=18,b.FlvTag.isAudioFrame=function(a){return b.FlvTag.AUDIO_TAG===a[0]},b.FlvTag.isVideoFrame=function(a){return b.FlvTag.VIDEO_TAG===a[0]},b.FlvTag.isMetaData=function(a){return b.FlvTag.METADATA_TAG===a[0]},b.FlvTag.isKeyFrame=function(a){return b.FlvTag.isVideoFrame(a)?23===a[11]:b.FlvTag.isAudioFrame(a)?!0:b.FlvTag.isMetaData(a)?!0:!1},b.FlvTag.frameTime=function(a){var b=a[4]<<16;return b|=a[5]<<8,b|=a[6]<<0,b|=a[7]<<24},b.FlvTag.durationFromTags=function(a){if(a.length<2)return 0;var b,c=a[0],d=a[a.length-1];return b=d.pts-a[a.length-2].pts||1/24,d.pts-c.pts+b}}(this),function(a){a.videojs.Hls.ExpGolomb=function(a){var b=a.byteLength,c=0,d=0;this.length=function(){return 8*b},this.bitsAvailable=function(){return 8*b+d},this.loadWord=function(){var e=a.byteLength-b,f=new Uint8Array(4),g=Math.min(4,b);if(0===g)throw new Error("no bytes available");f.set(a.subarray(e,e+g)),c=new DataView(f.buffer).getUint32(0),d=8*g,b-=g},this.skipBits=function(a){var e;d>a?(c<<=a,d-=a):(a-=d,e=a/8,a-=8*e,b-=e,this.loadWord(),c<<=a,d-=a)},this.readBits=function(a){var e=Math.min(d,a),f=c>>>32-e;return console.assert(32>a,"Cannot read more than 32 bits at a time"),d-=e,d>0?c<<=e:b>0&&this.loadWord(),e=a-e,e>0?f<a;++a)if(0!==(c&2147483648>>>a))return c<<=a,d-=a,a;return this.loadWord(),a+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var a=this.skipLeadingZeros();return this.readBits(a+1)-1},this.readExpGolomb=function(){var a=this.readUnsignedExpGolomb();return 1&a?1+a>>>1:-1*(a>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()}}(this),function(){var a,b=window.videojs.Hls.ExpGolomb,c=window.videojs.Hls.FlvTag;window.videojs.Hls.H264ExtraData=a=function(){this.sps=[],this.pps=[]},a.prototype.extraDataExists=function(){return this.sps.length>0},a.prototype.scaling_list=function(a,b){var c,d,e=8,f=8;for(c=0;a>c;++c)0!==f&&(d=b.readExpGolomb(),f=(e+d+256)%256),e=0===f?e:f},a.prototype.getSps0Rbsp=function(){for(var a=this.sps[0],b=1,c=1,d=0,e=a.byteLength-2,f=new Uint8Array(a.byteLength);e>b;)0===a[b]&&0===a[b+1]&&3===a[b+2]&&(f.set(a.subarray(c,b+1),d),d+=b+1-c,c=b+3),b++;return f.set(a.subarray(c),d),f.subarray(0,d+(a.byteLength-c))},a.prototype.metaDataTag=function(a){var d,e,f,g,h,i,j,k,l,m,n,o,p,q=new c(c.METADATA_TAG),r=0,s=0,t=0,u=0;if(q.dts=a,q.pts=a,d=new b(this.getSps0Rbsp()),e=d.readUnsignedByte(),d.skipBits(16),d.skipUnsignedExpGolomb(),(100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e)&&(f=d.readUnsignedExpGolomb(),3===f&&d.skipBits(1),d.skipUnsignedExpGolomb(),d.skipUnsignedExpGolomb(),d.skipBits(1),d.readBoolean()))for(g=3!==f?8:12,h=0;g>h;++h)d.readBoolean()&&(6>h?this.scaling_list(16,d):this.scaling_list(64,d));if(d.skipUnsignedExpGolomb(),i=d.readUnsignedExpGolomb(),0===i)d.readUnsignedExpGolomb();else if(1===i)for(d.skipBits(1),d.skipExpGolomb(),d.skipExpGolomb(),j=d.readUnsignedExpGolomb(),h=0;j>h;++h)d.skipExpGolomb();return d.skipUnsignedExpGolomb(),d.skipBits(1),k=d.readUnsignedExpGolomb(),l=d.readUnsignedExpGolomb(),m=d.readBits(1),0===m&&d.skipBits(1),d.skipBits(1),n=d.readBoolean(),n&&(r=d.readUnsignedExpGolomb(),s=d.readUnsignedExpGolomb(),t=d.readUnsignedExpGolomb(),u=d.readUnsignedExpGolomb()),o=16*(k+1)-2*r-2*s,p=(2-m)*(l+1)*16-2*t-2*u,q.writeMetaDataDouble("videocodecid",7),q.writeMetaDataDouble("width",o),q.writeMetaDataDouble("height",p),q},a.prototype.extraDataTag=function(a){var b,d=new c(c.VIDEO_TAG,!0);for(d.dts=a,d.pts=a,d.writeByte(1),d.writeByte(this.sps[0][1]),d.writeByte(this.sps[0][2]),d.writeByte(this.sps[0][3]),d.writeByte(255),d.writeByte(225),d.writeShort(this.sps[0].length),d.writeBytes(this.sps[0]),d.writeByte(this.pps.length),b=0;b=e))switch(this._state){default:case 0:this._state=1;case 1:if(a[b]<=1&&(f=this._h264Frame?this._h264Frame.nalUnitSize():0,f>=1&&0===this._h264Frame.negIndex(1))){if(1===a[b]&&f>=2&&0===this._h264Frame.negIndex(2))return f>=3&&0===this._h264Frame.negIndex(3)?this._h264Frame.length-=3:this._h264Frame.length-=2,this._state=3,this.writeBytes(a,b+1,e-1);if(e>1&&0===a[b]&&1===a[b+1])return f>=2&&0===this._h264Frame.negIndex(2)?this._h264Frame.length-=2:this._h264Frame.length-=1,this._state=3,this.writeBytes(a,b+2,e-2);if(e>2&&0===a[b]&&0===a[b+1]&&1===a[b+2])return this._state=3,this.writeBytes(a,b+3,e-3)}this._state=2;case 2:for(g=b,h=g+e,i=h-3;i>b;)if(a[b+2]>1)b+=3;else if(0!==a[b+1])b+=2;else if(0!==a[b])b+=1;else{if(1===a[b+2])return b>g&&this._h264Frame.writeBytes(a,g,b-g),this._state=3,b+=3,this.writeBytes(a,b,h-b);if(h-b>=4&&0===a[b+2]&&1===a[b+3])return b>g&&this._h264Frame.writeBytes(a,g,b-g),this._state=3,b+=4,this.writeBytes(a,b,h-b);b+=3}return this._state=1,void(this._h264Frame&&this._h264Frame.writeBytes(a,g,e));case 3:if(this._h264Frame)switch(this._nalUnitType){case c.seq_parameter_set_rbsp:this._h264Frame.endNalUnit(this._newExtraData.sps);break;case c.pic_parameter_set_rbsp:this._h264Frame.endNalUnit(this._newExtraData.pps);break;case c.slice_layer_without_partitioning_rbsp_idr:this._h264Frame.endNalUnit();break;default:this._h264Frame.endNalUnit()}return this._nalUnitType=31&a[b],this._h264Frame&&(this._nalUnitType===c.access_unit_delimiter_rbsp?this.finishFrame():this._nalUnitType===c.slice_layer_without_partitioning_rbsp_idr&&(this._h264Frame.keyFrame=!0)),this._h264Frame||(this._h264Frame=new d(d.VIDEO_TAG),this._h264Frame.pts=this._next_pts,this._h264Frame.dts=this._next_dts),this._h264Frame.startNalUnit(),this._state=2,this.writeBytes(a,b,e)}}}(this),function(a){var b=a.videojs.Hls.FlvTag,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3];a.videojs.Hls.AacStream=function(){var a,d,e,f,g,h,i,j,k,l,m,n,o;this.tags=[],this.setTimeStampOffset=function(a){f=a-1e3},this.setNextTimeStamp=function(b,c,f){a=b,e=c,f&&(d=0)},this.writeBytes=function(p,q,r){var s,t,u;for(q=q||0,r=r||0,r=r>e?e:r,e-=r,s=q+r;s>q;)switch(d){default:d=0;break;case 0:if(q>=s)return;if(255!==p[q])return console.assert(!1,"Error no ATDS header found"),q+=1,void(d=0);q+=1,d=1;break;case 1:if(q>=s)return;if(240!==(240&p[q]))return console.assert(!1,"Error no ATDS header found"),q+=1,void(d=0);g=!!(1&p[q]),q+=1,d=2;break;case 2:if(q>=s)return;h=((192&p[q])>>>6)+1,i=(60&p[q])>>>2,j=(1&p[q])<<2,q+=1,d=3;break;case 3:if(q>=s)return;j|=(192&p[q])>>>6,k=(3&p[q])<<11,q+=1,d=4;break;case 4:if(q>=s)return;k|=p[q]<<3,q+=1,d=5;break;case 5:if(q>=s)return;k|=(224&p[q])>>>5,k-=g?7:9,q+=1,d=6;break;case 6:if(q>=s)return;l=1024*((3&p[q])+1),m=1e3*l/c[i],t=h<<11|i<<7|j<<3,(t!==o||a-f>=1e3)&&(n=new b(b.METADATA_TAG),n.pts=a,n.dts=a,n.writeMetaDataDouble("audiocodecid",10),n.writeMetaDataBoolean("stereo",2===j),n.writeMetaDataDouble("audiosamplerate",c[i]),n.writeMetaDataDouble("audiosamplesize",16),this.tags.push(n),o=t,n=new b(b.AUDIO_TAG,!0),n.pts=a,n.dts=n.pts,n.view.setUint16(n.position,t),n.position+=2,n.length=Math.max(n.length,n.position),this.tags.push(n),f=a),q+=1,d=7;break;case 7:if(!g){if(2>s-q)return;q+=2}n=new b(b.AUDIO_TAG),n.pts=a,n.dts=a,d=8;break;case 8:for(;k;){if(q>=s)return;u=k>s-q?s-q:k,n.writeBytes(p,q,u),q+=u,k-=u}this.tags.push(n),d=0,a+=m}}}}(this),function(a,b,c){"use strict";var d,e=function(a,b,c){var d,e="";for(d=b;c>d;d++)e+="%"+("00"+a[d].toString(16)).slice(-2);return e},f=function(b,c,d){return a.decodeURIComponent(e(b,c,d))},g=function(b,c,d){return a.unescape(e(b,c,d))},h={TXXX:function(a){var b;if(3===a.data[0])for(b=1;bi)){for(c={data:new Uint8Array(f),frames:[],pts:g[0].pts,dts:g[0].dts},l=0;f>l;)c.data.set(g[0].data,l),l+=g[0].data.byteLength,i-=g[0].data.byteLength,g.shift();d=10,64&c.data[5]&&(d+=4,d+=c.data[10]<<24|c.data[11]<<16|c.data[12]<<8|c.data[13],f-=c.data[16]<<24|c.data[17]<<16|c.data[18]<<8|c.data[19]);do{if(j=c.data[d+4]<<24|c.data[d+5]<<16|c.data[d+6]<<8|c.data[d+7],1>j)return b.log("Malformed ID3 frame encountered. Skipping metadata parsing.");k={id:String.fromCharCode(c.data[d],c.data[d+1],c.data[d+2],c.data[d+3]),data:c.data.subarray(d+10,d+j+10)},h[k.id]&&h[k.id](k),c.frames.push(k),d+=10,d+=j}while(f>d);this.trigger("data",c)}}},d.prototype=new b.Hls.Stream,b.Hls.MetadataStream=d}(window,window.videojs),function(a){var b,c,d=a.videojs,e=d.Hls.FlvTag,f=d.Hls.H264Stream,g=d.Hls.AacStream,h=d.Hls.MetadataStream;d.Hls.SegmentParser=function(){var a,i=this,j=new Uint8Array(b),k=0,l=new f,m=new g;i.stream={programMapTable:{}},i.metadataStream=new h,this.mediaTimelineOffset=null,i.timestampOffset=null,i.getFlvHeader=function(a,b,c){var d,f,g,h=new Uint8Array(9),i=new DataView(h.buffer);return a=a||0,b=void 0===b?!0:b,c=void 0===c?!0:c,i.setUint8(0,70),i.setUint8(1,76),i.setUint8(2,86),i.setUint8(3,1),i.setUint8(4,(b?4:0)|(c?1:0)),i.setUint32(5,h.byteLength),0>=a?(f=new Uint8Array(h.byteLength+4),f.set(h),f.set([0,0,0,0],h.byteLength),f):(d=new e(e.METADATA_TAG),d.pts=d.dts=0,d.writeMetaDataDouble("duration",a),g=d.finalize().length,f=new Uint8Array(h.byteLength+g),f.set(h),f.set(i.byteLength,g),f)},i.flushTags=function(){l.finishFrame()},i.tagsAvailable=function(){return l.tags.length+m.tags.length},i.getNextTag=function(){var a;return a=l.tags.length?m.tags.length&&m.tags[0].dts0){if(c.byteLength+k0&&(j.set(c.subarray(f),k),k+=c.byteLength-f));a(c.subarray(f,f+b))?f+=b:(d.log("error parsing m2ts packet, attempting to re-align"),f++)}},a=function(a){var e,f,g,h,j,k,n,o,p,q,r,s,t,u,v,w,x,y,z=0,A=z+b,B=!!(64&a[z+1]),C=(31&a[z+1])<<8|a[z+2],D=(48&a[z+3])>>>4;if(z+=4,D>1&&(z+=a[z]+1),0===C){if(B&&(z+=1+a[z]),e=a[z],0!==e&&d.log("the table_id of the PAT should be 0x00 but was"+e.toString(16)),f=!!(1&a[z+5]))for(g=(15&a[z+1])<<8|a[z+2],z+=8,k=z+(g-5-4);k>z;z+=4)if(h=a[z]<<8|a[z+1],j=(31&a[z+2])<<8|a[z+3],0===h)i.stream.networkPid=j;else if(void 0===i.stream.pmtPid)i.stream.pmtPid=j;else if(i.stream.pmtPid!==j)throw new Error("TS has more that 1 program")}else if(C===i.stream.programMapTable[c.h264]||C===i.stream.programMapTable[c.adts]||C===i.stream.programMapTable[c.metadata]){if(B){if(0!==a[z+0]||0!==a[z+1]||1!==a[z+2])throw new Error("PES did not begin with start code");n=a[z+4]<<8|a[z+5],o=0!==(4&a[z+6]),p=a[z+7],q=a[z+8],z+=9,192&p&&(r=(14&a[z+0])<<28|(255&a[z+1])<<21|(254&a[z+2])<<13|(255&a[z+3])<<6|(254&a[z+4])>>>2,r/=45,s=r,64&p&&(s=(14&a[z+5])<<28|(255&a[z+6])<<21|(254&a[z+7])<<13|(255&a[z+8])<<6|(254&a[z+9])>>>2,s/=45)),z+=q,null===i.timestampOffset&&(i.timestampOffset=r),C===i.stream.programMapTable[c.h264]?l.setNextTimeStamp(r,s,o):C===i.stream.programMapTable[c.adts]&&m.setNextTimeStamp(r,n,o); }C===i.stream.programMapTable[c.adts]?m.writeBytes(a,z,A-z):C===i.stream.programMapTable[c.h264]?l.writeBytes(a,z,A-z):C===i.stream.programMapTable[c.metadata]&&i.metadataStream.push({pts:r,dts:s,data:a.subarray(z)})}else if(i.stream.pmtPid===C){if(B&&(z+=1+a[z]),2!==a[z]&&d.log("The table_id of a PMT should be 0x02 but was "+a[z].toString(16)),t=!!(1&a[z+5]))for(i.stream.programMapTable={},v=(15&a[z+1])<<8|a[z+2],u=(15&a[z+10])<<8|a[z+11],v-=u,v-=13,i.stream.programMapTable.pcrPid=(31&a[z+8])<<8|a[z+9],z+=12+u;v>0;){if(w=a[z+0],x=(31&a[z+1])<<8|a[z+2],w===c.h264&&i.stream.programMapTable[w]&&i.stream.programMapTable[w]!==x)throw new Error("Program has more than 1 video stream");if(w===c.adts&&i.stream.programMapTable[w]&&i.stream.programMapTable[w]!==x)throw new Error("Program has more than 1 audio Stream");i.stream.programMapTable[w]=x,y=(15&a[z+3])<<8|a[z+4],w===c.metadata&&(i.metadataStream.descriptor=new Uint8Array(a.subarray(z+5,z+5+y))),z+=5+y,v-=5+y}}else i.stream.networkPid===C||17===C||8191===C||i.stream.programMapTable.pcrPid||d.log("Unknown PID parsing TS packet: "+C);return!0},i.getTags=function(){return l.tags},i.stats={h264Tags:function(){return l.tags.length},aacTags:function(){return m.tags.length}}},d.Hls.SegmentParser.MP2T_PACKET_LENGTH=b=188,d.Hls.SegmentParser.STREAM_TYPES=c={h264:27,adts:15,metadata:21}}(window),function(a,b,c,d,e){var f,g,h,i=function(){},j=function(){var a="[^=]*",b='"[^"]*"|[^,]*',c="(?:"+a+")=(?:"+b+")";return new RegExp("(?:^|,)("+c+")")}(),k=function(a){for(var b,c=a.split(j),d=c.length,e={};d--;)""!==c[d]&&(b=/([^=]*)=(.*)/.exec(c[d]).slice(1),b[0]=b[0].replace(/^\s+|\s+$/g,""),b[1]=b[1].replace(/^\s+|\s+$/g,""),b[1]=b[1].replace(/^['"](.*)['"]$/g,"$1"),e[b[0]]=b[1]);return e},l=a.Hls.Stream;f=function(){var a="";f.prototype.init.call(this),this.push=function(b){var c;for(a+=b,c=a.indexOf("\n");c>-1;c=a.indexOf("\n"))this.trigger("data",a.substring(0,c)),a=a.substring(c+1)}},f.prototype=new l,g=function(){g.prototype.init.call(this)},g.prototype=new l,g.prototype.push=function(a){var c,d;return a=a.replace(/^\s+|\s+$/g,""),0!==a.length?"#"!==a[0]?void this.trigger("data",{type:"uri",uri:a}):0!==a.indexOf("#EXT")?void this.trigger("data",{type:"comment",text:a.slice(1)}):(a=a.replace("\r",""),(c=/^#EXTM3U/.exec(a))?void this.trigger("data",{type:"tag",tagType:"m3u"}):(c=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(a))?(d={type:"tag",tagType:"inf"},c[1]&&(d.duration=parseFloat(c[1])),c[2]&&(d.title=c[2]),void this.trigger("data",d)):(c=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"targetduration"},c[1]&&(d.duration=b(c[1],10)),void this.trigger("data",d)):(c=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"totalduration"},c[1]&&(d.duration=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"version"},c[1]&&(d.version=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"media-sequence"},c[1]&&(d.number=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"discontinuity-sequence"},c[1]&&(d.number=b(c[1],10)),void this.trigger("data",d)):(c=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(a))?(d={type:"tag",tagType:"playlist-type"},c[1]&&(d.playlistType=c[1]),void this.trigger("data",d)):(c=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(a))?(d={type:"tag",tagType:"byterange"},c[1]&&(d.length=b(c[1],10)),c[2]&&(d.offset=b(c[2],10)),void this.trigger("data",d)):(c=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(a))?(d={type:"tag",tagType:"allow-cache"},c[1]&&(d.allowed=!/NO/.test(c[1])),void this.trigger("data",d)):(c=/^#EXT-X-STREAM-INF:?(.*)$/.exec(a))?(d={type:"tag",tagType:"stream-inf"},c[1]&&(d.attributes=k(c[1]),d.attributes.RESOLUTION&&!function(){var a=d.attributes.RESOLUTION.split("x"),c={};a[0]&&(c.width=b(a[0],10)),a[1]&&(c.height=b(a[1],10)),d.attributes.RESOLUTION=c}(),d.attributes.BANDWIDTH&&(d.attributes.BANDWIDTH=b(d.attributes.BANDWIDTH,10)),d.attributes["PROGRAM-ID"]&&(d.attributes["PROGRAM-ID"]=b(d.attributes["PROGRAM-ID"],10))),void this.trigger("data",d)):(c=/^#EXT-X-ENDLIST/.exec(a))?void this.trigger("data",{type:"tag",tagType:"endlist"}):(c=/^#EXT-X-DISCONTINUITY/.exec(a))?void this.trigger("data",{type:"tag",tagType:"discontinuity"}):(c=/^#EXT-X-KEY:?(.*)$/.exec(a))?(d={type:"tag",tagType:"key"},c[1]&&(d.attributes=k(c[1]),d.attributes.IV&&("0x"===d.attributes.IV.substring(0,2)&&(d.attributes.IV=d.attributes.IV.substring(2)),d.attributes.IV=d.attributes.IV.match(/.{8}/g),d.attributes.IV[0]=b(d.attributes.IV[0],16),d.attributes.IV[1]=b(d.attributes.IV[1],16),d.attributes.IV[2]=b(d.attributes.IV[2],16),d.attributes.IV[3]=b(d.attributes.IV[3],16),d.attributes.IV=new Uint32Array(d.attributes.IV))),void this.trigger("data",d)):void this.trigger("data",{type:"tag",data:a.slice(4,a.length)})):void 0},h=function(){var a,b=this,j=[],k={};h.prototype.init.call(this),this.lineStream=new f,this.parseStream=new g,this.lineStream.pipe(this.parseStream),this.manifest={allowCache:!0},this.parseStream.on("data",function(f){({tag:function(){(({"allow-cache":function(){this.manifest.allowCache=f.allowed,"allowed"in f||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var a={};"length"in f&&(k.byterange=a,a.length=f.length,"offset"in f||(this.trigger("info",{message:"defaulting offset to zero"}),f.offset=0)),"offset"in f&&(k.byterange=a,a.offset=f.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"})),f.duration>=0&&(k.duration=f.duration),this.manifest.segments=j},key:function(){return f.attributes?"NONE"===f.attributes.METHOD?void(a=null):f.attributes.URI?(f.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:f.attributes.METHOD||"AES-128",uri:f.attributes.URI},void(f.attributes.IV!==e&&(a.iv=f.attributes.IV))):void this.trigger("warn",{message:"ignoring key declaration without URI"}):void this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){return c(f.number)?void(this.manifest.mediaSequence=f.number):void this.trigger("warn",{message:"ignoring invalid media sequence: "+f.number})},"discontinuity-sequence":function(){return c(f.number)?void(this.manifest.discontinuitySequence=f.number):void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+f.number})},"playlist-type":function(){return/VOD|EVENT/.test(f.playlistType)?void(this.manifest.playlistType=f.playlistType):void this.trigger("warn",{message:"ignoring unknown playlist type: "+f.playlist})},"stream-inf":function(){return this.manifest.playlists=j,f.attributes?(k.attributes||(k.attributes={}),void(k.attributes=d(k.attributes,f.attributes))):void this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},discontinuity:function(){k.discontinuity=!0},targetduration:function(){return!c(f.duration)||f.duration<0?void this.trigger("warn",{message:"ignoring invalid target duration: "+f.duration}):void(this.manifest.targetDuration=f.duration)},totalduration:function(){return!c(f.duration)||f.duration<0?void this.trigger("warn",{message:"ignoring invalid total duration: "+f.duration}):void(this.manifest.totalDuration=f.duration)}})[f.tagType]||i).call(b)},uri:function(){k.uri=f.uri,j.push(k),!this.manifest.targetDuration||"duration"in k||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),k.duration=this.manifest.targetDuration),a&&(k.key=a),k={}},comment:function(){}})[f.type].call(b)})},h.prototype=new l,h.prototype.push=function(a){this.lineStream.push(a)},h.prototype.end=function(){this.lineStream.push("\n")},window.videojs.m3u8={LineStream:f,ParseStream:g,Parser:h}}(window.videojs,window.parseInt,window.isFinite,window.videojs.util.mergeOptions),function(a){a.Hls.xhr=function(b,c){var d,e,f={method:"GET",timeout:45e3};return"function"!=typeof c&&(c=function(){}),"object"==typeof b&&(f=a.util.mergeOptions(f,b),b=f.url),d=new window.XMLHttpRequest,d.open(f.method,b),d.url=b,d.requestTime=(new Date).getTime(),f.responseType&&(d.responseType=f.responseType),f.withCredentials&&(d.withCredentials=!0),f.timeout&&(e=window.setTimeout(function(){4!==d.readyState&&(d.timedout=!0,d.abort())},f.timeout)),d.onreadystatechange=function(){return 4===this.readyState?(window.clearTimeout(e),d.timedout?c.call(this,"timeout",b):this.status>=400||0===this.status?c.call(this,!0,b):(this.response&&(this.responseTime=(new Date).getTime(),this.roundTripTime=this.responseTime-this.requestTime,this.bytesReceived=this.response.byteLength||this.response.length,this.bandwidth=Math.floor(this.bytesReceived/this.roundTripTime*8*1e3)),c.call(this,!1,b))):void 0},d.send(null),d}}(window.videojs),function(a,b){"use strict";var c,d,e,f=10;e=function(a,b,c){var d,e,g,h,i=0;for(b=b||0,e=b,c=void 0!==c?c:(a.segments||[]).length,d=a.targetDuration||f,h=Math.max(a.mediaSequence-b,0),i+=h*d,e+=h;c>e;e++)g=a.segments[e-a.mediaSequence],i+=g.preciseDuration||g.duration||d;return i},c=function(b,c,d){if(!b)return 0;if(void 0===c&&void 0===d){if(b.totalDuration)return b.totalDuration;if(!b.endList)return a.Infinity}return e(b,c,d)},d=function(a){var d,g,h,i,j,k,l;if(!a.segments)return b.createTimeRange();if(a.endList)return b.createTimeRange(0,c(a));if(d=e(a,0,a.mediaSequence),g=d+e(a,a.mediaSequence,a.mediaSequence+a.segments.length),i=a.targetDuration||f,!a.endList)for(h=3*i,l=a.segments.length-1;l>=0&&h>0;l--)j=a.segments[l],k=Math.min(j.preciseDuration||j.duration||i,h),h-=k,g-=k;return b.createTimeRange(d,g)},b.Hls.Playlist={duration:c,seekable:d}}(window,window.videojs),function(a,b){"use strict";var c=b.Hls.resolveUrl,d=b.Hls.xhr,e=b.Hls.Playlist,f=function(a,c){var d,e,f=!1,g=b.util.mergeOptions(a,{});for(d=a.playlists.length;d--;)if(e=g.playlists[d],e.uri===c.uri){if(e.segments&&c.segments&&e.segments.length===c.segments.length&&e.mediaSequence===c.mediaSequence)continue;g.playlists[d]=b.util.mergeOptions(e,c),g.playlists[c.uri]=g.playlists[d],f=!0}return f?g:null},g=function(e,h){var i,j,k,l,m=this;if(g.prototype.init.call(this),!e)throw new Error("A non-empty playlist URL is required");l=function(c,d,e){var g,h,i;return m.setBandwidth(k||d),k=null,c?(m.error={status:d.status,message:"HLS playlist request error at URL: "+e,responseText:d.responseText,code:d.status>=500?4:2},m.trigger("error")):(m.state="HAVE_METADATA",g=new b.m3u8.Parser,g.push(d.responseText),g.end(),g.manifest.uri=e,i=f(m.master,g.manifest),h=1e3*(g.manifest.targetDuration||10),i?(m.master=i,m.updateMediaPlaylist_(g.manifest)):h/=2,m.media().endList||(a.clearTimeout(j),j=a.setTimeout(function(){m.trigger("mediaupdatetimeout")},h)),void m.trigger("loadedplaylist"))},m.state="HAVE_NOTHING",m.expiredPostDiscontinuity_=0,m.expiredPreDiscontinuity_=0,i=this.dispose,m.dispose=function(){k&&(k.onreadystatechange=null,k.abort(),k=null),a.clearTimeout(j),i.call(this)},m.media=function(a){var b=!1;if(!a)return m.media_;if("HAVE_NOTHING"===m.state||"HAVE_MASTER"===m.state)throw new Error("Cannot switch media playlist from "+m.state);if("string"==typeof a){if(!m.master.playlists[a])throw new Error("Unknown playlist URI: "+a);a=m.master.playlists[a]}if(b=a.uri!==m.media_.uri,m.master.playlists[a.uri].endList)return k&&(k.onreadystatechange=null,k.abort(),k=null),m.state="HAVE_METADATA",m.media_=a,void(b&&m.trigger("mediachange"));if(b){if(m.state="SWITCHING_MEDIA",k){if(c(m.master.uri,a.uri)===k.url)return;k.onreadystatechange=null,k.abort(),k=null}k=d({url:c(m.master.uri,a.uri),withCredentials:h},function(b){l(b,this,a.uri),m.trigger("mediachange")})}},m.setBandwidth=function(a){m.bandwidth=a.bandwidth},m.on("mediaupdatetimeout",function(){"HAVE_METADATA"===m.state&&(m.state="HAVE_CURRENT_METADATA",k=d({url:c(m.master.uri,m.media().uri),withCredentials:h},function(a){l(a,this,m.media().uri)}))}),d({url:e,withCredentials:h},function(f){var g,i;if(f)return m.error={status:this.status,message:"HLS playlist request error at URL: "+e,responseText:this.responseText,code:2},m.trigger("error");if(g=new b.m3u8.Parser,g.push(this.responseText),g.end(),m.state="HAVE_MASTER",g.manifest.uri=e,g.manifest.playlists){for(m.master=g.manifest,i=m.master.playlists.length;i--;)m.master.playlists[m.master.playlists[i].uri]=m.master.playlists[i];return k=d({url:c(e,g.manifest.playlists[0].uri),withCredentials:h},function(a){l(a,this,g.manifest.playlists[0].uri),a||m.trigger("loadedmetadata")}),m.trigger("loadedplaylist")}return m.master={uri:a.location.href,playlists:[{uri:e}]},m.master.playlists[e]=m.master.playlists[0],l(null,this,e),m.trigger("loadedmetadata")})};g.prototype=new b.Hls.Stream,g.prototype.updateMediaPlaylist_=function(a){var b,c,d;if(this.media_){if(c=a.mediaSequence-this.media_.mediaSequence,b=this.media_.mediaSequence,this.media_.discontinuitySequence!==a.discontinuitySequence)for(d=c;d--;)if(this.media_.segments[d].discontinuity){b=d+this.media_.mediaSequence,this.expiredPreDiscontinuity_+=this.expiredPostDiscontinuity_,this.expiredPostDiscontinuity_=0;break}this.expiredPreDiscontinuity_+=e.duration(this.media_,this.media_.mediaSequence,b),this.expiredPostDiscontinuity_+=e.duration(this.media_,b,this.media_.mediaSequence+c)}this.media_=this.master.playlists[a.uri]},b.Hls.PlaylistLoader=g}(window,window.videojs),function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>8|a>>>24},d=function(a){this._precompute();var b,c,d,e,f,g=this._tables[0][4],h=this._tables[1],i=a.length,j=1;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size");for(e=a.slice(0),f=[],this._key=[e,f],b=i;4*i+28>b;b++)d=e[b-1],(b%i===0||8===i&&b%i===4)&&(d=g[d>>>24]<<24^g[d>>16&255]<<16^g[d>>8&255]<<8^g[255&d],b%i===0&&(d=d<<8^d>>>24^j<<24,j=j<<1^283*(j>>7))),e[b]=e[b-i]^d;for(c=0;b;c++,b--)d=e[3&c?b:b-4],4>=b||4>c?f[c]=d:f[c]=h[0][g[d>>>24]]^h[1][g[d>>16&255]]^h[2][g[d>>8&255]]^h[3][g[255&d]]},d.prototype={_tables:[[[],[],[],[],[]],[[],[],[],[],[]]],_precompute:function(){var a,b,c,d,e,f,g,h,i,j=this._tables[0],k=this._tables[1],l=j[4],m=k[4],n=[],o=[];for(a=0;256>a;a++)o[(n[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!l[b];b^=d||1,c=o[c]||1)for(g=c^c<<1^c<<2^c<<3^c<<4,g=g>>8^255&g^99,l[b]=g,m[g]=b,f=n[e=n[d=n[b]]],i=16843009*f^65537*e^257*d^16843008*b,h=257*n[g]^16843008*g,a=0;4>a;a++)j[a][b]=h=h<<24^h>>>8,k[a][g]=i=i<<24^i>>>8;for(a=0;5>a;a++)j[a]=j[a].slice(0),k[a]=k[a].slice(0)},decrypt:function(a,b,c,d,e,f){var g,h,i,j,k=this._key[1],l=a^k[0],m=d^k[1],n=c^k[2],o=b^k[3],p=k.length/4-2,q=4,r=this._tables[1],s=r[0],t=r[1],u=r[2],v=r[3],w=r[4];for(j=0;p>j;j++)g=s[l>>>24]^t[m>>16&255]^u[n>>8&255]^v[255&o]^k[q],h=s[m>>>24]^t[n>>16&255]^u[o>>8&255]^v[255&l]^k[q+1],i=s[n>>>24]^t[o>>16&255]^u[l>>8&255]^v[255&m]^k[q+2],o=s[o>>>24]^t[l>>16&255]^u[m>>8&255]^v[255&n]^k[q+3],q+=4,l=g,m=h,n=i;for(j=0;4>j;j++)e[(3&-j)+f]=w[l>>>24]<<24^w[m>>16&255]<<16^w[n>>8&255]<<8^w[255&o]^k[q++],g=l,l=m,m=n,n=o,o=g}},g=function(a,b,c){var e,f,g,i,j,k,l,m,n,o=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>2),p=new d(Array.prototype.slice.call(b)),q=new Uint8Array(a.byteLength),r=new Int32Array(q.buffer);for(e=c[0],f=c[1],g=c[2],i=c[3],n=0;n