(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";function init(e){function t(e){Flip.instance.defaultTask.timeline[e?"stop":"start"]()}var n=e.commentPage,i=e.canDisableFeature,a=createGLCanvas(),r=document.createElement("canvas"),o=(new _pageVisibility.VisibilityWatcher).init();if((0,_message.sendMessageAsync)(_danmaku.MSG_EVENT_DANMAKU_WEBGL_STATUS,{success:!!a},{noReply:!0}),!a)return(0,_webgl.reportGLStatus)(!1,!1,0);var s=a.getContext("webgl");(0,_webgl.reportGLStatus)(!0,s.getExtension("OES_texture_float"),s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS));var c=require(14),u=c.RenderFactory,l=(c.CLIP_MODE_CIRCLE,new u({displayCanvas:a,textureCanvas:r,width:450,height:400,textStyle:{font:'13px "Microsoft YaHei"',lineHeight:16,padding:"5 8",maxWidth:430,maxLineCount:3,margin:"0 10",background:"#4c4c4c"}})),d=void 0,g=new _FeatureController.FeatureController;return i&&g.init(),l.addTexts(n.comments.map(function(e){return e.content})).renderTexture().bufferData().init(),l.viewHeight=.7*document.documentElement.clientHeight,Flip.instance.on("frameStart",function(){if(d){var e=l.$renderStage.getRenderRelativeRect(0),n=_Rect.Rect.fromClientBound(a.getBoundingClientRect()),i=shrinkRect(n,e?e[1]:0),r=void 0;if(i.contains(d)){var o=(d.x-n.left)/n.width,s=(d.y-n.top)/l.height;l.$renderStage.setTransparentLocation(o,s),l.$renderStage.enableClipCircle=!0,r=!0,t(!0)}else l.$renderStage.enableClipCircle=!1,t(!1);d=null,g.show(!!r)}}),window.addEventListener("mousemove",function(e){d={x:e.clientX,y:e.clientY}},!0),window.addEventListener("touchmove",function(e){var t=e.touches[0];d={x:t.clientX,y:e.clientY}},!0),o.on(_pageVisibility.EVENT_VISIBLE_CHANGE,function(){t(!o.visible)}),{toggleDisplay:function(e){a.style.display=e?"block":"none",t(!e),g.show(!!e)},animate:function(){return beginScrollAnimation(l,{velocity:15}).once("finish",function(){return g.dispose()})}}}function shrinkRect(e,t){return new _Rect.Rect(e.x,e.y+e.height*t,e.width,e.height*(1-t))}function beginScrollAnimation(e,t){var n=t.velocity,i=0;return e.transparentAllRenders(0),e.beginScroll({velocity:n}).on("update",function(){var t=e.$renderStage.getRenderRelativeRect(i),n=e.viewHeight/e.bufferHeight*.96;t&&t[1]<n&&t[1]>0&&(e.bounceRender({index:i,timeScale:3,startAlpha:1}),i++);for(var a=0,r=e.renderCount,o=.2*n;r>a;a++){var s=e.$renderStage.getRenderRelativeRect(a)[1],c=a>=i?0:1;if(0>s)c=0;else{if(!(o>s))continue;c=s/o}e.$renderStage.transparentRect(a,c)}})}function hasInjected(){return document.head.hasAttribute("uc-nexus-gl-danmaku")?!0:(document.head.setAttribute("uc-nexus-gl-danmaku","1"),!1)}function createGLCanvas(){var e=document.createElement("canvas"),t=e.style;return e.getContext("webgl")?(t.position="fixed",t.bottom="4px",t.right="4px",t.zIndex=Number.MAX_SAFE_INTEGER-2,t.webkitUserSelect="none",t.pointerEvents="none",e.setAttribute("id","vi-dog-gl-canvas"),document.body.appendChild(e),e):null}var _danmaku=require(19),_message=require(22),_Rect=require(7),_pageVisibility=require(12),_webgl=require(23),_FeatureController=require(3);!hasInjected()&&(0,_message.sendMessageAsync)(_danmaku.MSG_EVENT_DANMAKU_REQUIRE_FLIP_WEB_GL,{}).then(function(){return(0,_message.sendMessageAsync)(_danmaku.MSG_EVENT_DANMAKU_QUERY_COMMENT,{url:window.location.href})}).then(function(e){var t=init(e);t&&(t.animate(),(0,_message.registerMsgHandler)(_danmaku.MSG_EVENT_DANMAKU_ENABLED_CHANGE,function(e){return t.toggleDisplay(e.enabled)}))});


},{"12":12,"14":14,"19":19,"22":22,"23":23,"3":3,"7":7}],2:[function(require,module,exports){
"use strict";exports.defineProperty=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},exports.inherits=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)},exports.possibleConstructorReturn=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},exports.createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),exports.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},exports.slicedToArray=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(c){o=!0,i=c}finally{try{!n&&a["return"]&&a["return"]()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),exports.get=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var u=o.get;if(void 0!==u)return u.call(n)};


},{}],3:[function(require,module,exports){
"use strict";exports.FeatureController=void 0;var _AsyncRender2=require(5),_i18n=require(4),_dom=require(9),_message=require(22),_danmaku=require(19),FeatureController=exports.FeatureController=function(n){function e(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];require(2).classCallCheck(this,e);var t=require(2).possibleConstructorReturn(this,Object.getPrototypeOf(e).call(this,n));return t.createDOM(),t}return require(2).inherits(e,n),require(2).createClass(e,[{key:"createDOM",value:function(){var n=this,e=this.element=document.createElement("div"),t=e.createShadowRoot();t.innerHTML=styleContent+'\n        <div class="tip"></div>\n        <div class="dialog">\n            <div class="msg">\n                '+(0,_i18n.$m)("close_danmaku_message")+'\n            </div>\n            <div class="control">\n                <div class="confirm">'+(0,_i18n.$m)("close")+'</div>\n                <div class="cancel">'+(0,_i18n.$m)("Cancel")+"</div>\n            </div>\n        </div>\n    ",(0,_dom.$)(".msg .focus",t).addEventListener("click",function(){return(0,_message.sendMessageAsync)(_danmaku.MSG_EVENT_OPEN_DANMAKU_OPTION_PAGE,null,{noReply:!0})}),(0,_dom.$)(".tip",t).addEventListener("click",function(){return n.setRenderState({showDialog:!0})}),(0,_dom.$)(".dialog .cancel",t).addEventListener("click",function(){return n.setRenderState({showDialog:!1})}),(0,_dom.$)(".dialog .confirm",t).addEventListener("click",function(){return n.closeFeature()})}},{key:"closeFeature",value:function(){(0,_message.sendMessageAsync)(_danmaku.MSG_EVENT_DISABLE_DANMAKU_FEATURE,null,{noReply:!0}),this.setRenderState({show:!1,showDialog:!1})}},{key:"show",value:function(n){function e(e){return n.apply(this,arguments)}return e.toString=function(){return n.toString()},e}(function(n){var e={show:!!n};n||(e.showDialog=!1),this.setRenderState(e)})},{key:"dispose",value:function(){(0,_dom.removeNodeFromParent)(this.element)}},{key:"syncRenderState",value:function(){var n=this.renderState,e=this.element;(0,_dom.toggleClass)(e,"hide",!n.show),(0,_dom.toggleClass)((0,_dom._$)(".dialog",e),"hide",!n.showDialog)}},{key:"init",value:function(){var n=this;return this.syncRenderState(),document.body.appendChild(this.element),this.init=function(){return n},this}}]),e}(_AsyncRender2.AsyncRender),styleContent="<style>\n    :host{\n       position: fixed;\n       bottom: 4px;\n       right: 10px;\n       z-index: "+(Number.MAX_SAFE_INTEGER-1)+";\n    }\n    :host(.hide){\n       display: none;\n    }\n    .hide{\n        display: none;\n    }\n    .tip{\n        cursor: pointer;\n        color: white;\n        border-radius: 50%;\n        background-color: rgb(62, 153, 255);\n        box-shadow: 0px 4px 6px 0px rgba(0, 90, 176, 0.2);\n        position: fixed;\n        width: 21px;\n        bottom: 5px;\n        right: 20px;\n        height: 21px;\n    }\n    .tip:hover{\n        background-color: rgb(91, 168, 254);\n    }\n    .dialog{\n        background: white;\n        bottom: 35px;\n        right: 0;\n        color: #666;\n        position: absolute;\n        min-width: 200px;\n        border-radius: 5px;\n        box-shadow: 0px 0px 28px -3px rgba(0,0,0,0.75);\n    }\n    .dialog .msg{\n         padding: 10px 10px;\n         border-bottom: 1px solid rgba(0,0,0,0.3);\n    }\n    .dialog .control > div{\n        display: inline-block;\n        width: 48%;\n        text-align: center;\n        padding: 10px 0;\n        cursor: pointer;\n    }\n    .cancel{\n        color: rgba(0,0,0,0.3);\n    }\n    .dialog .control > div +  div{\n        border-left: 1px solid rgba(0,0,0,0.3);\n    }\n    .focus{\n        color: #2695ff;\n        cursor: pointer;\n    }\n    .tip{\n        background-position: 7px 7px;\n        background-repeat: no-repeat;\n        background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsSAAALEgHS3X78AAAASElEQVQI123NwRGAIBTE0F+aUJR0BYVRxPMgKDLuNZlsoOKIZUiogYw+hQE68jSncH7Akirulfj56EPoSDtI20UKtMd8SxntAvClc56c0hifAAAAAElFTkSuQmCC');\n    }\n</style>";


},{"19":19,"2":2,"22":22,"4":4,"5":5,"9":9}],4:[function(require,module,exports){
"use strict";function $m(e){return chrome.i18n.getMessage(e)}exports.$m=$m;


},{}],5:[function(require,module,exports){
"use strict";var AsyncRender=exports.AsyncRender=function(){function e(t){require(2).classCallCheck(this,e),this.renderState=Object.assign({},t),this.__lasyRenderState={},this.needSync()}return require(2).createClass(e,[{key:"syncRenderState",value:function(e){}},{key:"setRenderState",value:function(e){var t=void 0,n=this.renderState;e&&Object.getOwnPropertyNames(e).forEach(function(s){var r=e[s];r!==n[s]&&(n[s]=r,t=!0)}),t&&this.needSync()}},{key:"shouldUpdate",value:function(e,t){return!0}},{key:"needSync",value:function(){var e=this;this._syncDispatched||(this._syncDispatched=!0,requestAnimationFrame(function(){var t=e.renderState;e.shouldUpdate(t,e.__lastRenderState)&&e.syncRenderState(t),e.__lastRenderState=e.renderState,e._syncDispatched=!1}))}}]),e}();


},{"2":2}],6:[function(require,module,exports){
"use strict";function addEventListener(e,t,n,r){if("string"==typeof t&&t&&(0,_utils.isFunc)(n)){var i,s;return e.hasOwnProperty("$$callbacks")||(e.$$callbacks={}),i=e.$$callbacks,(s=i[t])||(s=i[t]=[]),arrAdd(s,r?warpOnceFunc(n):n)}return!1}function arrAdd(e,t,n){return-1==e.indexOf(t)?(e[n?"unshift":"push"](t),!0):void 0}function emitEvent(e,t,n,r){var i,s;return e.hasOwnProperty("$$callbacks")&&(s=(i=e.$$callbacks)[t])?(n?n instanceof Array||(n=[n]):n=[],void 0===r&&(r=e),i[t]=s.reduce(function(e,t){return(0,_utils.isFunc)(t)&&-1!==t.apply(r,n)&&e.push(t),e},[])):!1}function removeEventListener(e,t,n){var r,i,s;return void 0===t?e.$$callbacks={}:(r=e.$$callbacks)&&(i=r[t])&&i&&(n?(s=i.indexOf(n))>-1&&(i[s]=null):r[t]=[]),e}function warpOnceFunc(e){return function(){return e.apply(this,arguments),-1}}exports.EventEmitter=void 0,exports.addEventListener=addEventListener,exports.emitEvent=emitEvent,exports.removeEventListener=removeEventListener;var _utils=require(10),EventEmitter=exports.EventEmitter=function(){function e(){require(2).classCallCheck(this,e)}return require(2).createClass(e,[{key:"on",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];return addEventListener(this,e,t,n),this}},{key:"once",value:function(e,t){return this.on(e,t,!0)}},{key:"off",value:function(e,t){return removeEventListener(this,e,t),this}},{key:"emit",value:function(e,t,n){return emitEvent(this,e,t,n),this}}]),e}();


},{"10":10,"2":2}],7:[function(require,module,exports){
"use strict";function rectContains(t,e){var n=e.w||0,i=e.h||0,r=e.x,s=r+n,o=e.y,h=o+i;return t.left<r&&t.right>s&&t.top<o&&t.bottom>h}function intersectRect(t,e){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}exports.rectContains=rectContains;var Rect=exports.Rect=function(){function t(e,n,i,r){return require(2).classCallCheck(this,t),e instanceof t?t.fromClientBound(e):(this.x=e,this.y=n,this.w=i,void(this.h=r))}return require(2).createClass(t,[{key:"height",get:function(){return this.h},set:function(t){this.h=+t}},{key:"width",get:function(){return this.w},set:function(t){this.w=+t}},{key:"left",get:function(){return this.x},set:function(t){this.x=+t}},{key:"right",get:function(){return this.x+this.w},set:function(t){this.x=+t-this.w}},{key:"top",get:function(){return this.y},set:function(t){this.y=+t}},{key:"bottom",get:function(){return this.y+this.h},set:function(t){this.y=+t-this.h}}]),require(2).createClass(t,[{key:"intersect",value:function(t){return intersectRect(this,t)}},{key:"contains",value:function(t){return rectContains(this,t)}},{key:"equals",value:function(e){return e instanceof t&&this.x===e.x&&this.y===e.y&&this.w===e.w&&this.h===e.h}},{key:"clone",value:function(){return new t(this.x,this.y,this.w,this.h)}}],[{key:"fromClientBound",value:function(e,n,i,r){if(4==arguments.length)return new t(e,n,i-e,r-n);if(1==arguments.length)return new t(e.left,e.top,e.width,e.height);throw Error("argument error")}},{key:"fromUnionBounds",value:function(){for(var e=1/0,n=1/0,i=-(1/0),r=-(1/0),s=0;s<arguments.length;s++){var o=arguments[s];o.left<e&&(e=o.left),o.right>i&&(i=o.right),o.top<n&&(n=o.top),o.bottom>r&&(r=o.bottom)}return new t(e,n,i-e,r-n)}}]),t}();


},{"2":2}],8:[function(require,module,exports){
"use strict";function defer(){var e=void 0,r=void 0,n=new Promise(function(n,o){e=n,r=o});return{resolve:function(r){e(r)},reject:function(e){r(e)},promise:n}}exports.defer=defer;


},{}],9:[function(require,module,exports){
"use strict";function $(e,o){return e instanceof HTMLElement?e:(o||document).querySelector(e)}function _$(e,o){return(o||document).shadowRoot.querySelector(e)}function _$$(e,o){return slice.call((o||document).shadowRoot.querySelectorAll(e))}function $$(e,o){return slice.call((o||document).querySelectorAll(e))}function toggleClass(e,o,t){var r=2==arguments.length?e.classList.contains(o):!t;e.classList[r?"remove":"add"](o)}function removeNodeFromParent(e){return e&&e.parentNode?(e.parentNode.removeChild(e),!0):!1}exports.$=$,exports._$=_$,exports._$$=_$$,exports.$$=$$,exports.toggleClass=toggleClass,exports.removeNodeFromParent=removeNodeFromParent;var slice=Array.prototype.slice;


},{}],10:[function(require,module,exports){
"use strict";function forEach(r,t,n){if(isObj(r))if(void 0===n&&(n=r),r instanceof Array||r.hasOwnProperty("length"))for(var e=0,o=r.length;o>e;e++)t.call(n,r[e],e);else for(var i in r)r.hasOwnProperty(i)&&t.call(n,r[i],i);return r}function arrAdd(r,t,n){return-1==r.indexOf(t)?(r[n?"unshift":"push"](t),!0):void 0}function arrFind(r,t){var n=0,e=!0,o=!1,i=void 0;try{for(var a,s=r[Symbol.iterator]();!(e=(a=s.next()).done);e=!0){var f=a.value;if(t(f,n++))return f}}catch(u){o=!0,i=u}finally{try{!e&&s["return"]&&s["return"]()}finally{if(o)throw i}}}function arrFirst(r,t){var n=0,e=!0,o=!1,i=void 0;try{for(var a,s=r[Symbol.iterator]();!(e=(a=s.next()).done);e=!0){var f=a.value,u=t(f,n++);if(u)return u}}catch(c){o=!0,i=c}finally{try{!e&&s["return"]&&s["return"]()}finally{if(o)throw i}}}function arrRemove(r,t){var n=r.indexOf(t);return n>-1&&r.splice(n,1),-1!=n}function arrFilterMappedResult(r,t,n){var e=[],o=void 0;return forEach(r,function(r,n){(o=t.call(this,r,n))&&e.push(o)},n),e}function isFunc(r){return"function"==typeof r}function isObj(r){return r&&"object"==typeof r}function isStr(r){return"string"==typeof r}function noop(){}exports.forEach=forEach,exports.arrAdd=arrAdd,exports.arrFind=arrFind,exports.arrFirst=arrFirst,exports.arrRemove=arrRemove,exports.arrFilterMappedResult=arrFilterMappedResult,exports.isFunc=isFunc,exports.isObj=isObj,exports.isStr=isStr,exports.noop=noop;


},{}],11:[function(require,module,exports){
"use strict";function getFontHeight(e){var t=arguments.length<=1||void 0===arguments[1]?document.documentElement:arguments[1];if(/(\d+(\.\d+)?)(px|em|rem)/.test(e)){var n=+RegExp.$1,r=RegExp.$3;if(isNaN(n))return NaN;switch(r){case"px":return n;case"rem":t=document.documentElement;break;case"em":break;default:return NaN}return n*window.getComputedStyle(t).fontSize}return NaN}exports.getFontHeight=getFontHeight;var StringMeasure=exports.StringMeasure=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.canvas;require(2).classCallCheck(this,e);var r=n instanceof HTMLCanvasElement?n:document.createElement("canvas");this.$ctx=r.getContext("2d")}return require(2).createClass(e,[{key:"font",set:function(e){this.$ctx.font=e},get:function(){return this.$ctx.font}},{key:"$canvas",get:function(){return this.$ctx.canvas}},{key:"fontHeight",get:function(){var e=this.$ctx;return getFontHeight(e.font,e.canvas)}}]),require(2).createClass(e,[{key:"measureText",value:function(e){return this.$ctx.measureText(e)}},{key:"measureTextWidth",value:function(e){return this.$ctx.measureText(e).width}},{key:"measureTextToWidth",value:function(e,t){for(var n=0,r="",i=e.length,u=0;t>u&&i>n;n++)r+=e[n],u=this.measureTextWidth(r);return u>t&&(e=e.substr(0,e.length-1),u=this.measureTextWidth(e)),{width:u,text:r}}},{key:"measureTextToLines",value:function(e,t){var n=t.maxWidth,r=t.maxHeight,i=void 0===r?1/0:r,u=t.lineHeight,a=t.lineCount,s=void 0===a?1/0:a,o=e.length,c=0,h=[],g=u||0;for(u=u||this.fontHeight,u||(u=0);o>c&&i>g&&h.length<s;){var d=this.measureTextToWidth(e.substring(c),n).text;if(!d.length)throw Error("invalid width");c+=d.length,h.push(d),g+=u}return h}}]),e}(),defaultStringMeasure=exports.defaultStringMeasure=void 0,_defaultStringMeasure=void 0;Object.defineProperty(exports,"defaultStringMeasure",{get:function(){return _defaultStringMeasure||(_defaultStringMeasure=new StringMeasure),_defaultStringMeasure}});


},{"2":2}],12:[function(require,module,exports){
"use strict";exports.VisibilityWatcher=exports.EVENT_VISIBLE_CHANGE=void 0;var _EventEmitter2=require(6),EVENT_VISIBLE_CHANGE=exports.EVENT_VISIBLE_CHANGE="vb-c",VisibilityWatcher=exports.VisibilityWatcher=function(i){function t(){require(2).classCallCheck(this,t);var i=require(2).possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this));return i.visible=null,i.visibilityState="uninited",i}return require(2).inherits(t,i),require(2).createClass(t,[{key:"init",value:function(){function i(i){var e="visible"==(t.visibilityState=i);if(e!=t.visible){var s=t.visible;t.visible=e,t.emit(EVENT_VISIBLE_CHANGE,{last:s,visible:e})}}var t=this;return document.addEventListener("visibilitychange",function(){i(document.visibilityState)}),window.addEventListener("unload",function(){i("unload")}),i(document.visibilityState),this.init=function(){return t},t}}]),t}(_EventEmitter2.EventEmitter);


},{"2":2,"6":6}],13:[function(require,module,exports){
"use strict";function parseCSSArray(t){var e=[],i=[];switch("string"==typeof t?e=t.split(/\s+/):"number"==typeof t?e=[t]:Array.isArray(t)&&(e=t),e.length){case 1:i=[0,0,0,0];break;case 2:i=[0,1,0,1];break;case 3:i=[0,1,2,1];break;case 4:i=[0,1,2,3];break;default:throw Error("argument Error")}return i.map(function(t){return+e[t]})}function roundRectPath(t,e,i,r){r?(t.moveTo(0,r),t.quadraticCurveTo(0,0,r,0),t.lineTo(e-r,0),t.quadraticCurveTo(e,0,e,r),t.lineTo(e,i-r),t.quadraticCurveTo(e,i,e-r,i),t.lineTo(r,i),t.quadraticCurveTo(0,i,0,i-r),t.lineTo(0,r),t.closePath()):t.rect(0,0,e,i)}exports.CanvasTextRender=exports.CANVAS_TEXT_RENDER_ALIGN_BOTTOM=exports.CANVAS_TEXT_RENDER_ALIGN_TOP=exports.CANVAS_TEXT_RENDER_ALIGN_RIGHT=exports.CANVAS_TEXT_RENDER_ALIGN_CENTER=exports.CANVAS_TEXT_RENDER_ALIGN_LEFT=void 0,exports.parseCSSArray=parseCSSArray;var _StringMeasure=require(11),CANVAS_TEXT_RENDER_ALIGN_LEFT=exports.CANVAS_TEXT_RENDER_ALIGN_LEFT="left",CANVAS_TEXT_RENDER_ALIGN_CENTER=exports.CANVAS_TEXT_RENDER_ALIGN_CENTER="center",CANVAS_TEXT_RENDER_ALIGN_RIGHT=exports.CANVAS_TEXT_RENDER_ALIGN_RIGHT="right",CANVAS_TEXT_RENDER_ALIGN_TOP=exports.CANVAS_TEXT_RENDER_ALIGN_TOP="top",CANVAS_TEXT_RENDER_ALIGN_BOTTOM=exports.CANVAS_TEXT_RENDER_ALIGN_BOTTOM="bottom",stringMeasure=new _StringMeasure.StringMeasure,CanvasTextRenderContent=function(){function t(e){var i=e.text,r=e.font,n=e.width,s=e.height,a=e.lineHeight,h=e.maxWidth,o=e.maxLineCount,u=void 0===o?1/0:o,l=e.horizontalAlign,d=void 0===l?CANVAS_TEXT_RENDER_ALIGN_LEFT:l,T=e.verticalAlign,g=void 0===T?CANVAS_TEXT_RENDER_ALIGN_CENTER:T;require(2).classCallCheck(this,t),this.$text=i,this.$font=r,this.$width=n,this.$height=s,this.$lineHeight=a||0,this.$maxWidth=h,this.horizontalAlign=d,this.verticalAlign=g,this.$maxLineCount=u,this.reset()}return require(2).createClass(t,[{key:"reset",value:function(){stringMeasure.font=this.font;var t=this.text,e=this.$width,i=this.$maxWidth,r=e&&i>e?e:i;r||(r=stringMeasure.measureText(t).width);var n=stringMeasure.measureTextToLines(t,{maxWidth:r,maxHeight:this.$height||1/0,lineHeight:this.lineHeight,lineCount:this.$maxLineCount});if(!e){for(var s=n.length,a=n.join(""),h=Math.floor(stringMeasure.measureText(a).width/n.length),o=0,u=0,l="";u<a.length&&s>o;u++)stringMeasure.measureText(l+a[u]).width>h?(n[o]=l,o++,l=a[u]):l+=a[u];this.$width=n.reduce(function(t,e){return Math.max(t,stringMeasure.measureText(e).width)},0)}this.$lines=n,isFinite(this.$height)||(this.$height=this.$lines.length*this.lineHeight)}},{key:"render",value:function(t){var e=(0,_StringMeasure.getFontHeight)(t.font=this.font,t.canvas),i=this.lineHeight,r=this.$lines,n=this.width,s=this.horizontalAlign,a=this.verticalAlign,h=0,o=void 0,u=void 0,l=void 0;t.beginPath(),t.rect(-8,-2,n+10,this.height),t.textBaseline="hanging";var d=!0,T=!1,g=void 0;try{for(var _,c=r[Symbol.iterator]();!(d=(_=c.next()).done);d=!0){var A=_.value;l=t.measureText(A).width,o=s==CANVAS_TEXT_RENDER_ALIGN_CENTER?(n-l)/2:s==CANVAS_TEXT_RENDER_ALIGN_RIGHT?n-l:0,u=a==CANVAS_TEXT_RENDER_ALIGN_TOP?0:a==CANVAS_TEXT_RENDER_ALIGN_BOTTOM?i-e:(i-e)/2,t.fillText(A,o,u+h),h+=i}}catch(E){T=!0,g=E}finally{try{!d&&c["return"]&&c["return"]()}finally{if(T)throw g}}}},{key:"text",set:function(t){t!=this.$text&&(this.$text=t,this.reset())},get:function(){return this.$text}},{key:"lineHeight",get:function(){return this.$lineHeight||(0,_StringMeasure.getFontHeight)(this.font)}},{key:"height",get:function(){return this.$height}},{key:"width",get:function(){return this.$width}},{key:"font",get:function(){return this.$font},set:function(t){this.$font!=t&&(this.$font=t,this.reset())}}]),t}(),CanvasTextRender=exports.CanvasTextRender=function(t){function e(t){var i=t.width,r=t.x,n=void 0===r?0:r,s=t.y,a=void 0===s?0:s,h=t.text,o=t.font,u=void 0===o?"16px sans-serif":o,l=t.borderWidth,d=void 0===l?0:l,T=t.padding,g=void 0===T?0:T,_=t.height,c=void 0===_?1/0:_,A=t.color,E=void 0===A?"white":A,N=t.background,v=void 0===N?"black":N,R=t.borderRadius,f=void 0===R?0:R,C=t.borderColor,x=t.lineHeight,p=t.verticalAlign,S=t.horizontalAlign,m=t.maxWidth,y=t.margin,b=void 0===y?0:y,L=t.maxLineCount;require(2).classCallCheck(this,e);var $=require(2).possibleConstructorReturn(this,Object.getPrototypeOf(e).call(this));$.padding=g;var k=$.padding,G=$.content=new CanvasTextRenderContent({verticalAlign:p,horizontalAlign:S,font:u,lineHeight:x,text:h,maxLineCount:L,height:c-k[0]-k[2]-d,width:i-k[1]-k[3]-d,maxWidth:m-k[1]-k[3]-d});return $.width=G.width+k[1]+k[3]+d,$.height=G.height+k[0]+k[2]+d,Object.assign($,{background:v,borderWidth:d,borderRadius:f,borderColor:C,color:E,x:n,y:a,margin:b}),$}return require(2).inherits(e,t),require(2).createClass(e,[{key:"render",value:function(t){var e=t.ctx;e.save(),this.transform(e),this.clipContext(e),this.paint(e),e.restore()}},{key:"invalid",value:function(){this.$lines=null}},{key:"transform",value:function(t){t.translate(this.x,this.y)}},{key:"clipContext",value:function(t){var e=this.width,i=this.height,r=this.borderWidth;t.beginPath(),t.rect(-r,-r,e+r,i+r),t.clip()}},{key:"paint",value:function(t){this.paintBackground(t),this.paintText(t)}},{key:"paintText",value:function(t){var e=this.padding;t.translate(e[3],e[0]),t.fillStyle=this.color,this.content.render(t)}},{key:"paintBackground",value:function(t){t.beginPath(),roundRectPath(t,this.width,this.height,this.borderRadius),t.fillStyle=this.background;var e=this.borderWidth;e&&(t.lineWidth=this.borderWidth,t.strokeStyle=this.borderColor,t.stroke()),t.fill()}}]),e}(Flip.Render);Object.defineProperties(CanvasTextRender.prototype,{padding:{get:function(){return this.$padding},set:function(t){this.$padding=parseCSSArray(t)}},margin:{get:function(){return this.$margin},set:function(t){this.$margin=parseCSSArray(t)}}});


},{"11":11,"2":2}],14:[function(require,module,exports){
"use strict";function setCanvasPropertyWithCSS(e,t,i,r){e[t]=i,e.style[t]=r}function getDevicePixelRatio(){return window.devicePixelRatio||1}function getCanvasOrCreate(e){if(!e)return document.createElement("canvas");if(e instanceof HTMLCanvasElement)return e;if("string"==typeof e)return getCanvasOrCreate((0,_dom.$)(e));throw Error("not a canvas")}exports.RenderFactory=exports.CLIP_MODE_RECT=exports.CLIP_MODE_CIRCLE=void 0,exports.getDevicePixelRatio=getDevicePixelRatio;var _StringTexture=require(16),_RenderStage=require(15),_dom=require(9);exports.CLIP_MODE_CIRCLE=_RenderStage.CLIP_MODE_CIRCLE,exports.CLIP_MODE_RECT=_RenderStage.CLIP_MODE_RECT;var defaultTextStyle={borderRadius:12,maxWidth:160,padding:"7 12 3 12",margin:"5 0",font:getComputedStyle(document.documentElement).font},RenderFactory=exports.RenderFactory=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=t.displayCanvas,r=t.textureCanvas,a=t.textStyle,n=t.width,s=void 0===n?400:n,h=t.height,o=void 0===h?300:h,d=t.renderTaskName,u=t.clipMode,v=t.textAlign,g=void 0===v?"right":v;require(2).classCallCheck(this,e),this.displayCanvas=getCanvasOrCreate(i),this.textureCanvas=getCanvasOrCreate(r),this.data={},this.$stringTexture=_StringTexture.StringTexture.fromCanvas(this.textureCanvas,{scale:getDevicePixelRatio(),defaultTextRenderConfig:Object.assign({},defaultTextStyle,a||{}),textAlign:g}),this.$renderStage=new _RenderStage.RenderStage({canvas:this.displayCanvas,renderTaskName:d,clipMode:u}),this.width=s,this.height=o}return require(2).createClass(e,[{key:"renderCount",get:function(){return this.$renderStage.renderCount}}]),require(2).createClass(e,[{key:"init",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.renderGlobal;return this.$renderStage.init({renderGlobal:t}),this}},{key:"renderTexture",value:function(){var e=this.$stringTexture,t=e.renderRect;return this.width=Math.max(t.right,this.width),this.height=Math.max(t.bottom,this.height),e.render(),this.$renderStage.image=e.getImageData(),this}},{key:"bufferData",value:function(){var e=this.$stringTexture,t=e.renderVertexData(),i=t.coordData,r=t.vertexData;return this.$renderStage.bufferAttributes(i,r),this}},{key:"transparentAllRenders",value:function(e){for(var t=0,i=this.renderCount,r=this.$renderStage;i>t;t++)r.transparentRect(t,e)}},{key:"transformRender",value:function(e,t){var i=void 0;t instanceof Flip.Mat3?i=t:"function"==typeof t&&(i=new Flip.Mat3,i=t(i,this.$stringTexture.getRenderBound(e))||i);var r=this.$stringTexture.renderVertexData({startIndex:e,count:1,transform:i}),a=r.vertexData;return this.$renderStage.rectVertexData(e,a),this}},{key:"addTexts",value:function(e,t){var i=this;return e.forEach(function(e){return i.addText(e,t)}),this}},{key:"addText",value:function(e,t){this.$stringTexture.addText(e,t)}},{key:"beginScroll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.velocity,i=void 0===t?15:t,r=e.originY,a=e.destinationY,n=this.height,s=this.$renderStage;r=void 0==r?this.viewHeight/getDevicePixelRatio():+r,a=void 0==a?-n:a;var h=Math.abs(r-a),o=r/n,d=a/n;return Flip.animate({duration:h/i,on:{update:function(){var e=o+(d-o)*this.percent;s.setTransform(Flip.Mat3().translate(0,e))}}})}},{key:"bounceRender",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.index,i=e.velocity,r=void 0===i?40:i,a=e.timeScale,n=void 0===a?2:a,s=e.startAlpha,h=void 0===s?1:s,o=this,d=isNaN(h),u=o.$renderStage.getRenderRelativeRect(t)[3]*this.viewHeight/getDevicePixelRatio();return Flip.animate({duration:u/r*n,ease:Flip.EASE.bounceOut,on:{update:function(){var e=this.percent;d||(o.$renderStage.transparentRect(t,h),d=!0),o.transformRender(t,function(t,i){var r=i.width/2+i.left,a=i.top+i.height/2;return t.translate(r,a).scale(e,e).translate(-r,-a)})}}})}}]),e}();Object.defineProperties(RenderFactory.prototype,{bufferHeight:{get:function(){return this.$height*getDevicePixelRatio()}},bufferWidth:{get:function(){return this.$width*getDevicePixelRatio()}},viewWidth:{get:function(){return this.displayCanvas.width},set:function(e){if((e=parseInt(e))&&e!=this.viewWidth){var t=e*getDevicePixelRatio();setCanvasPropertyWithCSS(this.displayCanvas,"width",t,e+"px")}}},viewHeight:{get:function(){return this.displayCanvas.height},set:function(e){if((e=parseInt(e))&&e!=this.viewHeight){var t=e*getDevicePixelRatio(),i=this.bufferHeight;setCanvasPropertyWithCSS(this.displayCanvas,"height",t,e+"px"),this.$renderStage.setRenderSize(this.bufferWidth,i,0,t-i)}}},width:{get:function(){return this.$width},set:function(e){if((e=parseInt(e))&&e!=this.$width){this.$width=e;var t=getDevicePixelRatio(),i=e*t,r=this.displayCanvas;setCanvasPropertyWithCSS(r,"width",i,e+"px"),setCanvasPropertyWithCSS(this.textureCanvas,"width",i,e+"px"),this.$renderStage.setRenderSize(i,this.textureCanvas.height)}}},height:{get:function(){return this.$height},set:function(e){if((e=parseInt(e))&&e!=this.$height){this.$height=e;var t=getDevicePixelRatio(),i=e*t,r=this.displayCanvas;setCanvasPropertyWithCSS(r,"height",i,e+"px"),setCanvasPropertyWithCSS(this.textureCanvas,"height",i,e+"px"),this.$renderStage.setRenderSize(this.textureCanvas.width,i)}}}});


},{"15":15,"16":16,"2":2,"9":9}],15:[function(require,module,exports){
"use strict";function createTextRenderScene(){var e=new Flip.GL.Scene({fragSource:_glShader.fragSource,vertexSource:_glShader.vertexSource}),t=new Flip.GL.Geometry({drawCount:0,drawMode:WebGLRenderingContext.TRIANGLES}),i=new Flip.GL.Uniform({name:"uTransform",value:new Flip.Mat3});return e.addBinder({clean:function(e){e.clear(e.COLOR_BUFFER_BIT),e.disable(e.BLEND)}}).addBinder(i).addBinder(new Flip.GL.Attribute("aTexCoord",new Float32Array(0))).addBinder(new Flip.GL.Sampler2D({name:"uTextImg",flipY:!1})).addBinder(new Flip.GL.Attribute("aCalParam",new Float32Array(0))).addBinder(new Flip.GL.Attribute("aVertex",new Float32Array(0))),e.add(t),{$scene:e,$geometry:t,$transform:i}}function createClipScene(){var e=new Flip.GL.Scene({fragSource:_glShader.circleFragSource,vertexSource:_glShader.circleVertexSource}),t=new Flip.GL.Geometry({drawCount:CLIP_FAN_COUNT+2,drawMode:WebGLRenderingContext.TRIANGLE_FAN});return e.addBinder("setup",function(e){e.enable(e.BLEND),e.blendFunc(e.ZERO,e.ZERO)}).addBinder(new Flip.GL.Attribute("aVertex",(0,_math.circleVertexData)(CLIP_CIRCLE_RADIUS,CLIP_FAN_COUNT))).addBinder("uColor",[1,0,0,1]).addBinder(new Flip.GL.Uniform({name:"uTranslateVec",value:new Flip.GL.Vector([0,0])})),e.add(t),e.$geometry=t,e}function repeatVec(e,t,i){for(var r=t.length,a=new e(r*i),n=0,l=0;i>n;n++,l+=r)for(var c=0;r>c;c++)a[l+c]=t[c];return a}exports.RenderStage=exports.CLIP_MODE_RECT=exports.CLIP_MODE_CIRCLE=void 0;var _glShader=require(17),_math=require(18),NUMBER_COUNT_PER_RECT=12,CLIP_FAN_COUNT=100,CLIP_CIRCLE_RADIUS=.4,CLIP_RECT_HEIGHT=.12,CLIP_MODE_CIRCLE=exports.CLIP_MODE_CIRCLE="circle",CLIP_MODE_RECT=exports.CLIP_MODE_RECT="rect",RenderStage=exports.RenderStage=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=t.canvas,r=t.renderTaskName,a=void 0===r?"gl-render":r,n=t.clipMode;require(2).classCallCheck(this,e),this.$renderTask=new Flip.GL.Task({canvas:i,name:a});var l=createTextRenderScene();this.$clipScene=createClipScene(),this.$geometry=l.$geometry,this.$scene=l.$scene,this.$transform=l.$transform,this.$clipCircleRatio=1,this.enableClipCircle=!1,this.clipMode=n||CLIP_MODE_RECT}return require(2).createClass(e,[{key:"enableClipCircle",set:function(e){this.$clipScene.disabled=!e},get:function(){return!this.$clipScene.disabled}},{key:"clipCircleRatio",set:function(e){this.$clipCircleRatio!=+e&&(this.$clipCircleRatio=+e,this.$clipCircleChanged=1,this.invalid())},get:function(){return this.$clipCircleRatio}},{key:"clipMode",get:function(){return this.$clipMode},set:function(e){e!=CLIP_MODE_CIRCLE&&(e=CLIP_MODE_RECT),this.$clipMode!=e&&(this.$clipMode=e,this.$clipCircleChanged=1,this.invalid())}},{key:"renderCount",get:function(){var e=this.$geometry;return(e.drawCount-e.startIndex)/6}}]),require(2).createClass(e,[{key:"init",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=t.renderGlobal,r=this.$renderTask;return r.add(this.$scene),r.add(this.$clipScene),r.on("update",function(t){return e.update(t)}),(i||Flip.instance).add(r),this.init=function(){return e},this}},{key:"invalid",value:function(){this.$scene.invalid()}},{key:"update",value:function(e){if(Flip.Render.prototype.update.apply(this,arguments),this.$clipCircleChanged){var t=void 0,i=void 0;this.clipMode==CLIP_MODE_RECT?(t=4,i=(0,_math.rectVertexData)(4,CLIP_RECT_HEIGHT)):(t=CLIP_FAN_COUNT+2,i=(0,_math.circleVertexData)(CLIP_CIRCLE_RADIUS,CLIP_FAN_COUNT,this.$clipCircleRatio)),this.$clipScene.binder.aVertex.data=i,this.$clipScene.$geometry.drawCount=t,this.$clipCircleChanged=0}}},{key:"setTransform",value:function(e){this.$transform.value=e,this.invalid()}},{key:"setTransparentLocation",value:function(e,t){var i=2*(e-.5),r=2*(t-.5);this.$clipScene.binder.uTranslateVec.value=new Flip.GL.Vector([i,r])}},{key:"transform",value:function(e){var t=this.$transform;t.value=t.value.concat(e),t.invalid(),this.invalid()}},{key:"transparentRect",value:function(e,t){var i=this.$scene.binder.aCalParam,r=i.data,a=12,n=e*a;t=(0,_math.clamp)(t,0,1);for(var l=0;a>l;l+=2)r[n+l+1]=t;i.invalid(),this.invalid()}},{key:"getRenderRelativeRect",value:function(e){if(e<this.renderCount){var t=this.$scene.binder,i=t.aVertex,r=t.uTransform,a=e*NUMBER_COUNT_PER_RECT,n=i.data[a],l=i.data[a+1],c=i.data[a+2],d=i.data[a+5],s=r.value,o=(0,_math.vec3MulMat3)([n,l,1],s),u=(0,_math.vec3MulMat3)([c,d,1],s);return[o[0],o[1],u[0]-o[0],u[1]-o[1]]}}},{key:"rectVertexData",value:function(e,t){for(var i=this.$scene.binder.aVertex,r=i.data,a=e*NUMBER_COUNT_PER_RECT,n=0;NUMBER_COUNT_PER_RECT>n;n++)r[a+n]=t[n];i.invalid(),this.invalid()}},{key:"bufferAttributes",value:function(e,t){var i=this.$scene.binder;i.aTexCoord.data=e,i.aVertex.data=t,i.aCalParam.data=repeatVec(Float32Array,[1,1],e.length/2),this.$geometry.setDrawRange(e.length/2,0),this.invalid()}},{key:"setRenderSize",value:function(e,t,i,r){var a=this.$renderTask.gl;isFinite(e)||(e=a.canvas.width),isFinite(t)||(t=a.canvas.height),a.viewport(i||0,r||0,e,t),this.clipCircleRatio=e/t,this.$scene.invalid()}},{key:"image",set:function(e){var t=this.$scene.binder.uTextImg;t.source=e,this.invalid()}}]),e}();


},{"17":17,"18":18,"2":2}],16:[function(require,module,exports){
"use strict";exports.StringTexture=exports.STRING_TEXTURE_TEXT_ALIGN_NONE=exports.STRING_TEXTURE_TEXT_ALIGN_RIGHT=exports.STRING_TEXTURE_TEXT_ALIGN_CENTER=exports.STRING_TEXTURE_TEXT_ALIGN_LEFT=void 0;var _CanvasTextRender=require(13),_ImagePromise=require(21),_math=require(18),STRING_TEXTURE_TEXT_ALIGN_LEFT=exports.STRING_TEXTURE_TEXT_ALIGN_LEFT="left",STRING_TEXTURE_TEXT_ALIGN_CENTER=exports.STRING_TEXTURE_TEXT_ALIGN_CENTER="center",STRING_TEXTURE_TEXT_ALIGN_RIGHT=exports.STRING_TEXTURE_TEXT_ALIGN_RIGHT="right",STRING_TEXTURE_TEXT_ALIGN_NONE=exports.STRING_TEXTURE_TEXT_ALIGN_NONE="none",StringTexture=exports.StringTexture=function(){function t(e){require(2).classCallCheck(this,t),this.$ctx=e.ctx,this.width=e.width,this.height=e.height,this.renders=[],this.imageFormat=e.imageFormat||"image/png",this.imageQuality=e.imageQuality||1,this.defaultTextRenderConfig=e.defaultTextRenderConfig||{},this.scale=e.scale||1,this.textAlign=e.textAlign||STRING_TEXTURE_TEXT_ALIGN_NONE}return require(2).createClass(t,null,[{key:"fromCanvas",value:function(e,i){var r=e.getContext("2d");return new t(Object.assign({ctx:r,width:e.width,height:e.height},i))}}]),require(2).createClass(t,[{key:"render",value:function e(){var t=this.$ctx,i={ctx:t},r=this.scale;this.textAlign,this.width;t.save(),t.scale(r,r);var a=!0,n=!1,s=void 0;try{for(var h,T=this.renders[Symbol.iterator]();!(a=(h=T.next()).done);a=!0){var e=h.value;e.render(i)}}catch(o){n=!0,s=o}finally{try{!a&&T["return"]&&T["return"]()}finally{if(n)throw s}}t.restore()}},{key:"getImageData",value:function(){var t=this.$ctx,e=t.canvas;return t.getImageData(0,0,e.width,e.height)}},{key:"getImageAsync",value:function(){return(0,_ImagePromise.ImagePromise)(this.$ctx.canvas.toDataURL(this.imageFormat,this.imageQuality))}},{key:"addText",value:function(t,e){var i=this.renders,r=this.textAlign,a=this.scale,n=new _CanvasTextRender.CanvasTextRender(Object.assign({maxWidth:this.width/a,text:t},this.defaultTextRenderConfig,e)),s=i[i.length-1];if(s&&(n.y=s.y+s.height+s.margin[2]),n.y+=n.margin[1],r==STRING_TEXTURE_TEXT_ALIGN_RIGHT)n.x=this.width/a-n.width-n.margin[3];else if(r==STRING_TEXTURE_TEXT_ALIGN_LEFT)n.x=n.margin[0];else if(r==STRING_TEXTURE_TEXT_ALIGN_CENTER)n.x=(this.width/a-n.width)/2+n.margin[0];else{if(r!=STRING_TEXTURE_TEXT_ALIGN_NONE)throw Error("invalid textAlign:"+r);n.x+=n.margin[0]}this.renders.push(n)}},{key:"getText",value:function(t){var e=this.renders[t];return e?e.text:void 0}},{key:"getRenderBound",value:function(t){var e=this.width,i=this.height,r=this.renders,a=this.scale,n=r[t],s=n.x/e*a,h=(n.x+n.width)/e*a,T=n.y/i*a,o=(n.y+n.height)/i*a;return{left:s,top:T,right:h,bottom:o,width:h-s,height:o-T}}},{key:"renderVertexData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.mode,i=void 0===e?WebGLRenderingContext.TRIANGLES:e,r=t.startIndex,a=t.count,n=t.transform;if(i==WebGLRenderingContext.TRIANGLES){r=r||0;for(var s,h,T=this.width,o=this.height,_=this.renders,d=this.scale,E=isNaN(a)?_.length:r+a,g=new Float32Array(6*(E-r)*2),u=new Float32Array(g.length),l=r,c=0;E>l;l++,c++){s=_[l],h=12*c;var x=s.x/T*d,R=(s.x+s.width)/T*d,N=s.y/o*d,v=(s.y+s.height)/o*d,I=void 0,m=void 0,G=void 0,f=void 0;if(n){var X=(0,_math.vec3MulMat3)([x,N,1],n),y=require(2).slicedToArray(X,2);I=y[0],G=y[1];var A=(0,_math.vec3MulMat3)([R,v,1],n),w=require(2).slicedToArray(A,2);m=w[0],f=w[1]}else I=x,m=R,G=N,f=v;g[h]=x,g[h+1]=N,u[h]=I,u[h+1]=G,g[h+2]=R,g[h+3]=N,u[h+2]=m,u[h+3]=G,g[h+4]=x,g[h+5]=v,u[h+4]=I,u[h+5]=f,g[h+6]=x,g[h+7]=v,u[h+6]=I,u[h+7]=f,g[h+8]=R,g[h+9]=N,u[h+8]=m,u[h+9]=G,g[h+10]=R,g[h+11]=v,u[h+10]=m,u[h+11]=f}return{coordData:g,vertexData:u}}throw Error("not support")}},{key:"renderRect",get:function(){var t=1/0,e=1/0,i=-(1/0),r=-(1/0);return this.renders.forEach(function(a){var n=a.x,s=a.y;t=Math.min(n,t),e=Math.min(s,e),i=Math.max(n+a.width,i),r=Math.max(s+a.height,r)}),{left:t,top:e,right:i,bottom:r}}}]),t}();Object.defineProperties(StringTexture.prototype,{width:{get:function(){return this.$ctx.canvas.width},set:function(t){this.width!=t&&(t=parseInt(t))&&(this.$ctx.canvas.width=t)}},height:{get:function(){return this.$ctx.canvas.height},set:function(t){this.height!=(t=parseInt(t))&&(this.$ctx.canvas.height=t)}}});


},{"13":13,"18":18,"2":2,"21":21}],17:[function(require,module,exports){
"use strict";var vertexSource=exports.vertexSource="\nprecision mediump float;\nmat3 mat3FromTranslate(float dx,float dy);\nmat3 mat3FromScale(float sx,float sy);\nmat3 mat3ScaleInCenter(vec2 size,float scale);\n\nattribute vec2 aTexCoord;\nattribute vec2 aVertex;\nattribute vec2 aCalParam;\nvarying vec3 vTexCoord;\nuniform mat3 uTransform;\n\nvoid main(){\n  vec3 pos = uTransform * vec3(aVertex.x,aVertex.y,1.0);\n  gl_Position=vec4((pos.x-0.5)*2.0,(0.5-pos.y)*2.0,0.0,1.0);\n  vTexCoord=vec3(aTexCoord,aCalParam.y);\n}\nmat3 mat3ScaleInCenter(vec2 center,float scale){\n  float dx=center.x;\n  float dy=center.y;\n  return mat3FromTranslate(dx,dy) * mat3FromScale(scale,scale) * mat3FromTranslate(-dx,-dy);\n}\nmat3 mat3FromTranslate(float dx,float dy){\n  return mat3( \n    1.0 , 0.0 , 0.0,\n    0.0 , 1.0 , 0.0,\n    dx  , dy  , 1.0\n  );\n}\nmat3 mat3FromScale(float sx,float sy){\n  return mat3(\n    sx , 0.0 , 0.0,\n    0.0, sy  , 0.0,\n    0.0, 0.0 , 1.0\n  );\n}\n",fragSource=exports.fragSource="\nprecision mediump float;\nuniform sampler2D uTextImg;\nvarying vec3 vTexCoord;\nfloat map(float value,float start,float end);\nvoid main(){\n  float alpha=vTexCoord.z;\n  if(alpha >1.0 || alpha <0.0)discard;\n  vec4 color= texture2D(uTextImg,vTexCoord.xy) * alpha;\n  gl_FragColor=color;\n}\nfloat map(float value,float start,float end){\n  if(value < start || value >end) return value;\n  return (value - start )/ (end - start);\n}\n",circleVertexSource=exports.circleVertexSource="\nprecision mediump float;\n\nmat3 mat3FromTranslate(vec2 vec);\n\nuniform vec2 uTranslateVec;\nattribute vec2 aVertex;\n\nvoid main(){\n  mat3 mat=mat3FromTranslate(uTranslateVec);\n  gl_Position=vec4(mat * vec3(aVertex,1.0) , 1.0);\n}\nmat3 mat3FromTranslate(vec2 vec){\n  return mat3( \n    1.0 , 0.0 , 0.0,\n    0.0 , 1.0 , 0.0,\n    vec.x  , -vec.y  , 1.0\n  );\n}\n",circleFragSource=exports.circleFragSource="\nprecision mediump float;\n\nuniform vec4 uColor;\nvoid main(){\n  gl_FragColor=uColor;\n}\n";


},{}],18:[function(require,module,exports){
"use strict";function vec3MulMat3(e,t){var r=require(2).slicedToArray(e,3),a=r[0],c=r[1],n=r[2],l=void 0===n?1:n,o=t.elements;return[a*o[0]+c*o[3]+l*o[6],a*o[1]+c*o[4]+l*o[7],a*o[2]+c*o[5]+l*o[8]]}function circleVertexData(e,t){var r=arguments.length<=2||void 0===arguments[2]?1:arguments[2],a=new Float32Array(2*t+4),c=2*Math.PI;a[0]=a[1]=0;for(var n=2,l=0,o=c/t;c>=l;n+=2,l+=o)a[n]=Math.sin(l)*e,a[n+1]=Math.cos(l)*e*r;return a}function rectVertexData(e,t){var r=new Float32Array(8),a=e/2,c=t/2;return r[0]=-a,r[1]=-c,r[2]=-a,r[3]=c,r[4]=a,r[5]=c,r[6]=a,r[7]=-c,r}function clamp(e,t,r){return e>r?r:t>e?t:e}exports.vec3MulMat3=vec3MulMat3,exports.circleVertexData=circleVertexData,exports.rectVertexData=rectVertexData,exports.clamp=clamp;


},{"2":2}],19:[function(require,module,exports){
"use strict";var MSG_EVENT_DANMAKU_USER_POST=exports.MSG_EVENT_DANMAKU_USER_POST="post-danmaku",MSG_EVENT_DANMAKU_QUERY_COMMENT=exports.MSG_EVENT_DANMAKU_QUERY_COMMENT="comment-danmaku",MSG_EVENT_DANMAKU_ENABLED_CHANGE=exports.MSG_EVENT_DANMAKU_ENABLED_CHANGE="danmaku-enabled-change",MSG_EVENT_DANMAKU_QUERY_SERVER=exports.MSG_EVENT_DANMAKU_QUERY_SERVER="danmaku-query-server",MSG_EVENT_DANMAKU_BUBBLE_LOOP_COUNT=exports.MSG_EVENT_DANMAKU_BUBBLE_LOOP_COUNT="danmaku-loop-count",MSG_EVENT_DANMAKU_REQUIRE_FLIP_WEB_GL=exports.MSG_EVENT_DANMAKU_REQUIRE_FLIP_WEB_GL="danmaku-flip-webGL",MSG_DATA_VALUE_COMMENT_SOURCE_CRAWLER=exports.MSG_DATA_VALUE_COMMENT_SOURCE_CRAWLER="crawler",MSG_DATA_VALUE_COMMENT_SOURCE_SERVER=exports.MSG_DATA_VALUE_COMMENT_SOURCE_SERVER="server",MSG_EVENT_DANMAKU_TOGGLE_DISPLAY=exports.MSG_EVENT_DANMAKU_TOGGLE_DISPLAY="toggle-danmaku-display",MSG_EVENT_DANMAKU_WEBGL_STATUS=exports.MSG_EVENT_DANMAKU_WEBGL_STATUS="danmaku-webgl-status",MSG_EVENT_DISABLE_DANMAKU_FEATURE=exports.MSG_EVENT_DISABLE_DANMAKU_FEATURE="disable-danmaku",MSG_EVENT_OPEN_DANMAKU_OPTION_PAGE=exports.MSG_EVENT_OPEN_DANMAKU_OPTION_PAGE="open-danmaku-option-page";


},{}],20:[function(require,module,exports){
"use strict";var MSG_EVENT_STATISTIC_RECORD=exports.MSG_EVENT_STATISTIC_RECORD="statistic-record";


},{}],21:[function(require,module,exports){
"use strict";function ImagePromise(n){return new Promise(function(e,o){var r=new Image;r.src=n,r.onload=function(){e(r),r=null},r.onerror=function(){o(r),r=null}})}exports.ImagePromise=ImagePromise;


},{}],22:[function(require,module,exports){
"use strict";function sendMessageAsync(e,r){var t=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=t.noReply,o=t.extId,s={type:e,data:r,sync:!1,noReply:n,d:"req"};if(n)return sendMsg(o,s),Promise.resolve();var c=guid(),d=(0,_defer.defer)();return s.guid=c,deferCache[c]=d,sendMsg(o,s),d.promise["catch"](noop)}function initPort(){deferCache=Object.create(null);try{extPort=chrome.runtime.connect({name:"page:connect"}),extPort.onMessage.addListener(onMsg),extPort.onDisconnect.addListener(function(){disposePort(),setTimeout(initPort,0)})}catch(e){console.log(e)}}function disposePort(){for(var e in deferCache){var r=deferCache[e];r&&r.reject&&r.reject("disconnect")}deferCache=Object.create(null),extPort=null}function onMsg(e){var r=e.guid,t=e.d,n=deferCache[r];if("postTab"===t){var o=bkMsgHandlers[e.type];o&&o(e.data)}else n&&"res"===t&&(e.success?n.resolve(e.data):n.reject(e.error),delete deferCache[r])}function registerMsgHandler(e,r){"function"==typeof r&&(bkMsgHandlers[e]=r)}function sendMsg(e,r){if(e&&r)throw Error("not support external");r&&(extPort?extPort.postMessage(r):chrome.runtime.sendMessage(r))}function noop(){}function guid(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+Date.now()}exports.sendMessageAsync=sendMessageAsync,exports.registerMsgHandler=registerMsgHandler;var _defer=require(8),deferCache=void 0,bkMsgHandlers=Object.create(null),extPort=void 0;"object"==typeof chrome&&chrome.runtime&&chrome.runtime.onMessage&&chrome.runtime.onMessage.addListener(onMsg),window.addEventListener("unload",function(){extPort.disconnect(),disposePort()}),initPort();


},{"8":8}],23:[function(require,module,exports){
"use strict";function reportGLStatus(t,e,r){(0,_wowPage.wowLog)("5.11.1.2.1",{webgl:t?"1":"0",float_texture:e?"1":"0",vertex_sampler:+r||0})}exports.reportGLStatus=reportGLStatus;var _wowPage=require(24);


},{"24":24}],24:[function(require,module,exports){
"use strict";function wowLog(s,e){(0,_message.sendMessageAsync)(_statistic.MSG_EVENT_STATISTIC_RECORD,{id:s,param:e},{noReply:!1})}exports.wowLog=wowLog;var _message=require(22),_statistic=require(20);


},{"20":20,"22":22}]},{},[1]);
