webpackJsonpjwplayer([1],[,,,,,,function(e,t,n){"use strict";var r=n(36),i=n(94),a=n(95);r.operations=i,r.operations.pipeline=a.pipeline,r.operations.pipelineAsync=a.pipelineAsync,e.exports=r},function(e,t,n){(function(t){var r="object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this,i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,a=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(203),i)r.regeneratorRuntime=a;else try{delete r.regeneratorRuntime}catch(s){r.regeneratorRuntime=void 0}}).call(t,function(){return this}())},,,,,,,,,function(e,t,n){"use strict";function r(e,t){for(var n=new Uint8Array(t),r=0,i=0;i>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=255&n}function o(e,t){var n=e[t],r=e[t+1],i=e[t+2],a=e[t+3];return n<<24|r<<16|i<<8|a}function u(e,t){var n=e[t],r=e[t+1];return n<<8|r}function c(e){return f.map(e,function(e){return e.toString(16)})}t.__esModule=!0,t.combineUint8Arrays=r,t.concatUint8Array=i,t.extendUint8Array=a,t.writeUint32=s,t.readUint32=o,t.readUint16=u,t.toHex=c;var f=n(1)},function(e,t,n){var r,i;r=[n(8)],i=function(e){function t(e){e||n()}function n(){throw new Error("Invalid DFXP file")}var r=e.seconds;return function(i){t(i);var a=[],s=i.getElementsByTagName("p"),o=30,u=i.getElementsByTagName("tt");if(u&&u[0]){var c=parseFloat(u[0].getAttribute("ttp:frameRate"));isNaN(c)||(o=c)}t(s),s.length||(s=i.getElementsByTagName("tt:p"),s.length||(s=i.getElementsByTagName("tts:p")));for(var f=0;f\s+<").replace(/tts?:/g,"");if(h){var p=l.getAttribute("begin"),m=l.getAttribute("dur"),v=l.getAttribute("end"),y={begin:r(p,o),text:h};v?y.end=r(v,o):m&&(y.end=y.begin+r(m,o)),a.push(y)}}return a.length||n(),a}}.apply(t,r),!(void 0!==i&&(e.exports=i))},function(e,t,n){var r,i;r=[n(1),n(21),n(2),n(14),n(19),n(17),n(30)],i=function(e,t,r,i,a,s,o){function u(e){if(this._currentTextTrackIndex=-1,e){if(this._textTracks||this._initTextTracks(),e.length){var t=0,n=e.length;for(t;tthis._textTracks.length)&&this.setTextTracks(t);var r=-1,i=0;for(i;i1&&(t+=" ["+this._unknownCount+"]")),t}function C(e){this._textTracks.push(e),this._tracksById[e._id]=e}function L(e,t){var n=this;return r.ajax(e.file,function(e){U.call(n,e,t)},N)}function P(){if(this._textTracks){var t=e.filter(this._textTracks,function(e){return e.embedded||"subs"===e.groupid});this._initTextTracks(),e.each(t,function(e){this._tracksById[e._id]=e}),this._textTracks=t}}function D(e,t){if(this._renderNatively){var n=this._tracksById[e._id];if(!n)return this._cuesByTrackId||(this._cuesByTrackId={}),void(this._cuesByTrackId[e._id]={cues:t,loaded:!1});if(this._cuesByTrackId[e._id]&&this._cuesByTrackId[e._id].loaded)return;var r;for(this._cuesByTrackId[e._id]={cues:t,loaded:!0};r=t.shift();)w(n,r)}else e.data=t}function O(t){var n=window.VTTCue,r=e.map(t,function(e){return new n(e.begin,e.end,e.text)});return r}function R(e,t){var r=this._renderNatively;n.e(11,function(require){var i=n(13),a=new i(window);r?a.oncue=function(e){w(t,e)}:(t.data=t.data||[],a.oncue=function(e){t.data.push(e)});try{a.parse(e).flush()}catch(s){N(s)}})}function B(n){var r=n.currentTarget.activeCues;if(r&&r.length){var i=r[r.length-1].startTime;if(this._activeCuePosition!==i){var a=[];if(e.each(r,function(e){e.startTime=0?R.call(this,u,t):(n=a(u),r=O(n),D.call(this,t,r))}}catch(c){N(c.message+": "+t.file)}}function N(e){r.log("CAPTIONS("+e+")")}var F={_itemTracks:null,_textTracks:null,_tracksById:null,_cuesByTrackId:null,_metaCuesByTextTime:null,_currentTextTrackIndex:-1,_unknownCount:0,_renderNatively:!1,_activeCuePosition:null,_initTextTracks:I,addTracksListener:m,clearTracks:y,disableTextTrack:g,getSubtitlesTrack:f,removeTracksListener:v,addTextTracks:T,setTextTracks:u,setupSideloadedTracks:c,setSubtitlesTrack:l,textTrackChangeHandler:null,addTrackHandler:null,addCuesToTrack:p,addCaptionsCue:d,addVTTCue:h};return F}.apply(t,r),!(void 0!==i&&(e.exports=i))},,,,,,function(e,t,n){"use strict";function r(e){return e&&e["@@transducer/reduced"]}function i(e,t){f.run(function(){e(t)})}function a(e){return console.log("error in channel transformer",e.stack),h}function s(e,t,n){var r=(t||a)(n);return r!==h&&e.add(r),e}function o(){}function u(e){return function(t){return{"@@transducer/step":function(n,r){try{return t["@@transducer/step"](n,r)}catch(i){return s(n,e,i)}},"@@transducer/result":function(n){try{return t["@@transducer/result"](n)}catch(r){return s(n,e,r)}}}}}var c=n(37),f=n(38),l=64,d=1024,h=null,p=function(e){this.value=e},m=function(e,t){this.handler=e,this.value=t},v=function(e,t,n,r){this.buf=n,this.xform=r,this.takes=e,this.puts=t,this.dirty_takes=0,this.dirty_puts=0,this.closed=!1};v.prototype._put=function(e,t){if(e===h)throw new Error("Cannot put CLOSED on a channel.");if(!t.is_active())return null;if(this.closed)return t.commit(),new p((!1));var n,a;if(this.buf&&!this.buf.is_full()){t.commit();for(var s=r(this.xform["@@transducer/step"](this.buf,e));;){if(0===this.buf.count())break;if(n=this.takes.pop(),n===c.EMPTY)break;n.is_active()&&(e=this.buf.remove(),a=n.commit(),i(a,e))}return s&&this.close(),new p((!0))}for(;;){if(n=this.takes.pop(),n===c.EMPTY)break;if(n.is_active())return t.commit(),a=n.commit(),i(a,e),new p((!0))}if(this.dirty_puts>l?(this.puts.cleanup(function(e){return e.handler.is_active()}),this.dirty_puts=0):this.dirty_puts++,t.is_blockable()){if(this.puts.length>=d)throw new Error("No more than "+d+" pending puts are allowed on a single channel.");this.puts.unbounded_unshift(new m(t,e))}return null},v.prototype._take=function(e){if(!e.is_active())return null;var t,n,a,s;if(this.buf&&this.buf.count()>0){for(e.commit(),s=this.buf.remove();;){if(this.buf.is_full())break;if(t=this.puts.pop(),t===c.EMPTY)break;n=t.handler,n.is_active()&&(a=n.commit(),a&&i(a,!0),r(this.xform["@@transducer/step"](this.buf,t.value))&&this.close())}return new p(s)}for(;;){if(t=this.puts.pop(),s=t.value,t===c.EMPTY)break;if(n=t.handler,n.is_active())return e.commit(),a=n.commit(),a&&i(a,!0),new p(s)}if(this.closed)return e.commit(),new p(h);if(this.dirty_takes>l?(this.takes.cleanup(function(e){return e.is_active()}),this.dirty_takes=0):this.dirty_takes++,e.is_blockable()){if(this.takes.length>=d)throw new Error("No more than "+d+" pending takes are allowed on a single channel.");this.takes.unbounded_unshift(e)}return null},v.prototype.close=function(){if(!this.closed){if(this.closed=!0,this.buf)for(this.xform["@@transducer/result"](this.buf);;){if(0===this.buf.count())break;if(t=this.takes.pop(),t===c.EMPTY)break;if(t.is_active()){n=t.commit();var e=this.buf.remove();i(n,e)}}for(;;){var t=this.takes.pop();if(t===c.EMPTY)break;if(t.is_active()){var n=t.commit();i(n,h)}}for(;;){var r=this.puts.pop();if(r===c.EMPTY)break;if(r.handler.is_active()){var a=r.handler.commit();a&&i(a,!1)}}}},v.prototype.is_closed=function(){return this.closed},o.prototype["@@transducer/init"]=function(){throw new Error("init not available")},o.prototype["@@transducer/result"]=function(e){return e},o.prototype["@@transducer/step"]=function(e,t){return e.add(t),e},t.chan=function(e,t,n){if(t){if(!e)throw new Error("Only buffered channels can use transducers");t=t(new o)}else t=new o;return t=u(n)(t),new v(c.ring(32),c.ring(32),e,t)},t.Box=p,t.Channel=v,t.CLOSED=h},function(e,t){"use strict";t.__esModule=!0;var n={BDA_UNITIALIZED_MPEG2STREAMTYPE:-1,Reserved1:0,ISO_IEC_11172_2_VIDEO:1,ISO_IEC_13818_2_VIDEO:2,ISO_IEC_11172_3_AUDIO:3,ISO_IEC_13818_3_AUDIO:4,ISO_IEC_13818_1_PRIVATE_SECTION:5,ISO_IEC_13818_1_PES:6,ISO_IEC_13522_MHEG:7,ANNEX_A_DSM_CC:8,ITU_T_REC_H_222_1:9,ISO_IEC_13818_6_TYPE_A:10,ISO_IEC_13818_6_TYPE_B:11,ISO_IEC_13818_6_TYPE_C:12,ISO_IEC_13818_6_TYPE_D:13,ISO_IEC_13818_1_AUXILIARY:14,ISO_IEC_13818_1_RESERVED:15,ISO_IEC_14496_3_AUDIO:17,USER_PRIVATE:16,ISO_IEC_14496_1_IN_PES:18,ISO_IEC_14496_1_IN_SECTION:19,ISO_IEC_13818_6_DOWNLOAD:20,METADATA_IN_PES:21,METADATA_IN_SECTION:22,METADATA_IN_DATA_CAROUSEL:23,METADATA_IN_OBJECT_CAROUSEL:24,METADATA_IN_DOWNLOAD_PROTOCOL:25,IRPM_STREAMM:26,ITU_T_H264:27,ISO_IEC_USER_PRIVATE:128,DOLBY_AC3_AUDIO:129,DOLBY_DIGITAL_PLUS_AUDIO_ATSC:135};t["default"]=n},,,,,,,,,,,function(e,t,n){"use strict";function r(e,t){var n=o.chan(s.fixed(1));return new c.Process(e,function(e){e===o.CLOSED?n.close():c.put_then_callback(n,e,function(e){n.close()})},t).run(),n}function i(e,t){t=t||[];var n=e.apply(null,t);return r(n,e)}function a(e,t,n){var r;return 0===e&&(e=null),r="number"==typeof e?s.fixed(e):e,o.chan(r,t,n)}var s=n(37),o=n(24),u=n(55),c=n(96),f=n(97);e.exports={buffers:{fixed:s.fixed,dropping:s.dropping,sliding:s.sliding},spawn:r,go:i,chan:a,DEFAULT:u.DEFAULT,CLOSED:o.CLOSED,put:c.put,take:c.take,offer:c.offer,poll:c.poll,sleep:c.sleep,alts:c.alts,putAsync:c.put_then_callback,takeAsync:c.take_then_callback,NO_VALUE:c.NO_VALUE,timeout:f.timeout}},function(e,t){"use strict";function n(e,t,n,r,i){for(var a=0;;){if(a>=i)break;n[r+a]=e[t+a],a++}}var r={toString:function(){return"[object EMPTY]"}},i=function(e,t,n,r){this.length=n,this.array=r,this.head=e,this.tail=t};i.prototype._unshift=function(e){var t=this.array,n=this.head;t[n]=e,this.head=(n+1)%t.length,this.length++},i.prototype._resize=function(){var e=this.array,t=2*e.length,r=new Array(t),i=this.head,a=this.tail,s=this.length;ai?(n(e,a,r,0,e.length-a),n(e,0,r,e.length-a,i),this.tail=0,this.head=s,this.array=r):a===i&&(this.tail=0,this.head=0,this.array=r)},i.prototype.unbounded_unshift=function(e){this.length+1===this.array.length&&this._resize(),this._unshift(e)},i.prototype.pop=function(){if(0===this.length)return r;var e=this.array,t=this.tail,n=e[t];return e[t]=null,this.tail=(t+1)%e.length,this.length--,n},i.prototype.cleanup=function(e){for(var t=this.length,n=0;n=this.n},a.prototype.remove=function(){return this.buf.pop()},a.prototype.add=function(e){this.buf.unbounded_unshift(e)},a.prototype.count=function(){return this.buf.length};var s=function(e,t){this.buf=e,this.n=t};s.prototype.is_full=function(){return!1},s.prototype.remove=function(){return this.buf.pop()},s.prototype.add=function(e){this.buf.length=s)break;e++}u=!1,o.length>0&&i()}var i,a=n(37),s=1024,o=a.ring(32),u=!1,c=!1;if("undefined"!=typeof MessageChannel){var f=new MessageChannel;f.port1.onmessage=function(e){r()},i=function(){c&&u||(c=!0,f.port2.postMessage(0))}}else i="undefined"!=typeof e?function(){c&&u||(c=!0,e(r))}:function(){c&&u||(c=!0,setTimeout(r,0))};t.run=function(e){o.unbounded_unshift(e),i()},t.queue_delay=function(e,t){setTimeout(e,t)}}).call(t,n(48).setImmediate)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.SegmentOriginalData=t.Dimensions=t.Segment=t.StreamInfo=t.Level=void 0;var a=n(62),s=r(a),o=n(1),u=(t.Level=function(){function e(){i(this,e),this.segments=[],this.mediaSequence=0,this.mediaSequenceMap={},this.streamInfo=new u,this.updatedInLastRefresh=!1,this.disabled=!1,this.segmentFileSize=new s["default"](30)}return e.prototype.containsSegment=function(e){return!!e&&void 0!==this.mediaSequenceMap[e.mediaSequenceId]},e.prototype.flushSegmentInfo=function(){this.segments=[],this.mediaSequenceMap={}},e.prototype.appendSegment=function(e){return!this.containsSegment(e)&&(this.segments.push(e),this.mediaSequenceMap[e.mediaSequenceId]=e,!0)},e.prototype.updateSegments=function(){if(this.segments.length){for(var e=-1,t=this.segments,n=void 0,r=0;r=this.mediaSequence&&e===-1&&(e=n.start)}this.streamInfo.end=n.end,e!==-1&&(this.streamInfo.start=e)}},e.prototype.getSegmentTimeRange=function(t,n){return e.getRanges(this.segments,t,n)},e.prototype.getLastSegment=function(){return o.last(this.segments)},e.getRanges=function(e,t,n){return o.filter(e,function(e){return t<=e.end&&n>=e.start})},e}(),t.StreamInfo=function l(){i(this,l),this.label="",this.urls=[],this.bandwidth=1e5,this.start=0,this.end=0,this.codecs=[],this.trackTypes=[],this.resolution=new c,this.targetDuration=5,this.originalIndex=0,this.video="",this.audio="",this.programId=0,this.hasEndlist=!1}),c=(t.Segment=function d(){i(this,d),this.duration=0,this.title="",this.start=0,this.end=0,this.discontinuity=0,this.mediaSequenceId=0,this.url="",this.key="",this.aesKeyUri="",this.aesIV=[],this.originalData=new f,this.byteRange={},this.pts=0,this.size=0,this.isLast=!1},t.Dimensions=function h(){i(this,h),this.width=0,this.height=0}),f=t.SegmentOriginalData=function p(){i(this,p),this.duration=0,this.start=0,this.end=0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){if(0!==c.size(this.requestsInFlight)){var e=c.reduce(this.requestsInFlight,function(e,t){return e+(t.avgBandwidth.average()||0)},0);this.averageDownlink_.push(e)}}t.__esModule=!0,t.Network=t.RequestType=void 0;var s=n(62),o=r(s),u=n(41),c=n(1),f=n(3),l=n(6),d=t.RequestType=void 0;!function(e){e[e.Text=0]="Text",e[e.ByteArray=1]="ByteArray"}(d||(t.RequestType=d={}));var h=function m(e,t,n){i(this,m),this.uri=e,this.requester=t,this.estimatedSize=n,this.avgBandwidth=new o["default"](20)},p=function(){function e(t){i(this,e),this.requests_=[],this.destroyed_=!1,this.credentials="omit",this.requestsInFlight={},c.extend(this,f),this.recordBandwidth_=c.throttle(a.bind(this),100),this.averageDownlink_=new o["default"](20),this.averageLatency_=new o["default"](10),this.credentials=t&&t.withCredentials?"include":"omit"}return e.prototype.status=function(){var e=c.filter(this.requestsInFlight,function(e){return"media-file"===e.requester});return{requestsOutstanding:c.size(e),bandwidth:Math.max(this.averageDownlink_.average(),0),bandwidthMax:Math.max(this.averageDownlink_.max(),0),latency:this.averageLatency_.average()/1e3}},e.prototype.maxLatency=function(){return this.averageLatency_.max()},e.prototype.request=function(e){function t(e){var t=f.indexOf(e);return f.splice(t,1),e}var n=this;if(this.destroyed_)throw"Network Engine destroyed";for(var r=e.retryParameters||{},i=r.maxAttempts||1,a=r.backoffFactor||2,s=null==r.baseDelay?500:r.baseDelay,o=this.send_(e,0),u=function(t){var r=t%e.uris.length;o=o["catch"](function(){return n.resend_(e,s,r)}),s*=a},c=1;c5){var v=Math.floor(o/m);u.requestsInFlight[r].avgBandwidth.push(v),u.recordBandwidth_(),t=p,o=0}n(e,t,o)})}if(t.error)throw t.error;var r=t.requestId,i=c.identity;e===d.Text&&!function(){var e=void 0;e=new TextDecoder,i=function(t,n){return e.decode(t||Uint8Array,{stream:n})}}();var a=l.chan(1e5),s=l.chan(),o=c.now()-t.startTime;o=Math.min(Math.max(10,o||0),3e3),this.averageLatency_.push(o);var u=this,f=0,h=t.response.body.getReader();return n(h,c.now(),0),{chan:a,metaChan:s,url:t.url}},e.prototype.send_=function(e,t){var n=e.uris[t],r=e.requester,i=c.uniqueId("request_"),a=new h(n,r,100);this.requestsInFlight[i]=a;var s={requestId:i,startTime:c.now(),url:n,response:void 0,error:void 0},o={credentials:this.credentials};return fetch(n,o)["catch"](function(){return s.url&&"http:"===s.url.substring(0,5)&&"https:"===document.location.protocol?s.error="Unable to fetch HTTP resource over HTTPS":s.error="Crossdomain access denied",null}).then(function(e){if(s.response=e,!e||!e.ok)throw s.error=s.error||e.status+" "+e.statusText,s;return s})},e.prototype.resend_=function(e,t,n){var r=this,i=e.retryParameters||{},a=null==i.fuzzFactor?.5:i.fuzzFactor,s=2*Math.random()-1,o=s*a,c=t*(1+o);return(0,u.wait)(c).then(function(){return r.send_(e,n)})},e.prototype.destroy=function(){this.destroyed_=!0;var e=c.map(this.requests_,function(e){return e["catch"](c.noop)});return Promise.all(e)},e}();t.Network=p},function(e,t,n){"use strict";function r(e){return new Promise(function(t){setTimeout(t,e)})}function i(e){return new Promise(function(t){a.takeAsync(e,t)})}t.__esModule=!0,t.wait=r,t.channelToPromise=i;var a=n(6)},,,,,,,function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var a=n(83).nextTick,s=Function.prototype.apply,o=Array.prototype.slice,u={},c=0;t.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=!(arguments.length<2)&&o.call(arguments,1);return u[n]=!0,a(function(){u[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(t,n(48).setImmediate,n(48).clearImmediate)},,,,function(e,t,n){var r,i;r=[n(2)],i=function(e){return{volume:function(t){t=e.between(t/100,0,1),this.video.volume=t},mute:function(e){this.video.muted=!!e},resize:function(t,n,r){if(!(t&&n&&this.video.videoWidth&&this.video.videoHeight))return!1;if("uniform"===r){var i=t/n,a=this.video.videoWidth/this.video.videoHeight,s=null;Math.abs(i-a)<.09&&(s="fill"),e.style(this.video,{objectFit:s})}return!1},getVideo:function(e){var t=document.getElementById(e),n=(t?t.querySelector("video"):void 0)||document.createElement("video");return n.className="jw-video jw-reset",this.video=n,n}}}.apply(t,r),!(void 0!==i&&(e.exports=i))},function(e,t,n){var r,i;r=[n(3),n(20),n(5)],i=function(e,t,n){var r=256;return{attached:!0,beforeComplete:!1,stallCheckTimeout_:-1,lastStalledTime_:NaN,trigger:function(t,n){if(this.attached)return e.trigger.call(this,t,n)},setState:function(e){if(this.attached)return t.setState.call(this,e)},checkComplete:function(){return this.beforeComplete},playbackComplete_:function(){this.stopStallCheck(),this.setState(n.COMPLETE),this.beforeComplete=!1,this.trigger("complete")},attachMedia:function(){this.attached=!0,this.eventsOn_(),this.beforeComplete&&this.playbackComplete_()},detachMedia:function(){return this.stopStallCheck(),this.attached=!1,this.eventsOff_(),this.video},stopStallCheck:function(){clearTimeout(this.stallCheckTimeout_)},startStallCheck:function(){this.stopStallCheck(),this.stallCheckTimeout_=setTimeout(this.stalledHandler.bind(this),r)},stalledHandler:function(){return this.lastStalledTime_!==this.video.currentTime?void(this.lastStalledTime_=this.video.currentTime):void(this.video.paused||this.video.ended||this.state!==n.LOADING&&this.state!==n.ERROR&&(this.seeking||this.setState(n.STALLED)))}}}.apply(t,r),!(void 0!==i&&(e.exports=i))},function(e,t,n){var r,i;r=[n(2),n(5)],i=function(e,t){return{seeking:!1,loadedmetadata:function(){var e={duration:this.getDuration(),height:this.video.videoHeight,width:this.video.videoWidth},t=this.drmUsed;t&&(e.drm=t),this.trigger("meta",e)},timeupdate:function(){this.stopStallCheck();var e=this.video.videoHeight;e!==this._helperLastVideoHeight&&this.trigger("adaptation",{size:{width:this.video.videoWidth,height:this.video.videoHeight}}),this._helperLastVideoHeight=e,this.state===t.STALLED&&this.setState(t.PLAYING),this.startStallCheck();var n=this.getCurrentTime(),r={position:n,duration:this.getDuration()};if(this.getPtsOffset){var i=this.getPtsOffset();i>=0&&(r.metadata={mpegts:i+n})}(this.state===t.PLAYING||this.seeking)&&this.trigger("time",r)},click:function(e){this.trigger("click",e)},volumechange:function(){var e=this.video;this.trigger("volume",{volume:Math.round(100*e.volume)}),this.trigger("mute",{mute:e.muted})},seeked:function(){this.seeking&&(this.seeking=!1,this.trigger("seeked"))},playing:function(){this.setState(t.PLAYING)},pause:function(){this.state!==t.COMPLETE&&(this.video.ended||this.video.currentTime!==this.video.duration&&this.setState(t.PAUSED))},progress:function(){var t=this.getDuration();if(!(t<=0||t===1/0)){var n=this.video.buffered;if(n&&0!==n.length){var r=e.between(n.end(n.length-1)/t,0,1);this.trigger("bufferChange",{bufferPercent:100*r,position:this.getCurrentTime(),duration:t})}}},ended:function(){if(this.stopStallCheck(),this._helperLastVideoHeight=0,this.state!==t.IDLE&&this.state!==t.COMPLETE){if(this.beforeComplete=!0,this.attached=!0,this.trigger("beforeComplete"),!this.attached)return;this.playbackComplete_()}},loadeddata:function(){this.setTextTracks(this.video.textTracks),this.video.setAttribute("jw-loaded","data")},error:function(){var e=this.video.error&&this.video.error.code||-1,t={1:"Unknown operation aborted",2:"Unknown network error",3:"Unknown decode error",4:"Source not supported"}[e]||"Unknown";this.trigger("mediaError",{code:e,message:"Error playing file: "+t})}}}.apply(t,r),!(void 0!==i&&(e.exports=i))},function(e,t,n){"use strict";function r(e){return Math.floor(Math.random()*(e+1))}function i(e){var t,n=new Array(e);for(t=0;tt?i.segments:[]})})},e.prototype.getSegmentFromIndex=function(e){var t=e.split("_"),n=t[0],r=t[1],i=this.levels_[parseInt(n)];return i.mediaSequenceMap[r]},e.prototype.updateTS=function(e,t,n){var r=this.levels_[e],i=r.mediaSequenceMap[t];i&&"video"===n.type&&n.duration&&(i.duration=n.duration,i.pts=n.start,this.updateTimeline_(r))},e.prototype.setPtsMapping=function(e,t,n){this.ptsToSecondsMap_[e]||(this.ptsToSecondsMap_[e]={discontinuity:e,pts:t,seconds:n})},e.prototype.getPtsMapping=function(e){return this.ptsToSecondsMap_[e]},e.prototype.updateLevel=function(e){var t=this.levels_[e.level];t.segmentFileSize.push(e.size);var n=t.segmentFileSize.max()/t.streamInfo.targetDuration; t.streamInfo.bandwidth=Math.max(t.streamInfo.bandwidth,n)},e.prototype.refreshManifest=function(e){var t=this;return"VOD"===this.streamType&&this.levels_[e].segments.length?Promise.resolve(this.currentManifestMetadata):(this.fetchDataPromise_=this.fetchManifestData_({manifestURL:this.url,loadStreamIndex:e}).then(function(e){return t.refreshLevels_(e)}).then(function(e){return t.appendManifestInfoToLevels_(e)}).then(function(e){var n=e.media.streamInfo.originalIndex,r=t.levels_[n];return t.referenceTimeline_=r,t.updateTimeline_(r),t.currentManifestMetadata}).then(function(e){var n=u.any(e.levels,u.property("updatedInLastRefresh"));return t.refreshesWithoutChanges=n?0:t.refreshesWithoutChanges+1,e}),this.fetchDataPromise_)},e.prototype.destroy=function(){this.liveManifestLoader&&this.liveManifestLoader.destroy(),this.network&&(this.network=null)},e.prototype.fetchManifest_=function(e){var t=this;return this.fetchDataPromise_=this.fetchManifestData_(e).then(function(e){return t.setupLevels_(e)})["catch"](function(e){return e}).then(function(e){var n=u.isString(e);if(n)throw e;var r=u.where(t.levels_,{disabled:!1});if(!r.length)throw"No levels to play";if(!t.referenceTimeline_||t.referenceTimeline_.disabled)throw"Playlist could not be loaded";var i=t.referenceTimeline_.streamInfo;return t.sortedLevels_=t.getSortedLevels_(r),t.currentManifestMetadata={initialLevel:t.initialLevel,sortedLevels:t.sortedLevels_,levels:r,trackTypes:r[0].streamInfo.trackTypes,streamType:t.streamType,start:i.start,end:i.end},t.currentManifestMetadata}),this.fetchDataPromise_},e.prototype.doneLoading=function(){return this.fetchDataPromise_},e.prototype.fetchManifestData_=function(e){function t(t,n){var i=e.loadStreamIndex;u.isNumber(i)&&!u.isNaN(i)||(i=r.getLevelFromLabel(t,e.loadStreamLabel));var a=t[i],s=n.getPlaylist();return s.streamInfos=t,r.downloadAndParseThrottle_(a.urls,a).then(function(e){return{master:s,media:e.parser.getPlaylist()}})["catch"](function(){return{master:s,media:{streamInfo:a}}})}function n(e){var n=e.parser;if(e.children=r.groupRedundantStreams_(e.children),e.children.length)return r.parsedMaster_=e,t(e.children,n);var i=n.getPlaylist();return{master:void 0,media:i}}var r=this;return this.url===e.manifestURL&&this.parsedMaster_?t(this.parsedMaster_.children,this.parsedMaster_.parser):this.downloadAndParseThrottle_([e.manifestURL]).then(n)},e.prototype.downloadAndParseThrottle_=function(t,n){var r=n?e.makeRedundantStreamKey(n):t[0],i=u.now(),a=this.lastManifestRefreshTime_[r];if(a&&i-a.time<500)return a.promise;var s=this.downloadAndParse_(t,n);return this.lastManifestRefreshTime_[r]={time:i,promise:s},s},e.prototype.downloadAndParse_=function(e,t){var n=new i.ManifestParser(t),r=new a.ManifestLoader(this.network),s=[];return r.on("baseUrlFound",n.setBaseUrl,n),n.on("mediaPlaylistFound",function(e){s.push(e)}),r.on("manifestChunk",n.parse,n),r.load(e).then(function(){return n.off(),r.off(),{children:s,parser:n}})},e.prototype.suspendManifestReloading=function(){"LIVE"===this.streamType&&this.liveManifestLoader&&this.liveManifestLoader.cancelReloading()},e.prototype.refreshLevels_=function(e){var t=this,n=e.media;if(!n.streamInfo)return null;var r=u.where(this.levels_,{disabled:!1});if(r.length>1&&(this.disableLevel_(n),r=u.where(this.levels_,{disabled:!1})),r.length!==this.sortedLevels_.length){this.sortedLevels_=this.getSortedLevels_(r),this.currentManifestMetadata.levels=r,this.currentManifestMetadata.sortedLevels=this.sortedLevels_;var i=r[0],a=i.streamInfo.originalIndex,s=u.indexOf(this.sortedLevels_,this.levels_[a]);return this.trigger("levels-disabled",{levels:this.sortedLevels_,nextIndex:s}),this.fetchManifestData_({manifestURL:this.url,loadStreamIndex:a}).then(function(e){return t.refreshLevels_(e)})}return Promise.resolve(e)},e.prototype.setupLevels_=function(e){var t=this;e.master||(e.master=new i.Playlist,e.master.streamInfos=[e.media.streamInfo]),this.levels_.length||(this.levels_=u.map(e.master.streamInfos,function(t){var n=new s.Level;return n.streamInfo=t,n.streamInfo.video&&e.master.renditions.video&&(n.streamInfo.video=e.master.renditions.video[n.streamInfo.video]),n.streamInfo.audio&&e.master.renditions.audio&&(n.streamInfo.audio=e.master.renditions.audio[n.streamInfo.audio]),n})),u.each(this.levels_,function(e,t){e.streamInfo.originalIndex=t});var n=e.media;if(!n.streamInfo)return Promise.reject("Invalid manifest file");this.disableLevels_(n);var r=n.streamInfo.originalIndex,a=this.levels_[r],o=a.streamInfo;this.referenceTimeline_=a,o.start=n.streamInfo.start,o.end=n.streamInfo.end,o.targetDuration=n.streamInfo.targetDuration,o.hasEndlist?this.streamType="VOD":o.end-o.start>=120&&(this.streamType="DVR"),u.each(n.mediaElements,function(e){e.level=r,a.appendSegment(e)}),this.initialLevel=a;var c=u.where(this.levels_,{disabled:!1});if(!c.length)throw"No levels to play";if(this.sortedLevels_=this.getSortedLevels_(c),a.disabled){var f=c[0].streamInfo.originalIndex;return this.fetchManifestData_({manifestURL:this.url,loadStreamIndex:f}).then(function(e){return t.setupLevels_(e)})}return Promise.resolve()},e.prototype.setCurrentQuality=function(e){if(e!==-1){var t=this.sortedLevels_[e];this.refreshManifest(t.streamInfo.originalIndex)}},e.prototype.disableLevels_=function(e){e&&this.disableLevel_(e);var t=u.any(this.levels_,function(e){return u.any(e.streamInfo.trackTypes,function(e){return"video"===e.type})}),n=u.any(this.levels_,function(e){return u.contains(e.streamInfo.codecs,"mp4a.40.2")});u.each(this.levels_,function(e){var r=1===e.streamInfo.trackTypes.length&&"audio"===e.streamInfo.trackTypes[0].type,i=e.streamInfo.codecs&&u.contains(e.streamInfo.codecs,"mp4a.40.5");(t&&r||n&&i)&&(e.disabled=!0)})},e.prototype.disableLevel_=function(e){var t=e.mediaElements;if(!t||!t.length||!t[0].url){var n=e.streamInfo.originalIndex;this.levels_[n].disabled=!0}},e.prototype.getSortedLevels_=function(e){var t=u.clone(e);return t.sort(function(e,t){return t.streamInfo.resolution.height&&e.streamInfo.resolution.height?t.streamInfo.resolution.height-e.streamInfo.resolution.height:t.streamInfo.bandwidth-e.streamInfo.bandwidth}),t},e.prototype.appendManifestInfoToLevels_=function(e){var t=e.media,n=t.streamInfo.originalIndex,r=this.levels_[n];if(r.mediaSequence=t.mediaSequence,"DVR"===this.streamType||"LIVE"===this.streamType){t.segments=t.mediaElements||[],r.updateSegments.call(t);var i=this.syncLiveLevels_(t);i||this.referenceTimeline_.segments.length&&(t.mediaElements[0].start=u.last(this.referenceTimeline_.segments).end,this.ptsToSecondsMap_={}),t.streamInfo.hasEndlist&&(u.each(this.levels_,function(e){e.streamInfo.hasEndlist=!0}),this.streamType=this.currentManifestMetadata.streamType="VOD")}var a=!1;return u.each(t.mediaElements,function(e){var t=r.appendSegment(e);t&&(a=!0),e.level=r.streamInfo.originalIndex}),r.updatedInLastRefresh=a,r.streamInfo.targetDuration=t.streamInfo.targetDuration,e},e.prototype.updateTimeline_=function(e){e.updateSegments(),e===this.referenceTimeline_&&(this.currentManifestMetadata.start=e.streamInfo.start,this.currentManifestMetadata.end=e.streamInfo.end)},e.prototype.syncLiveLevels_=function(e){var t=this,n=!1;return u.each(this.levels_,function(r){if(t.attemptSync_(e,r))n=!0;else{var i=t.liveManifestLoader.refreshRequests[r.streamInfo.originalIndex];i&&i.cycles||r.flushSegmentInfo()}}),n},e.prototype.attemptSync_=function(e,t){var n=e.mediaElements[0],r=t.getLastSegment();if(0===t.segments.length)return!1;if(r.mediaSequenceId+1===n.mediaSequenceId)return n.start=r.end,!0;for(var i=0,a=0;i=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s,u=e.makeRedundantStreamKey(o),c=n[u];c?c.urls=c.urls.concat(o.urls):n[u]=o}return Object.keys(n).map(function(e){return n[e]})},e.makeRedundantStreamKey=function(e){var t=e.resolution;return t&&t.width&&t.height?""+t.width+"x"+t.height:e.bandwidth?""+e.bandwidth:"no resolution"},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.StreamingEngine=void 0;var a=n(7),s=r(a),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},u=n(104),c=n(98),f=r(c),l=n(210),d=n(1),h=n(2),p=n(3),m=n(6),v=n(23),y=window,g=y.VTTCue||y.TextTrackCue,_=1,b=10,T=60,x=50,k=200,w=30,E={video:{"default":'video/mp4; codecs="avc1.4d4015"'},audio:{"default":"audio/aac",aac:"audio/aac",mp3:"audio/mpeg"}};t.StreamingEngine=function(){function e(t,n,r,a,s){var o=this;i(this,e),this.lastTransmuxSessionComplete_=Promise.resolve([]),this.onTickInterval=-1,this.bufferEventSent_=!1,this.startOfStream_=!0,this.lastDuration_=NaN,d.extend(this,p),this.network=n,this.video=r,this.mediaSource=a,this.manifestRepresentation=t,this.mediaDataModel=new u.MDM(t,n),this.adaptive=new f["default"],this.edition_=s,this.supports=new v(s),this.manifestRepresentation.on("levels-disabled",function(e){var t=e.nextIndex;e.levels.length>1&&t++,o.adaptive.updateLevels(e.nextIndex),o.trigger("levels",{levels:e.levels,currentQuality:t})}),this.adaptive.on("quality-change",function(e){o.manifestRepresentation.setCurrentQuality(e)}),this.textTrackCache_={captions:{cues:{}},metadata:{cues:{}}},this.mediaDataModel.on("segment-download-error",function(e){o.trackTypes_||o.beginStream()})}return e.prototype.updateDuration_=function(e){return"VOD"!==e.streamType&&e.end>this.video.duration&&this.msee.setDuration(e.end),this.onDurationChange(e),e},e.prototype.clearBackBuffer_=function(e){var t=this;if(!this.mediaSource.sourceBuffers.length||!this.lastTransmuxSession_.tmsArray.length)return Promise.resolve(e);var n=d.last(this.lastTransmuxSession_.tmsArray).ts.isLast;if(this.mediaSource.sourceBuffers[0].buffered.length&&!n){var r=function(){var n=t.mediaSource.sourceBuffers[0].buffered.start(0),r=Math.max(t.video.currentTime-T,0);if(r-n>b)return{v:t.removeBuffer(0,r).then(function(){return t.mediaDataModel.removeAllTmsInRange(0,r),e})["catch"](function(){return e})}}();if("object"===("undefined"==typeof r?"undefined":o(r)))return r.v}return Promise.resolve(e)},e.prototype.skipVideoBeforeAudio=function(){if(this.msee&&2===this.mseeTracks_.length){var e=this.msee.sourceBuffers_.video.buffered,t=this.msee.sourceBuffers_.audio.buffered;if(e.length&&t.length){var n=e.start(0),r=t.start(0);if(this.video.currentTime===n&&n.2)return e;var r=this.manifestRepresentation.levels_[n.level].segments,i=r.indexOf(n),a=r[i+1];if(!a||i===-1)return e;if(n.errorInSegment)return this.video.currentTime=n.end+.01,e;if(a.errorInSegment&&a.start-t<.2)return this.video.currentTime=a.end+.01,e;var s=this.firstBufferedRange_(t),o=this.mediaDataModel.currentTransmuxSession,u=d.pluck(this.mseeTracks_,"type");return t>=n.start&&tt&&(this.video.currentTime=s),n.discontinuity!==a.discontinuity&&this.video.buffered.length>1&&(this.video.currentTime=a.start),e},e.prototype.firstBufferedRange_=function(e){var t=d.map(this.mseeTracks_,function(t){for(var n=this.msee.sourceBuffers_[t.type].buffered,r=n.length,i=0;i=a&&e<=n.end(i)||e<=a)return a}return e},this);return Math.max.apply(Math,t)},e.prototype.onTick_=function(){var e=this;if(this.msee){if(this.video&&this.video.error)return this.destroy();this.adaptive.whatToDownload(this).then(this.buffer_.bind(this)),this.manifestRepresentation.doneLoading().then(function(t){return e.updateDuration_(t)}).then(function(t){return e.skipDiscontinuousZones(t)}).then(function(t){return e.clearBackBuffer_(t)})["catch"](function(t){return e.trigger("error",t)})}},e.prototype.removeBuffer=function(e,t){if(!this.msee)return Promise.resolve();var n=d.map(this.mseeTracks_,function(n){return this.msee.remove(n.type,e,t)["catch"](function(){})},this);return this.mediaDataModel.removeInactiveTmsInRange(e,t),Promise.all(n)},e.prototype.setCurrentQuality=function(e){var t=this.manifestRepresentation.sortedLevels_;this.adaptive.setQuality(e,t)},e.prototype.addListeners=function(){this.removeVideoListeners_(),this.onTimeUpdateListener=this.onTimeUpdate_.bind(this),this.onSeekingListener=this.onSeeking_.bind(this),this.video.addEventListener("timeupdate",this.onTimeUpdateListener,!1),this.video.addEventListener("seeking",this.onSeekingListener,!1),this.onTickThrottle_=d.throttle(this.onTick_.bind(this),x),this.resumeOnTick()},e.prototype.removeVideoListeners_=function(){this.video.removeEventListener("timeupdate",this.onTimeUpdateListener),this.video.removeEventListener("seeking",this.onSeekingListener)},e.prototype.removeListeners=function(){this.removeVideoListeners_(),this.suspendOnTick(),this.adaptive.off(),this.manifestRepresentation&&this.manifestRepresentation.off(),this.off()},e.getLiveStartTime=function(e){var t=e.end-e.start,n=h.between(.75*t,w/2,w),r=Math.max(e.start,e.end-n),i=e.initialLevel.getSegmentTimeRange(r,r);return i.length?i[0].start:0},e.prototype.setupMSEE_=function(e){var t=this;return new Promise(function(n,r){function i(){t.mediaSource.removeEventListener("sourceopen",i);try{t.msee=new l(t.mediaSource,null);var a=d.reduce(e,function(e,t){var n=E[t.type],r=n[t.codec]||n["default"];return e[t.type]=r,e},{});t.msee.init(a)}catch(s){r(s)}n(t.msee)}t.mediaSource.addEventListener("sourceopen",i),"open"===t.mediaSource.readyState&&i()})},e.prototype.setMseReady_=function(){var e=this;return this.mseReady=this.mediaDataModel.getTrackTypes().then(function(t){return e.mseeTracks_=t,e.trackTypes_=t.concat([{type:"metadata"},{type:"captions"}]),e.trigger("trackTypes",t),t}).then(this.setupMSEE_.bind(this))["catch"](function(e){})},e.prototype.setManifest=function(e,t){var n=this,r=this.manifestRepresentation.load(e,t).then(function(e){return n.onDurationChange(e)}).then(function(e){var r=void 0;return"Auto"===t?r=0:(r=d.indexOf(e.sortedLevels,n.manifestRepresentation.initialLevel),r+=1),n.setCurrentQuality(r),n.trigger("levels",{levels:e.sortedLevels,currentQuality:r}),n.trigger("trackTypes",e.trackTypes),e})["catch"](function(e){throw"Cannot load M3U8: "+e});return this.setMseReady_(),Promise.all([this.mseReady,r]).then(function(e){var t=e[1];n.msee.setDuration(t.end)})["catch"](function(){return null}),r},e.prototype.beginStream=function(){this.adaptive.whatToDownload(this,this.startOfStream_).then(this.buffer_.bind(this))["catch"](function(e){}),this.startOfStream_=!1,this.addListeners();var t=this;this.video.addEventListener("progress",function n(e){var r=e.target;t.msee&&t.minForwardBuffer()>_&&(r.removeEventListener("progress",n),t.bufferEventSent_=!0,t.trigger("bufferFull"))},!1),"LIVE"!==this.manifestRepresentation.streamType&&"DVR"!==this.manifestRepresentation.streamType||this.video.addEventListener("loadedmetadata",function r(n){var i=n.target;i.removeEventListener("loadedmetadata",r),t.manifestRepresentation&&(i.currentTime=e.getLiveStartTime(t.manifestRepresentation.currentManifestMetadata))})},e.prototype.buffer_=function(e){var t=this,n=e.segment;if(n&&!(n.end0)return s;var f=e[i];3!==f&&0!==f||(--u,i++);var l=e.buffer.slice(o-10,i+u+1);s.push({data:l}),i+=u+1}return s}t.__esModule=!0,t["default"]=r;var a=n(21),s=9},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n,r,i,a){var s;return l["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return console.assert(r.closed===!1,"Audio channel should not be closed"),s=m.combineUint8Arrays(t,n),o.next=4,h.put(r,{sourceFile:e,codec:a,type:"init",start:i});case 4:return o.next=6,h.put(r,{sourceFile:e,codec:a,type:"mediaSegment",payload:s});case 6:case"end":return o.stop()}},g[0],this)}function s(e,t){return l["default"].mark(function n(){var r,i,s,u,c,f,d;return l["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r=void 0,i=[],s=0,u=Number.MAX_VALUE,c=void 0,f=!1,d=void 0;case 7:return n.t0=h.CLOSED,n.next=10,h.take(e);case 10:if(n.t1=r=n.sent,n.t0===n.t1){n.next=30;break}if("error"!==r.type){n.next=17;break}return n.next=15,h.put(t,r);case 15:return t.close(),n.abrupt("return");case 17:if(c=r.sourceFile,d=d||o(r),u=Math.min(u,r.pts),i.push(r.payload),s+=r.payload.length,!((r.pts-u)/9e4>1||!f||s>2e4)){n.next=28;break}return f=!0,n.delegateYield(a(c,i,s,t,u,d),"t2",25);case 25:s=0,i=[],u=Number.MAX_VALUE;case 28:n.next=7;break;case 30:return n.delegateYield(a(c,i,s,t,u,d),"t3",31);case 31:t.close();case 32:case"end":return n.stop()}},n,this)})}function o(e){switch(e.type){case y["default"].ISO_IEC_13818_1_RESERVED:var t=u(e.payload),n=t.frameData||{},r=0===n.mpegVersion&&n.channels>1&&n.rateIndex>=6,i=1===n.mpegVersion&&n.rateIndex>6;return r||i?"mp4a.40.5":"mp4a.40.2";case y["default"].ISO_IEC_11172_3_AUDIO:case y["default"].ISO_IEC_13818_3_AUDIO:default:return"mp3"}}function u(e){for(var t=0,n=0,r={},i=0;t>4,n=4095===t;if(n){var r=e[1]>>>3&1,i=e[1]>>>1&3;if(0===i){var a=(e[2]>>>6&3)+1,s=e[2]>>>2&15;if(15!==s){var o=(1&e[2])<<2|e[3]>>>6&3,u=(3&e[3])<<11|(255&e[4])<<3|(224&e[5])>>5;if(0!==u)return{mpegVersion:r,profile:a,rateIndex:s,channels:o,frameLength:u}}}}}t.__esModule=!0;var f=n(7),l=i(f);t["default"]=s,t.parseFrame=c;var d=n(6),h=r(d),p=n(16),m=r(p),v=n(25),y=i(v),g=[a].map(l["default"].mark),_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,0,0]},function(e,t){"use strict";t.__esModule=!0;var n={H264_NAL_UNIT_TYPE:6,H265_NAL_UNIT_TYPE:39,SEI_PAYLOAD_ITU_T_35:4,ITU_T_T35_COUNTRY_CODE:181,ITU_T_T35_PROVIDER_CODE:49,USER_IDENTIFIER_ATSC1_DATA:1195456820,USER_DATA_TYPE_CC_DATA:3,NTSC_CC_FIELD_1:0,NTSC_CC_FIELD_2:1,DTVCC_PACKET_DATA:2,DTVCC_PACKET_START:3,RBSP_TRAILING_BITS:128};t["default"]=n},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n(59),a=n(2),s=function(){function e(){r(this,e)}return e.probeAAC=function(t){for(var n=0,r=t.length-e.AAC_HEADER_SIZE;n12||s.channels>7)}n++}return!1},e.probeMP3=function(t){for(var n,r=0,i=t.length-e.MP3_HEADER_SIZE;r>4,h=(12&t[r+2])>>2,p=(2&t[r+3])>>1,m=3===l?"LAYER1":"OTHER",v=1===l?4:1;switch(f){case 3:a=e.MP3_SAMPLE_RATE_MAP.MPEG1[h],s=e.MP3_BITRATE_MAP.MPEG1[l-1][d],o=e.MP3_SAMPLES_COEFFICENT.MPEG1[l-1];break;case 2:a=e.MP3_SAMPLE_RATE_MAP.MPEG2[h],s=e.MP3_BITRATE_MAP.OTHER[m][d],o=e.MP3_SAMPLES_COEFFICENT.OTHER[l-1];break;default:a=e.MP3_SAMPLE_RATE_MAP["MPEG2.5"][h],s=e.MP3_BITRATE_MAP.OTHER[m][d],o=e.MP3_SAMPLES_COEFFICENT.OTHER[l-1]}s*=1e3,u=Math.floor((o*s/a+p)*v),c=r+u;for(var y=-1*e.MP3_FRAME_TOLERANCE;y<=e.MP3_FRAME_TOLERANCE;y++)if((t[c+y]<<8|65504&t[c+y+1])===e.MP3_SYNCWORD)return!0;return!1}r++}return!1},e.probeMPEGTS=function(t){var n=t[0],r=t[e.TS_PACKET_SIZE];return n===r&&r===e.TS_SYNCBYTE},e.probeID3=function(e){return"ID3"===a.utf8ArrayToStr(e.subarray(0,3))},e}();t["default"]=s,s.AAC_HEADER_SIZE=18,s.AAC_SYNCWORD=65520,s.MP3_HEADER_SIZE=8,s.MP3_SYNCWORD=65504,s.MP3_FRAME_TOLERANCE=3,s.MP3_SAMPLE_RATE_MAP={MPEG1:[44100,48e3,32e3,0],MPEG2:[22050,24e3,16e3,0],"MPEG2.5":[11025,12e3,8e3,0]},s.MP3_BITRATE_MAP={MPEG1:[[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0],[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,0],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0]],OTHER:{LAYER1:[0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,0],OTHER:[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0]}},s.MP3_SAMPLES_COEFFICENT={MPEG1:[12,144,144],OTHER:[12,144,72]},s.TS_PACKET_SIZE=188,s.TS_SYNCBYTE=71},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(t){n(this,e),this._samplesCount=0,this._insertIndex=0,this._sum=0,this._samples=new Array(t),this._size=t}return e.prototype.push=function(e){this._sum+=e-(this._samples[this._insertIndex]||0),this._samples[this._insertIndex]=e,this._samplesCount=Math.max(this._samplesCount,this._insertIndex+1),this._insertIndex=(this._insertIndex+1)%this._samples.length},e.prototype.average=function(){return 0===this._samplesCount?0:this._sum/this._samplesCount},e.prototype.max=function(){return 0===this._samplesCount?0:this._samples.reduce(function(e,t){return Math.max(e,t)})},e}();t["default"]=r},,,,,,,,,,,,,,,,,,,,,function(e,t){function n(e){if(u===setTimeout)return setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function r(e){if(c===clearTimeout)return clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function i(){h&&l&&(h=!1,l.length?d=l.concat(d):p=-1,d.length&&a())}function a(){if(!h){var e=n(i);h=!0;for(var t=d.length;t;){for(l=d,d=[];++p1)for(var r=1;r0)){s.next=8;break}return s.next=8,N(r,i);case 8:return r.close(),s.abrupt("break",23);case 12:if(o=e(n),o!==a&&a!==j){s.next=17;break}i.push(n),s.next=20;break;case 17:return s.next=19,N(r,i);case 19:i=[n];case 20:a=o;case 21:s.next=0;break;case 23:case"end":return s.stop()}},s,this)})),r}function w(e,t,n){var r=V(n);return B(P["default"].mark(function i(){var n,a,s;return P["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:n=new Array(e),a=0;case 3:if(!(a0)){i.next=11;break}return i.next=11,N(r,n.slice(0,a));case 11:return r.close(),i.abrupt("return");case 13:n[a]=s;case 14:a++,i.next=3;break;case 17:return i.next=19,N(r,n);case 19:i.next=0;break;case 21:case"end":return i.stop()}},i,this)})),r}function E(e){var t=0;for(var n in e)t++;return t}function S(e){var t=e[G];return void 0===t&&(t=e[G]=Y()),t}function I(e){function t(e){return function(t){n--,0===n&&q(i,!0),t||r.untap(e.channel)}}var n,r=new K(e),i=V(1);return B(P["default"].mark(function a(){var s,o,u,c,f;return P["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=3,U(e);case 3:if(s=a.sent,c=r.taps,s!==Q){a.next=9;break}for(o in c)u=c[o],u.keepOpen||u.channel.close();return r.untapAll(),a.abrupt("break",17);case 9:n=E(c),f=n;for(o in c)u=c[o],q(u.channel,s,t(u));if(!(f>0)){a.next=15;break}return a.next=15,U(i);case 15:a.next=0;break;case 17:case"end":return a.stop()}},a,this)})),r}function M(e){var t=new H(e);return B(P["default"].mark(function n(){var r,i,a,s,o,u;return P["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r=t._getAllState();case 1:return n.next=4,X(r.reads);case 4:if(i=n.sent,a=i.value,s=i.channel,a!==Q){n.next=11;break}return delete t.stateMap[S(s)],r=t._getAllState(),n.abrupt("continue",1);case 11:if(s!==t.change){n.next=14;break}return r=t._getAllState(),n.abrupt("continue",1);case 14:if(o=r.solos,!(o.indexOf(s)>-1)&&(0!==o.length||r.mutes.indexOf(s)>-1)){n.next=21;break}return n.next=18,N(e,a);case 18:if(u=n.sent){n.next=21;break}return n.abrupt("break",23);case 21:n.next=1;break;case 23:case"end":return n.stop()}},n,this)})),t}function A(){return null}function C(e,t,n){n=n||A;var r=new $(e,t,n);return B(P["default"].mark(function i(){var n,a,s,o,u;return P["default"].wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=3,U(e);case 3:if(n=i.sent,a=r.mults,n!==Q){i.next=8;break}for(s in a)a[s].muxch().close();return i.abrupt("break",17);case 8:if(s=t(n),o=a[s],!o){i.next=15;break}return i.next=13,N(o.muxch(),n);case 13:u=i.sent,u||delete a[s];case 15:i.next=0;break;case 17:case"end":return i.stop()}},i,this)})),r}var L=n(7),P=r(L),D=[f].map(P["default"].mark),O=n(24).Box,R=n(36),B=R.go,U=R.take,N=R.put,F=R.takeAsync,q=R.putAsync,X=R.alts,V=R.chan,Q=R.CLOSED,j={},Y=function(){var e=0;return function(){return e++,""+e}}(),G="__csp_channel_id",K=function(e){this.taps={},this.ch=e},z=function(e,t){this.channel=e,this.keepOpen=t};K.prototype.muxch=function(){return this.ch},K.prototype.tap=function(e,t){var n=S(e);this.taps[n]=new z(e,t)},K.prototype.untap=function(e){delete this.taps[S(e)]},K.prototype.untapAll=function(){this.taps={}},I.tap=function(e,t,n){return e.tap(t,n),t},I.untap=function(e,t){e.untap(t)},I.untapAll=function(e){e.untapAll()};var H=function(e){this.ch=e,this.stateMap={},this.change=V(),this.soloMode=M.MUTE};H.prototype._changed=function(){q(this.change,!0)},H.prototype._getAllState=function(){var e,t=this.stateMap,n=[],r=[],i=[];for(var a in t){var s=t[a],o=s.state,u=s.channel;o[M.SOLO]&&n.push(u),o[M.MUTE]&&r.push(u),o[M.PAUSE]&&i.push(u)}var c,f;if(this.soloMode===M.PAUSE&&n.length>0){for(f=n.length,e=new Array(f+1),c=0;c1?(this.adaptiveQualityLevel=this.manualQualityLevel,this.desiredQualityArbiter=u.ADAPTIVE,this.trigger("quality-change",this.adaptiveQualityLevel)):(this.desiredQualityArbiter=u.MANUAL,this.manualQualityLevel=n,this.trigger("quality-change",n))},e.prototype.updateLevels=function(e){this.manualQualityLevel=e,this.adaptiveQualityLevel=e},e.prototype.getQuality=function(){return this.desiredQualityArbiter===u.ADAPTIVE?this.adaptiveQualityLevel:this.manualQualityLevel},e.prototype.changeAdaptiveQuality_=function(e,t,n){return!!this.allowQualitySwitching_(e,t,this.adaptiveQualityLevel,n)&&(this.lastAdaptiveSwitchTime_=e.now,"VOD"===this.streamType&&(this.isChangingQuality=!0),e.action.push("Quality switch from "+this.adaptiveQualityLevel+" to "+n),this.adaptiveQualityLevel=n,this.trigger("quality-change",n),!0)},e.prototype.allowQualitySwitching_=function(e,t,n,r){if("VOD"===this.streamType)return e.videoEnd-t>f;e.manifestRepresentation.requestTS(t,t,n),e.manifestRepresentation.requestTS(t,t,r);var i=e.sortedLevels[n],s=e.sortedLevels[r];if(!(i&&s&&i.segments.length&&s.segments.length))return!1;var o=a.Level.getRanges(i.segments,t,t)[0];return s.containsSegment(o)},e.prototype.adaptationEnabled=function(){return this.desiredQualityArbiter===u.ADAPTIVE},e.timeToDownload_=function(e,t){var n=t.segmentFileSize.average()/1e3,r=t.streamInfo.bandwidth/8/1e3*t.streamInfo.targetDuration;n=n?Math.max(n,r):1.5*r;var i=_*n;return n/e.bandwidth+i},e.minForwardBuffer_=function(t,n,r){var i=e.timeToDownload_(t,n);return Math.min(r,Math.max(d,i,n.streamInfo.targetDuration))},e.prototype.earliestSegmentToLoad=function(t){var n=this;return t.manifestRepresentation.requestTS(t.currentTime,t.maxBufferEnd,this.getQuality()).then(function(r){var i=o.last(r);if(r.length)for(var a=t.runway-t.minForwardBuffer,s=e.timeToDownload_(t,t.sortedLevels[n.getQuality()]),u=0,c=r.length-1;c>=1;c--){if(u+=2*s,u>a)return n.isChangingQuality=!1,i;i=r[c]}return n.isChangingQuality=!1,i})},e.maxForwardBuffer_=function(t,n){var r=e.timeToDownload_(t,n);return Math.min(h,Math.max(d,r*l,n.streamInfo.targetDuration*l))},e.prototype.getState_=function(t,n){return t.manifestRepresentation.doneLoading().then(function(r){if(!t.mediaDataModel)return null;var a=t.video.currentTime,s=r.end;if(n){this.streamType=t.manifestRepresentation.streamType;var u=r.levels[0];this.streamInitialQuality=o.indexOf(r.sortedLevels,u),this.manualQualityLevel===-1&&(this.adaptiveQualityLevel=this.streamInitialQuality,this.manualQualityLevel=this.streamInitialQuality)}"VOD"!==r.streamType&&0===a&&(a=i.StreamingEngine.getLiveStartTime(r));var l=r.sortedLevels[this.getQuality()],d=t.network.status(),h=Math.max(1,d.bandwidth),p=d.latency,m=l.streamInfo.targetDuration,v=a+t.maxForwardBuffer(),y=Math.max(v-a-p,0),g=c,_=f;if("VOD"!==this.streamType){g=Math.min(g,m);var b=l.segments.length?o.last(l.segments).end:s;_=Math.min(_,b-a-l.streamInfo.targetDuration)}var T=a+_+m,x=e.minForwardBuffer_(d,l,_),k=e.maxForwardBuffer_(d,l),w=a+k,E=t.mediaDataModel.currentTransmuxSession,S=!0,I=void 0;return E&&!E.forwardBufferCleared&&E.tmsArray.length&&(I=E.tmsArray[0].ts,S=!1,v=I.end),n&&(y=0,v=a,x=1,d.requestsOutstanding=0),{requestsOutstanding:d.requestsOutstanding,bandwidth:h,runway:y,currentTime:a,videoEnd:s,currentBufferEnd:v,targetDuration:m,currentSessionTSSegment:I,sessionBufferCleared:S,minForwardBuffer:x,maxBufferEnd:w,upswitchBufferTime:T,minBufferForDownswitch:g,minBufferForUpswitch:_,action:[],now:o.now(),manifestRepresentation:t.manifestRepresentation,sortedLevels:r.sortedLevels,mdm:t.mediaDataModel}}.bind(this))},e.prototype.liveAdaptive_=function(e){if(this.desiredQualityArbiter===u.MANUAL)return this.firstSegmentToBuffer_(e,e.currentBufferEnd,e.maxBufferEnd);var t=e.now-this.lastAdaptiveSwitchTime_,n=e.sortedLevels.length-1;if(e.now-this.lastTimeWithEnoughBuffer>5e3&&t>p&&this.adaptiveQualityLevel1)){var r=this.targetUpswitchLevel_(e);return t>p&&r5e3&&t>p&&this.adaptiveQualityLevel!==n&&(this.changeAdaptiveQuality_(e,e.currentBufferEnd,n),this.isChangingQuality=!1),e.runway1)){if(e.runwayt.minForwardBuffer)return i}return r},e}();t["default"]=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.Caterpillar=void 0;var i=n(57),a=n(40),s=n(56),o=(n(100),n(3)),u=n(1);n(6),t.Caterpillar=function(){function e(t){r(this,e),u.extend(this,o),this.edition=t}return e.prototype.inited=function(){return!!this.streamingEngine},e.prototype.setup=function(e,t,n,r){this.mediaSource=t,this.videoTag=e,this.preload_=n||"metadata",this.network=new a.Network({withCredentials:r}),this.manifestRepresentation=new s.Manifest(this.network,this.videoTag),this.streamingEngine=new i.StreamingEngine(this.manifestRepresentation,this.network,this.videoTag,this.mediaSource,this.edition)},e.prototype.destroy=function(){this.videoTag&&this.videoTag.pause(),this.streamingEngine&&this.streamingEngine.destroy(),this.manifestRepresentation&&this.manifestRepresentation.destroy(),this.network&&this.network.destroy(),this.streamingEngine=void 0,this.manifestRepresentation=void 0,this.mediaSource=void 0,this.videoTag=void 0},e.prototype.play=function(){this.videoTag&&(this.videoTag.play(),this.streamingEngine.resumeOnTick())},e.prototype.pause=function(){this.videoTag&&(this.videoTag.pause(),this.manifestRepresentation.suspendManifestReloading(),this.streamingEngine.suspendOnTick())},e.prototype.getDuration=function(){if(!this.manifestRepresentation)return 0;var e=this.manifestRepresentation.currentManifestMetadata;return e?"VOD"===e.streamType?e.end:"DVR"===e.streamType?e.start-e.end:1/0:0},e.prototype.getExternalTime=function(e){if(!this.manifestRepresentation)return 0;var t=this.manifestRepresentation.currentManifestMetadata;return t?("DVR"===t.streamType&&(e-=t.end),e):0},e.prototype.getCurrentTime=function(){return this.getExternalTime(this.videoTag.currentTime)},e.prototype.getPtsOffset=function(){return this.streamingEngine.mediaDataModel.getPtsOffset()},e.prototype.getConfiguration=function(){return this.manifestRepresentation?this.manifestRepresentation.doneLoading().then(function(t){var n=this.streamingEngine.mediaDataModel.getSegmentAtTime(this.videoTag.currentTime),r=this.streamingEngine.adaptive.getQuality();if(n){var i=this.manifestRepresentation.levels_[n.level];r=t.sortedLevels.indexOf(i)}var a=!1;return t.sortedLevels.length>1&&(r++,a=this.streamingEngine.adaptive.adaptationEnabled()),{currentLevel:r,levels:e.parseLevels_(t.sortedLevels),enableAdaptation:a}}.bind(this)):Promise.resolve(null)},e.prototype.getAudioCodec=function(){return this.streamingEngine.audioCodec},e.parseLevels_=function(e){var t=u.map(e,function(e){var t=e.streamInfo.bandwidth||0;return e.streamInfo.resolution&&e.streamInfo.resolution.height?{label:e.streamInfo.label,bitrate:t,height:e.streamInfo.resolution.height,width:e.streamInfo.resolution.width}:{label:e.streamInfo.label,bitrate:t,height:1,width:1}});return t.length>1&&t.unshift({label:"Auto",bitrate:1,height:1,width:1}),t},e.prototype.setCurrentQuality=function(e){this.streamingEngine.setCurrentQuality(e)},e.prototype.beginStream=function(){var e=this;this.readyToPlayPromise_.then(function(){e.streamingEngine.beginStream()})},e.prototype.initStream=function(t){var n=this,r=arguments.length<=1||void 0===arguments[1]?"Auto":arguments[1];this.streamingEngine.on("meta",function(e){this.trigger("meta",e)},this).on("bufferFull",function(e){this.trigger("bufferFull",e)},this).on("trackTypes",function(e){this.trigger("trackTypes",e)},this).on("cueAdded",function(e){this.trigger("cueAdded",e)},this).on("error",function(e){this.trigger("error",e)},this).on("levels",function(t){var n=e.parseLevels_(t.levels);this.trigger("levels",{levels:n,currentQuality:t.currentQuality})},this),this.readyToPlayPromise_=new Promise(function(e,t){n.streamReadyToStart_=e,n.streamStarted_=t})["catch"](function(){}),this.streamingEngine.setManifest(t,r).then(function(){var e="auto"===n.preload_;e?(n.streamingEngine.beginStream(),n.streamStarted_()):n.streamReadyToStart_()})["catch"](function(e){return n.trigger("error",e)})},e}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n(1),a=n(3),s=n(4);t.HLSMetadataLogger=function(){function e(t,n,s,o,u){r(this,e),this.isAudioOnly=!1,this.video=t,this.streamingEngine=n,this.mdm=s,this.adaptive=o,this.manifest=u,i.extend(this,a)}return e.prototype.sendStartupMetadata=function(e){this.trigger(s.JWPLAYER_MEDIA_META,this.formatStreamMetadata(e)),this.mdm.getTrackTypes().then(function(e){this.isAudioOnly=1===e.length&&"audio"===e[0].type}.bind(this))},e.prototype.sendDeltaMetadata=function(e){this.trigger(s.JWPLAYER_MEDIA_META,this.formatDeltaMetadata(e))},e.prototype.sendSegmentCompletedMetadata=function(e,t){this.manifest.doneLoading().then(function(n){this.trigger(s.JWPLAYER_MEDIA_META,this.formatSegmentCompleteMetadata(n,e,t))}.bind(this))},e.prototype.sendBufferChangeMetadata=function(){this.manifest.doneLoading().then(function(e){var t=this.formatBufferChangeData(e);this.trigger("hls-metadata-bufferchange",t)}.bind(this))},e.prototype.formatStreamMetadata=function(e){var t=this,n=this.adaptive.getQuality();return{type:"meta",metadata:{levelIndex:n,levels:i.map(e.sortedLevels,function(e){return t.formatLevelData(e)})}}},e.prototype.formatDeltaMetadata=function(e){var t=this,n=this.adaptive.getQuality();return{type:"meta",metadata:{levelIndex:n,audioTrackIndex:-1,subtitlesTrackIndex:-1,subtitlesTracks:[],audioTracks:[],adaptiveType:e.streamType,duration:e.end-e.start,levels:i.map(e.sortedLevels,function(e){return t.formatLevelData(e)})}}},e.prototype.getBandwidthMetrics=function(e,t){var n=this.mdm.network,r=n.status();if(!t){var i=this.adaptive.getQuality();t=e.sortedLevels[i]}return{bandwidth:1e3*r.bandwidth,latencyRate:r.latency*r.bandwidth*1e3,initialLevelBitrate:t.streamInfo.bandwidth,currentLevelBitrate:0,estimatedRate:0,priorRate:0,currentRate:0,currentMaxRate:1e3*r.bandwidthMax,averageRate:1e3*r.bandwidth,modifiedAverageRate:0,instantRate:0,medianInstantRate:0,averageInstantRate:0,smoothInstantRate:0}},e.prototype.formatSegmentCompleteMetadata=function(e,t,n){var r=this,a=this.adaptive.getQuality(),s=this.mdm.network.status(),o=n.segments.indexOf(t);return{type:"meta",metadata:{streamType:e.streamType,bandwidthMetrics:this.getBandwidthMetrics(e,n),droppedFrames:0,bandwidth:1e3*s.bandwidth,height:n.streamInfo.resolution.height,width:n.streamInfo.resolution.width,duration:e.end-e.start,currentLevel:n.streamInfo.label,levelIndex:a,segment:this.formatSegmentData(t,n,o),levels:i.map(e.sortedLevels,function(e){return r.formatLevelData(e)})}}},e.prototype.formatLevelData=function(e){var t=this,n=e.streamInfo.trackTypes,r=n&&1===n.length&&"audio"===n[0].type,a=i.map(e.segments,function(n,r){return t.formatSegmentData(n,e,r)});return{responseTime:1e3,bitrate:e.streamInfo.bandwidth,index:e.streamInfo.originalIndex,mediaSequence:e.mediaSequence,audioOnly:r,audioGroup:"audio", requestTime:100,segments:a,width:e.streamInfo.resolution.width,height:e.streamInfo.resolution.height,start:e.streamInfo.start,endTime:e.streamInfo.end,duration:e.streamInfo.end-e.streamInfo.start,subtitlesGroup:"subtitles",m3u8:"#EXTM3U\n#EXT-X-ENDLIST\n",label:e.streamInfo.label}},e.prototype.formatSegmentData=function(e,t,n){var r=e.size,i=this.mdm.network,a=i.status();return{mediaSequenceNumber:e.mediaSequenceId,start:e.start,duration:e.duration,index:n,httpStatus:0,size:r,bitrate:r/e.duration,bandwidth:1e3*a.bandwidth,loadTime:r/(1e3*a.bandwidth),dtsOffset:e.pts/9e4-e.start,error:null,discontinuity:e.discontinuity,type:e.url.substring(e.url.lastIndexOf(".")+1).toUpperCase()}},e.prototype.formatBufferChangeData=function(t){function n(e){if(e.length){for(var t=[],n=0;n0?this.getManifestLoadRunway_(e,this.video.currentTime).then(a.wait).then(function(){t.manifest&&n.cycles>0&&(n.cycles--,n.status=i.COMPLETE,t.reload_(e))}):n.status=i.IDLE)},e.prototype.getManifestLoadRunway_=function(e,t){var n=this;return this.manifest.doneLoading().then(function(){var r=3*n.network.maxLatency(),i=n.manifest.levels_[e],a=i.segments[i.segments.length-1],u=1e3*(a.end-t),c=1e3*n.manifest.levels_[e].streamInfo.targetDuration;if(c=Math.min(c,1e3*a.duration),c+s>u)return Math.max((u-r)/2,s);if(1===n.manifest.refreshesWithoutChanges)c/=2;else if(n.manifest.refreshesWithoutChanges>5)return o;return Math.max(c,s)})},e.prototype.cancelReloading=function(){c.each(this.refreshRequests,function(e){e.cycles=0})},e.prototype.destroy=function(){this.cancelReloading(),this.video=null,this.refreshRequests=[],this.network=null,this.manifest=void 0},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.ManifestLoader=void 0;var a=n(7),s=r(a),o=n(40),u=n(3),c=n(1),f=n(6);t.ManifestLoader=function(){function e(t){i(this,e),this.totalManifest="",this.leftoverContent="",this.network=t,c.extend(this,u)}return e.prototype.load=function(e){var t={requester:"manifest",requestType:o.RequestType.Text,uris:e,retryParameters:{maxAttempts:2}},n=this.network.request(t),r=this;return n.then(function(e){var t=e.chan;return r.trigger("baseUrlFound",e.url),new Promise(function(e){f.go(s["default"].mark(function n(){var i;return s["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=3,f.take(t);case 3:if(i=n.sent,i!==f.CLOSED){n.next=10;break}return r.parseManifestChunk("",!0),e(),n.abrupt("break",13);case 10:r.parseManifestChunk(i,!1);case 11:n.next=0;break;case 13:case"end":return n.stop()}},n,this)}))})})},e.prototype.parseManifestChunk=function(e,t){var n=this.leftoverContent+e;if(this.totalManifest+=e,n=n.replace(/\r\n/g,"\n").replace(/\r/g,""),t&&n||n.indexOf("#EXT-X-ENDLIST")>=n.length-16)this.leftoverContent="",this.trigger("manifestChunk",n);else{var r=n.lastIndexOf("\n");this.leftoverContent=n.substring(r+1),this.trigger("manifestChunk",n.substring(0,r))}},e}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.ManifestParser=t.Playlist=void 0;var i=n(39),a=n(56),s=n(3),o=n(2),u=n(1),c=t.Playlist=function l(){r(this,l)},f=t.ManifestParser=function(){function e(t){r(this,e),this.KEY_VALUE=/^(?:,|, | )?([A-Z\-]+)=((?:"[^"]*")|(?:[^,]*))(.*)$/,this.EXTM3U={exp:/^#EXTM3U\s*$/,action:this.assignPlaylist.bind(this)},this.EXT_X_TARGETDURATION={exp:/^#EXT-X-TARGETDURATION:\s*(\d+(?:\.\d+)?)\s*$/,action:this.assignFloatStreamInfo.bind(this),prop:"targetDuration",checkType:this.setMediaPlaylist.bind(this)},this.EXT_X_MEDIA_SEQUENCE={exp:/^#EXT-X-MEDIA-SEQUENCE:\s*(\d+)\s*$/,action:this.assignMediaSequence.bind(this),checkType:this.setMediaPlaylist.bind(this)},this.EXT_X_VERSION={exp:/^#EXT-X-VERSION:\s*(\d+)\s*$/,action:this.assignInt.bind(this),prop:"version"},this.EXT_X_ALLOW_CACHE={exp:/^#EXT-X-ALLOW-CACHE:.*$/},this.EXT_X_KEY={exp:/^#EXT-X-KEY:(.*)$/,action:this.assignAesKey.bind(this)},this.EXT_X_STREAM_INF={exp:/^#EXT-X-STREAM-INF:(.*)$/,action:this.assignMediaPlaylist.bind(this),checkType:this.setMasterPlaylist.bind(this)},this.EXT_X_I_FRAME_STREAM_INF={exp:/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/,action:this.assignIFrameMediaPlaylist.bind(this)},this.EXT_X_I_FRAMES_ONLY={exp:/^#EXT-X-I-FRAMES-ONLY\s*$/,action:this.setIFrameOnly.bind(this)},this.EXT_X_BYTERANGE={exp:/^#EXT-X-BYTERANGE:\s*(\d+(?:\.\d+)?)(?:@(\d+(?:\.\d+)?))?$/,action:this.setByteRange.bind(this)},this.EXTINF={exp:/^#EXTINF:\s*(-?\d+(?:\.\d+)?)(?:,(.*))?$/,action:this.createSegment.bind(this),checkType:this.setMediaPlaylist.bind(this)},this.EXT_X_MEDIA={exp:/^#EXT-X-MEDIA:(.*)$/,action:this.parseMedia.bind(this),checkType:this.setMasterPlaylist.bind(this)},this.EXT_X_DISCONTINUITY_SEQUENCE={exp:/^#EXT-X-DISCONTINUITY-SEQUENCE:\s*(\d+)\s*$/,action:this.setDiscontinuitySequence.bind(this),checkType:this.setMediaPlaylist.bind(this)},this.EXT_X_DISCONTINUITY={exp:/^#EXT-X-DISCONTINUITY\s*$/,action:this.incrementDiscontinuity.bind(this),checkType:this.setMediaPlaylist.bind(this)},this.EXT_X_ENDLIST={exp:/^#EXT-X-ENDLIST\s*$/,action:this.setEndlist.bind(this)},this.EXT_X_PLAYLIST_TYPE={exp:/^#EXT-X-PLAYLIST-TYPE:\s*(EVENT|VOD)\s*$/},this.EXT_X_INDEPENDENT_SEGMENTS={exp:/^#EXT-X-INDEPENDENT-SEGMENTS\s*$/},this.EXT_X_PROGRAM_DATE_TIME={exp:/^#EXT-X-PROGRAM-DATE-TIME:\s*([\d\-T:\.\+A-Z]+)\s*$/},this.DECIMAL_FLOATING_POINT={exp:/^(?:\+|-)?\d+(?:\.\d+)?$/},this.COMMENT={exp:/^#[^EXT](.*)$/},this.WHITESPACE={exp:/^\s*$/},this.URI={exp:/^([^#].+)$/,action:this.assignURL.bind(this)},this.props=[this.EXTM3U,this.EXT_X_VERSION,this.EXT_X_ALLOW_CACHE,this.EXTINF,this.EXT_X_BYTERANGE,this.EXT_X_DISCONTINUITY,this.EXT_X_KEY,this.EXT_X_PROGRAM_DATE_TIME,this.EXT_X_TARGETDURATION,this.EXT_X_MEDIA_SEQUENCE,this.EXT_X_DISCONTINUITY_SEQUENCE,this.EXT_X_ENDLIST,this.EXT_X_PLAYLIST_TYPE,this.EXT_X_I_FRAMES_ONLY,this.EXT_X_MEDIA,this.EXT_X_STREAM_INF,this.EXT_X_I_FRAME_STREAM_INF,this.EXT_X_INDEPENDENT_SEGMENTS,this.DECIMAL_FLOATING_POINT,this.URI,this.WHITESPACE,this.COMMENT],this.playlistObject=new c,this.manifestData="",this.baseURL="",this.discontinuityCount=0,u.extend(this,s),this.streamInfo=t||new i.StreamInfo}return e.prototype.assignPlaylist=function(t){u.extend(t,e.makePlaylistProperties())},e.prototype.assignFloatStreamInfo=function(e,t,n){e.streamInfo[t]=parseFloat(n[1])},e.prototype.assignInt=function(e,t,n){e[t]=parseInt(n[1])},e.prototype.assignURL=function(t,n,r){var i=r[0];if("media"===t.type){if(t.mediaElements.length>0){var a=t.mediaElements.length-1,s=t.mediaElements[a];if(s.url=e.getURI(i,this.baseURL),t.byteRangeLength){s.byteRange.length=t.byteRangeLength;var u=t.byteRangeStart;if(!u&&a>0){var c=t.mediaElements[a-1],f=c.byteRange.length,l=c.byteRange.byteRangeStart;u=l+f||0}s.byteRange.start=u}"AES-128"===t.key&&(s.aesKeyUri=o.getAbsolutePath(t.keyUri,this.baseURL),s.aesIV=this._getSegmentIV(t.aesIV,s.mediaSequenceId)),this.trigger("tsSegmentFound",s)}}else if("master"===t.type&&t.streamInfos.length>0){var d=t.streamInfos[t.streamInfos.length-1];d.urls.length||(d.urls.push(e.getURI(i,this.baseURL)),this.trigger("mediaPlaylistFound",d))}},e.prototype.assignMediaSequence=function(e,t,n){e.mediaSequence=e.currentMediaSequenceId=parseInt(n[1])},e.prototype.assignMediaPlaylist=function(t,n,r){var i=r[1];t.streamInfos.push(e.makeStreamInfo(i))},e.prototype.assignIFrameMediaPlaylist=function(t,n,r){var i=r[1];t.iframeStreamInfos.push(e.makeStreamInfo(i))},e.prototype.setIFrameOnly=function(e){e.iframeOnly=!0},e.prototype.assignAesKey=function(e,t,n){var r=this.parseAttributeValuePair(n[1]);e.key=r.method,e.keyUri=r.uri,e.aesIV=r.iv},e.prototype.setMediaPlaylist=function(t){return t.type||(u.extend(t,e.makeMediaPlaylistProperties()),t.streamInfo=this.streamInfo),"media"===t.type},e.prototype.setMasterPlaylist=function(t){return t.type||u.extend(t,e.makeMasterPlaylistProperties()),"master"===t.type},e.prototype.createIVArrayBuffer_=function(e){var t="00000000000000000000000000000000";return e=t.substr(e.length)+e,this.hexStringToArrayBuffer_(e)},e.prototype.hexStringToArrayBuffer_=function(e){var t=void 0,n=new Uint8Array(16);for(t=0;t=0))throw"expected a media sequence value before a segment, but did not find one.";r.mediaSequenceId=e.currentMediaSequenceId,e.currentMediaSequenceId++,r.title&&!/^(?:\{\}|no desc)$/.test(r.title.trim())&&(r.extInfTitle=r.title),e.streamInfo.end+=r.duration,e.mediaElements.push(r)},e.prototype.setDiscontinuitySequence=function(e,t,n){this.discontinuityCount=e.discontinuitySequence=parseFloat(n[1])},e.prototype.incrementDiscontinuity=function(e){e.containsDiscontinuities=!0,this.discontinuityCount++},e.prototype.setEndlist=function(e){"master"!==e.type&&(e.mediaElements[e.mediaElements.length-1].isLast=!0,this.streamInfo.hasEndlist=!0)},e.prototype.parseAttributeValuePair=function(e){for(var t={},n=e;;){var r=n.match(this.KEY_VALUE);if(null==r)break;var i=r[1].toLowerCase(),a="";a=0===r[2].indexOf('"')&&r[2].lastIndexOf('"')===r[2].length-1?r[2].slice(1,r[2].length-1):r[2],t[i]=a,n=r[3]}return t},e.makePlaylistProperties=function(){return{version:1,independentSegments:!1,start:{timeOffset:0,precise:!1}}},e.makeMasterPlaylistProperties=function(){return{type:"master",media:[],streamInfos:[],iframeStreamInfos:[],renditions:{}}},e.makeMediaPlaylistProperties=function(){return{type:"media",streamInfo:null,mediaSequence:0,currentMediaSequenceId:0,playlistType:null,discontinuitySequence:null,containsDiscontinuities:!1,iFramesOnly:!1,mediaElements:[]}},e.makeStreamInfo=function(t){var n=e.parseKeyValuesPairs(t),r=new i.StreamInfo,a=n.url||n.uri;if(a&&r.urls.push(a),r.bandwidth=parseFloat(n.bandwidth),n.codecs&&(r.codecs=n.codecs.split(/[, ] */g)),n.resolution){var s=n.resolution.split("x");r.resolution={width:parseInt(s[0]),height:parseInt(s[1])}}return r.trackTypes=e.getLevelTypes(r),r.video=n.video,r.audio=n.audio,r.programId=parseInt(n.programid),r.label=n.name||e.makeLabel(r),r},e.makeLabel=function(e){return e.resolution&&e.resolution&&e.resolution.height?e.resolution.height+"p":Math.floor(e.bandwidth/1e3)+" kbps"},e.parseKeyValuesPairs=function(t){for(var n={},r=void 0,i=void 0,a=void 0,s=t;;){if(r=e.KEY_VALUE.exec(s),null===r)break;i=r[1].replace("-","").toLowerCase(),a="",a=0===r[2].indexOf('"')&&r[2].lastIndexOf('"')===r[2].length-1?r[2].slice(1,r[2].length-1):r[2],n[i]=a,s=r[3]}return n},e.getLevelTypes=function(e){var t=e.resolution.width*e.resolution.height,n=e.codecs,r=!1,i=u.compact(u.map(n,function(e){return e.indexOf("avc1")>=0?(r=!0,{type:"video",codec:"default"}):e.indexOf("mp4a.40.34")>=0?{type:"audio",codec:"mp3"}:e.indexOf("mp4a")>=0?{type:"audio",codec:"aac"}:void 0}));return t&&!r&&i.push({type:"video",codec:"default"}),i},e.getURI=function(e,t){var n=/^(https?:\/\/.*)$/i,r=/^(\/.*)$/,i=/^(.+)$/;if(n.test(e))return e;if(r.test(e)){var a=new URL(t);return a.protocol+"//"+a.host+e}return i.test(e)?t+e:e},e.prototype.parse=function(e){var t=this,n=e.split("\n");this.manifestData+=e,n.forEach(function(e){var n=void 0,r=!1;t.props.forEach(function(i){n=i.exp.exec(e),n&&(i.checkType&&!i.checkType(t.playlistObject)||(i.action&&i.action(t.playlistObject,i.prop,n),r=!0))})})},e.prototype.getPlaylist=function(){return this.playlistObject},e.prototype.setBaseUrl=function(e){var t=e.split(/[?#]/)[0];this.baseURL=t.substring(0,t.lastIndexOf("/")+1)},e}();f.KEY_VALUE=/^(?:,|, | )?([A-Z\-]+)=((?:"[^"]*")|(?:[^,]*))(.*)$/},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.MDM=void 0;var a=n(7),s=r(a),o=n(40),u=n(41),c=n(106),f=n(1),l=n(3),d=n(6),h=4,p=8;t.MDM=function(){function e(t,n){var r=this;i(this,e),this.loadedAesKeys_={},this.sessionHistory_=[],this.segmentPtsOffset_=-1,this.network=n,this.manifestRepresentation=t,f.extend(this,l),this.streamTypesKnown_=new Promise(function(e,t){r.streamTypesKnownResolve_=e,r.streamTypesKnownReject_=t})}return e.prototype.getTrackTypes=function(){return this.streamTypesKnown_},e.prototype.removeTmsInRange_=function(e,t,n){f.each(this.sessionHistory_,function(r){n===!1&&r.active||(r.tmsArray=f.filter(r.tmsArray,function(n){return!(!n.ts.errorInSegment||n.ts.start!==e&&n.ts.end!==t)||!(n.ts.starte)}))}),this.sessionHistory_=f.filter(this.sessionHistory_,function(e){return!!e.tmsArray.length})},e.prototype.removeInactiveTmsInRange=function(e,t){return this.removeTmsInRange_(e,t,!1)},e.prototype.removeAllTmsInRange=function(e,t){return this.removeTmsInRange_(e,t,!0)},e.prototype.getSegmentAtTime=function(e){for(var t=this.sessionHistory_.length;t--;){var n=this.sessionHistory_[t].tmsArray,r=f.find(n,function(t){return t.ts.start<=e&&t.ts.end>=e});if(r)return r.ts}},e.prototype.getTransmuxSegment=function(e){return this.currentTransmuxSession?this.currentTransmuxSession.getTransmuxSegment(e):null},e.prototype.get=function(e){var t=this,n=this.getTransmuxSegment(e);return n||(n=new c.TransmuxSegment(e),this.transmux_(n),this.beginDownloadingSegment(n)),e.aesKeyUri?this.loadedAesKeys_[e.aesKeyUri].then(function(){return Promise.resolve(t.currentTransmuxSession)})["catch"](function(e){return Promise.reject("Cannot download AES key: "+e)}):Promise.resolve(this.currentTransmuxSession)},e.prototype.getPtsOffset=function(){var e=this.currentTransmuxSession.tmsArray[0];return e&&e.ts.pts&&(this.segmentPtsOffset_=e.ts.pts/9e4-e.ts.start),this.segmentPtsOffset_},e.prototype.complete=function(e){e.transmuxStatus="complete"},e.prototype.endTransmuxSession=function(e){e&&e.tmsArray&&e.destroy()},e.prototype.transmux_=function(e){var t=this,n=e.ts;if(this.isSegmentContiguous_(e))this.currentTransmuxSession.tmsArray.push(e);else{this.endTransmuxSession(this.currentTransmuxSession),this.currentTransmuxSession=new c.TransmuxSession,this.currentTransmuxSession.tmsArray.push(e),this.segmentPtsOffset_=-1,this.sessionHistory_.push(this.currentTransmuxSession);var r=["audio","video","metadata","captions"],i=f.map(r,function(e){return this.spawnTransmuxTaker_(this.currentTransmuxSession,e)},this),a=f.pluck(i,"offsetsKnown");this.currentTransmuxSession.offsetsKnown=Promise.all(a).then(function(e){return f.reduce(e,function(e,t){return e[t.type]=t,e},{})})}n.aesKeyUri&&(this.loadedAesKeys_[n.aesKeyUri]||(this.loadedAesKeys_[n.aesKeyUri]=this.loadAesKey_(n).then(function(e){return(0,u.channelToPromise)(e.chan)}))),this.currentTransmuxSession.transmuxer.trackTypesKnown().then(function(e){0!==e.length&&t.streamTypesKnownResolve_(e)})},e.prototype.spawnTransmuxTaker_=function(e,t){var n=e.transmuxer[t],r=e.mediaChannels[t],i=void 0,a=void 0,o=new Promise(function(e,t){i=e,a=t});return d.go(s["default"].mark(function u(){var e,o,c,l,m,v,y;return s["default"].wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e=f.now()+h,"metadata"!==t&&"captions"!==t||i({type:t}),o=void 0;case 3:return s.t0=d.CLOSED,s.next=6,d.take(n);case 6:if(s.t1=o=s.sent,s.t0===s.t1){s.next=24;break}if("duration-update"!==o.type){s.next=11;break}return o.sourceFile&&(c=o.sourceFile.split("_"),l=c[0],m=c[1],this.manifestRepresentation.updateTS(l,m,{type:t,duration:o.duration,start:o.start})),s.abrupt("continue",3);case 11:return"metadata"!==o.type||f.isNumber(o.start)||f.isNumber(o.pts)||(v=this.manifestRepresentation.getSegmentFromIndex(o.sourceFile),o.start=v.start),s.next=14,d.put(r,o);case 14:if("error"!==o.type){s.next=16;break}return s.abrupt("return",a(o.message));case 16:if("init"===o.type&&i({type:t,codec:o.codec,start:o.start}),y=f.now(),!(y>e)){s.next=22;break}return e=y+h,s.next=22,d.timeout(p);case 22:s.next=3;break;case 24:i({type:t}),r.close();case 26:case"end":return s.stop()}},u,this)}).bind(this)),{offsetsKnown:o}},e.prototype.downloadComplete_=function(e,t){return e.size=t.size,this.manifestRepresentation.updateLevel(e),t},e.prototype.loadAesKey_=function(e){var t={requestType:o.RequestType.ByteArray,requester:"aes-key",uris:[e.aesKeyUri],retryParameters:{maxAttempts:2}};return this.network.request(t)},e.prototype.isSegmentContiguous_=function(e){if(!e||e.ts.errorInSegment||!this.currentTransmuxSession||!this.currentTransmuxSession.transmuxer||!this.currentTransmuxSession.tmsArray.length)return!1;var t=this.currentTransmuxSession.tmsArray,n=t[t.length-1];return e.ts.discontinuity===n.ts.discontinuity&&(e.ts.level===n.ts.level&&e.ts.mediaSequenceId===n.ts.mediaSequenceId+1&&!n.ts.errorInSegment)},e.prototype.beginDownloadingSegment=function(e){var t=this,n=e.ts;e.transmuxStatus="downloading";var r={requestType:o.RequestType.ByteArray,requester:"media-file",uris:[n.url],retryParameters:{maxAttempts:2}},i=this.network.request(r);this.currentTransmuxSession.enqueueNetworkData({segment:e.ts,netRequestPromise:i,aesKeyPromise:this.loadedAesKeys_[e.ts.aesKeyUri]}),i.then(function(e){(0,u.channelToPromise)(e.metaChan).then(t.downloadComplete_.bind(t,n))})["catch"](function(){n.errorInSegment=!0,t.trigger("segment-download-error",n)})},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,n,r){return new Promise(function(i){I.go(o["default"].mark(function a(){var s,u;return o["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=3,I.take(e);case 3:if(s=a.sent,s!==I.CLOSED){a.next=10;break}return r&&t.close(),a.next=8,I.put(t,{type:"endOfFile"});case 8:return i(),a.abrupt("break",17);case 10:return u={sourceFile:n,payload:s},a.next=13,I.put(t,u);case 13:if(a.sent){a.next=15;break}return a.abrupt("break",17);case 15:a.next=0;break;case 17:case"end":return a.stop()}},a,this)}))})}t.__esModule=!0;var s=n(7),o=r(s),u=n(121),c=r(u),f=n(123),l=r(f),d=n(59),h=r(d),p=n(119),m=r(p),v=n(120),y=r(v),g=n(118),_=r(g),b=n(122),T=r(b),x=n(116),k=r(x),w=n(114),E=r(w),S=n(125),I=n(6),M=function(){function e(t){var n=this;i(this,e),this.id=t;var r=void 0,a=void 0,s=void 0;this.trackTypesKnownPromise=Promise.race([new Promise(function(e){r=e}),new Promise(function(e){s=e}),new Promise(function(e){a=e})]).then(function(e){return 0===e.length?(n.videoPesChannel.close(),f.close(),p.close(),g.close()):1===e.length&&("audio"===e[0].type?n.videoPesChannel.close():"video"===e[0].type&&(f.close(),p.close(),g.close())),e}),this.inputToMpegTSChannel=I.chan(1e4);var o=this.tsPacketChannel=I.chan(),u=this.pesPacketChannel=I.chan(),f=I.chan(),d=this.videoPesChannel=I.chan();this.tsToMetadataChannel=I.chan();var p=I.chan(),v=I.chan(),g=I.chan(),b=I.chan(),x=I.chan();this.audio=I.chan(),this.video=I.chan(),this.captions=I.chan(),this.metadata=I.chan(),I.go((0,l["default"])(r,o,u)),I.go((0,m["default"])(a,p,g,v)),I.go((0,y["default"])(this.tsToMetadataChannel,v,this.metadata)),I.go((0,T["default"])(d,b,x,this.metadata)),I.go((0,_["default"])(b,this.video)),I.go((0,E["default"])(x,this.captions)),I.go((0,S.PesPacketSplitter)(r,this.pesPacketChannel,f,this.videoPesChannel,this.tsToMetadataChannel)),I.go((0,c["default"])(s,this.inputToMpegTSChannel,this.tsPacketChannel,this.pesPacketChannel,p));var k=I.operations.merge([g,f]);I.go((0,h["default"])(k,this.audio))}return e.prototype.nextFile=function(e,t){if(t.aesKeyPromise){var n=I.chan(1e4);return I.go((0,k["default"])(e,n,t.id,t.aesIV,t.aesKeyPromise)),a(n,this.inputToMpegTSChannel,t.id,t.isLast)}return a(e,this.inputToMpegTSChannel,t.id,t.isLast)},e.prototype.endOfInput=function(){this.inputToMpegTSChannel.close()},e.prototype.trackTypesKnown=function(){return this.trackTypesKnownPromise},e}();t["default"]=M},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.TransmuxSession=t.TransmuxSegment=void 0;var a=n(105),s=r(a),o=n(1),u=n(6);t.TransmuxSegment=function c(e){i(this,c),this.ts=e,this.transmuxStatus="in-progress"},t.TransmuxSession=function(){function e(){i(this,e),this.dataQueue_=[],this.isSendingData_=!1,this.forwardBufferCleared=!1,this.active=!0,this.firstDataBuffered={audio:!1,video:!1};var t=o.uniqueId("transmuxer-");this.tmsArray=[],this.transmuxer=new s["default"](t),this.mediaChannels={video:new u.chan(1e4),audio:new u.chan(1e4),metadata:new u.chan(1e4),captions:new u.chan(1e4)}}return e.prototype.getTransmuxSegment=function(e){return o.find(this.tmsArray,function(t){return e===t.ts})},e.prototype.destroy=function(){var e=this;this.isSendingData_||(this.transmuxer.endOfInput(),this.transmuxer=null),o.each(this.dataQueue_,function(t){e.tmsArray=o.without(e.tmsArray,t.segment)}),this.active=!1,this.dataQueue_=null},e.prototype.enqueueNetworkData=function(e){this.dataQueue_.push(e),this.runQueue_()},e.prototype.runQueue_=function(){var e=this;if(!this.dataQueue_)return void this.destroy();if(!this.isSendingData_&&this.dataQueue_.length){this.isSendingData_=!0;var t=this.dataQueue_.shift();t.netRequestPromise.then(function(n){e.dataQueue_||e.destroy();var r=t.segment,i=r.level+"_"+r.mediaSequenceId,a={id:i,isLast:r.isLast,aesIV:r.aesIV,aesKeyPromise:t.aesKeyPromise};e.transmuxer.nextFile(n.chan,a).then(function(){return e.isSendingData_=!1}).then(e.runQueue_.bind(e))})["catch"](function(){e.isSendingData_=!1})}},e.prototype.markBuffered=function(e){this.firstDataBuffered[e]=!0},e.prototype.isBuffered=function(e){var t=this;return o.all(e,function(e){return t.firstDataBuffered[e]})},e}()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(t){n(this,e),this.aesIV=t}return e.prototype.decrypt=function(e,t){return window.crypto.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}();t["default"]=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(t){r(this,e);var n=this.uint8ArrayToUint32Array_(t.buffer),i=this.keySize=n.length,a=i+6;this.ksRows=4*(a+1),this.keyWords=n,this.subMix=[],this.invSubMix=[],this.initTable(),this.expandKey()}return e.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),n=new Uint32Array(4),r=0;r>>8^255&p^99,e[l]=p,t[p]=l;var m=f[l],v=f[m],y=f[v],g=257*f[p]^16843008*p;n[l]=g<<24|g>>>8,r[l]=g<<16|g>>>16,i[l]=g<<8|g>>>24,a[l]=g,g=16843009*y^65537*v^257*m^16843008*l,s[p]=g<<24|g>>>8,o[p]=g<<16|g>>>16,u[p]=g<<8|g>>>24,c[p]=g,l?(l=m^f[f[f[y^m]]],d^=f[f[d]]):l=d=1}},e.prototype.expandKey=function(){for(var e,t=this.keySchedule=new Uint32Array(this.ksRows).fill(0),n=this.rcon,r=this.invKeySchedule=new Uint32Array(this.ksRows).fill(0),i=this.keySize,a=this.keyWords,s=this.ksRows,o=this.sBox,u=this.invSubMix[0],c=this.invSubMix[1],f=this.invSubMix[2],l=this.invSubMix[3],d=0;d6&&d%i===4&&(h=o[h>>>24]<<24|o[h>>>16&255]<<16|o[h>>>8&255]<<8|o[255&h]):(h=h<<8|h>>>24,h=o[h>>>24]<<24|o[h>>>16&255]<<16|o[h>>>8&255]<<8|o[255&h],h^=n[d/i|0]<<24),t[d]=e=(t[d-i]^h)>>>0}for(var p=0;p>>24]]^c[o[h>>>16&255]]^f[o[h>>>8&255]]^l[o[255&h]],r[p]=r[p]>>>0},e.prototype.decrypt=function(e,t,n){for(var r=this.invKeySchedule,i=r[0],a=r[1],s=r[2],o=r[3],u=this.keySize+6,c=this.invSubMix[0],f=this.invSubMix[1],l=this.invSubMix[2],d=this.invSubMix[3],h=this.invSBox,p=new Uint8Array(e.length),m=this.uint8ArrayToUint32Array_(n),v=m[0],y=m[1],g=m[2],_=m[3],b=new DataView(e.buffer);t>>24]^f[E[1]>>>16&255]^l[E[2]>>>8&255]^d[255&E[3]]^r[M++],S[1]=c[E[1]>>>24]^f[E[2]>>>16&255]^l[E[3]>>>8&255]^d[255&E[0]]^r[M++],S[2]=c[E[2]>>>24]^f[E[3]>>>16&255]^l[E[0]>>>8&255]^d[255&E[1]]^r[M++],S[3]=c[E[3]>>>24]^f[E[0]>>>16&255]^l[E[1]>>>8&255]^d[255&E[2]]^r[M++],E[0]=S[0],E[1]=S[1],E[2]=S[2],E[3]=S[3];S[0]=(h[E[0]>>>24]<<24|h[E[1]>>>16&255]<<16|h[E[2]>>>8&255]<<8|h[255&E[3]])^r[M++],S[1]=(h[E[1]>>>24]<<24|h[E[2]>>>16&255]<<16|h[E[3]>>>8&255]<<8|h[255&E[0]])^r[M++],S[2]=(h[E[2]>>>24]<<24|h[E[3]>>>16&255]<<16|h[E[0]>>>8&255]<<8|h[255&E[1]])^r[M++],S[3]=(h[E[3]>>>24]<<24|h[E[0]>>>16&255]<<16|h[E[1]>>>8&255]<<8|h[255&E[2]])^r[M],I[3]=S[0]^v,I[2]=S[3]^y,I[1]=S[2]^g,I[0]=S[1]^_;for(var C=new DataView(I.buffer),A=0;A<16;A++)p[A+t]=C.getUint8(15-A);v=T,y=x,g=k,_=w,t+=16}return this.unpad_(p)},e.prototype.unpad_=function(e){var t=e.length,n=e[t-1];return e.subarray(0,e.length-n)},e}();t["default"]=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(107),s=r(a),o=n(112),u=r(o),c=n(108),f=r(c),l=function(){function e(t,n){i(this,e),this.key=t,this.iv=n,this.fastAesKey=new u["default"](t)}return e.prototype.supportsWebCrypto_=function(){return window.crypto&&"https:"===window.location.protocol},e.prototype.decrypt=function(e){var t=this;if(this.supportsWebCrypto_())return this.fastAesKey.expandKey().then(function(n){var r=new s["default"](t.iv);return r.decrypt(e,n)});var n=new f["default"](this.key);return Promise.resolve(n.decrypt(e,0,this.iv))},e}();t["default"]=l},function(e,t){"use strict";t.__esModule=!0;var n=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,i=Math.floor(e/8),e-=8*i,t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return console.assert(e<=32,"Cannot read more than 32 bits at a time"),r-=i,r>0?n<<=i:t>0&&this.loadWord(),i=e-i,i>0?a<>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};t["default"]=n},function(e,t){"use strict";t.__esModule=!0;t.SpecialASCII={42:"á",92:"é",94:"í",95:"ó",96:"ú",123:"ç",124:"÷",125:"Ñ",126:"ñ",127:"♫"},t.US={48:"®",49:"°",50:"½",51:"¿",52:"™",53:"¢",54:"£",55:"♪",56:"à",57:" ",58:"è",59:"â",60:"ê",61:"î",62:"ô",63:"û"}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(t){n(this,e),this.key=t}return e.prototype.expandKey=function(){return window.crypto.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}();t["default"]=r},function(e,t){"use strict";t.__esModule=!0;var n,r,i,a,s,o,u,c,f,l,d,h,p,m,v,y,g,_,b,T,x,k,w,E,S,I,M,A,C,L,P,D,O,R,B,U,N;!function(){var e;E={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:[]};for(e in E)E.hasOwnProperty(e)&&(E[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),M=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),I=new Uint8Array([0,0,0,1]),A=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]), C=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),L={video:A,audio:C},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,0,0,0,0,0]),B=R,U=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N=R,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}(),n=function(e){var t,n,r,i=[],a=0;for(t=1;t>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return n(E.ftyp,S,I,S,M)},y=function(e){return n(E.hdlr,L[e])},s=function(e){return n(E.mdat,e)},v=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),n(E.mdhd,t)},m=function(e){return n(E.mdia,v(e),y(e.type),u(e))},o=function(e){return n(E.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return n(E.minf,"video"===e.type?n(E.vmhd,P):n(E.smhd,D),r(),_(e))},c=function(e,t){for(var r=[],i=t.length;i--;)r[i]=x(t[i]);return n.apply(null,[E.moof,o(e)].concat(r))},f=function(e){for(var t=e.length,r=[];t--;)r[t]=h(e[t]);return n.apply(null,[E.moov,d(4294967295)].concat(r).concat(l(e)))},l=function(e){for(var t=e.length,r=[];t--;)r[t]=k(e[t]);return n.apply(null,[E.mvex].concat(r))},d=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return n(E.mvhd,t)},g=function(e){var t,r,i=e.samples||[],a=new Uint8Array(4+i.length);for(r=0;r>>8),a.push(255&r[t].byteLength),a=a.concat(Array.prototype.slice.call(r[t]));for(t=0;t>>8),s.push(255&i[t].byteLength),s=s.concat(Array.prototype.slice.call(i[t]));return n(E.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),n(E.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length]).concat(a).concat([i.length]).concat(s))),n(E.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},t=function(e){return n(E.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]),i(e))}}(),T=function(){return n(E.styp,S,I,S)},p=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return n(E.tkhd,t)},x=function(e){var t,r,i,a,s;return t=n(E.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])),r=n(E.tfdt,new Uint8Array([0,0,0,0,e.baseMediaDecodeTime>>>24&255,e.baseMediaDecodeTime>>>16&255,e.baseMediaDecodeTime>>>8&255,255&e.baseMediaDecodeTime])),s=88,"audio"===e.type?(i=w(e,s),n(E.traf,t,r,i)):(a=g(e),i=w(e,a.length+s),n(E.traf,t,r,i,a))},h=function(e){return e.duration=e.duration||4294967295,n(E.trak,p(e),m(e))},k=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),n(E.trex,t)},function(){var e,t,r;r=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var i,a,s,o;for(a=e.samples||[],t+=20+16*a.length,i=r(a,t),o=0;o>>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(E.trun,new Uint8Array(i))},e=function(e,t){var i,a,s,o;for(a=e.samples||[],t+=20+8*a.length,i=r(a,t),o=0;o>>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(E.trun,new Uint8Array(i))},w=function(n,r){return"audio"===n.type?e(n,r):t(n,r)}}(),t["default"]={ftyp:a,mdat:s,moof:c,moov:f,initSegment:function(e){var t,n=a(),r=f(e);return t=new Uint8Array(n.byteLength+r.byteLength),t.set(n),t.set(r,n.byteLength),t}}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return d["default"].mark(function n(){var r,i;return d["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r=void 0,i=new T;case 2:return n.t0=p.CLOSED,n.next=5,p.take(e);case 5:if(n.t1=r=n.sent,n.t0===n.t1){n.next=10;break}return n.delegateYield(o(t,r,i),"t2",8);case 8:n.next=2;break;case 10:t.close();case 11:case"end":return n.stop()}},n,this)})}function o(e,t,n){var r,i,a,s,o,l;return d["default"].wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(r=new x,r.payload=t.payload,i=r.payload.length,a=new _.CaptionsParser,!(r.position=48&&r<=63&&(i=o.US[r],this.handleCharacters_(e,t,i)),(17===n||25===n)&&r>=32&&r<=47&&this.handleMidRowChanges_(e,t),(20===n||28===n||21===n||29===r)&&r>=32&&r<=47&&this.handleCommand_(e,t),(23===n||31===n)&&r>=33&&r<=35&&this.handleCommand_(e,t),n>=16&&n<=23&&r>=64&&r<=127&&this.handlePAC_(e,t)},e.prototype.getCharacter_=function(e){return o.SpecialASCII[e]?o.SpecialASCII[e]:0===e?"":String.fromCharCode(e)},e.prototype.handleCharacters_=function(e,t,n){e.mode===k?(e.buffer[1-e.bufferIndex]+=n,e.captionEnd=t.pts,this.finishCaption_(e,1-e.bufferIndex,t),e.captionStart=t.pts):e.buffer[e.bufferIndex]+=n},e.prototype.handleMidRowChanges_=function(e,t){var n=t.ccByte1,r=t.ccByte2,i=!!(1&n);if(i){var a=(14&r)>>1;U[a]}else{var s=(14&r)>>1;U[s]}},e.prototype.handleCommand_=function(e,t){var n=t.ccByte1,r=t.ccByte2;n=23&n;var i=n<<8|r;if(i===e.lastCommand)return void(e.lastCommand=0);switch(e.lastCommand=i,i){case p:e.mode=i;break;case m:break;case v:break;case y:break;case g:break;case _:case b:case T:e.mode=i,this.rollup_(e,t),e.captionEnd=t.pts,this.finishCaption_(e,e.bufferIndex,t),e.captionStart=t.pts;break;case x:e.mode=i;break;case k:e.mode=i,e.captionStart=t.pts;break;case w:e.nonCaptionText="";break;case E:break;case S:e.captionEnd=t.pts,this.finishCaption_(e,1-e.bufferIndex,t);break;case I:e.buffer[e.bufferIndex]+="\n",this.rollup_(e,t);break;case M:e.buffer[e.bufferIndex]="";break;case A:e.mode=p,!isNaN(e.captionStart)&&(isNaN(e.captionEnd)||e.captionEnd<=e.captionStart)&&(e.captionEnd=t.pts,this.finishCaption_(e,1-e.bufferIndex,t)),e.bufferIndex=1-e.bufferIndex,e.captionStart=t.pts;break;case C:e.position[e.bufferIndex]+=2.5;break;case L:e.position[e.bufferIndex]+=5;break;case P:e.position[e.bufferIndex]+=7.5}},e.prototype.finishCaption_=function(e,t,n){if(e.captionStart>-1){var r=e.buffer[t];if(e.lastCommand===S&&(e.buffer[t]=""),!r)return;var i=new f;i.text=r.replace(/\n+/g,"\n").replace(/^\n+/,"").replace(/\n+$/,""),i.start=e.captionStart,i.end=e.captionEnd;var a=new d;a.backgroundColor=e.backgroundColor||a.backgroundColor,a.backgroundTransparency=e.backgroundTransparency||a.backgroundTransparency,a.textColor=e.textColor||a.textColor,a.textStyle=e.textStyle||a.textStyle,i.style=a;var s=new l;s.position=e.position[t],s.line=e.line[t],i.positioning=s,e.captions.push(i),e.captionEnd=NaN}},e.prototype.rollup_=function(e,t){var n=1;switch(e.mode){case _:n=2;break;case b:n=3;break;case T:n=4}var r=e.buffer[e.bufferIndex];r=r.replace(/\n+/g,"\n");var i=r.split("\n");e.buffer[e.bufferIndex]=i.slice(Math.max(0,i.length-n)).join("\n")},e.prototype.handlePAC_=function(e,t){var n=(30&t.ccByte2)>>1,r=(16&t.ccByte2)>>4,i=(!!(1&t.ccByte2),7&t.ccByte1),a=((32&t.ccByte2)>>5,e.mode===k?1-e.bufferIndex:e.bufferIndex);switch(r){case R:e.position[a]=10+10*D[n]/4;break;case O:}e.line[a]=B[i],16===t.ccByte1&&t.ccByte2>95||(e.buffer[a]+="\n")},e.prototype.getCCDataPackets=function(e,t,n){var r=0,i=e.payload,a=i[e.position++];e.position++,r+=2;var s=31&a;return this.getPackets_(e,t,s,n),r+=3*s},e.prototype.getPackets_=function(e,t,n,r){for(var i=e.payload,a=e.position,s=(e.payload.length,0);s=0;y--)if(m[y].pts<=r){m.splice(y+1,0,v),p=!0;break}p||m.splice(0,0,v)}}e.position=a},e}()},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n,r,i){function a(e,a){var s=c.combineUint8Arrays(e,a);return new Promise(function(e){i.then(function(i){var a=new h["default"](i,r);a.decrypt(s).then(function(n){var r=new Uint8Array(n);l.putAsync(t,r,e)})["catch"](function(r){l.putAsync(t,{type:"error",file:n,message:"Error decrypting AES stream"}),t.close(),e()})})})}var s=[],u=0;return o["default"].mark(function f(){var n;return o["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=l.CLOSED,r.next=3,l.take(e);case 3:if(r.t1=n=r.sent,r.t0===r.t1){r.next=9;break}u+=n.length,s.push(new Uint8Array(n)),r.next=0;break;case 9:u>0?a(s,u).then(function(){return t.close()}):t.close();case 10:case"end":return r.stop()}},f,this)})}t.__esModule=!0;var s=n(7),o=i(s);t["default"]=a;var u=n(16),c=r(u),f=n(6),l=r(f),d=n(109),h=i(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=new u["default"](e),n=t.readUnsignedByte(),r=t.readBits(6);t.skipBits(2);var i=t.readUnsignedByte();if(t.skipUnsignedExpGolomb(),100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||139===n||134===n){var a=t.readUnsignedExpGolomb();if(3===a&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()){var o=3!==a?8:12;for(l=0;l18e4)&&(f=o-s+u),n.next=20,I.put(t,{type:"duration-update",sourceFile:a,duration:f/9e4,start:s});case 20:s=c.dts,n.next=24;break;case 23:u=c.dts-o;case 24:if(o=c.dts,a=c.sourceFile,!(r.sps&&r.pps&&i.length>0&&c.flags.hasKeyframe)){n.next=30;break}return n.delegateYield(d(t,r,i),"t2",28);case 28:i=[],m(r);case 30:l(r,c),i.push(c),n.next=5;break;case 34:if(!i.length||r.sps&&r.pps||console.warn("TS File missing Keyframe info"),!i.length){n.next=38;break}return n.next=38,I.put(t,{type:"duration-update",sourceFile:a,duration:(o-s+u)/9e4,start:s});case 38:return n.delegateYield(d(t,r,i),"t3",39);case 39:t.close();case 40:case"end":return n.stop()}},n,this)})}function o(e){return 31&e.payload[0]}function u(e){return 9===o(e)}function c(e){return 5===o(e)}function f(e,t){A.isNumber(t.pts)&&(e.minSegmentPts=Math.min(t.pts,e.minSegmentPts),e.maxSegmentPts=Math.max(t.pts,e.maxSegmentPts)),A.isNumber(t.dts)&&(e.minSegmentDts=Math.min(t.dts,e.minSegmentDts),e.maxSegmentDts=Math.max(t.dts,e.maxSegmentDts))}function l(e,t){var n=t.nalus,r=n.length;e.naluCount+=r;for(var i=0;i0)){h.next=26;break}return d=c.sourceFile,h.delegateYield(y(d,t,s,i,e,l),"t0",25);case 25:m(t);case 26:t.naluCount=0,t.nalUnitsByteLength=0;case 28:case"end":return h.stop()}},M[0],this)}function h(e){return{type:"video",codec:"avc",pps:[e.pps],sps:[e.sps],height:e.spsInfo.height,width:e.spsInfo.width,profileIdc:e.spsInfo.profileIdc,levelIdc:e.spsInfo.levelIdc,profileCompatibility:e.spsInfo.profileCompatibility}}function p(e,t,n){t.baseMediaDecodeTime=e.baseMediaDecodeTime,t.minSegmentPts=e.minSegmentPts,t.maxSegmentPts=e.maxSegmentPts,t.minSegmentDts=e.minSegmentDts,t.maxSegmentDts=e.maxSegmentDts,t.samples=n}function m(e){e.minSegmentPts=Number.MAX_VALUE,e.maxSegmentPts=0,e.minSegmentDts=Number.MAX_VALUE,e.maxSegmentDts=0}function v(e,t,n,r,i,a,s){for(var o=t.nalus,f=e.sample,l=0;l2e4)){i.next=20;break}return i.delegateYield(a(d,l,s,o,e,n,r),"t3",18);case 18:o=0,s=[];case 20:l=c.sourceFile,s.push(c.payload),o+=c.payload.length,i.next=5;break;case 25:return i.delegateYield(a(d,l,s,o,e,n,r),"t4",26);case 26:n.close(),r.close();case 28:case"end":return i.stop()}},i,this)})}t.__esModule=!0;var o=n(7),u=i(o);t["default"]=s;var c=n(6),f=r(c),l=n(16),d=r(l),h=n(61),p=i(h),m=n(25),v=i(m),y=n(58),g=i(y),_=[a].map(u["default"].mark)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n){return o["default"].mark(function r(){var i,a,s,u,f,h;return o["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=void 0,a=d.operations.merge([e,t]);case 2:return r.t0=d.CLOSED,r.next=5,d.take(a);case 5:if(r.t1=i=r.sent,r.t0===r.t1){r.next=19;break}if("error"!==i.type){r.next=11;break}return r.next=10,d.put(n,i);case 10:return r.abrupt("continue",2);case 11:if(s=void 0,u=void 0,i.payload?(f=i,h=new Uint8Array(f.payload),s=(0,l["default"])(h).cues,u=f.dts):s=i.cues,0===c.size(s)){r.next=17;break}return r.next=17,d.put(n,{type:"metadata",pts:u,sourceFile:i.sourceFile,payload:s});case 17:r.next=2;break;case 19:n.close();case 20:case"end":return r.stop()}},r,this)})}t.__esModule=!0;var s=n(7),o=i(s);t["default"]=a;var u=n(205),c=r(u),f=n(58),l=i(f),d=n(6)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n,r,i){function a(e,t,n){var r,i,a,s,u,c;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:r=Math.floor(t.length/d["default"].TS_PACKET_SIZE),i=0;case 2:if(!(i-1)){i.next=19;break}return u(r,s.subarray(r.startCodePrefix)),i.delegateYield(o(t,r),"t2",19);case 19:l=0,s=a.payload,r.state="zeroes-0",r.startCodePrefix=-1,r.chunkFile=a.sourceFile,i.next=27;break;case 26:s=h.concatUint8Array(s,a.payload);case 27:for(;l0&&(s=a.payload,l=s.byteLength,r.maybeEndOfNalu-=r.startCodePrefix-v,r.startCodePrefix=v);case 30:if(!r.queueToSend.length){i.next=36;break}return g=r.queueToSend.shift(),i.next=34,m.put(t,g);case 34:i.next=30;break;case 36:if(!r.seiQueueToSend.length){i.next=42;break}return _=r.seiQueueToSend.shift(),i.next=40,m.put(n,_);case 40:i.next=36;break;case 42:i.next=3;break;case 44:if(n.close(),c){i.next=48;break}return u(r,s.subarray(r.startCodePrefix)),i.delegateYield(o(t,r),"t3",48);case 48:t.close();case 49:case"end":return i.stop()}},i,this)})}function s(e){var t={sourceFile:e.chunkFile,pts:e.naluBuffer[0].pts,dts:e.naluBuffer[0].dts,flags:e.flags,nalus:e.naluBuffer};return e.flags={},e.naluBuffer=[],e.chunkFile=e.currentPes.sourceFile,t}function o(e,t){var n;return f["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=s(t),r.next=3,m.put(e,n);case 3:case"end":return r.stop()}},v[0],this)}function u(e,t){if(t.length){var n=128&t[0];if(!n){var r=31&t[0],i={pts:e.currentPes.pts,dts:e.currentPes.dts,payload:t};switch(r){case 5:e.flags.hasKeyframe=!0;break;case 6:e.seiQueueToSend.push(i);break;case 7:e.flags.hasSPS=!0;break;case 8:e.flags.hasPPS=!0}var a=9===r;if(a&&e.naluBuffer.length){var o=s(e);e.queueToSend.push(o)}e.naluBuffer.push(i)}}}t.__esModule=!0;var c=n(7),f=i(c);t["default"]=a;var l,d=n(16),h=r(d),p=n(6),m=r(p),v=[o].map(f["default"].mark),y={"zeroes-0":{0:{newstate:"zeroes-1"}},"zeroes-1":{0:{newstate:"zeroes-2"},"default":{newstate:"zeroes-0"}},"zeroes-2":{0:{newstate:"zeroes-3plus",method:function(e){this.maybeEndOfNalu=e}},1:{newstate:"sync",method:function(e,t){if(this.startCodePrefix>=0){var n=t.subarray(this.startCodePrefix,e-2);u(this,n)}}},"default":{newstate:"zeroes-0"}},"zeroes-3plus":{0:{newstate:"zeroes-3plus"},1:{newstate:"sync",method:function(e,t){if(this.startCodePrefix>=0){var n=t.subarray(this.startCodePrefix,this.maybeEndOfNalu-2);u(this,n)}}},"default":{newstate:"zeroes-0"}},sync:{0:{newstate:"zeroes-1",method:function(e){this.startCodePrefix=e}},"default":{newstate:"zeroes-0",method:function(e){this.startCodePrefix=e}}}}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n){var r={},i=[],a=-1,u=void 0;return d["default"].mark(function l(){var h,m,v,y,_,T=this;return d["default"].wrap(function(l){for(;;)switch(l.prev=l.next){case 0:h=void 0;case 1:return l.next=3,p.take(t);case 3:if(l.t0=h=l.sent,l.t1=p.CLOSED,l.t0===l.t1){l.next=22;break}if(m=h.header.pid,0!==m){l.next=11;break}a=s(h),l.next=20;break;case 11:if(m!==a){l.next=15;break}return l.delegateYield(d["default"].mark(function x(){var t;return d["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:u=o(h),t=[],b.each(u,function(e){e===g["default"].ISO_IEC_13818_1_RESERVED?t.push({type:"audio",codec:"aac"}):e===g["default"].ISO_IEC_11172_3_AUDIO||e===g["default"].ISO_IEC_13818_3_AUDIO?t.push({type:"audio",codec:"mp3"}):e===g["default"].ITU_T_H264&&t.push({type:"video",codec:"default"})}),e(t);case 4:if(!i.length){a.next=9;break}return h=i.shift(),a.delegateYield(c(n,u,r,h),"t0",7);case 7:a.next=4;break;case 9:case"end":return a.stop()}},x,T)})(),"t2",13);case 13:l.next=20;break;case 15:if(!u){l.next=19;break}return l.delegateYield(c(n,u,r,h),"t3",17); case 17:l.next=20;break;case 19:i.push(h);case 20:l.next=1;break;case 22:v=b.keys(u),y=0;case 24:if(!(y>4,t>13)throw new Error("Multiple PMT/NIT entries not supported");var n=0;return n|=(31&e.payload[10])<<8|e.payload[11]}function o(e){var t={};u(e);for(var n=e.payload,r=(15&n[1])<<8|n[2],i=r+3,a=(15&n[10])<<8|n[11],s=12+a;s>>1;return t+n},parsePES:function(e,t){var n=t[0]<<16|t[1]<<8|t[2];if(1===n){var i=t[3];t[4]<<8|t[5];if(i!==r.PADDING_STREAM&&i!==r.PRIVATE_STREAM_2){var a,s,o=t[7]>>>6,u=(4&t[6])>>>2,c=t[8]+9;2===o?(a=this.readTS(t.subarray(9)),s=a):3===o&&(a=this.readTS(t.subarray(9)),s=this.readTS(t.subarray(14)));var f={id:i,type:e,pts:a,dts:s,data_alignment_indicator:u,payload:t.subarray(c)};return f}}}};t["default"]=i},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n,r,i){var a=!1,s=!1,u=[];return o["default"].mark(function f(){var d,h;return o["default"].wrap(function(o){for(;;)switch(o.prev=o.next){case 0:d=void 0;case 1:return o.t0=l.CLOSED,o.next=4,l.take(t);case 4:if(o.t1=d=o.sent,o.t0===o.t1){o.next=42;break}if(h=d.type,"error"!==h){o.next=11;break}return o.next=10,l.put(n,d);case 10:return o.abrupt("break",42);case 11:if(h!==c["default"].ISO_IEC_13818_1_RESERVED){o.next=17;break}return a||(a=!0,u.push({type:"audio",codec:"aac"})),o.next=15,l.put(n,d);case 15:o.next=39;break;case 17:if(h!==c["default"].ISO_IEC_11172_3_AUDIO&&h!==c["default"].ISO_IEC_13818_3_AUDIO){o.next=23;break}return a||(a=!0,u.push({type:"audio",codec:"mp3"})),o.next=21,l.put(n,d);case 21:o.next=39;break;case 23:if(h!==c["default"].ITU_T_H264){o.next=29;break}return s||(s=!0,u.push({type:"video",codec:"default"})),o.next=27,l.put(r,d);case 27:o.next=39;break;case 29:if(h!==c["default"].METADATA_IN_PES){o.next=34;break}return o.next=32,l.put(i,d);case 32:o.next=39;break;case 34:if("error"!==h){o.next=39;break}return o.next=37,l.put(i,d);case 37:o.next=39;break;case 39:2===u.length&&e(u),o.next=1;break;case 42:e(u),r.close(),i.close(),n.close();case 46:case"end":return o.stop()}},f,this)})}t.__esModule=!0;var s=n(7),o=i(s);t.PesPacketSplitter=a;var u=n(25),c=i(u),f=n(6),l=r(f)},function(e,t){"use strict";function n(e){var t={syncByte:e[0],payloadStart:0!==(64&e[1]),priority:0!==(32&e[1]),pid:(31&e[1])<<8|e[2],adaptationField:0!==(32&e[3]),containsPayload:0!==(16&e[3]),continuityCounter:15&e[3]},n=4;if(t.adaptationField){n+=1;var r=e[4];n+=r}var i;i=t.containsPayload?e.subarray(n):null;var a={header:t,payload:i};return a}t.__esModule=!0,t.TsPacket=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){(function(t,n){!function(t){"use strict";function r(e,t,n,r){var i=Object.create((t||a).prototype),s=new p(r||[]);return i._invoke=l(e,n,s),i}function i(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}function a(){}function s(){}function o(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function c(e){this.arg=e}function f(e){function t(n,r,a,s){var o=i(e[n],e,r);if("throw"!==o.type){var u=o.arg,f=u.value;return f instanceof c?Promise.resolve(f.arg).then(function(e){t("next",e,a,s)},function(e){t("throw",e,a,s)}):Promise.resolve(f).then(function(e){u.value=e,a(u)},s)}s(o.arg)}function r(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return a=a?a.then(r,r):r()}"object"==typeof n&&n.domain&&(t=n.domain.bind(t));var a;this._invoke=r}function l(e,t,n){var r=w;return function(a,s){if(r===S)throw new Error("Generator is already running");if(r===I){if("throw"===a)throw s;return v()}for(;;){var o=n.delegate;if(o){if("return"===a||"throw"===a&&o.iterator[a]===y){n.delegate=null;var u=o.iterator["return"];if(u){var c=i(u,o.iterator,s);if("throw"===c.type){a="throw",s=c.arg;continue}}if("return"===a)continue}var c=i(o.iterator[a],o.iterator,s);if("throw"===c.type){n.delegate=null,a="throw",s=c.arg;continue}a="next",s=y;var f=c.arg;if(!f.done)return r=E,f;n[o.resultName]=f.value,n.next=o.nextLoc,n.delegate=null}if("next"===a)n.sent=n._sent=s;else if("throw"===a){if(r===w)throw r=I,s;n.dispatchException(s)&&(a="next",s=y)}else"return"===a&&n.abrupt("return",s);r=S;var c=i(e,t,n);if("normal"===c.type){r=n.done?I:E;var f={value:c.arg,done:n.done};if(c.arg!==M)return f;n.delegate&&"next"===a&&(s=y)}else"throw"===c.type&&(r=I,a="throw",s=c.arg)}}}function d(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function h(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(d,this),this.reset(!0)}function m(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function i(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var s=g.call(i,"catchLoc"),o=g.call(i,"finallyLoc");if(s&&o){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),h(n),M}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;h(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:m(e),resultName:t,nextLoc:n},M}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,function(){return this}(),n(83))},,function(e,t,n){var r,i;(function(){function n(e){function t(t,n,r,i,a,s){for(;a>=0&&a0?0:o-1;return arguments.length<3&&(i=n[s?s[u]:u],u+=e),t(n,r,i,s,u,o)}}function a(e){return function(t,n,r){n=w(n,r);for(var i=A(t),a=e>0?0:i-1;a>=0&&a0?s=a>=0?a:Math.max(a+o,s):o=a>=0?Math.min(a+1,o):a+o+1;else if(n&&a&&o)return a=n(r,i),r[a]===i?a:-1;if(i!==i)return a=t(p.call(r,s,o),x.isNaN),a>=0?a+s:-1;for(a=e>0?s:o-1;a>=0&&a=0&&t<=M};x.each=x.forEach=function(e,t,n){t=k(t,n);var r,i;if(C(e))for(r=0,i=e.length;r=0},x.invoke=function(e,t){var n=p.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){var i=r?t:e[t];return null==i?i:i.apply(e,n)})},x.pluck=function(e,t){return x.map(e,x.property(t))},x.where=function(e,t){return x.filter(e,x.matcher(t))},x.findWhere=function(e,t){return x.find(e,x.matcher(t))},x.max=function(e,t,n){var r,i,a=-(1/0),s=-(1/0);if(null==t&&null!=e){e=C(e)?e:x.values(e);for(var o=0,u=e.length;oa&&(a=r)}else t=w(t,n),x.each(e,function(e,n,r){i=t(e,n,r),(i>s||i===-(1/0)&&a===-(1/0))&&(a=e,s=i)});return a},x.min=function(e,t,n){var r,i,a=1/0,s=1/0;if(null==t&&null!=e){e=C(e)?e:x.values(e);for(var o=0,u=e.length;or||void 0===n)return 1;if(nt?(s&&(clearTimeout(s),s=null),o=c,a=e.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(u,f)),a}},x.debounce=function(e,t,n){var r,i,a,s,o,u=function(){var c=x.now()-s;c=0?r=setTimeout(u,t-c):(r=null,n||(o=e.apply(a,i),r||(a=i=null)))};return function(){a=this,i=arguments,s=x.now();var c=n&&!r;return r||(r=setTimeout(u,t)),c&&(o=e.apply(a,i),a=i=null),o}},x.wrap=function(e,t){return x.partial(t,e)},x.negate=function(e){return function(){return!e.apply(this,arguments)}},x.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},x.once=x.partial(x.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];x.keys=function(e){if(!x.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)x.has(e,n)&&t.push(n);return O&&o(e,t),t},x.allKeys=function(e){if(!x.isObject(e))return[];var t=[];for(var n in e)t.push(n);return O&&o(e,t),t},x.values=function(e){for(var t=x.keys(e),n=t.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},N=x.invert(U),F=function(e){var t=function(t){return e[t]},n="(?:"+x.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};x.escape=F(U),x.unescape=F(N),x.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),x.isFunction(r)?r.call(e):r};var q=0;x.uniqueId=function(e){var t=++q+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var X=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Q=/\\|'|\r|\n|\u2028|\u2029/g,j=function(e){return"\\"+V[e]};x.template=function(e,t,n){!t&&n&&(t=n),t=x.defaults({},t,x.templateSettings);var r=RegExp([(t.escape||X).source,(t.interpolate||X).source,(t.evaluate||X).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(r,function(t,n,r,s,o){return a+=e.slice(i,o).replace(Q,j),i=o+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(a+="';\n"+s+"\n__p+='"),t}),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var s=new Function(t.variable||"obj","_",a)}catch(o){throw o.source=a,o}var u=function(e){return s.call(this,e,x)},c=t.variable||"obj";return u.source="function("+c+"){\n"+a+"}",u},x.chain=function(e){var t=x(e);return t._chain=!0,t};var Y=function(e,t){return e._chain?x(t).chain():t};x.mixin=function(e){x.each(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return h.apply(e,arguments),Y(this,n.apply(x,e))}})},x.mixin(x),x.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=f[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],Y(this,n)}}),x.each(["concat","join","slice"],function(e){var t=f[e];x.prototype[e]=function(){return Y(this,t.apply(this._wrapped,arguments))}}),x.prototype.value=function(){return this._wrapped},x.prototype.valueOf=x.prototype.toJSON=x.prototype.value,x.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return x}.apply(t,r),!(void 0!==i&&(e.exports=i))}).call(this)},,,,,function(e,t,n){var r,i;r=[],i=function(){var e=!0,t={media:{TextSourceBuffer:{isTypeSupported:function(){return!1}}},asserts:{assert:function(){}},util:{EventManager:function(){this.destroy=function(){},this.listen=function(e,t,n){e.addEventListener(t,n,!1)}},PublicPromise:function(){var e,t,n=new Promise(function(n,r){e=n,t=r});return n.resolve=e,n.reject=t,n}}};return t.media.MediaSourceEngine=function(e,n){t.asserts.assert("open"==e.readyState,"The MediaSource should be in the 'open' state."),this.mediaSource_=e,this.textTrack_=n,this.sourceBuffers_={},this.queues_={},this.eventManager_=new t.util.EventManager,this.destroyed_=!1},t.media.MediaSourceEngine.Operation,t.media.MediaSourceEngine.isTypeSupported=function(e){return t.media.TextSourceBuffer.isTypeSupported(e)||MediaSource.isTypeSupported(e)},t.media.MediaSourceEngine.support=function(){var e={basic:!!window.MediaSource};if(e.basic){var n=['video/mp4; codecs="avc1.42E01E"','audio/mp4; codecs="mp4a.40.2"','video/webm; codecs="vp8"','video/webm; codecs="vp9"','audio/webm; codecs="vorbis"','audio/webm; codecs="opus"','video/mp2t; codecs="avc1.42E01E"','video/mp2t; codecs="mp4a.40.2"',"text/vtt",'application/mp4; codecs="wvtt"',"application/ttml+xml",'application/mp4; codecs="stpp"'];n.forEach(function(n){e[n]=t.media.MediaSourceEngine.isTypeSupported(n);var r=n.split(";")[0];e[r]=e[r]||e[n]})}return e},t.media.MediaSourceEngine.prototype.destroy=function(){this.destroyed_=!0;var n=[];for(var r in this.queues_){var i=this.queues_[r],a=i[0];this.queues_[r]=i.slice(0,1),a&&n.push(a.p["catch"](function(){}));for(var s=1;s=n.start(i)&&t "+e),this.enqueueBlockingOperation_(function(){this.mediaSource_.duration=e}.bind(this))},t.media.MediaSourceEngine.prototype.append_=function(e,t){this.sourceBuffers_[e].appendBuffer(t)},t.media.MediaSourceEngine.prototype.remove_=function(e,t,n){this.sourceBuffers_[e].remove(t,n)},t.media.MediaSourceEngine.prototype.onError_=function(e,n){var r=this.queues_[e][0];t.asserts.assert(r,"Spurious error event!"),t.asserts.assert(!this.sourceBuffers_[e].updating,"SourceBuffer should not be updating on error!"),r.p.reject(n)},t.media.MediaSourceEngine.prototype.onUpdateEnd_=function(e,n){var r=this.queues_[e][0];t.asserts.assert(r,"Spurious updateend event!"),t.asserts.assert(!this.sourceBuffers_[e].updating,"SourceBuffer should not be updating on updateend!"),r.p.resolve(),this.popFromQueue_(e)},t.media.MediaSourceEngine.prototype.enqueueOperation_=function(e,n){if(this.destroyed_)return Promise.reject();var r={start:n,p:new t.util.PublicPromise};if(this.queues_[e].push(r),1==this.queues_[e].length)try{r.start()}catch(i){r.p.reject(i),this.popFromQueue_(e)}return r.p},t.media.MediaSourceEngine.prototype.enqueueBlockingOperation_=function(n){if(this.destroyed_)return Promise.reject();var r=[];for(var i in this.sourceBuffers_){var a=new t.util.PublicPromise,s={start:function(e){e.resolve()}.bind(null,a),p:a};this.queues_[i].push(s),r.push(a),1==this.queues_[i].length&&s.start()}return Promise.all(r).then(function(){if(!e)for(var r in this.sourceBuffers_)t.asserts.assert(0==this.sourceBuffers_[r].updating,"SourceBuffers should not be updating after a blocking op!");var i;try{n()}catch(a){i=Promise.reject(a)}for(var r in this.sourceBuffers_)this.popFromQueue_(r);return i}.bind(this),function(){if(t.asserts.assert(this.destroyed_,"Should be destroyed by now"),!e)for(var n in this.sourceBuffers_)this.queues_[n].length&&(t.asserts.assert(1==this.queues_[n].length,"Should be at most one item in queue!"),t.asserts.assert(r.indexOf(this.queues_[n][0].p)!=-1,"The item in queue should be one of our waiters!"),this.queues_[n].shift());return Promise.reject()}.bind(this))},t.media.MediaSourceEngine.prototype.popFromQueue_=function(e){this.queues_[e].shift();var t=this.queues_[e][0];if(t)try{t.start()}catch(n){t.p.reject(n),this.popFromQueue_(e)}},t.media.MediaSourceEngine.prototype.setTimestampOffset=function(e,t){ return this.enqueueBlockingOperation_(function(){this.sourceBuffers_[e].timestampOffset=t}.bind(this))},t.media.MediaSourceEngine}.apply(t,r),!(void 0!==i&&(e.exports=i))}]);