@volcengine/veplayer 1.11.1-rc.1 → 1.12.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ window.DanmuMask=function(t){var e={};function a(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=10)}([function(t,e,a){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var n in a)r(a,n)&&(t[n]=a[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,a,n,r){if(e.subarray&&t.subarray)t.set(e.subarray(a,a+n),r);else for(var i=0;i<n;i++)t[r+i]=e[a+i]},flattenChunks:function(t){var e,a,n,r,i,s;for(n=0,e=0,a=t.length;e<a;e++)n+=t[e].length;for(s=new Uint8Array(n),r=0,e=0,a=t.length;e<a;e++)i=t[e],s.set(i,r),r+=i.length;return s}},s={arraySet:function(t,e,a,n,r){for(var i=0;i<n;i++)t[r+i]=e[a+i]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(n)},function(t,e,a){"use strict";var n=a(23)();t.exports=function(t){return t!==n&&null!==t}},function(t,e,a){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,a){"use strict";var n,r,i,s,o,l,u,h=a(12),d=a(29),f=Function.prototype.apply,c=Function.prototype.call,_=Object.create,g=Object.defineProperty,p=Object.defineProperties,m=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var a,r;return d(e),r=this,n.call(this,t,a=function(){i.call(r,t,a),f.call(e,this,arguments)}),a.__eeOnceListener__=e,this},o={on:n=function(t,e){var a;return d(e),m.call(this,"__ee__")?a=this.__ee__:(a=v.value=_(null),g(this,"__ee__",v),v.value=null),a[t]?"object"==typeof a[t]?a[t].push(e):a[t]=[a[t],e]:a[t]=e,this},once:r,off:i=function(t,e){var a,n,r,i;if(d(e),!m.call(this,"__ee__"))return this;if(!(a=this.__ee__)[t])return this;if("object"==typeof(n=a[t]))for(i=0;r=n[i];++i)r!==e&&r.__eeOnceListener__!==e||(2===n.length?a[t]=n[i?0:1]:n.splice(i,1));else n!==e&&n.__eeOnceListener__!==e||delete a[t];return this},emit:s=function(t){var e,a,n,r,i;if(m.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(a=arguments.length,i=new Array(a-1),e=1;e<a;++e)i[e-1]=arguments[e];for(r=r.slice(),e=0;n=r[e];++e)f.call(n,this,i)}else switch(arguments.length){case 1:c.call(r,this);break;case 2:c.call(r,this,arguments[1]);break;case 3:c.call(r,this,arguments[1],arguments[2]);break;default:for(a=arguments.length,i=new Array(a-1),e=1;e<a;++e)i[e-1]=arguments[e];f.call(r,this,i)}}},l={on:h(n),once:h(r),off:h(i),emit:h(s)},u=p({},l),t.exports=e=function(t){return null==t?_(u):p(Object(t),l)},e.methods=o},function(t,e,a){"use strict";t.exports=function(t){return null!=t}},function(t,e,a){"use strict";t.exports=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16|0}},function(t,e,a){"use strict";var n=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();t.exports=function(t,e,a,r){var i=n,s=r+a;t^=-1;for(var o=r;o<s;o++)t=t>>>8^i[255&(t^e[o])];return-1^t}},function(t,e,a){"use strict";var n=a(0),r=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){i=!1}for(var s=new n.Buf8(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function l(t,e){if(e<65534&&(t.subarray&&i||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var a="",s=0;s<e;s++)a+=String.fromCharCode(t[s]);return a}s[254]=s[254]=1,e.string2buf=function(t){var e,a,r,i,s,o=t.length,l=0;for(i=0;i<o;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<o&&56320==(64512&(r=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(r-56320),i++),l+=a<128?1:a<2048?2:a<65536?3:4;for(e=new n.Buf8(l),s=0,i=0;s<l;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<o&&56320==(64512&(r=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(r-56320),i++),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},e.buf2binstring=function(t){return l(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,r=e.length;a<r;a++)e[a]=t.charCodeAt(a);return e},e.buf2string=function(t,e){var a,n,r,i,o=e||t.length,u=new Array(2*o);for(n=0,a=0;a<o;)if((r=t[a++])<128)u[n++]=r;else if((i=s[r])>4)u[n++]=65533,a+=i-1;else{for(r&=2===i?31:3===i?15:7;i>1&&a<o;)r=r<<6|63&t[a++],i--;i>1?u[n++]=65533:r<65536?u[n++]=r:(r-=65536,u[n++]=55296|r>>10&1023,u[n++]=56320|1023&r)}return l(u,n)},e.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+s[t[a]]>e?a:e}},function(t,e,a){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,a){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,a){t.exports=a(11)},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}(),r=c(a(3)),i=c(a(30)),s=c(a(31)),o=c(a(32)),l=a(33),u=c(a(34)),h=c(a(43)),d=c(a(44)),f=a(46);function c(t){return t&&t.__esModule?t:{default:t}}var _=function(){function t(e){var a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(0,r.default)(this),this.url=e.url,this.player=e.player,this.aheadTime=parseFloat(localStorage.getItem("danmuMaskAheadTime"))||e.aheadTime||0,this.originStart=parseFloat(e.originStart)||0,this.interval=parseFloat(localStorage.getItem("danmuMaskInterval"))||e.interval||s.default.DEFAULT_INTERVAL,this.metaDataAreaLength=s.default.VERSION_LENGTH+s.default.INDEX_LENGTH+s.default.RESERVE_LENGTH,(0,l.log)("DanmuMask NPM Version: ",f.version),(0,l.log)("DanmuMask Config: ",e),this.searchFrameWorker=new d.default,this.searchFrameWorker.onmessage=function(t){if("searchResult"===t.data.method){var e=t.data.args;a.setDanmuMask(e.svgData||"")}else if("getData"===t.data.method){var n=t.data.args;a.getData(a.url,n.range).then((function(t){a.parseSvgData(n.index,t),a.searchFrameWorker.postMessage({method:"updateDataListItem",args:{index:n.index,key:"download",value:!0}})}))}}}return n(t,[{key:"init",value:function(){var t=this;(0,l.log)("DanmuMask init");var e=this;this.dataList=[],this.danmuEl=this.player.root.querySelector("xg-danmu"),this.danmuEl||(this.danmuEl=this.player.root.querySelector("xg-bullet")),this.danmuEl.style["-webkit-mask-position"]="center",this.danmuEl.style["-webkit-box-direction"]="normal",this.danmuEl.style["-webkit-mask-size"]="100% 100%";var a=this.player.root.getBoundingClientRect();this.containerWidth=a.width,this.containerHeight=a.height,this.getData(this.url,[0,this.metaDataAreaLength-1]).then((function(a){var n=new o.default(a);t.protocolVersion=n.readUint8(),t.indexAreaByteLength=n.readBigEnd(4),(0,l.log)("DanmuMask this.protocolVersion: ",t.protocolVersion),(0,l.log)("DanmuMask this.indexAreaByteLength: ",t.indexAreaByteLength),t.dataAreaBase=0,t.getData(t.url,[t.metaDataAreaLength,t.metaDataAreaLength+t.indexAreaByteLength-1]).then((function(a){var n=new o.default(a);t.indexByteStep=8,t.indexCount=t.indexAreaByteLength/t.indexByteStep;for(var r=n.readBigEnd(8)+t.dataAreaBase,i=void 0,u=0;u<t.indexCount;u++)i=u<t.indexCount-1?n.readBigEnd(8)+t.dataAreaBase:0,t.dataList.push({idx:u,timeStart:u*s.default.DURATION_STEP,timeEnd:(u+1)*s.default.DURATION_STEP,dataStart:r,dataEnd:i-1,download:!1,currentFrame:-1}),r=i;t.searchFrameWorker.postMessage({method:"updateData",args:{dataList:t.dataList,indexCount:t.indexCount}}),t.player.stopDanmuMaskTimer=function(){(0,l.log)("DanmuMask stopDanmuMaskTimer"),e.timer&&(e.timer.clear(),e.timer=null)},t.player.startDanmuMaskTimer=function(){(0,l.log)("DanmuMask startDanmuMaskTimer"),e.timer||(e.timer=new h.default,e.timer.repeat(e.timeupdateFunc.bind(e),e.interval))},t.player.onDanmuMaskSeeked=function(){t.searchFrameWorker.postMessage({method:"onDanmuMaskSeeked"})},e.player.startDanmuMaskTimer(),["ended","pause","error"].forEach((function(a){t.player.on(a,e.player.stopDanmuMaskTimer)})),["play","playing"].forEach((function(a){t.player.on(a,e.player.startDanmuMaskTimer)})),t.player.on("seeked",e.player.onDanmuMaskSeeked)}))}))}},{key:"timeupdateFunc",value:function(){var t=this.player.currentTime+this.originStart-this.aheadTime;this.searchFrameWorker.postMessage({method:"searchFrame",args:{currentTime:t}})}},{key:"getData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=this;return new Promise((function(n){var r=new i.default(t,e,n);r.once("error",(function(t){a.player.emit("error",t)})),r.once("progress_event",(function(t){a.player.emit("progress_event",t)}))}))}},{key:"setContainerSize",value:function(t,e){(0,l.log)("DanmuMask setContainerSize: ",t,e),this.containerWidth=t,this.containerHeight=e}},{key:"setDanmuMask",value:function(t){if((0,l.log)("DanmuMask setDanmuMask"),t){var e=this.player.video;this.containerWidth/this.containerHeight>=e.videoWidth/e.videoHeight?(this.topRatio=0,this.bottomRatio=100,this.leftRatio=100*(1-e.videoWidth*this.containerHeight/e.videoHeight/this.containerWidth)/2,this.rightRatio=100-this.leftRatio):(this.topRatio=100*(1-e.videoHeight*this.containerWidth/e.videoWidth/this.containerHeight)/2,this.bottomRatio=100-this.topRatio,this.leftRatio=0,this.rightRatio=100);var a="linear-gradient(rgb(0, 0, 0), rgb(0, 0, 0) "+this.topRatio+"%, rgba(0, 0, 0, 0) "+this.topRatio+"%), linear-gradient(rgba(0, 0, 0, 0) "+this.bottomRatio+"%, rgb(0, 0, 0) "+this.bottomRatio+"%, rgb(0, 0, 0)), linear-gradient(to right, rgb(0, 0, 0), rgb(0, 0, 0) "+this.leftRatio+"%, rgba(0, 0, 0, 0) "+this.leftRatio+"%), linear-gradient(to right, rgba(0, 0, 0, 0) "+this.rightRatio+"%, rgb(0, 0, 0) "+this.rightRatio+'%, rgb(0, 0, 0)),url("data:image/svg+xml;base64,'+t+'")';this.danmuEl.style["-webkit-mask-image"]=a,this.danmuEl.style["mask-image"]=a}else{var n="linear-gradient(rgb(0, 0, 0), rgb(0, 0, 0) 0%, rgba(0, 0, 0) 0%), linear-gradient(rgba(0, 0, 0) 100%, rgb(0, 0, 0) 100%, rgb(0, 0, 0)), linear-gradient(to right, rgb(0, 0, 0), rgb(0, 0, 0) 0%, rgba(0, 0, 0) 0%), linear-gradient(to right, rgba(0, 0, 0) 100%, rgb(0, 0, 0) 100%, rgb(0, 0, 0))";this.danmuEl.style["-webkit-mask-image"]=n,this.danmuEl.style["mask-image"]=n}}},{key:"parseSvgData",value:function(t,e){try{var a=u.default.inflate(e);(0,l.log)("DanmuMask output: ",a);for(var n=new o.default(a.buffer),r=[];n.position<a.byteLength-1;){var i={};i.dataPts=n.readBigEnd(8),i.dataSvgLength=n.readBigEnd(4),i.dataSvgBase64="";for(var s=0;s<i.dataSvgLength;s++)i.dataSvgBase64+=String.fromCharCode(n.readUint8());i.dataSvgBase64=window.btoa(i.dataSvgBase64),r.push(i)}this.searchFrameWorker.postMessage({method:"updateDataListItem",args:{index:t,key:"data",value:a}}),this.searchFrameWorker.postMessage({method:"updateDataListItem",args:{index:t,key:"frameList",value:r}}),(0,l.log)("DanmuMask frameList: ",r)}catch(t){(0,l.log)("DanmuMask zlib inflate error: ",t)}}},{key:"destroy",value:function(){var t=this;(0,l.log)("DanmuMask destroy"),this.player&&"function"==typeof this.player.off&&(["ended","pause","error"].forEach((function(e){t.player.stopDanmuMaskTimer&&t.player.off(e,t.player.stopDanmuMaskTimer)})),["play","playing"].forEach((function(e){t.player.startDanmuMaskTimer&&t.player.off(e,t.player.startDanmuMaskTimer)})),this.player.onDanmuMaskSeeked&&this.player.off("seeked",this.player.onDanmuMaskSeeked)),this.timer&&this.timer.clear(),this.searchFrameWorker&&this.searchFrameWorker.terminate(),this.setDanmuMask()}}]),t}();e.default=_,t.exports=e.default},function(t,e,a){"use strict";var n=a(4),r=a(13),i=a(17),s=a(25),o=a(26);(t.exports=function(t,e){var a,r,l,u,h;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],n(t)?(a=o.call(t,"c"),r=o.call(t,"e"),l=o.call(t,"w")):(a=l=!0,r=!1),h={value:e,configurable:a,enumerable:r,writable:l},u?i(s(u),h):h}).gs=function(t,e,a){var l,u,h,d;return"string"!=typeof t?(h=a,a=e,e=t,t=null):h=arguments[3],n(e)?r(e)?n(a)?r(a)||(h=a,a=void 0):a=void 0:(h=e,e=a=void 0):e=void 0,n(t)?(l=o.call(t,"c"),u=o.call(t,"e")):(l=!0,u=!1),d={get:e,set:a,configurable:l,enumerable:u},h?i(s(h),d):d}},function(t,e,a){"use strict";var n=a(14),r=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(t){return!!n(t)&&!r.test(i.call(t))}},function(t,e,a){"use strict";var n=a(15);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!n(t)}},function(t,e,a){"use strict";var n=a(16);t.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},function(t,e,a){"use strict";var n=a(4),r={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!n(t)&&hasOwnProperty.call(r,typeof t)}},function(t,e,a){"use strict";t.exports=a(18)()?Object.assign:a(19)},function(t,e,a){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,a){"use strict";var n=a(20),r=a(24),i=Math.max;t.exports=function(t,e){var a,s,o,l=i(arguments.length,2);for(t=Object(r(t)),o=function(n){try{t[n]=e[n]}catch(t){a||(a=t)}},s=1;s<l;++s)n(e=arguments[s]).forEach(o);if(void 0!==a)throw a;return t}},function(t,e,a){"use strict";t.exports=a(21)()?Object.keys:a(22)},function(t,e,a){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,a){"use strict";var n=a(1),r=Object.keys;t.exports=function(t){return r(n(t)?Object(t):t)}},function(t,e,a){"use strict";t.exports=function(){}},function(t,e,a){"use strict";var n=a(1);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,a){"use strict";var n=a(1),r=Array.prototype.forEach,i=Object.create,s=function(t,e){var a;for(a in t)e[a]=t[a]};t.exports=function(t){var e=i(null);return r.call(arguments,(function(t){n(t)&&s(Object(t),e)})),e}},function(t,e,a){"use strict";t.exports=a(27)()?String.prototype.contains:a(28)},function(t,e,a){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&(!0===n.contains("dwa")&&!1===n.contains("foo"))}},function(t,e,a){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,a){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,r=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}(),i=a(3),s=(n=i)&&n.__esModule?n:{default:n};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2];o(this,t),(0,s.default)(this);var r=this;if(r.url=e,r.on=!1,r.range=a,t.queue.some((function(t){return t.url===e&&JSON.stringify(t.range)===JSON.stringify(a)})))n("repeat");else{var i=new XMLHttpRequest;i.target=r,i.responseType="arraybuffer",i.open("get",e),a&&a.length>1&&(r.range=a,r.id=a.join("-"),i.setRequestHeader("Range","bytes="+a[0]+"-"+(a[1]||""))),i.onload=function(){200===i.status||206===i.status?n&&n instanceof Function&&n(i.response):n&&n instanceof Function?n("Not Found"):r.emit("error"),i.target.remove()},i.onerror=function(){n(!1),i.target.remove()},i.onabort=function(){i.target.remove()},r.xhr=i,t.queue.push(r),r.update()}}return r(t,[{key:"cancel",value:function(){this.xhr.abort()}},{key:"remove",value:function(){var e=this;t.queue.filter((function(a,n){return a.url===e.url&&JSON.stringify(a.range)===JSON.stringify(e.range)&&(t.queue.splice(n,1),!0)})),this.update()}},{key:"update",value:function(){var e=t.queue,a=e.filter((function(t){return t.on})),n=e.filter((function(t){return!t.on})),r=t.limit-a.length;n.forEach((function(t,e){e<r&&t.run()}))}},{key:"run",value:function(){1===this.xhr.readyState?(this.on=!0,this.xhr.send()):this.remove()}}],[{key:"clear",value:function(){t.queue.forEach((function(t){t.on&&t.cancel()})),t.queue.length=0}}]),t}();l.queue=[],l.limit=4,window.Task=l,e.default=l,t.exports=e.default},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}();var r=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.init()}return n(t,[{key:"init",value:function(){this.VERSION_LENGTH=1,this.INDEX_LENGTH=4,this.RESERVE_LENGTH=4,this.DURATION_STEP=10,this.DEFAULT_INTERVAL=30}}]),t}());e.default=r,t.exports=e.default},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}();var r=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e instanceof ArrayBuffer&&(this.buffer=e,this.dataview=new DataView(e),this.dataview.position=0)}return n(t,[{key:"skip",value:function(e){for(var a=Math.floor(e/4),n=e%4,r=0;r<a;r++)t.readByte(this.dataview,4);n>0&&t.readByte(this.dataview,n)}},{key:"readUint8",value:function(){return t.readByte(this.dataview,1)}},{key:"readUint16",value:function(){return t.readByte(this.dataview,2)}},{key:"readUint32",value:function(){return t.readByte(this.dataview,4)}},{key:"readUint64",value:function(){return t.readByte(this.dataview,8)}},{key:"readInt8",value:function(){return t.readByte(this.dataview,1,!0)}},{key:"readInt16",value:function(){return t.readByte(this.dataview,2,!0)}},{key:"readInt32",value:function(){return t.readByte(this.dataview,4,!0)}},{key:"readLittleEnd",value:function(e){for(var a=0,n=0;n<e;n++)a+=Math.pow(256,n)*t.readByte(this.dataview,1);return a}},{key:"readBigEnd",value:function(e){for(var a=0,n=0;n<e;n++)a+=Math.pow(256,e-n-1)*t.readByte(this.dataview,1);return a}},{key:"position",set:function(t){this.dataview.position=t},get:function(){return this.dataview.position}}],[{key:"readByte",value:function(t,e,a){var n=void 0;switch(e){case 1:n=a?t.getInt8(t.position):t.getUint8(t.position);break;case 2:n=a?t.getInt16(t.position):t.getUint16(t.position);break;case 3:if(a)throw"not supported for readByte 3";n=t.getUint8(t.position)<<16,n|=t.getUint8(t.position+1)<<8,n|=t.getUint8(t.position+2);break;case 4:n=a?t.getInt32(t.position):t.getUint32(t.position);break;case 8:n=t.getUint32(t.position)<<32,n|=t.getUint32(t.position+4);break;default:n=""}return t.position+=e,n}}]),t}();e.default=r,t.exports=e.default},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(t){var e;if(!n)return;for(var a=arguments.length,r=Array(a>1?a-1:0),i=1;i<a;i++)r[i-1]=arguments[i];console&&(e=console).log.apply(e,[t].concat(r))};var n=e.LOGOPEN=window.location.search.indexOf("log=true")>-1},function(t,e,a){"use strict";var n={};(0,a(0).assign)(n,a(35),a(38),a(9)),t.exports=n},function(t,e,a){"use strict";var n=a(36),r=a(0),i=a(7),s=a(2),o=a(8),l=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var a=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==a)throw new Error(s[a]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var h;if(h="string"==typeof e.dictionary?i.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(a=n.deflateSetDictionary(this.strm,h)))throw new Error(s[a]);this._dict_set=!0}}function h(t,e){var a=new u(e);if(a.push(t,!0),a.err)throw a.msg||s[a.err];return a.result}u.prototype.push=function(t,e){var a,s,o=this.strm,u=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=i.string2buf(t):"[object ArrayBuffer]"===l.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new r.Buf8(u),o.next_out=0,o.avail_out=u),1!==(a=n.deflate(o,s))&&0!==a)return this.onEnd(a),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(i.buf2binstring(r.shrinkBuf(o.output,o.next_out))):this.onData(r.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==a);return 4===s?(a=n.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,0===a):2!==s||(this.onEnd(0),o.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=h,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,h(t,e)}},function(t,e,a){"use strict";var n,r=a(0),i=a(37),s=a(5),o=a(6),l=a(2);function u(t,e){return t.msg=l[e],e}function h(t){return(t<<1)-(t>4?9:0)}function d(t){for(var e=t.length;--e>=0;)t[e]=0}function f(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(r.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function c(t,e){i._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,f(t.strm)}function _(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function p(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,h=t.w_mask,d=t.prev,f=t.strstart+258,c=u[i+s-1],_=u[i+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do{if(u[(a=e)+s]===_&&u[a+s-1]===c&&u[a]===u[i]&&u[++a]===u[i+1]){i+=2,a++;do{}while(u[++i]===u[++a]&&u[++i]===u[++a]&&u[++i]===u[++a]&&u[++i]===u[++a]&&u[++i]===u[++a]&&u[++i]===u[++a]&&u[++i]===u[++a]&&u[++i]===u[++a]&&i<f);if(n=258-(f-i),i=f-258,n>s){if(t.match_start=e,s=n,n>=o)break;c=u[i+s-1],_=u[i+s]}}}while((e=d[e&h])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead}function m(t){var e,a,n,i,l,u,h,d,f,c,_=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=_+(_-262)){r.arraySet(t.window,t.window,_,_,0),t.match_start-=_,t.strstart-=_,t.block_start-=_,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=_?n-_:0}while(--a);e=a=_;do{n=t.prev[--e],t.prev[e]=n>=_?n-_:0}while(--a);i+=_}if(0===t.strm.avail_in)break;if(u=t.strm,h=t.window,d=t.strstart+t.lookahead,f=i,c=void 0,(c=u.avail_in)>f&&(c=f),a=0===c?0:(u.avail_in-=c,r.arraySet(h,u.input,u.next_in,c,d),1===u.state.wrap?u.adler=s(u.adler,h,c,d):2===u.state.wrap&&(u.adler=o(u.adler,h,c,d)),u.next_in+=c,u.total_in+=c,c),t.lookahead+=a,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function v(t,e){for(var a,n;;){if(t.lookahead<262){if(m(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=p(t,a)),t.match_length>=3)if(n=i._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(c(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(c(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(c(t,!1),0===t.strm.avail_out)?1:2}function b(t,e){for(var a,n,r;;){if(t.lookahead<262){if(m(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=p(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=i._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(c(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=i._tr_tally(t,0,t.window[t.strstart-1]))&&c(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=i._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(c(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(c(t,!1),0===t.strm.avail_out)?1:2}function w(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}function k(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),d(this.dyn_ltree),d(this.dyn_dtree),d(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),d(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),d(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function y(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,i._tr_init(e),0):u(t,-2)}function x(t){var e,a=y(t);return 0===a&&((e=t.state).window_size=2*e.w_size,d(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a}function z(t,e,a,n,i,s){if(!t)return-2;var o=1;if(-1===e&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>9||8!==a||n<8||n>15||e<0||e>9||s<0||s>4)return u(t,-2);8===n&&(n=9);var l=new k;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=i+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new r.Buf8(2*l.w_size),l.head=new r.Buf16(l.hash_size),l.prev=new r.Buf16(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new r.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=s,l.method=a,x(t)}n=[new w(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(m(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,c(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(c(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(c(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(c(t,!1),t.strm.avail_out),1)})),new w(4,4,8,4,v),new w(4,5,16,8,v),new w(4,6,32,32,v),new w(4,4,16,16,b),new w(8,16,32,32,b),new w(8,16,128,128,b),new w(8,32,128,256,b),new w(32,128,258,1024,b),new w(32,258,258,4096,b)],e.deflateInit=function(t,e){return z(t,e,8,15,8,0)},e.deflateInit2=z,e.deflateReset=x,e.deflateResetKeep=y,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},e.deflate=function(t,e){var a,r,s,l;if(!t||!t.state||e>5||e<0)return t?u(t,-2):-2;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==e)return u(t,0===t.avail_out?-5:-2);if(r.strm=t,a=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,_(r,31),_(r,139),_(r,8),r.gzhead?(_(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),_(r,255&r.gzhead.time),_(r,r.gzhead.time>>8&255),_(r,r.gzhead.time>>16&255),_(r,r.gzhead.time>>24&255),_(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),_(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(_(r,255&r.gzhead.extra.length),_(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=o(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(_(r,0),_(r,0),_(r,0),_(r,0),_(r,0),_(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),_(r,3),r.status=113);else{var p=8+(r.w_bits-8<<4)<<8;p|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(p|=32),p+=31-p%31,r.status=113,g(r,p),0!==r.strstart&&(g(r,t.adler>>>16),g(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),f(t),s=r.pending,r.pending!==r.pending_buf_size));)_(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),f(t),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,_(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),f(t),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,_(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&f(t),r.pending+2<=r.pending_buf_size&&(_(r,255&t.adler),_(r,t.adler>>8&255),t.adler=0,r.status=113)):r.status=113),0!==r.pending){if(f(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&h(e)<=h(a)&&4!==e)return u(t,-5);if(666===r.status&&0!==t.avail_in)return u(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var v=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(m(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(c(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(c(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(c(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,s,o=t.window;;){if(t.lookahead<=258){if(m(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=o[r=t.strstart-1])===o[++r]&&n===o[++r]&&n===o[++r]){s=t.strstart+258;do{}while(n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&n===o[++r]&&r<s);t.match_length=258-(s-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=i._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(c(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(c(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(c(t,!1),0===t.strm.avail_out)?1:2}(r,e):n[r.level].func(r,e);if(3!==v&&4!==v||(r.status=666),1===v||3===v)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===v&&(1===e?i._tr_align(r):5!==e&&(i._tr_stored_block(r,0,0,!1),3===e&&(d(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),f(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(_(r,255&t.adler),_(r,t.adler>>8&255),_(r,t.adler>>16&255),_(r,t.adler>>24&255),_(r,255&t.total_in),_(r,t.total_in>>8&255),_(r,t.total_in>>16&255),_(r,t.total_in>>24&255)):(g(r,t.adler>>>16),g(r,65535&t.adler)),f(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?u(t,-2):(t.state=null,113===e?u(t,-3):0):-2},e.deflateSetDictionary=function(t,e){var a,n,i,o,l,u,h,f,c=e.length;if(!t||!t.state)return-2;if(2===(o=(a=t.state).wrap)||1===o&&42!==a.status||a.lookahead)return-2;for(1===o&&(t.adler=s(t.adler,e,c,0)),a.wrap=0,c>=a.w_size&&(0===o&&(d(a.head),a.strstart=0,a.block_start=0,a.insert=0),f=new r.Buf8(a.w_size),r.arraySet(f,e,c-a.w_size,a.w_size,0),e=f,c=a.w_size),l=t.avail_in,u=t.next_in,h=t.input,t.avail_in=c,t.next_in=0,t.input=e,m(a);a.lookahead>=3;){n=a.strstart,i=a.lookahead-2;do{a.ins_h=(a.ins_h<<a.hash_shift^a.window[n+3-1])&a.hash_mask,a.prev[n&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=n,n++}while(--i);a.strstart=n,a.lookahead=2,m(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,t.next_in=u,t.input=h,t.avail_in=l,a.wrap=o,0},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,a){"use strict";var n=a(0);function r(t){for(var e=t.length;--e>=0;)t[e]=0}var i=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);r(u);var h=new Array(60);r(h);var d=new Array(512);r(d);var f=new Array(256);r(f);var c=new Array(29);r(c);var _,g,p,m=new Array(30);function v(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?d[t]:d[256+(t>>>7)]}function k(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function y(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function x(t,e,a){y(t,a[2*e],a[2*e+1])}function z(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1}function S(t,e,a){var n,r,i=new Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var o=t[2*r+1];0!==o&&(t[2*r]=z(i[o]++,o))}}function B(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function D(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]}function O(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&D(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!D(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n}function M(t,e,a){var n,r,o,l,u=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],r=t.pending_buf[t.l_buf+u],u++,0===n?x(t,r,e):(x(t,(o=f[r])+256+1,e),0!==(l=i[o])&&y(t,r-=c[o],l),x(t,o=w(--n),a),0!==(l=s[o])&&y(t,n-=m[o],l))}while(u<t.last_lit);x(t,256,e)}function A(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=u=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[r]=0,t.opt_len--,o&&(t.static_len-=s[2*r+1]);for(e.max_code=u,a=t.heap_len>>1;a>=1;a--)O(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],O(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,O(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,o,l=e.dyn_tree,u=e.max_code,h=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,_=e.stat_desc.max_length,g=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>_&&(i=_,g++),l[2*n+1]=i,n>u||(t.bl_count[i]++,s=0,n>=c&&(s=f[n-c]),o=l[2*n],t.opt_len+=o*(i+s),d&&(t.static_len+=o*(h[2*n+1]+s)));if(0!==g){do{for(i=_-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[_]--,g-=2}while(g>0);for(i=_;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>u||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),S(i,u,t.bl_count)}function R(t,e,a){var n,r,i=-1,s=e[1],o=0,l=7,u=4;for(0===s&&(l=138,u=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++o<l&&r===s||(o<u?t.bl_tree[2*r]+=o:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,i=r,0===s?(l=138,u=3):r===s?(l=6,u=3):(l=7,u=4))}function T(t,e,a){var n,r,i=-1,s=e[1],o=0,l=7,u=4;for(0===s&&(l=138,u=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++o<l&&r===s)){if(o<u)do{x(t,r,t.bl_tree)}while(0!=--o);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),o--),x(t,16,t.bl_tree),y(t,o-3,2)):o<=10?(x(t,17,t.bl_tree),y(t,o-3,3)):(x(t,18,t.bl_tree),y(t,o-11,7));o=0,i=r,0===s?(l=138,u=3):r===s?(l=6,u=3):(l=7,u=4)}}r(m);var L=!1;function j(t,e,a,r){y(t,0+(r?1:0),3),function(t,e,a,r){E(t),r&&(k(t,a),k(t,~a)),n.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}(t,e,a,!0)}e._tr_init=function(t){L||(!function(){var t,e,a,n,r,l=new Array(16);for(a=0,n=0;n<28;n++)for(c[n]=a,t=0;t<1<<i[n];t++)f[a++]=n;for(f[a-1]=n,r=0,n=0;n<16;n++)for(m[n]=r,t=0;t<1<<s[n];t++)d[r++]=n;for(r>>=7;n<30;n++)for(m[n]=r<<7,t=0;t<1<<s[n]-7;t++)d[256+r++]=n;for(e=0;e<=15;e++)l[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,l[8]++;for(;t<=255;)u[2*t+1]=9,t++,l[9]++;for(;t<=279;)u[2*t+1]=7,t++,l[7]++;for(;t<=287;)u[2*t+1]=8,t++,l[8]++;for(S(u,287,l),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=z(t,5);_=new v(u,i,257,286,15),g=new v(h,s,0,30,15),p=new v(new Array(0),o,0,19,7)}(),L=!0),t.l_desc=new b(t.dyn_ltree,_),t.d_desc=new b(t.dyn_dtree,g),t.bl_desc=new b(t.bl_tree,p),t.bi_buf=0,t.bi_valid=0,B(t)},e._tr_stored_block=j,e._tr_flush_block=function(t,e,a,n){var r,i,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),A(t,t.l_desc),A(t,t.d_desc),s=function(t){var e;for(R(t,t.dyn_ltree,t.l_desc.max_code),R(t,t.dyn_dtree,t.d_desc.max_code),A(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(i=t.static_len+3+7>>>3)<=r&&(r=i)):r=i=a+5,a+4<=r&&-1!==e?j(t,e,a,n):4===t.strategy||i===r?(y(t,2+(n?1:0),3),M(t,u,h)):(y(t,4+(n?1:0),3),function(t,e,a,n){var r;for(y(t,e-257,5),y(t,a-1,5),y(t,n-4,4),r=0;r<n;r++)y(t,t.bl_tree[2*l[r]+1],3);T(t,t.dyn_ltree,e-1),T(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),M(t,t.dyn_ltree,t.dyn_dtree)),B(t),n&&E(t)},e._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(f[a]+256+1)]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){y(t,2,3),x(t,256,u),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,a){"use strict";var n=a(39),r=a(0),i=a(7),s=a(9),o=a(2),l=a(8),u=a(42),h=Object.prototype.toString;function d(t){if(!(this instanceof d))return new d(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var a=n.inflateInit2(this.strm,e.windowBits);if(a!==s.Z_OK)throw new Error(o[a]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=i.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=n.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(o[a])}function f(t,e){var a=new d(e);if(a.push(t,!0),a.err)throw a.msg||o[a.err];return a.result}d.prototype.push=function(t,e){var a,o,l,u,d,f=this.strm,c=this.options.chunkSize,_=this.options.dictionary,g=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=i.binstring2buf(t):"[object ArrayBuffer]"===h.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(c),f.next_out=0,f.avail_out=c),(a=n.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&_&&(a=n.inflateSetDictionary(this.strm,_)),a===s.Z_BUF_ERROR&&!0===g&&(a=s.Z_OK,g=!1),a!==s.Z_STREAM_END&&a!==s.Z_OK)return this.onEnd(a),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&a!==s.Z_STREAM_END&&(0!==f.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(f.output,f.next_out),u=f.next_out-l,d=i.buf2string(f.output,l),f.next_out=u,f.avail_out=c-u,u&&r.arraySet(f.output,f.output,l,u,0),this.onData(d)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((f.avail_in>0||0===f.avail_out)&&a!==s.Z_STREAM_END);return a===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(a=n.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=d,e.inflate=f,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},e.ungzip=f},function(t,e,a){"use strict";var n=a(0),r=a(5),i=a(6),s=a(40),o=a(41);function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function f(t,e){var a,n;return t&&t.state?(n=t.state,e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=a,n.wbits=e,d(t))):-2}function c(t,e){var a,n;return t?(n=new u,t.state=n,n.window=null,0!==(a=f(t,e))&&(t.state=null),a):-2}var _,g,p=!0;function m(t){if(p){var e;for(_=new n.Buf32(512),g=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(1,t.lens,0,288,_,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(2,t.lens,0,32,g,0,t.work,{bits:5}),p=!1}t.lencode=_,t.lenbits=9,t.distcode=g,t.distbits=5}function v(t,e,a,r){var i,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),r>=s.wsize?(n.arraySet(s.window,e,a-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((i=s.wsize-s.wnext)>r&&(i=r),n.arraySet(s.window,e,a-r,i,s.wnext),(r-=i)?(n.arraySet(s.window,e,a-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}e.inflateReset=d,e.inflateReset2=f,e.inflateResetKeep=h,e.inflateInit=function(t){return c(t,15)},e.inflateInit2=c,e.inflate=function(t,e){var a,u,h,d,f,c,_,g,p,b,w,k,y,x,z,S,B,E,D,O,M,A,R,T,L=0,j=new n.Buf8(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(a=t.state).mode&&(a.mode=13),f=t.next_out,h=t.output,_=t.avail_out,d=t.next_in,u=t.input,c=t.avail_in,g=a.hold,p=a.bits,b=c,w=_,A=0;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;p<16;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(2&a.wrap&&35615===g){a.check=0,j[0]=255&g,j[1]=g>>>8&255,a.check=i(a.check,j,2,0),g=0,p=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",a.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",a.mode=30;break}if(p-=4,M=8+(15&(g>>>=4)),0===a.wbits)a.wbits=M;else if(M>a.wbits){t.msg="invalid window size",a.mode=30;break}a.dmax=1<<M,t.adler=a.check=1,a.mode=512&g?10:12,g=0,p=0;break;case 2:for(;p<16;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(a.flags=g,8!=(255&a.flags)){t.msg="unknown compression method",a.mode=30;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=30;break}a.head&&(a.head.text=g>>8&1),512&a.flags&&(j[0]=255&g,j[1]=g>>>8&255,a.check=i(a.check,j,2,0)),g=0,p=0,a.mode=3;case 3:for(;p<32;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}a.head&&(a.head.time=g),512&a.flags&&(j[0]=255&g,j[1]=g>>>8&255,j[2]=g>>>16&255,j[3]=g>>>24&255,a.check=i(a.check,j,4,0)),g=0,p=0,a.mode=4;case 4:for(;p<16;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}a.head&&(a.head.xflags=255&g,a.head.os=g>>8),512&a.flags&&(j[0]=255&g,j[1]=g>>>8&255,a.check=i(a.check,j,2,0)),g=0,p=0,a.mode=5;case 5:if(1024&a.flags){for(;p<16;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}a.length=g,a.head&&(a.head.extra_len=g),512&a.flags&&(j[0]=255&g,j[1]=g>>>8&255,a.check=i(a.check,j,2,0)),g=0,p=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&((k=a.length)>c&&(k=c),k&&(a.head&&(M=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),n.arraySet(a.head.extra,u,d,k,M)),512&a.flags&&(a.check=i(a.check,u,k,d)),c-=k,d+=k,a.length-=k),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===c)break t;k=0;do{M=u[d+k++],a.head&&M&&a.length<65536&&(a.head.name+=String.fromCharCode(M))}while(M&&k<c);if(512&a.flags&&(a.check=i(a.check,u,k,d)),c-=k,d+=k,M)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=8;case 8:if(4096&a.flags){if(0===c)break t;k=0;do{M=u[d+k++],a.head&&M&&a.length<65536&&(a.head.comment+=String.fromCharCode(M))}while(M&&k<c);if(512&a.flags&&(a.check=i(a.check,u,k,d)),c-=k,d+=k,M)break t}else a.head&&(a.head.comment=null);a.mode=9;case 9:if(512&a.flags){for(;p<16;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(g!==(65535&a.check)){t.msg="header crc mismatch",a.mode=30;break}g=0,p=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=12;break;case 10:for(;p<32;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}t.adler=a.check=l(g),g=0,p=0,a.mode=11;case 11:if(0===a.havedict)return t.next_out=f,t.avail_out=_,t.next_in=d,t.avail_in=c,a.hold=g,a.bits=p,2;t.adler=a.check=1,a.mode=12;case 12:if(5===e||6===e)break t;case 13:if(a.last){g>>>=7&p,p-=7&p,a.mode=27;break}for(;p<3;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}switch(a.last=1&g,p-=1,3&(g>>>=1)){case 0:a.mode=14;break;case 1:if(m(a),a.mode=20,6===e){g>>>=2,p-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=30}g>>>=2,p-=2;break;case 14:for(g>>>=7&p,p-=7&p;p<32;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",a.mode=30;break}if(a.length=65535&g,g=0,p=0,a.mode=15,6===e)break t;case 15:a.mode=16;case 16:if(k=a.length){if(k>c&&(k=c),k>_&&(k=_),0===k)break t;n.arraySet(h,u,d,k,f),c-=k,d+=k,_-=k,f+=k,a.length-=k;break}a.mode=12;break;case 17:for(;p<14;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(a.nlen=257+(31&g),g>>>=5,p-=5,a.ndist=1+(31&g),g>>>=5,p-=5,a.ncode=4+(15&g),g>>>=4,p-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=30;break}a.have=0,a.mode=18;case 18:for(;a.have<a.ncode;){for(;p<3;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}a.lens[I[a.have++]]=7&g,g>>>=3,p-=3}for(;a.have<19;)a.lens[I[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,R={bits:a.lenbits},A=o(0,a.lens,0,19,a.lencode,0,a.work,R),a.lenbits=R.bits,A){t.msg="invalid code lengths set",a.mode=30;break}a.have=0,a.mode=19;case 19:for(;a.have<a.nlen+a.ndist;){for(;S=(L=a.lencode[g&(1<<a.lenbits)-1])>>>16&255,B=65535&L,!((z=L>>>24)<=p);){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(B<16)g>>>=z,p-=z,a.lens[a.have++]=B;else{if(16===B){for(T=z+2;p<T;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(g>>>=z,p-=z,0===a.have){t.msg="invalid bit length repeat",a.mode=30;break}M=a.lens[a.have-1],k=3+(3&g),g>>>=2,p-=2}else if(17===B){for(T=z+3;p<T;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}p-=z,M=0,k=3+(7&(g>>>=z)),g>>>=3,p-=3}else{for(T=z+7;p<T;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}p-=z,M=0,k=11+(127&(g>>>=z)),g>>>=7,p-=7}if(a.have+k>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=30;break}for(;k--;)a.lens[a.have++]=M}}if(30===a.mode)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=30;break}if(a.lenbits=9,R={bits:a.lenbits},A=o(1,a.lens,0,a.nlen,a.lencode,0,a.work,R),a.lenbits=R.bits,A){t.msg="invalid literal/lengths set",a.mode=30;break}if(a.distbits=6,a.distcode=a.distdyn,R={bits:a.distbits},A=o(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,R),a.distbits=R.bits,A){t.msg="invalid distances set",a.mode=30;break}if(a.mode=20,6===e)break t;case 20:a.mode=21;case 21:if(c>=6&&_>=258){t.next_out=f,t.avail_out=_,t.next_in=d,t.avail_in=c,a.hold=g,a.bits=p,s(t,w),f=t.next_out,h=t.output,_=t.avail_out,d=t.next_in,u=t.input,c=t.avail_in,g=a.hold,p=a.bits,12===a.mode&&(a.back=-1);break}for(a.back=0;S=(L=a.lencode[g&(1<<a.lenbits)-1])>>>16&255,B=65535&L,!((z=L>>>24)<=p);){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(S&&0==(240&S)){for(E=z,D=S,O=B;S=(L=a.lencode[O+((g&(1<<E+D)-1)>>E)])>>>16&255,B=65535&L,!(E+(z=L>>>24)<=p);){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}g>>>=E,p-=E,a.back+=E}if(g>>>=z,p-=z,a.back+=z,a.length=B,0===S){a.mode=26;break}if(32&S){a.back=-1,a.mode=12;break}if(64&S){t.msg="invalid literal/length code",a.mode=30;break}a.extra=15&S,a.mode=22;case 22:if(a.extra){for(T=a.extra;p<T;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}a.length+=g&(1<<a.extra)-1,g>>>=a.extra,p-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;S=(L=a.distcode[g&(1<<a.distbits)-1])>>>16&255,B=65535&L,!((z=L>>>24)<=p);){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(0==(240&S)){for(E=z,D=S,O=B;S=(L=a.distcode[O+((g&(1<<E+D)-1)>>E)])>>>16&255,B=65535&L,!(E+(z=L>>>24)<=p);){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}g>>>=E,p-=E,a.back+=E}if(g>>>=z,p-=z,a.back+=z,64&S){t.msg="invalid distance code",a.mode=30;break}a.offset=B,a.extra=15&S,a.mode=24;case 24:if(a.extra){for(T=a.extra;p<T;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}a.offset+=g&(1<<a.extra)-1,g>>>=a.extra,p-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=30;break}a.mode=25;case 25:if(0===_)break t;if(k=w-_,a.offset>k){if((k=a.offset-k)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=30;break}k>a.wnext?(k-=a.wnext,y=a.wsize-k):y=a.wnext-k,k>a.length&&(k=a.length),x=a.window}else x=h,y=f-a.offset,k=a.length;k>_&&(k=_),_-=k,a.length-=k;do{h[f++]=x[y++]}while(--k);0===a.length&&(a.mode=21);break;case 26:if(0===_)break t;h[f++]=a.length,_--,a.mode=21;break;case 27:if(a.wrap){for(;p<32;){if(0===c)break t;c--,g|=u[d++]<<p,p+=8}if(w-=_,t.total_out+=w,a.total+=w,w&&(t.adler=a.check=a.flags?i(a.check,h,w,f-w):r(a.check,h,w,f-w)),w=_,(a.flags?g:l(g))!==a.check){t.msg="incorrect data check",a.mode=30;break}g=0,p=0}a.mode=28;case 28:if(a.wrap&&a.flags){for(;p<32;){if(0===c)break t;c--,g+=u[d++]<<p,p+=8}if(g!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=30;break}g=0,p=0}a.mode=29;case 29:A=1;break t;case 30:A=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=f,t.avail_out=_,t.next_in=d,t.avail_in=c,a.hold=g,a.bits=p,(a.wsize||w!==t.avail_out&&a.mode<30&&(a.mode<27||4!==e))&&v(t,t.output,t.next_out,w-t.avail_out)?(a.mode=31,-4):(b-=t.avail_in,w-=t.avail_out,t.total_in+=b,t.total_out+=w,a.total+=w,a.wrap&&w&&(t.adler=a.check=a.flags?i(a.check,h,w,t.next_out-w):r(a.check,h,w,t.next_out-w)),t.data_type=a.bits+(a.last?64:0)+(12===a.mode?128:0)+(20===a.mode||15===a.mode?256:0),(0===b&&0===w||4===e)&&0===A&&(A=-5),A)},e.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var a;return t&&t.state?0==(2&(a=t.state).wrap)?-2:(a.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var a,n=e.length;return t&&t.state?0!==(a=t.state).wrap&&11!==a.mode?-2:11===a.mode&&r(1,e,n,0)!==a.check?-3:v(t,e,n,n)?(a.mode=31,-4):(a.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,a){"use strict";t.exports=function(t,e){var a,n,r,i,s,o,l,u,h,d,f,c,_,g,p,m,v,b,w,k,y,x,z,S,B;a=t.state,n=t.next_in,S=t.input,r=n+(t.avail_in-5),i=t.next_out,B=t.output,s=i-(e-t.avail_out),o=i+(t.avail_out-257),l=a.dmax,u=a.wsize,h=a.whave,d=a.wnext,f=a.window,c=a.hold,_=a.bits,g=a.lencode,p=a.distcode,m=(1<<a.lenbits)-1,v=(1<<a.distbits)-1;t:do{_<15&&(c+=S[n++]<<_,_+=8,c+=S[n++]<<_,_+=8),b=g[c&m];e:for(;;){if(c>>>=w=b>>>24,_-=w,0===(w=b>>>16&255))B[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=g[(65535&b)+(c&(1<<w)-1)];continue e}if(32&w){a.mode=12;break t}t.msg="invalid literal/length code",a.mode=30;break t}k=65535&b,(w&=15)&&(_<w&&(c+=S[n++]<<_,_+=8),k+=c&(1<<w)-1,c>>>=w,_-=w),_<15&&(c+=S[n++]<<_,_+=8,c+=S[n++]<<_,_+=8),b=p[c&v];a:for(;;){if(c>>>=w=b>>>24,_-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=p[(65535&b)+(c&(1<<w)-1)];continue a}t.msg="invalid distance code",a.mode=30;break t}if(y=65535&b,_<(w&=15)&&(c+=S[n++]<<_,(_+=8)<w&&(c+=S[n++]<<_,_+=8)),(y+=c&(1<<w)-1)>l){t.msg="invalid distance too far back",a.mode=30;break t}if(c>>>=w,_-=w,y>(w=i-s)){if((w=y-w)>h&&a.sane){t.msg="invalid distance too far back",a.mode=30;break t}if(x=0,z=f,0===d){if(x+=u-w,w<k){k-=w;do{B[i++]=f[x++]}while(--w);x=i-y,z=B}}else if(d<w){if(x+=u+d-w,(w-=d)<k){k-=w;do{B[i++]=f[x++]}while(--w);if(x=0,d<k){k-=w=d;do{B[i++]=f[x++]}while(--w);x=i-y,z=B}}}else if(x+=d-w,w<k){k-=w;do{B[i++]=f[x++]}while(--w);x=i-y,z=B}for(;k>2;)B[i++]=z[x++],B[i++]=z[x++],B[i++]=z[x++],k-=3;k&&(B[i++]=z[x++],k>1&&(B[i++]=z[x++]))}else{x=i-y;do{B[i++]=B[x++],B[i++]=B[x++],B[i++]=B[x++],k-=3}while(k>2);k&&(B[i++]=B[x++],k>1&&(B[i++]=B[x++]))}break}}break}}while(n<r&&i<o);n-=k=_>>3,c&=(1<<(_-=k<<3))-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=i<o?o-i+257:257-(i-o),a.hold=c,a.bits=_}},function(t,e,a){"use strict";var n=a(0),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],i=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,a,l,u,h,d,f){var c,_,g,p,m,v,b,w,k,y=f.bits,x=0,z=0,S=0,B=0,E=0,D=0,O=0,M=0,A=0,R=0,T=null,L=0,j=new n.Buf16(16),I=new n.Buf16(16),N=null,C=0;for(x=0;x<=15;x++)j[x]=0;for(z=0;z<l;z++)j[e[a+z]]++;for(E=y,B=15;B>=1&&0===j[B];B--);if(E>B&&(E=B),0===B)return u[h++]=20971520,u[h++]=20971520,f.bits=1,0;for(S=1;S<B&&0===j[S];S++);for(E<S&&(E=S),M=1,x=1;x<=15;x++)if(M<<=1,(M-=j[x])<0)return-1;if(M>0&&(0===t||1!==B))return-1;for(I[1]=0,x=1;x<15;x++)I[x+1]=I[x]+j[x];for(z=0;z<l;z++)0!==e[a+z]&&(d[I[e[a+z]]++]=z);if(0===t?(T=N=d,v=19):1===t?(T=r,L-=257,N=i,C-=257,v=256):(T=s,N=o,v=-1),R=0,z=0,x=S,m=h,D=E,O=0,g=-1,p=(A=1<<E)-1,1===t&&A>852||2===t&&A>592)return 1;for(;;){b=x-O,d[z]<v?(w=0,k=d[z]):d[z]>v?(w=N[C+d[z]],k=T[L+d[z]]):(w=96,k=0),c=1<<x-O,S=_=1<<D;do{u[m+(R>>O)+(_-=c)]=b<<24|w<<16|k|0}while(0!==_);for(c=1<<x-1;R&c;)c>>=1;if(0!==c?(R&=c-1,R+=c):R=0,z++,0==--j[x]){if(x===B)break;x=e[a+d[z]]}if(x>E&&(R&p)!==g){for(0===O&&(O=E),m+=S,M=1<<(D=x-O);D+O<B&&!((M-=j[D+O])<=0);)D++,M<<=1;if(A+=1<<D,1===t&&A>852||2===t&&A>592)return 1;u[g=R&p]=E<<24|D<<16|m-h|0}}return 0!==R&&(u[m+R]=x-O<<24|64<<16|0),f.bits=E,0}},function(t,e,a){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}();var r=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.timeID=null,this.func=null}return n(t,[{key:"repeat",value:function(t,e){var a=this;null===this.func&&(this.func=t),this.func===t&&(this.timeID=setTimeout((function(){t(),a.repeat(t,e)}),e))}},{key:"clear",value:function(){clearTimeout(this.timeID)}}]),t}();e.default=r,t.exports=e.default},function(t,e,a){t.exports=function(){return a(45)('!function(e){var t={};function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t,a){"use strict";var r,n=a(1),o=(r=n)&&r.__esModule?r:{default:r};var i=[],s=-1,u=0,d=function(e){for(var t=new o.default,a=s<0?u-1:s+1,r=null,n=s<0?0:s;n<=a;n++)if(i[n]&&e>=i[n].timeStart&&e<i[n].timeEnd){if(s=n,i[n].download){if(!i[n].frameList)break;if(i[n].currentFrame<0)for(var d=i[n].frameList,f=0,l=d.length-1;f<=l;){var c=Math.ceil(f+(l-f)*(1e3*e-d[f].dataPts)/(d[l].dataPts-d[f].dataPts));if(1e3*e>=d[c=Math.min(c,l)].dataPts){if(!(c<d.length-1)){r={svgData:d[c].dataSvgBase64};break}if(1e3*e<d[c+1].dataPts){r={svgData:d[c].dataSvgBase64};break}f=c+1}else{if(!(c>0)){r={svgData:d[c].dataSvgBase64};break}if(1e3*e>=d[c-1].dataPts){r={svgData:d[c].dataSvgBase64};break}l=c-1}}else for(var v=i[n].currentFrame;v<i[n].frameList.length-1;v++){var g=i[n].frameList[v],m=i[n].frameList[v+1];if(1e3*e>=g.dataPts&&1e3*e<m.dataPts){r={svgData:(1e3*e-g.dataPts<=m.dataPts-1e3*e?g:m).dataSvgBase64};break}}}else r={range:[i[n].dataStart,i[n].dataEnd],index:n};n+1<u&&!i[n+1].download&&(r={range:[i[n+1].dataStart,i[n+1].dataEnd],index:n+1});break}return t.resolve(r),t};onmessage=function(e){var t=this;if("searchFrame"===e.data.method){var a=e.data.args;d(a.currentTime||0).then((function(e){e&&(void 0!==e.svgData?t.postMessage({method:"searchResult",args:{svgData:e.svgData}}):e.range&&t.postMessage({method:"getData",args:{range:e.range,index:e.index}}))}))}else if("updateData"===e.data.method){var r=e.data.args;i=r.dataList,u=r.indexCount}else if("updateDataListItem"===e.data.method){var n=e.data.args;i[n.index][n.key]=n.value}else"onDanmuMaskSeeked"===e.data.method&&(s=-1,i&&i.forEach((function(e){e.currentFrame=-1})))}},function(e,t,a){"use strict";a.r(t);var r=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}();var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var t=void 0,a=void 0,r=new Promise((function(e,r){t=e,a=r}));return r.resolve=t,r.reject=a,r}return r(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();t.default=n}]);\n//# sourceMappingURL=acb745a4ca74246753f9.worker.js.map',"/acb745a4ca74246753f9.worker.js")}},function(t,e,a){"use strict";var n=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var a;try{(a=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),a=a.getBlob()}catch(e){a=new Blob([t])}return new Worker(n.createObjectURL(a))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}}},function(t){t.exports=JSON.parse('{"version":"0.3.6"}')}]);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ /*! Built @Thu, 14 Sep 2023 04:46:00 GMT */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["danmu.js"]=t():e["danmu.js"]=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},t.hasClass=i,t.addClass=r,t.removeClass=o,t.toggleClass=function(e,t){t.split(/\s+/g).forEach((function(t){i(e,t)?o(e,t):r(e,t)}))},t.findDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],n=void 0;try{n=e.querySelector(t)}catch(i){t.startsWith("#")&&(n=e.getElementById(t.slice(1)))}return n},t.deepCopy=function e(t,n){if("Object"===a(n)&&"Object"===a(t))return Object.keys(n).forEach((function(i){"Object"!==a(n[i])||n[i]instanceof Node?"Array"===a(n[i])?t[i]="Array"===a(t[i])?t[i].concat(n[i]):n[i]:t[i]=n[i]:t[i]?e(t[i],n[i]):t[i]=n[i]})),t},t.typeOf=a,t.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},t.attachEventListener=function(e,t,n,i){if(i)e.on(t,n),function(e,t,n,i){e.once(i,(function r(){e.off(t,n),e.off(i,r)}))}(e,t,n,i);else{e.on(t,(function i(r){n(r),e.off(t,i)}))}},t.styleUtil=function(e,t,n){var i=e.style;try{i[t]=n}catch(e){i.setProperty(t,n)}},t.styleCSSText=function(e,t){var n=e.style;try{n.cssText=t}catch(e){}},t.isNumber=function(e){return"number"==typeof e&&!Number.isNaN(e)},t.isFunction=function(e){return"function"==typeof e},t.throttle=function(e,t){var n=this,i=0;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(i),i=setTimeout((function(){return e.apply(n,o)}),t)}};t.hasOwnProperty=Object.prototype.hasOwnProperty;function i(e,t){return e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function r(e,t){e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):i(e,t)||(e.className+=" "+t)}function o(e,t){e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):i(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}))}function a(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(4),a=(i=o)&&i.__esModule?i:{default:i};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"setLogger",value:function(e){this.logger=e instanceof a.default?e:new a.default((e||"")+".js")}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var i=n(19)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r="undefined"!=typeof window&&window.location.href.indexOf("danmu-debug")>-1,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructorName=t||""}return i(e,[{key:"info",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r&&(t=console).log.apply(t,["[Danmu Log]["+this.constructorName+"]",e].concat(i))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(6),o=(i=r)&&i.__esModule?i:{default:i};n(34),t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DanmuJs=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=f(n(7)),o=n(26),a=f(n(1)),s=f(n(27)),l=f(n(32)),u=n(33),c=n(0);function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=t.DanmuJs=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.setLogger("danmu"),n.logger&&n.logger.info("danmu.js version: "+o.version);var i=n.config={overlap:!1,area:{start:0,end:1,lines:void 0},hooks:void 0,live:!1,comments:[],direction:"r2l",needResizeObserver:!1,dropStaleComments:!1,channelSize:void 0,maxCommentsLength:void 0,bulletOffset:void 0,interval:2e3,highScorePriority:!0,chaseEffect:!0};if((0,c.deepCopy)(i,e),(0,r.default)(n),n.globalHooks={},i.hooks&&n.hooks(i.hooks),n.hideArr=[],n.recycler=new l.default,n.freezeId=null,i.comments.forEach((function(e){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),n.container=i.container&&1===i.container.nodeType?i.container:null,!n.container)return n.emit("error","container id can't be empty"),!1,h(n,!1);if(i.containerStyle){var a=i.containerStyle;Object.keys(a).forEach((function(e){n.container.style[e]=a[e]}))}return(0,c.addClass)(n.container,"danmu"),n.live=i.live,n.player=i.player,n.direction=i.direction,n.bulletBtn=new s.default(n),n.main=n.bulletBtn.main,n.isReady=!0,n.emit("ready"),n.logger&&n.logger.info("ready"),n.addResizeObserver(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"hooks",value:function(e){(0,c.deepCopy)(this.globalHooks,e)}},{key:"addResizeObserver",value:function(){var e=this;this.config.needResizeObserver&&this.container&&(0,u.addObserver)(this.container,(function(){e.logger&&e.logger.info("needResizeObserver"),e.resize()}))}},{key:"start",value:function(){this.logger&&this.logger.info("start"),this.main&&this.main.start()}},{key:"pause",value:function(){this.logger&&this.logger.info("pause"),this.main&&this.main.pause()}},{key:"play",value:function(){this.logger&&this.logger.info("play"),this.main&&this.main.play()}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),this.main&&this.main.stop()}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.main&&this.main.clear()}},{key:"destroy",value:function(){for(var e in(0,u.unObserver)(this.container),this.logger&&this.logger.info("destroy"),this.stop(),this.bulletBtn&&this.bulletBtn.destroy(),this.recycler&&this.recycler.destroy(),this)delete this[e];this.emit("destroy")}},{key:"sendComment",value:function(e){var t=this.main,n=this.logger;n&&n.info("sendComment: "+(e.txt||"[DOM Element]")),t&&(e.duration||(e.duration=15e3),e&&e.id&&e.duration&&(e.el||e.elLazyInit||e.txt)&&(e.duration=e.duration?e.duration:5e3,e.style||(e.style={opacity:void 0,fontSize:void 0}),e.style&&(this.opacity&&this.opacity!==e.style.opacity&&(e.style.opacity=this.opacity),this.fontSize&&this.fontSize!==e.style.fontSize&&(e.style.fontSize=this.fontSize)),e.prior||e.realTime?(t.data.unshift(e),e.realTime&&(t.readData(),t.dataHandle())):t.data.push(e),t.sortData(),t.keepPoolWatermark()))}},{key:"setCommentID",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentID: oldID "+e+" newID "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.id=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.id=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentDuration",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentDuration: id "+e+" duration "+t),e&&t&&(t=t||5e3,this.main.data.some((function(n){return n.id===e&&(n.duration=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.duration=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger&&this.logger.info("setCommentLike: id "+e+" like "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.like=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.pauseMove(),n.setLikeDom(t.el,t.style),"paused"!==n.danmu.main.status&&n.startMove(),!0)})))}},{key:"restartComment",value:function(e){if(this.logger&&this.logger.info("restartComment: id "+e),e){var t=this.main;if(this._releaseCtrl(e),"closed"===t.status)return;t.queue.some((function(n){return n.id===e&&("paused"!==t.status?n.startMove(!0):n.status="paused",!0)}))}}},{key:"_releaseCtrl",value:function(e){this.freezeId&&e===this.freezeId&&(this.mouseControl=!1,this.freezeId=null)}},{key:"_freezeCtrl",value:function(e){this.mouseControl=!0,this.freezeId=e}},{key:"freezeComment",value:function(e){if(this.logger&&this.logger.info("freezeComment: id "+e),e){this._freezeCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.status="forcedPause",t.pauseMove(),t.el&&t.el.style&&(0,c.styleUtil)(t.el,"zIndex",10),!0)}))}}},{key:"removeComment",value:function(e){if(this.logger&&this.logger.info("removeComment: id "+e),e){var t=this.main;this._releaseCtrl(e),t.queue=t.queue.filter((function(t){return t.id!==e||(t.remove(),!1)})),t.data=t.data.filter((function(t){return t.id!==e}))}}},{key:"updateComments",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.logger&&this.logger.info("updateComments: "+e.length+", isClear "+t);var n=this.main;"boolean"==typeof t&&t&&(n.data=[]),n.data=n.data.concat(e),n.sortData(),n.keepPoolWatermark()}},{key:"setAllDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this,n=arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.logger&&this.logger.info("setAllDuration: mode "+e+" duration "+n+" force "+i),n&&(n=n||5e3,i&&(this.main.forceDuration=n),this.main.data.forEach((function(t){e===t.mode&&(t.duration=n)})),this.main.queue.forEach((function(i){e===i.mode&&(i.duration=n,i.pauseMove(),"paused"!==t.main.status&&i.startMove())})))}},{key:"setPlayRate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",n=arguments[1];this.logger&&this.logger.info("setPlayRate: "+n),(0,c.isNumber)(n)&&n>0&&(this.main.playRate=n,this.main.queue.forEach((function(n){t===n.mode&&(n.pauseMove(),"paused"!==e.main.status&&n.startMove())})))}},{key:"setOpacity",value:function(e){this.logger&&this.logger.info("setOpacity: opacity "+e),this.container&&(this.container.style.opacity=e)}},{key:"setFontSize",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{reflow:!0};this.logger&&this.logger.info("setFontSize: size "+e+" channelSize "+t),this.fontSize=e+"px",e&&(this.main.data.forEach((function(e){e.style&&(e.style.fontSize=n.fontSize)})),this.main.queue.forEach((function(e){e.options.style||(e.options.style={}),e.options.style.fontSize=n.fontSize,e.setFontSize(n.fontSize),t&&(e.top=e.channel_id[0]*t,e.topInit())}))),t&&(this.config.channelSize=t,i.reflow&&this.main.channel.resizeSync())}},{key:"setArea",value:function(e){this.logger&&this.logger.info("setArea: area "+e),this.config.area=e,!1!==e.reflow&&this.main.channel.resizeSync()}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("hide: mode "+e),this.hideArr.indexOf(e)<0&&this.hideArr.push(e);var t=this.main.queue.filter((function(t){return e===t.mode||"color"===e&&t.color}));t.forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("show: mode "+e);var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger&&this.logger.info("setDirection: direction "+e),this.direction=e,this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger&&this.logger.info("resize"),this.emit("channel_resize")}},{key:"status",get:function(){return this.main.status}},{key:"state",get:function(){var e=this.main;return{status:e.status,comments:e.data,bullets:e.queue,displayArea:e.channel.getRealOccupyArea()}}},{key:"containerPos",get:function(){return this.main.channel.containerPos}}]),t}(a.default);t.default=d},function(e,t,n){"use strict";var i,r,o,a,s,l,u,c=n(8),f=n(25),h=Function.prototype.apply,d=Function.prototype.call,p=Object.create,g=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n,r;return f(t),r=this,i.call(this,e,n=function(){o.call(r,e,n),h.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:i=function(e,t){var n;return f(t),m.call(this,"__ee__")?n=this.__ee__:(n=y.value=p(null),g(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:r,off:o=function(e,t){var n,i,r,o;if(f(t),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(i=n[e]))for(o=0;r=i[o];++o)r!==t&&r.__eeOnceListener__!==t||(2===i.length?n[e]=i[o?0:1]:i.splice(o,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,i,r,o;if(m.call(this,"__ee__")&&(r=this.__ee__[e]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(r=r.slice(),t=0;i=r[t];++t)h.call(i,this,o)}else switch(arguments.length){case 1:d.call(r,this);break;case 2:d.call(r,this,arguments[1]);break;case 3:d.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];h.call(r,this,o)}}},l={on:c(i),once:c(r),off:c(o),emit:c(a)},u=v({},l),e.exports=t=function(e){return null==e?p(u):v(Object(e),l)},t.methods=s},function(e,t,n){"use strict";var i=n(3),r=n(9),o=n(13),a=n(21),s=n(22);(e.exports=function(e,t){var n,r,l,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],i(e)?(n=s.call(e,"c"),r=s.call(e,"e"),l=s.call(e,"w")):(n=l=!0,r=!1),c={value:t,configurable:n,enumerable:r,writable:l},u?o(a(u),c):c}).gs=function(e,t,n){var l,u,c,f;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],i(t)?r(t)?i(n)?r(n)||(c=n,n=void 0):n=void 0:(c=t,t=n=void 0):t=void 0,i(e)?(l=s.call(e,"c"),u=s.call(e,"e")):(l=!0,u=!1),f={get:t,set:n,configurable:l,enumerable:u},c?o(a(c),f):f}},function(e,t,n){"use strict";var i=n(10),r=/^\s*class[\s{/}]/,o=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!r.test(o.call(e))}},function(e,t,n){"use strict";var i=n(11);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},function(e,t,n){"use strict";var i=n(12);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(3),r={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(r,typeof e)}},function(e,t,n){"use strict";e.exports=n(14)()?Object.assign:n(15)},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var i=n(16),r=n(20),o=Math.max;e.exports=function(e,t){var n,a,s,l=o(arguments.length,2);for(e=Object(r(e)),s=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},a=1;a<l;++a)i(t=arguments[a]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(17)()?Object.keys:n(18)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(2),r=Object.keys;e.exports=function(e){return r(i(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(2);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(2),r=Array.prototype.forEach,o=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return r.call(arguments,(function(e){i(e)&&a(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(23)()?String.prototype.contains:n(24)},function(e,t,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(!0===i.contains("dwa")&&!1===i.contains("foo"))}},function(e,t,n){"use strict";var i=String.prototype.indexOf;e.exports=function(e){return i.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e){e.exports=JSON.parse('{"version":"1.1.13"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(1)),o=s(n(28)),a=n(0);function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.setLogger("control"),n.danmu=e,n.main=new o.default(e),e.config.defaultOff||n.main.start(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"createSwitch",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.logger&&this.logger.info("createSwitch"),this.switchBtn=(0,a.createDom)("dk-switch",'<span class="txt">弹</span>',{},"danmu-switch "+(e?"danmu-switch-active":"")),this.switchBtn}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.main.destroy(),this)a.hasOwnProperty.call(this,e)&&delete this[e]}}]),t}(r.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n(1)),o=l(n(29)),a=l(n(30)),s=n(0);function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.setLogger("main"),n.danmu=e,n.container=e.container,n.channel=new a.default(e),n.data=[].concat(e.config.comments),n.playedData=[],n.queue=[],n.timer=null,n.playRate=1,n.retryStatus="normal",n.interval=e.config.interval,n._status="idle",n._events=[],n._bindEvents(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this._unbindEvents(),this._cancelTick(),this.channel&&this.channel.destroy(),this.data=[],this)delete this[e]}},{key:"_bindEvents",value:function(){var e=this,t=this.danmu,n=this.container;this._unbindEvents();this._events.push([t,"bullet_remove",function(t){var n=t.bullet,i=e.data,r=e.queue;r.some((function(e,t){return e.id===n.id&&(r.splice(t,1),!0)})),i.some((function(e){return e.id===n.id&&(e.attached_=!1,!0)}))}]);if(this._events.push([n,"transitionend",function(t){var n=e._getBulletByEvt(t);n&&(n.status="end",n.remove(!1))}]),t.config.mouseControl||t.config.mouseEnterControl){this._events.push([n,"mouseover",function(t){var n,i=e.danmu;!i||i.mouseControl&&i.config.mouseControlPause||(n=e._getBulletByEvt(t))&&"waiting"!==n.status&&"end"!==n.status&&i.emit("bullet_hover",{bullet:n,event:t})}])}this._events.forEach((function(e){e[0].addEventListener?e[0].addEventListener(e[1],e[2],!1):e[0].on&&e[0].on(e[1],e[2])}))}},{key:"_unbindEvents",value:function(){this._events.length&&(this._events.forEach((function(e){e[0].removeEventListener?e[0].removeEventListener(e[1],e[2],!1):e[0].off&&e[0].off(e[1],e[2])})),this._events=[])}},{key:"_cancelTick",value:function(){this.handleTimer&&(clearTimeout(this.handleTimer),this.handleTimer=null)}},{key:"_startTick",value:function(){var e=this;e.retryStatus="normal",e._cancelTick(),e.sortData(),function t(){"closed"!==e._status||"stop"!==e.retryStatus?("playing"===e._status&&(e.readData(),e.dataHandle()),"stop"===e.retryStatus&&"paused"!==e._status||(e.handleTimer=setTimeout(t,250))):e._cancelTick()}()}},{key:"start",value:function(){this.logger&&this.logger.info("start");"playing"!==this._status&&(this._status="playing",this.queue=[],this.container.innerHTML="",this.channel.reset(),this._startTick())}},{key:"stop",value:function(){this.logger&&this.logger.info("stop");"closed"!==this._status&&(this._status="closed",this.retryStatus="stop",this.queue=[],this.container&&(this.container.innerHTML=""),this.channel&&this.channel.reset(),this._cancelTick())}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.channel&&this.channel.reset(),this.data=[],this.queue=[],this.container&&(this.container.innerHTML="")}},{key:"play",value:function(){var e=this;if("closed"!==this._status){this.logger&&this.logger.info("play"),this._status="playing";var t=this.channel.channels;t&&t.length>0&&["scroll","top","bottom"].forEach((function(n){e.queue.forEach((function(e){e.startMove(),e.resized=!0}));for(var i=0;i<t.length;i++)t[i].queue[n].forEach((function(e){e.resized=!1}))})),this._startTick()}else this.logger&&this.logger.info("play ignored")}},{key:"pause",value:function(){if("closed"!==this._status){this.logger&&this.logger.info("pause"),this._status="paused",this._cancelTick();var e=this.channel.channels;e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove()}))}else this.logger&&this.logger.info("pause ignored")}},{key:"dataHandle",value:function(){"paused"!==this._status&&"closed"!==this._status&&this.queue.length&&this.queue.forEach((function(e){"waiting"===e.status&&e.startMove()}))}},{key:"readData",value:function(){var e=this.danmu,t=this.interval,n=this.channel,i=e.player,r=void 0,a=void 0;if(e.isReady&&e.main){if(i){var l=i.currentTime?Math.floor(1e3*i.currentTime):0;a=this.data.filter((function(n){return!n.start&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&(n.start=l),!n.attached_&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&n.start-t<=l&&l<=n.start+t})),e.config.highScorePriority&&a.sort((function(e,t){return t.prior&&!e.prior||(t.score||-1)-(e.score||-1)})),e.live&&(this.data=[])}else 0===(a=this.data.splice(0,1)).length&&(a=this.playedData.splice(0,1));if(a.length>0&&n.checkAvailableTrack(a[0].mode)){n.updatePos();var u=0;e:for(var c,f=0;f<a.length;f++)if(c=a[f],this.forceDuration&&this.forceDuration!==c.duration&&(c.duration=this.forceDuration),(r=new o.default(e,c)).bulletCreateFail){if(0===u)break e;u--}else if(r.attach(),c.attached_=!0,n.addBullet(r).result)this.queue.push(r),r.topInit(),u=0;else{for(var h in r.detach(),r)s.hasOwnProperty.call(r,h)&&delete r[h];if(r=null,c.attached_=!1,c.noDiscard&&(c.prior?this.data.unshift(c):this.data.push(c)),0===u)break e;u--}}}}},{key:"sortData",value:function(){this.data.sort((function(e,t){return(e.start||-1)-(t.start||-1)}))}},{key:"keepPoolWatermark",value:function(){var e=this.danmu,t=e.config,n=e.player,i=this.data,r=[],o=0;if("number"==typeof t.maxCommentsLength&&i.length>t.maxCommentsLength){o=i.length-t.maxCommentsLength;for(var a,s=0;s<o;s++)(a=i[s]).prior&&!a.attached_&&r.push(i[s])}else if(t.dropStaleComments&&n&&n.currentTime){var l=Math.floor(1e3*n.currentTime)-t.interval;if(l>0)for(var u,c=0;c<i.length;c++)if((u=i[c]).prior&&!u.attached_&&r.push(i[c]),u.start>l){o=c;break}}o>0&&(i.splice(0,o),this.data=r.concat(i))}},{key:"_getBulletByEvt",value:function(e){for(var t,n=e.target||e.srcElement,i=this.queue,r=void 0,o=0;o<i.length;o++)if((t=i[o])&&t.el&&(t.el===n||t.el.contains(n))){r=t;break}return r}},{key:"status",get:function(){return this._status}}]),t}(r.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bullet=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(1)),o=s(n(4)),a=n(0);function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var c=new o.default("bullet"),f=t.Bullet=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l(this,t);var i=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=e.container,o=e.recycler,a=e.config;return i.setLogger(c),i.danmu=e,i.options=n,i.duration=n.duration,i.id=n.id,i.container=r,i.mode="top"===n.mode||"bottom"===n.mode?n.mode:"scroll",i.start=n.start,i.prior=n.prior,i.realTime=n.realTime,i.color=n.color,i.bookChannelId=n.bookChannelId,i.reuseDOM=!0,i.noCopyEl=!(!a.disableCopyDOM&&!n.disableCopyDOM),i.recycler=o,i._fullySlideInScreenDuration=void 0,i._lastMoveTime=void 0,i.status="waiting",n.elLazyInit||(i.bulletCreateFail=!i._makeEl()),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"_makeEl",value:function(){var e=this.danmu,t=this.options,n=e.config,i=e.globalHooks,r=void 0,o="",s=t.style||{};if(s.perspective="500em",t.el||t.elLazyInit){if(this.noCopyEl&&(this.reuseDOM=!1),t.elLazyInit){if((0,a.isFunction)(i.bulletCreateEl))try{var l=i.bulletCreateEl(t);r=l instanceof HTMLElement?l:l.el}catch(e){}}else if(1===t.el.nodeType&&!t.el.parentNode)if(this.reuseDOM){var u=(0,a.copyDom)(t.el);t.eventListeners&&t.eventListeners.length>0&&t.eventListeners.forEach((function(e){u.addEventListener(e.event,e.listener,e.useCapture||!1)})),(r=this.recycler.use()).childNodes.length>0&&(r.innerHTML=""),r.textContent&&(r.textContent=""),r.appendChild(u)}else r=t.el}else"string"==typeof t.txt&&((r=this.recycler.use()).textContent=t.txt);if(!r||!e.main)return!1;var c=void 0;if((0,a.isNumber)(n.bulletOffset)&&n.bulletOffset>=0)c=n.bulletOffset;else{var f=e.containerPos;c=f.width/10>100?100:f.width/10}var h=t.realTime?0:Math.floor(Math.random()*c),d=this.updateOffset(h,!0);return s.left=d,Object.keys(s).forEach((function(e){var t=e.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));o+=t+":"+s[e]+";"})),(0,a.styleCSSText)(r,o),this.el=r,t.like&&t.like.el&&this.setLikeDom(t.like.el,t.like.style),!0}},{key:"updateOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.random=e;var n=this.danmu.containerPos.width+e+"px";return t||(0,a.styleUtil)(this.el,"left",this.danmu.containerPos.width+e+"px"),n}},{key:"attach",value:function(){if(this.options.elLazyInit&&!this.el&&this._makeEl(),this.danmu&&this.danmu.main){var e=this.danmu,t=this.options,n=this.el,i=e.globalHooks;i.bulletAttaching&&i.bulletAttaching(t),this.container.contains(n)||this.container.appendChild(n),this.elPos=n.getBoundingClientRect(),"b2t"===this.direction?(this.width=this.elPos.height,this.height=this.elPos.width):(this.width=this.elPos.width,this.height=this.elPos.height),this.moveV&&(this.duration=(this.danmu.containerPos.width+this.random+this.width)/this.moveV*1e3),i.bulletAttached&&i.bulletAttached(t,n)}}},{key:"detach",value:function(){var e=this.el,t=this.danmu,n=this.options,i=t.globalHooks;e&&(i.bulletDetaching&&i.bulletDetaching(n),this.reuseDOM?this.recycler.unused(e):e.parentNode&&e.parentNode.removeChild(e),i.bulletDetached&&i.bulletDetached(n,e),this.el=null),this.elPos=void 0}},{key:"topInit",value:function(){this.logger&&this.logger.info("topInit #"+(this.options.txt||"[DOM Element]")+"#"),"b2t"===this.direction?((0,a.styleUtil)(this.el,"transformOrigin","left top"),(0,a.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY("+this.danmu.containerPos.height+"px) translateZ(0px) rotate(90deg)"),(0,a.styleUtil)(this.el,"transition","transform 0s linear 0s")):(0,a.styleUtil)(this.el,"top",this.top+"px")}},{key:"pauseMove",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if("paused"!==t.status&&("forcedPause"!==t.status&&(this.status="paused"),t._moveV=void 0,this.el))if("scroll"===this.mode){var n=t.danmu.containerPos;if(e){var i=((new Date).getTime()-t._lastMoveTime)/1e3,r=i*this.moveV,o=0;o=t.moveMoreS-r>=0?"b2t"===this.direction?(t.moveMoreS-r)/t.moveContainerHeight*n.height:(t.moveMoreS-r)/t.moveContainerWidth*n.width:t.moveMoreS-r,"b2t"===this.direction?(0,a.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY("+o+"px) translateZ(0px) rotate(90deg)"):(0,a.styleUtil)(this.el,"left",o+"px")}else"b2t"===this.direction?(0,a.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY("+(this.el.getBoundingClientRect().top-n.top)+"px) translateZ(0px) rotate(90deg)"):(0,a.styleUtil)(this.el,"left",this.el.getBoundingClientRect().left-n.left+"px");"b2t"===this.direction||(0,a.styleUtil)(this.el,"transform","translateX(0px) translateY(0px) translateZ(0px)"),(0,a.styleUtil)(this.el,"transition","transform 0s linear 0s")}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e){if(this.hasMove||(this.danmu.emit("bullet_start",this),this.hasMove=!0),("forcedPause"!==this.status||e)&&this.el&&"start"!==this.status)if(this.status="start","scroll"===this.mode){var t=this.danmu.containerPos;if(!this.el)return;var n=this.el.getBoundingClientRect(),i=void 0;if("b2t"===this.direction){i=n.bottom-t.bottom;var r=(n.bottom-t.top)/this.moveV;(0,a.styleUtil)(this.el,"transition","transform "+r+"s linear 0s"),(0,a.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY(-"+this.height+"px) translateZ(0px) rotate(90deg)"),this._lastMoveTime=(new Date).getTime(),this.moveMoreS=n.top-t.top,this.moveContainerHeight=t.height}else{i=n.right-t.right;var o=n.right-t.left,s=o/this.moveV;n.right>t.left?((0,a.styleUtil)(this.el,"transition","transform "+s+"s linear 0s"),(0,a.styleUtil)(this.el,"transform","translateX(-"+o+"px) translateY(0px) translateZ(0px)"),this._lastMoveTime=(new Date).getTime(),this.moveMoreS=n.left-t.left,this.moveContainerWidth=t.width):(this.status="end",this.remove())}this._fullySlideInScreenDuration=i/this.moveV}else{var l=(new Date).getTime(),u=(this.startTime&&l-this.startTime>this.duration?l-this.startTime:this.duration)/1e3;(0,a.styleUtil)(this.el,"left","50%"),(0,a.styleUtil)(this.el,"margin","0 0 0 -"+this.width/2+"px"),(0,a.styleUtil)(this.el,"visibility","hidden"),(0,a.styleUtil)(this.el,"transition","visibility "+u+"s 0s"),this.pastDuration||(this.pastDuration=1),this.startTime=l}}},{key:"remove",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.logger&&this.logger.info("remove #"+(this.options.txt||"[DOM Element]")+"#");var t=this;e&&t.pauseMove(),t.el&&t.el.parentNode&&(t.detach(),this.options.el&&1===this.options.el.nodeType&&this.noCopyEl&&(0,a.styleUtil)(this.options.el,"transform","none"),t.danmu.emit("bullet_remove",{bullet:t}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e){Object.keys(t).forEach((function(n){e.style[n]=t[n]}));if(e.className="danmu-like",this.el){var n=this.el.querySelector(".danmu-like");n&&this.el.removeChild(n),this.el.innerHTML=""+this.el.innerHTML+e.outerHTML}}return e}},{key:"moveV",get:function(){var e=this.danmu,t=this.options,n=this._moveV;if(!n){if(t.moveV)n=t.moveV;else if(this.elPos){var i=e.containerPos;n=("b2t"===this.direction?i.height+(e.config.chaseEffect?this.height:0):i.width+(e.config.chaseEffect?this.width:0))/this.duration*1e3}n&&(n*=e.main.playRate,this._moveV=n)}return n}},{key:"direction",get:function(){return this.danmu.direction}},{key:"fullySlideIntoScreen",get:function(){var e=!0;"scroll"===this.mode&&this._lastMoveTime&&this._fullySlideInScreenDuration>0&&(e=((new Date).getTime()-this._lastMoveTime)/1e3>=this._fullySlideInScreenDuration);return e}}]),t}(r.default);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0),l=n(31);var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;return i.setLogger("channel"),i.danmu=e,i.width=0,i.height=0,i.reset(!0),i.channels=[],i.updatePos(),(0,s.attachEventListener)(n.danmu,"bullet_remove",(function(e){i.removeBullet(e.bullet)}),"destroy"),(0,s.attachEventListener)(n.danmu,"channel_resize",(function(){i.resize()}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"checkAvailableTrack",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this.channels,n=!1;if("scroll"===e)for(var i,r=0;r<t.length;r++)if(n=!0,(i=t[r]).operating[e])n=!1;else{var o=i.queue[e][0];if(!o||o.fullySlideIntoScreen){if(n)break}else n=!1}else n=!0;return n}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.channels.splice(0,this.channels.length),this._cancelResizeTimer(),this)s.hasOwnProperty.call(this,e)&&delete this[e]}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("reset");var t=this,n=t.danmu,i=n.container,r=n.bulletBtn;function o(){if(t.danmu&&t.danmu.container){var e=t.danmu.container.getBoundingClientRect();t.width=e.width,t.height=e.height,t.resetId&&(cancelAnimationFrame(t.resetId),t.resetId=null);var n=t._initChannels(),i=n.channelSize,r=n.channelCount,o=n.channels;t.channelCount=r,t.channels=o,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}}t.container=i,r&&r.main&&r.main.queue.forEach((function(e){e.remove()})),t.channels&&t.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var n=0;n<t.channels.length;n++)t.channels[n].queue[e].forEach((function(e){e.remove()}))})),r&&r.main&&r.main.data&&r.main.data.forEach((function(e){e.attached_=!1})),e?this.resetId=requestAnimationFrame(o):o()}},{key:"getRealOccupyArea",value:function(){return{width:this.width,height:this.height}}},{key:"updatePos",value:function(){var e=this.container.getBoundingClientRect();this.containerPos=e,this.containerWidth=e.width,this.containerHeight=e.height,this.containerTop=e.top,this.containerBottom=e.bottom,this.containerLeft=e.left,this.containerRight=e.right}},{key:"addBullet",value:function(e){var t=this,n=this.danmu,i=this.channels,r=void 0,o=void 0,a=void 0;if("b2t"===t.direction?(o=this.channelWidth,a=Math.ceil(e.width/o)):(r=this.channelHeight,a=Math.ceil(e.height/r)),a>i.length)return{result:!1,message:"exceed channels.length, occupy="+a+",channelsSize="+i.length};for(var s=!0,l=void 0,u=-1,c=0,f=i.length;c<f;c++)if(i[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exited, channelOrder="+c+",danmu_id="+e.id};if("scroll"===e.mode)for(var h=0,d=i.length-a;h<=d;h+=a){s=!0;for(var p=h;p<h+a;p++){if((l=i[p]).operating.scroll||l.bookId.scroll&&l.bookId.scroll!==e.id){s=!1;break}l.operating.scroll=!0;var g=l.queue.scroll[0];if(g){var v=g.el.getBoundingClientRect();if("b2t"===t.direction){if(v.bottom>=t.containerPos.bottom){s=!1,l.operating.scroll=!1;break}}else if(v.right>=t.containerPos.right){s=!1,l.operating.scroll=!1;break}var m=void 0,y=g.moveV,b=void 0,_=e.moveV,k=void 0;if("b2t"===t.direction?(b=(m=v.bottom-t.containerTop)/y,k=t.containerHeight+e.random-m):(b=(m=v.right-t.containerLeft)/y,k=t.containerWidth+e.random-m),_>y){var w=k/(_-y);if(n.config.bOffset||(n.config.bOffset=0),b+n.config.bOffset>=w){var O=b*_-t.containerPos.width;O>0&&e.updateOffset(O+(1+Math.ceil(5*Math.random())))}}}l.operating.scroll=!1}if(s){u=h;break}}else if("top"===e.mode)for(var x=0,E=i.length-a;x<=E;x++){s=!0;for(var C=x;C<x+a;C++){if(C>Math.floor(i.length/2)){s=!1;break}if((l=i[C]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=x;break}}else if("bottom"===e.mode)for(var M=i.length-a;M>=0;M--){s=!0;for(var j=M;j<M+a;j++){if(j<=Math.floor(i.length/2)){s=!1;break}if((l=i[j]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=M;break}}if(-1!==u){for(var T=u,S=u+a;T<S;T++)(l=i[T]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&(delete l.bookId[e.mode],t.logger&&t.logger.info(T+"号轨道恢复正常使用")),l.operating[e.mode]=!1;if(e.prior)if(t.logger&&t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,n.player)n.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}));return e.channel_id=[u,a],e.el.setAttribute("data-line-index",u+1),"b2t"===t.direction?(e.top=u*o,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerWidth*t.danmu.config.area.start)):(e.top=u*r,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start)),{result:e,message:"success"}}if(e.options.realTime){var L=0,z=-1,P=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,n){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=L&&(L=e.start,z=n,P=e)})),P){P.remove(),t.removeBullet(P),t.danmu.bulletBtn.main.queue.splice(z,1),e.channel_id=P.channel_id;for(var D=P.channel_id[0],I=P.channel_id[0]+P.channel_id[1];D<I;D++)(l=i[D]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&delete l.bookId[e.mode],l.operating[e.mode]=!1;return e.top=P.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId||t.danmu.live){if(n.player)n.bulletBtn.main.data.some((function(n){return n.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),n.start+=2e3,!0)}))}else{u=-1;for(var A=0,R=i.length-a;A<=R;A++){s=!0;for(var q=A;q<A+a;q++)if(i[q].bookId[e.mode]){s=!1;break}if(s){u=A;break}}if(-1!==u){for(var B=u;B<u+a;B++)i[B].bookId[e.mode]=e.id,t.logger&&t.logger.info(B+"号轨道被"+e.id+"号优先弹幕预定");if(n.player)n.bulletBtn.main.data.some((function(n){return n.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),n.start+=2e3,n.bookChannelId=[u,a],t.logger&&t.logger.info(e.id+"号优先弹幕预定了"+u+"~"+(u+a-1)+"号轨道"),!0)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger&&this.logger.info("removeBullet "+(e.options.txt||"[DOM Element]"));for(var t=this.channels,n=e.channel_id,i=void 0,r=n[0],o=n[0]+n[1];r<o;r++)if(i=t[r]){i.operating[e.mode]=!0;var a=-1;i.queue[e.mode].some((function(t,n){return t.id===e.id&&(a=n,!0)})),a>-1&&i.queue[e.mode].splice(a,1),i.operating[e.mode]=!1}e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resizeSync",value:function(){this.resize(!0)}},{key:"_initChannels",value:function(){if(this.danmu&&this.danmu.config){var e=this.danmu.config,t=e.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12),n=void 0;if(e.area){var i=e.area,r=i.lines,o=i.start,a=i.end;if((0,l.validAreaLineRule)(r))n=r,"b2t"===this.direction?this.width=n*t:this.height=n*t;else if(o>=0&&a>=o){var u=a-o;"b2t"===this.direction?this.width=Math.floor(this.width*u):this.height=Math.floor(this.height*u)}}(0,s.isNumber)(n)||(n="b2t"===this.direction?Math.floor(this.width/t):Math.floor(this.height/t));for(var c=[],f=0;f<n;f++)c[f]={id:f,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};return{channelSize:t,channelCount:n,channels:c}}}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("resize");var t=this;function n(e,t){e[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}}}function i(e,i){function r(n){["scroll","top"].forEach((function(i){t.channels[n].queue[i].forEach((function(t){t.el&&e[n].queue[i].push(t)}))}))}function o(n){t.channels[n].queue.bottom.forEach((function(r){if(r.el&&(e[n+e.length-t.channels.length].queue.bottom.push(r),r.channel_id[0]+r.channel_id[1]-1===n)){var o=[].concat(r.channel_id);r.channel_id=[o[0]-t.channels.length+e.length,o[1]],r.top=r.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(r.top+=t.containerHeight*t.danmu.config.area.start),r.topInit()}}))}for(var a=0;a<t.channels.length;a++)n(e,a),r(a),o(a);for(var s=function(t){["scroll","top","bottom"].forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))},l=0;l<e.length;l++)s(l);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function r(e,i){for(var r=["scroll","top","bottom"],o=function(o){n(e,o),r.forEach((function(n){if("top"===n&&o>Math.floor(e.length/2));else if("bottom"===n&&o<=Math.floor(e.length/2));else{var r="bottom"===n?o-e.length+t.channels.length:o;t.channels[r].queue[n].forEach((function(a,s){if(a.el){if(e[o].queue[n].push(a),"bottom"===n&&a.channel_id[0]+a.channel_id[1]-1===r){var l=[].concat(a.channel_id);a.channel_id=[l[0]-t.channels.length+e.length,l[1]],a.top=a.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(a.top+=t.containerHeight*t.danmu.config.area.start),a.topInit()}t.channels[r].queue[n].splice(s,1)}}))}}))},a=0;a<e.length;a++)o(a);var s=function(t){r.forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))};for(a=0;a<e.length;a++)s(a);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function o(){var e=t.danmu,n=e.container,o=e.bulletBtn;t.container=n,t.updatePos(),t._cancelResizeTimer(),o.main.data&&o.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,t.logger&&t.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),t.logger&&t.logger.info("resize导致所有轨道恢复正常使用"),t.width=t.containerWidth,t.height=t.containerHeight;var a=t._initChannels(),s=a.channelSize,l=a.channels;t.channels&&(t.channels.length<=l.length?i(l,s):r(l,s)),t.resizing=!1}t.resizing||(t.resizing=!0,e?o():(this._cancelResizeTimer(),this.resizeId=requestAnimationFrame(o)))}},{key:"_cancelResizeTimer",value:function(){this.resizeId&&(cancelAnimationFrame(this.resizeId),this.resizeId=null)}},{key:"direction",get:function(){return this.danmu.direction}}]),t}(a.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validAreaLineRule=function(e){return"number"==typeof e&&e>=0&&Number.isInteger(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t={initDOM:function(){return document.createElement("div")},initSize:10},this.init(t)}return i(e,[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unused",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.style.opacity=0,this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.clearElementStyle(this.idleList[e]);for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.clearElementStyle(this.usingList[t]);for(var n in this)r.hasOwnProperty.call(this,n)&&delete this[n]}},{key:"clearElementStyle",value:function(e){var t="undefined"!=typeof window?window.navigator.userAgent:null;t&&(t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1?(0,r.styleUtil)(e,"transform","none"):e.setAttribute("style",""))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.destroyObserver=t.unObserver=t.addObserver=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=new(function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__handlers=[],window.ResizeObserver)try{this.observer=new window.ResizeObserver((0,r.throttle)((function(e){t.__trigger(e)}),100))}catch(e){}}return i(e,[{key:"addObserver",value:function(e,t){if(this.observer&&e){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&e===n[r].target&&(i=r);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){if(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){t[n].handler&&t[n].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}]),e}());t.addObserver=function(e,t){o.addObserver(e,t)},t.unObserver=function(e,t){o.unObserver(e,t)},t.destroyObserver=function(e,t){o.destroyObserver(e,t)}},function(e,t,n){var i=n(35);"string"==typeof i&&(i=[[e.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(37)(i,r);i.locals&&(e.exports=i.locals)},function(e,t,n){(e.exports=n(36)(!1)).push([e.i,".danmu{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#fff;-webkit-box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var r=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([r]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var i,r,o={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=s.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,c=0,f=[],h=n(38);function d(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=o[i.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](i.parts[a]);for(;a<i.parts.length;a++)r.parts.push(b(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(b(i.parts[a],t));o[i.id]={id:i.id,refs:1,parts:s}}}}function p(e,t){for(var n=[],i={},r=0;r<e.length;r++){var o=e[r],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function g(e,t){var n=l(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=f[f.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),f.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=l(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,r)}}function v(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=f.indexOf(e);t>=0&&f.splice(t,1)}function m(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,i,r,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var a=c++;n=u||(u=m(t)),i=w.bind(null,n,a,!1),r=w.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),g(e,t),t}(t),i=x.bind(null,n,t),r=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(t),i=O.bind(null,n),r=function(){v(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return d(n,t),function(e){for(var i=[],r=0;r<n.length;r++){var a=n[r];(s=o[a.id]).refs--,i.push(s)}e&&d(p(e,t),t);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete o[s.id]}}}};var _,k=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function w(e,t,n,i){var r=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=k(t,r);else{var o=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function O(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var i=n.css,r=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||o)&&(i=h(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,i=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var r,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}}])}));
3
+ //# sourceMappingURL=index.js.map