rax-canvas
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -1,2 +0,2 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-canvas",function(t,i,a){a.exports=e()});else{("undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this).RaxCanvas=e()}}(function(){return function(e){var t={};function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.w={},i(i.s=3)}([function(e,t,i){"undefined"!=typeof self&&self,e.exports=function(e){function t(a){if(i[a])return i[a].exports;var n=i[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,a){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransferedObjectUUID=function(e,t){return e.toLowerCase()+"-"+t}},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(7),o=a(r),s=i(8),u=a(s),d=i(9),c=a(d),l=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._drawCommands="",this._globalAlpha=1,this._fillStyle="rgb(0,0,0)",this._strokeStyle="rgb(0,0,0)",this._lineWidth=1,this._lineCap="butt",this._lineJoin="miter",this._miterLimit=10,this._globalCompositeOperation="source-over",this._textAlign="start",this._textBaseline="alphabetic",this._font="10px sans-serif",this._savedGlobalAlpha=[],this.timer=null,this.componentId=null,this.createRadialGradient=function(e,t,i,a,n,r){return new c.default(e,t,i,a,n,r)},this.quadraticCurveTo=function(e,t,i,a){this._drawCommands=this._drawCommands.concat("u"+e+","+t+","+i+","+a+";")},this.strokeText=function(e,t,i){var a=e.replace(/!/g,"!!");a=(a=a.replace(/,/g,"!,")).replace(/;/g,"!;"),this._drawCommands=this._drawCommands.concat("U"+a+","+t+","+i+",0.0;")},this.measureText=function(e){throw new Error("GCanvas not supported yet")},this.isPointInPath=function(e,t){throw new Error("GCanvas not supported yet")},this.className="CanvasRenderingContext2D"}return n(e,[{key:"setTransform",value:function(e,t,i,a,n,r){this._drawCommands=this._drawCommands.concat("t"+(1===e?"1":e.toFixed(2))+","+(0===t?"0":t.toFixed(2))+","+(0===i?"0":i.toFixed(2))+","+(1===a?"1":a.toFixed(2))+","+n.toFixed(2)+","+r.toFixed(2)+";")}},{key:"transform",value:function(e,t,i,a,n,r){this._drawCommands=this._drawCommands.concat("f"+(1===e?"1":e.toFixed(2))+","+(0===t?"0":t.toFixed(2))+","+(0===i?"0":i.toFixed(2))+","+(1===a?"1":a.toFixed(2))+","+n+","+r+";")}},{key:"resetTransform",value:function(){this._drawCommands=this._drawCommands.concat("m;")}},{key:"scale",value:function(e,t){this._drawCommands=this._drawCommands.concat("k"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"rotate",value:function(e){this._drawCommands=this._drawCommands.concat("r"+e.toFixed(6)+";")}},{key:"translate",value:function(e,t){this._drawCommands=this._drawCommands.concat("l"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"save",value:function(){this._savedGlobalAlpha.push(this._globalAlpha),this._drawCommands=this._drawCommands.concat("v;")}},{key:"restore",value:function(){this._drawCommands=this._drawCommands.concat("e;"),this._globalAlpha=this._savedGlobalAlpha.pop()}},{key:"createPattern",value:function(e,t){return new o.default(e,t)}},{key:"createLinearGradient",value:function(e,t,i,a){return new u.default(e,t,i,a)}},{key:"strokeRect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("s"+e+","+t+","+i+","+a+";")}},{key:"clearRect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("c"+e+","+t+","+i+","+a+";")}},{key:"clip",value:function(){this._drawCommands=this._drawCommands.concat("p;")}},{key:"resetClip",value:function(){this._drawCommands=this._drawCommands.concat("q;")}},{key:"closePath",value:function(){this._drawCommands=this._drawCommands.concat("o;")}},{key:"moveTo",value:function(e,t){this._drawCommands=this._drawCommands.concat("g"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"lineTo",value:function(e,t){this._drawCommands=this._drawCommands.concat("i"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"bezierCurveTo",value:function(e,t,i,a,n,r){this._drawCommands=this._drawCommands.concat("z"+e.toFixed(2)+","+t.toFixed(2)+","+i.toFixed(2)+","+a.toFixed(2)+","+n.toFixed(2)+","+r.toFixed(2)+";")}},{key:"arcTo",value:function(e,t,i,a,n){this._drawCommands=this._drawCommands.concat("h"+e+","+t+","+i+","+a+","+n+";")}},{key:"beginPath",value:function(){this._drawCommands=this._drawCommands.concat("b;")}},{key:"fillRect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("n"+e+","+t+","+i+","+a+";")}},{key:"rect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("w"+e+","+t+","+i+","+a+";")}},{key:"fill",value:function(){this._drawCommands=this._drawCommands.concat("L;")}},{key:"stroke",value:function(e){this._drawCommands=this._drawCommands.concat("x;")}},{key:"arc",value:function(e,t,i,a,n,r){var o=0;r&&(o=1),this._drawCommands=this._drawCommands.concat("y"+e.toFixed(2)+","+t.toFixed(2)+","+i.toFixed(2)+","+a+","+n+","+o+";")}},{key:"fillText",value:function(e,t,i){var a=e.replace(/!/g,"!!");a=(a=a.replace(/,/g,"!,")).replace(/;/g,"!;"),this._drawCommands=this._drawCommands.concat("T"+a+","+t+","+i+",0.0;")}},{key:"drawImage",value:function(t,i,a,n,r,o,s,u,d){var c=arguments.length;e.GBridge.bindImageTexture(this.componentId,t.src,t._id),this._drawCommands+=function(){if(3===c){var e=parseFloat(i)||0,l=parseFloat(a)||0;return"d"+t._id+",0,0,"+t.width+","+t.height+","+e+","+l+","+t.width+","+t.height+";"}if(5===c){var f=parseFloat(i)||0,_=parseFloat(a)||0,h=parseInt(n)||t.width,v=parseInt(r)||t.height;return"d"+t._id+",0,0,"+t.width+","+t.height+","+f+","+_+","+h+","+v+";"}if(9===c)return i=parseFloat(i)||0,a=parseFloat(a)||0,n=parseInt(n)||t.width,r=parseInt(r)||t.height,o=parseFloat(o)||0,s=parseFloat(s)||0,u=parseInt(u)||t.width,d=parseInt(d)||t.height,"d"+t._id+","+i+","+a+","+n+","+r+","+o+","+s+","+u+","+d+";"}()}},{key:"fillStyle",set:function(t){if(this._fillStyle=t,"string"==typeof t)this._drawCommands=this._drawCommands.concat("F"+t+";");else if(t instanceof o.default){var i=t._img;e.GBridge.bindImageTexture(this.componentId,i.src,i._id),this._drawCommands=this._drawCommands.concat("G"+i._id+","+t._style+";")}else if(t instanceof u.default){for(var a="D"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}else if(t instanceof c.default){for(var a="H"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._start_pos._r.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y.toFixed(2)+","+t._end_pos._r.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}},get:function(){return this._fillStyle}},{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(e){this._globalAlpha=e,this._drawCommands=this._drawCommands.concat("a"+e.toFixed(2)+";")}},{key:"strokeStyle",get:function(){return this._strokeStyle},set:function(t){if(this._strokeStyle=t,"string"==typeof t)this._drawCommands=this._drawCommands.concat("S"+t+";");else if(t instanceof o.default){var i=t._img;e.GBridge.bindImageTexture(this.componentId,i.src,i._id),this._drawCommands=this._drawCommands.concat("G"+i._id+","+t._style+";")}else if(t instanceof u.default){for(var a="D"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}else if(t instanceof c.default){for(var a="H"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._start_pos._r.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y+",".toFixed(2)+t._end_pos._r.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(e){this._lineWidth=e,this._drawCommands=this._drawCommands.concat("W"+e+";")}},{key:"lineCap",get:function(){return this._lineCap},set:function(e){this._lineCap=e,this._drawCommands=this._drawCommands.concat("C"+e+";")}},{key:"lineJoin",get:function(){return this._lineJoin},set:function(e){this._lineJoin=e,this._drawCommands=this._drawCommands.concat("J"+e+";")}},{key:"miterLimit",get:function(){return this._miterLimit},set:function(e){this._miterLimit=e,this._drawCommands=this._drawCommands.concat("M"+e+";")}},{key:"globalCompositeOperation",get:function(){return this._globalCompositeOperation},set:function(e){this._globalCompositeOperation=e;var t=0;switch(e){case"source-over":t=0;break;case"source-atop":t=5;break;case"source-in":t=0;break;case"source-out":t=2;break;case"destination-over":case"destination-atop":case"destination-in":t=4;break;case"destination-out":t=3;break;case"lighter":t=1;break;case"copy":t=2;break;case"xor":t=6;break;default:t=0}this._drawCommands=this._drawCommands.concat("B"+t+";")}},{key:"textAlign",get:function(){return this._textAlign},set:function(e){this._textAlign=e;var t=0;switch(e){case"start":t=0;break;case"end":t=1;break;case"left":t=2;break;case"center":t=3;break;case"right":t=4;break;default:t=0}this._drawCommands=this._drawCommands.concat("A"+t+";")}},{key:"textBaseline",get:function(){return this._textBaseline},set:function(e){this._textBaseline=e;var t=0;switch(e){case"alphabetic":t=0;break;case"middle":t=1;break;case"top":t=2;break;case"hanging":t=3;break;case"bottom":t=4;break;case"ideographic":t=5;break;default:t=0}this._drawCommands=this._drawCommands.concat("E"+t+";")}},{key:"font",get:function(){return this._font},set:function(e){this._font=e,this._drawCommands=this._drawCommands.concat("j"+e+";")}}]),e}();t.default=l,e.exports=t.default},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function n(e){return Array.isArray(e)?e:Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],a=!0,n=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){n=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=i(10),d=a(u),c=i(11),l=a(c),f=i(12),_=a(f),h=i(13),v=a(h),E=i(14),m=a(E),g=i(15),T=a(g),p=i(16),A=a(p),N=i(17),b=a(N),R=i(18),C=a(R),I=i(19),y=a(I),B=i(3),S=a(B),x=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="Float32Array";if(t)if(e instanceof Uint8Array)i="Uint8Array";else if(e instanceof Uint16Array)i="Uint16Array";else if(e instanceof Uint32Array)i="Uint32Array";else{if(!(e instanceof Float32Array))throw new Error("Check array type failed. Array type is "+(void 0===e?"undefined":s(e)));i="Float32Array"}return{Uint8Array:1,Uint16Array:2,Uint32Array:4,Float32Array:14}[i]+","+btoa(function(e,t){for(var i="",a=0;a<e.length;a++)0!==a&&(i+=","),i+=e[a];return i}(e))},G=function(){function e(t,i,a){var n=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),F.call(this),this._canvas=t,this._type=i,this._version="WebGL 1.0",this._attrs=a,this._map=new Map,Object.keys(d.default).forEach(function(e){return Object.defineProperty(n,e,{value:d.default[e]})})}return o(e,[{key:"canvas",get:function(){return this._canvas}}]),e}(),F=function(){this.className="WebGLRenderingContext",this.activeTexture=function(e){G.GBridge.callNative(this._canvas.id,S.default.activeTexture+","+e,!0)},this.attachShader=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.attachShader+","+e.id+","+t.id,!0)},this.bindAttribLocation=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.bindAttribLocation+","+e.id+","+t+","+i,!0)},this.bindBuffer=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.bindBuffer+","+e+","+(t?t.id:0),!0)},this.bindFramebuffer=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.bindFramebuffer+","+e+","+(t?t.id:0),!0)},this.bindRenderbuffer=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.bindRenderbuffer+","+e+","+(t?t.id:0),!0)},this.bindTexture=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.bindTexture+","+e+","+(t?t.id:0),!0)},this.blendColor=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.blendColor+","+target+","+e+","+t+","+i+","+a,!0)},this.blendEquation=function(e){G.GBridge.callNative(this._canvas.id,S.default.blendEquation+","+e,!0)},this.blendEquationSeparate=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.blendEquationSeparate+","+e+","+t,!0)},this.blendFunc=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.blendFunc+","+e+","+t,!0)},this.blendFuncSeparate=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.blendFuncSeparate+","+e+","+t+","+i+","+a,!0)},this.bufferData=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.bufferData+","+e+","+x(t,!0)+","+i,!0)},this.bufferSubData=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.bufferSubData+","+e+","+t+","+x(i,!0),!0)},this.checkFramebufferStatus=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.checkFramebufferStatus+","+e);return Number(t)},this.clear=function(e){G.GBridge.callNative(this._canvas.id,S.default.clear+","+e),this._canvas._needRender=!0},this.clearColor=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.clearColor+","+e+","+t+","+i,!0)},this.clearDepth=function(e){G.GBridge.callNative(this._canvas.id,S.default.clearDepth+","+e,!0)},this.clearStencil=function(e){G.GBridge.callNative(this._canvas.id,S.default.clearStencil+","+e)},this.colorMask=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.colorMask+","+e+","+t+","+i+","+a)},this.compileShader=function(e){G.GBridge.callNative(this._canvas.id,S.default.compileShader+","+e.id,!0)},this.compressedTexImage2D=function(e,t,i,a,n,r,o){G.GBridge.callNative(this._canvas.id,S.default.compressedTexImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+x(o),!0)},this.compressedTexSubImage2D=function(e,t,i,a,n,r,o,s){G.GBridge.callNative(this._canvas.id,S.default.compressedTexSubImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+o+","+x(s),!0)},this.copyTexImage2D=function(e,t,i,a,n,r,o,s){G.GBridge.callNative(this._canvas.id,S.default.copyTexImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+o+","+s,!0)},this.copyTexSubImage2D=function(e,t,i,a,n,r,o,s){G.GBridge.callNative(this._canvas.id,S.default.copyTexSubImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+o+","+s)},this.createBuffer=function(){var e=G.GBridge.callNative(this._canvas.id,S.default.createBuffer+""),t=new _.default(e);return this._map.set(t.uuid(),t),t},this.createFramebuffer=function(){var e=G.GBridge.callNative(this._canvas.id,S.default.createFramebuffer+""),t=new v.default(e);return this._map.set(t.uuid(),t),t},this.createProgram=function(){var e=G.GBridge.callNative(this._canvas.id,S.default.createProgram+""),t=new A.default(e);return this._map.set(t.uuid(),t),t},this.createRenderbuffer=function(){var e=G.GBridge.callNative(this._canvas.id,S.default.createRenderbuffer+""),t=new m.default(e);return this._map.set(t.uuid(),t),t},this.createShader=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.createShader+","+e),i=new b.default(t,e);return this._map.set(i.uuid(),i),i},this.createTexture=function(){var e=G.GBridge.callNative(this._canvas.id,S.default.createTexture+""),t=new T.default(e);return this._map.set(t.uuid(),t),t},this.cullFace=function(e){G.GBridge.callNative(this._canvas.id,S.default.cullFace+","+e,!0)},this.deleteBuffer=function(e){G.GBridge.callNative(this._canvas.id,S.default.deleteBuffer+","+e.id,!0)},this.deleteFramebuffer=function(e){G.GBridge.callNative(this._canvas.id,S.default.deleteFramebuffer+","+e.id,!0)},this.deleteProgram=function(e){G.GBridge.callNative(this._canvas.id,S.default.deleteProgram+","+e.id,!0)},this.deleteRenderbuffer=function(e){G.GBridge.callNative(this._canvas.id,S.default.deleteRenderbuffer+","+e.id,!0)},this.deleteShader=function(e){G.GBridge.callNative(this._canvas.id,S.default.deleteShader+","+e.id,!0)},this.deleteTexture=function(e){G.GBridge.callNative(this._canvas.id,S.default.deleteTexture+","+e.id,!0)},this.depthFunc=function(e){G.GBridge.callNative(this._canvas.id,S.default.depthFunc+","+e)},this.depthMask=function(e){G.GBridge.callNative(this._canvas.id,S.default.depthMask+","+Number(e),!0)},this.depthRange=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.depthRange+","+e+","+t,!0)},this.detachShader=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.detachShader+","+e.id+","+t.id,!0)},this.disable=function(e){G.GBridge.callNative(this._canvas.id,S.default.disable+","+e,!0)},this.disableVertexAttribArray=function(e){G.GBridge.callNative(this._canvas.id,S.default.disableVertexAttribArray+","+e,!0)},this.drawArrays=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.drawArrays+","+e+","+t+","+i),this._canvas._needRender=!0},this.drawElements=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.drawElements+","+e+","+t+","+i+","+a+";"),this._canvas._needRender=!0},this.enable=function(e){G.GBridge.callNative(this._canvas.id,S.default.enable+","+e,!0)},this.enableVertexAttribArray=function(e){G.GBridge.callNative(this._canvas.id,S.default.enableVertexAttribArray+","+e,!0)},this.flush=function(){G.GBridge.callNative(this._canvas.id,S.default.flush+"")},this.framebufferRenderbuffer=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.framebufferRenderbuffer+","+e+","+t+","+i+","+(a?a.id:0),!0)},this.framebufferTexture2D=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,S.default.framebufferTexture2D+","+e+","+t+","+i+","+(a?a.id:0)+","+n,!0)},this.frontFace=function(e){G.GBridge.callNative(this._canvas.id,S.default.frontFace+","+e,!0)},this.generateMipmap=function(e){G.GBridge.callNative(this._canvas.id,S.default.generateMipmap+","+e,!0)},this.getActiveAttrib=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getActiveAttrib+","+e.id+","+t),a=i.split(","),n=r(a,3),o=n[0],s=n[1],u=n[2];return new l.default({type:Number(o),size:Number(s),name:u})},this.getActiveUniform=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getActiveUniform+","+e.id+","+t),a=i.split(","),n=r(a,3),o=n[0],s=n[1],u=n[2];return new l.default({type:Number(o),size:Number(s),name:u})},this.getAttachedShaders=function(e){var t=this,i=G.GBridge.callNative(this._canvas.id,S.default.getAttachedShaders+","+e.id),a=n(i);return a[0],a.slice(1).map(function(e){return t._map.get(b.default.uuid(e))})},this.getAttribLocation=function(e,t){return G.GBridge.callNative(this._canvas.id,S.default.getAttribLocation+","+e.id+","+t)},this.getBufferParameter=function(e,t){var i=(G.GBridge.callNative(this._canvas.id,S.default.getBufferParameter+","+e+","+t),getBufferParameter),a=r(i,2);return a[0],a[1]},this.getError=function(){return G.GBridge.callNative(this._canvas.id,S.default.getError+"")},this.getExtension=function(e){return null},this.getFramebufferAttachmentParameter=function(e,t,i){var a=G.GBridge.callNative(this._canvas.id,S.default.getFramebufferAttachmentParameter+","+e+","+t+","+i);switch(i){case d.default.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return this._map.get(m.default.uuid(a))||this._map.get(T.default.uuid(a))||null;default:return a}},this.getParameter=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.getParameter+","+e);switch(e){case d.default.VERSION:return this._version;case d.default.ARRAY_BUFFER_BINDING:case d.default.ELEMENT_ARRAY_BUFFER_BINDING:return this._map.get(_.default.uuid(t))||null;case d.default.CURRENT_PROGRAM:return this._map.get(A.default.uuid(t))||null;case d.default.FRAMEBUFFER_BINDING:return this._map.get(v.default.uuid(t))||null;case d.default.RENDERBUFFER_BINDING:return this._map.get(m.default.uuid(t))||null;case d.default.TEXTURE_BINDING_2D:case d.default.TEXTURE_BINDING_CUBE_MAP:return this._map.get(T.default.uuid(t))||null;case d.default.ALIASED_LINE_WIDTH_RANGE:case d.default.ALIASED_POINT_SIZE_RANGE:case d.default.BLEND_COLOR:case d.default.COLOR_CLEAR_VALUE:case d.default.DEPTH_RANGE:case d.default.MAX_VIEWPORT_DIMS:case d.default.SCISSOR_BOX:case d.default.VIEWPORT:case d.default.COMPRESSED_TEXTURE_FORMATS:default:var i=t.split(","),a=n(i),r=(a[0],a.slice(1));return 1===r.length?Number(r[0]):r.map(Number)}},this.getProgramInfoLog=function(e){return G.GBridge.callNative(this._canvas.id,S.default.getProgramInfoLog+","+e.id)},this.getProgramParameter=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getProgramParameter+","+e.id+","+t),a=i.split(",").map(function(e){return parseInt(e)}),n=r(a,2),o=n[0],u=n[1];if(1===o)return Boolean(u);if(2===o)return u;throw new Error("Unrecongized program paramater "+i+", type: "+(void 0===i?"undefined":s(i)))},this.getRenderbufferParameter=function(e,t){return G.GBridge.callNative(this._canvas.id,S.default.getRenderbufferParameter+","+e+","+t)},this.getShaderInfoLog=function(e){return G.GBridge.callNative(this._canvas.id,S.default.getShaderInfoLog+","+e.id)},this.getShaderParameter=function(e,t){return G.GBridge.callNative(this._canvas.id,S.default.getShaderParameter+","+e.id+","+t)},this.getShaderPrecisionFormat=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getShaderPrecisionFormat+","+e+","+t),a=r(i,3),n=a[0],o=a[1],s=a[2];return new C.default({rangeMin:Number(n),rangeMax:Number(o),precision:Number(s)})},this.getShaderSource=function(e){return G.GBridge.callNative(this._canvas.id,S.default.getShaderSource+","+e.id)},this.getSupportedExtensions=function(){return Object.keys({})},this.getTexParameter=function(e,t){return G.GBridge.callNative(this._canvas.id,S.default.getTexParameter+","+e+","+t)},this.getUniformLocation=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getUniformLocation+","+e.id+","+t);return-1===i?null:new y.default(Number(i))},this.getVertexAttrib=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getVertexAttrib+","+e+","+t);switch(t){case d.default.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return this._map.get(_.default.uuid(i))||null;case d.default.CURRENT_VERTEX_ATTRIB:default:return i}},this.getVertexAttribOffset=function(e,t){var i=G.GBridge.callNative(this._canvas.id,S.default.getVertexAttribOffset+","+e+","+t);return Number(i)},this.isBuffer=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isBuffer+","+e.id);return Boolean(t)},this.isContextLost=function(){return!1},this.isEnabled=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isEnabled+","+e);return Boolean(t)},this.isFramebuffer=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isFramebuffer+","+e.id);return Boolean(t)},this.isProgram=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isProgram+","+e.id);return Boolean(t)},this.isRenderbuffer=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isRenderbuffer+","+renderbuffer.id);return Boolean(t)},this.isShader=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isShader+","+e.id);return Boolean(t)},this.isTexture=function(e){var t=G.GBridge.callNative(this._canvas.id,S.default.isTexture+","+e.id);return Boolean(t)},this.lineWidth=function(e){G.GBridge.callNative(this._canvas.id,S.default.lineWidth+","+e,!0)},this.linkProgram=function(e){G.GBridge.callNative(this._canvas.id,S.default.linkProgram+","+e.id,!0)},this.pixelStorei=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.pixelStorei+","+e+","+Number(t))},this.polygonOffset=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.polygonOffset+","+e+","+t)},this.readPixels=function(e,t,i,a,r,o,s){for(var u=G.GBridge.callNative(this._canvas.id,S.default.readPixels+","+e+","+t+","+i+","+a+","+r+","+o),d=u.split(","),c=n(d),l=(c[0],c.slice(1)),f=0;f<l.length;f++)s[f]=parseInt(l[f])},this.renderbufferStorage=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.renderbufferStorage+","+e+","+t+","+i+","+a,!0)},this.sampleCoverage=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.sampleCoverage+","+e+","+Number(t),!0)},this.scissor=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.scissor+","+e+","+t+","+i+","+a,!0)},this.shaderSource=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.shaderSource+","+e.id+","+t)},this.stencilFunc=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.stencilFunc+","+e+","+t+","+i,!0)},this.stencilFuncSeparate=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.stencilFuncSeparate+","+e+","+t+","+i+","+a,!0)},this.stencilMask=function(e){G.GBridge.callNative(this._canvas.id,S.default.stencilMask+","+e,!0)},this.stencilMaskSeparate=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.stencilMaskSeparate+","+e+","+t,!0)},this.stencilOp=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.stencilOp+","+e+","+t+","+i)},this.stencilOpSeparate=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.stencilOp+","+e+","+t+","+i+","+a,!0)},this.texImage2D=function(){for(var e,t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=G.GBridge).texImage2D.apply(e,[this._canvas.id].concat(i))},this.texParameterf=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.texParameterf+","+e+","+t+","+i,!0)},this.texParameteri=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.texParameteri+","+e+","+t+","+i)},this.texSubImage2D=function(){for(var e,t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=G.GBridge).texSubImage2D.apply(e,[this._canvas.id].concat(i))},this.uniform1f=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform1f+","+e.id+","+t)},this.uniform1fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform1fv+","+e.id+","+x(t),!0)},this.uniform1i=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform1i+","+e.id+","+t)},this.uniform1iv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform1iv+","+e.id+","+x(t),!0)},this.uniform2f=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.uniform2f+","+e.id+","+t+","+i,!0)},this.uniform2fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform2fv+","+e.id+","+x(t),!0)},this.uniform2i=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.uniform2i+","+e.id+","+t+","+i,!0)},this.uniform2iv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform2iv+","+e.id+","+x(t),!0)},this.uniform3f=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.uniform3f+","+e.id+","+t+","+i+","+a,!0)},this.uniform3fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform3fv+","+e.id+","+x(t),!0)},this.uniform3i=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.uniform3i+","+e.id+","+t+","+i+","+a,!0)},this.uniform3iv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform3iv+","+e.id+","+x(t),!0)},this.uniform4f=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,S.default.uniform4f+","+e.id+","+t+","+i+","+a+","+n,!0)},this.uniform4fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform4fv+","+e.id+","+x(t),!0)},this.uniform4i=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,S.default.uniform4i+","+e.id+","+t+","+i+","+a+","+n,!0)},this.uniform4iv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.uniform4iv+","+e.id+","+x(t,!0),!0)},this.uniformMatrix2fv=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.uniformMatrix2fv+","+e.id+","+Number(t)+","+x(i),!0)},this.uniformMatrix3fv=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.uniformMatrix3fv+","+e.id+","+Number(t)+","+x(i),!0)},this.uniformMatrix4fv=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.uniformMatrix4fv+","+e.id+","+Number(t)+","+x(i),!0)},this.useProgram=function(e){G.GBridge.callNative(this._canvas.id,S.default.useProgram+","+e.id,!0)},this.validateProgram=function(e){G.GBridge.callNative(this._canvas.id,S.default.validateProgram+","+e.id,!0)},this.vertexAttrib1f=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib1f+","+e+","+t,!0)},this.vertexAttrib2f=function(e,t,i){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib2f+","+e+","+t+","+i,!0)},this.vertexAttrib3f=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib3f+","+e+","+t+","+i+","+a,!0)},this.vertexAttrib4f=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib4f+","+e+","+t+","+i+","+a+","+n,!0)},this.vertexAttrib1fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib1fv+","+e+","+x(t),!0)},this.vertexAttrib2fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib2fv+","+e+","+x(t),!0)},this.vertexAttrib3fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib3fv+","+e+","+x(t),!0)},this.vertexAttrib4fv=function(e,t){G.GBridge.callNative(this._canvas.id,S.default.vertexAttrib4fv+","+e+","+x(t),!0)},this.vertexAttribPointer=function(e,t,i,a,n,r){G.GBridge.callNative(this._canvas.id,S.default.vertexAttribPointer+","+e+","+t+","+i+","+Number(a)+","+n+","+r,!0)},this.viewport=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,S.default.viewport+","+e+","+t+","+i+","+a,!0)}};t.default=G,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=1,n={};n.activeTexture=a++,n.attachShader=a++,n.bindAttribLocation=a++,n.bindBuffer=a++,n.bindFramebuffer=a++,n.bindRenderbuffer=a++,n.bindTexture=a++,n.blendColor=a++,n.blendEquation=a++,n.blendEquationSeparate=a++,n.blendFunc=a++,n.blendFuncSeparate=a++,n.bufferData=a++,n.bufferSubData=a++,n.checkFramebufferStatus=a++,n.clear=a++,n.clearColor=a++,n.clearDepth=a++,n.clearStencil=a++,n.colorMask=a++,n.compileShader=a++,n.compressedTexImage2D=a++,n.compressedTexSubImage2D=a++,n.copyTexImage2D=a++,n.copyTexSubImage2D=a++,n.createBuffer=a++,n.createFramebuffer=a++,n.createProgram=a++,n.createRenderbuffer=a++,n.createShader=a++,n.createTexture=a++,n.cullFace=a++,n.deleteBuffer=a++,n.deleteFramebuffer=a++,n.deleteProgram=a++,n.deleteRenderbuffer=a++,n.deleteShader=a++,n.deleteTexture=a++,n.depthFunc=a++,n.depthMask=a++,n.depthRange=a++,n.detachShader=a++,n.disable=a++,n.disableVertexAttribArray=a++,n.drawArrays=a++,n.drawArraysInstancedANGLE=a++,n.drawElements=a++,n.drawElementsInstancedANGLE=a++,n.enable=a++,n.enableVertexAttribArray=a++,n.flush=a++,n.framebufferRenderbuffer=a++,n.framebufferTexture2D=a++,n.frontFace=a++,n.generateMipmap=a++,n.getActiveAttrib=a++,n.getActiveUniform=a++,n.getAttachedShaders=a++,n.getAttribLocation=a++,n.getBufferParameter=a++,n.getContextAttributes=a++,n.getError=a++,n.getExtension=a++,n.getFramebufferAttachmentParameter=a++,n.getParameter=a++,n.getProgramInfoLog=a++,n.getProgramParameter=a++,n.getRenderbufferParameter=a++,n.getShaderInfoLog=a++,n.getShaderParameter=a++,n.getShaderPrecisionFormat=a++,n.getShaderSource=a++,n.getSupportedExtensions=a++,n.getTexParameter=a++,n.getUniform=a++,n.getUniformLocation=a++,n.getVertexAttrib=a++,n.getVertexAttribOffset=a++,n.isBuffer=a++,n.isContextLost=a++,n.isEnabled=a++,n.isFramebuffer=a++,n.isProgram=a++,n.isRenderbuffer=a++,n.isShader=a++,n.isTexture=a++,n.lineWidth=a++,n.linkProgram=a++,n.pixelStorei=a++,n.polygonOffset=a++,n.readPixels=a++,n.renderbufferStorage=a++,n.sampleCoverage=a++,n.scissor=a++,n.shaderSource=a++,n.stencilFunc=a++,n.stencilFuncSeparate=a++,n.stencilMask=a++,n.stencilMaskSeparate=a++,n.stencilOp=a++,n.stencilOpSeparate=a++,n.texImage2D=a++,n.texParameterf=a++,n.texParameteri=a++,n.texSubImage2D=a++,n.uniform1f=a++,n.uniform1fv=a++,n.uniform1i=a++,n.uniform1iv=a++,n.uniform2f=a++,n.uniform2fv=a++,n.uniform2i=a++,n.uniform2iv=a++,n.uniform3f=a++,n.uniform3fv=a++,n.uniform3i=a++,n.uniform3iv=a++,n.uniform4f=a++,n.uniform4fv=a++,n.uniform4i=a++,n.uniform4iv=a++,n.uniformMatrix2fv=a++,n.uniformMatrix3fv=a++,n.uniformMatrix4fv=a++,n.useProgram=a++,n.validateProgram=a++,n.vertexAttrib1f=a++,n.vertexAttrib2f=a++,n.vertexAttrib3f=a++,n.vertexAttrib4f=a++,n.vertexAttrib1fv=a++,n.vertexAttrib2fv=a++,n.vertexAttrib3fv=a++,n.vertexAttrib4fv=a++,n.vertexAttribPointer=a++,n.viewport=a++,t.default=n,e.exports=t.default},function(e,t,i){e.exports=i(5)},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ReactNativeBridge=t.WeexBridge=t.Image=void 0,t.enable=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.bridge,a=t.debug,n=t.disableAutoSwap,o=t.disableComboCommands,u=s.default.GBridge=r.default.GBridge=d.default.GBridge=l.default.GBridge=i;u.callEnable(e.ref,[0,-1,!1,!1,1,"white",!1]),!0===a&&u.callEnableDebug(),o&&u.callEnableDisableCombo();var c=new r.default(e.ref,{disableAutoSwap:n});return c.width=e.style.width,c.height=e.style.height,c};var n=i(6),r=a(n),o=i(20),s=a(o),u=i(2),d=a(u),c=i(1),l=a(c),f=i(21),_=a(f),h=i(22),v=a(h);t.Image=s.default,t.WeexBridge=_.default,t.ReactNativeBridge=v.default},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(1),o=a(r),s=i(2),u=a(s),d=function(){function e(t,i){var a=this,n=i.disableAutoSwap;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.id=null,this._needRender=!0,this.id=t,this._disableAutoSwap=n,n&&(this._swapBuffers=function(){e.GBridge.render(a.id)})}return n(e,[{key:"getContext",value:function(t){var i=this,a=null;if(t.match(/webgl/i))(a=new u.default(this)).componentId=this.id,this._disableAutoSwap||setInterval(function(){i._needRender&&(e.GBridge.render(i.id),i._needRender=!1)},16),e.GBridge.callSetContextType(this.id,1);else{if(!t.match(/2d/i))throw new Error("not supported context "+t);(a=new o.default(this)).componentId=this.id,setInterval(function(){var t=a._drawCommands;a._drawCommands="",e.GBridge.render2d(i.id,t),i._needRender=!1},16),e.GBridge.callSetContextType(this.id,0)}return a}},{key:"reset",value:function(){e.GBridge.callReset(this.id)}}]),e}();t.default=d,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._style=i,this._img=t},e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,i,a,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.addColorStop=function(e,t){this._stop_count<5&&0<=e&&e<=1&&(this._stops[this._stop_count]={_pos:e,_color:t},this._stop_count++)},this._start_pos={_x:t,_y:i},this._end_pos={_x:a,_y:n},this._stop_count=0,this._stops=[0,0,0,0,0]},e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),n=function(){function e(t,i,a,n,r,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._start_pos={_x:t,_y:i,_r:a},this._end_pos={_x:n,_y:r,_r:o},this._stop_count=0,this._stops=[0,0,0,0,0]}return a(e,[{key:"addColorStop",value:function(e,t){this._stop_count<5&&0<=e&&e<=1&&(this._stops[this._stop_count]={_pos:e,_color:t},this._stop_count++)}}]),e}();t.default=n,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,TEXTURE_2D:3553,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444},e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var i=t.type,a=t.name,n=t.size;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className="WebGLActiveInfo",this.type=i,this.name=a,this.size=n},e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLBuffer",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLFrameBuffer",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLRenderBuffer",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLTexture",s=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t,this.type=i}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLProgram",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLShader",s=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t,this.type=i}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var i=t.rangeMin,a=t.rangeMax,n=t.precision;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className="WebGLShaderPrecisionFormat",this.rangeMin=i,this.rangeMax=a,this.precision=n},e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLUniformLocation",s=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t,this.type=i}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),n=1,r=function(){},o=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._id=n++,this._width=0,this._height=0,this._src=void 0,this._onload=r,this._onerror=r,this.complete=!1}return a(e,[{key:"addEventListener",value:function(e,t){"load"===e?this.onload=t:"error"===e&&(this.onerror=t)}},{key:"removeEventListener",value:function(e,t){"load"===e?this.onload=r:"error"===e&&(this.onerror=r)}},{key:"width",get:function(){return this._width},set:function(e){this._width=e}},{key:"height",get:function(){return this._height},set:function(e){this._height=e}},{key:"src",get:function(){return this._src},set:function(t){var i=this;t.startsWith("//")&&(t="http:"+t),this._src=t,e.GBridge.perloadImage([this._src,this._id],function(e){if("string"==typeof e&&(e=JSON.parse(e)),e.error){var t={type:"error",target:i};i.onerror(t)}else{i.complete=!0,i.width="number"==typeof e.width?e.width:0,i.height="number"==typeof e.height?e.height:0;var t={type:"load",target:i};i.onload(t)}})}},{key:"onload",get:function(){return this._onload},set:function(e){this._onload=e}},{key:"onerror",get:function(){return this._onerror},set:function(e){this._onerror=e}}]),e}();o.GBridge=null,t.default=o,e.exports=t.default},function(e,t,i){"use strict";function a(e,t){for(var i="",a=0;a<e.length;a++)0!==a&&(i+=t),i+=e[a];return i}Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],a=!0,n=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){n=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=i(3),o=function(e){return e&&e.__esModule?e:{default:e}}(r),s="undefined"!=typeof WXEnvironment,u=s&&/ios/i.test(WXEnvironment.platform),d=s&&!u,c="undefined"!=typeof weex&&weex.requireModule?weex.requireModule("gcanvas"):"undefined"!=typeof __weex_require__?__weex_require__("@weex-module/gcanvas"):{},l=!1,f=!1,_=function(){var e=[];Object.keys(o.default).forEach(function(t){e[o.default[t]]=t});var t=function(t){return e[parseInt(t)]||"NotFoundMethod"};return function(e,i){var a=i.split(",")[0],n=t(a);console.log("=== callNative - componentId:"+e+"; method: "+n+"; cmds: "+i)}}(),h={},v={callEnable:function(e,t){return h[e]=[],c.enable({componentId:e,config:t})},callEnableDebug:function(){l=!0},callEnableDisableCombo:function(){f=!0},callSetContextType:function(e,t){c.setContextType(t,e)},callReset:function(e){c.resetComponent&&canvasModule.resetComponent(componentId)},render:u?function(e){return c.extendCallNative({contextId:e,type:1610612737})}:function(e){return callGCanvasLinkNative(e,1610612737,"render")},render2d:u?function(e,t){l&&(console.log(">>> >>> render2d ==="),console.log(">>> commands: "+t)),c.render(t,e)}:function(e,t){l&&(console.log(">>> >>> render2d ==="),console.log(">>> commands: "+t)),callGCanvasLinkNative(e,536870913,t)},callExtendCallNative:function(e,t){throw"should not be here anymore "+t},flushNative:u?function(e){var t=a(h[e],";");h[e]=[],l&&(console.log(">>> >>> flush native ==="),console.log(">>> commands: "+t));var i=c.extendCallNative({contextId:e,type:1610612736,args:t}),n=i&&i.result;return l&&console.log(">>> result: "+n),n}:function(e){var t=a(h[e],";");h[e]=[],l&&(console.log(">>> >>> flush native ==="),console.log(">>> commands: "+t));var i=callGCanvasLinkNative(e,1610612736,t);return l&&console.log(">>> result: "+i),i},callNative:function(e,t,i){return l&&_(e,t),h[e].push(t),!i||f?v.flushNative(e):void 0},texImage2D:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];if(u){if(6===i.length){var r=n(i,6),s=r[0],l=r[1],f=r[2],_=r[3],h=r[4],E=r[5];v.callNative(e,o.default.texImage2D+",6,"+s+","+l+","+f+","+_+","+h+","+E.src)}else if(9===i.length){var m=n(i,9),g=m[0],T=m[1],p=m[2],A=m[3],N=m[4],b=m[5],R=m[6],C=m[7],I=m[8];v.callNative(e,o.default.texImage2D+",9,"+g+","+T+","+p+","+A+","+N+","+b+","+ +R+","+C+","+(I?I.src:0))}}else if(d)if(6===i.length){var y=n(i,6),B=y[0],S=y[1],x=y[2],G=y[3],F=y[4],O=y[5];c.texImage2D(e,B,S,x,G,F,O.src)}else if(9===i.length){var P=n(i,9),w=P[0],L=P[1],U=P[2],M=P[3],D=P[4],k=P[5],X=P[6],V=P[7],H=P[8];c.texImage2D(e,w,L,U,M,D,k,X,V,H?H.src:0)}},texSubImage2D:function(e,t,i,a,n,r,s,l){u?8===arguments.length&&v.callNative(e,o.default.texSubImage2D+",6,"+t+","+i+","+a+","+n,NaN+r+","+s+","+l.src):d&&c.texSubImage2D(e,t,i,a,n,r,s,l.src)},bindImageTexture:function(e,t,i){c.bindImageTexture([t,i],e)},perloadImage:function(e,t){var i=n(e,2),a=i[0],r=i[1];c.preLoadImage([a,r],function(e){e.url=a,e.id=r,t(e)})}};t.default=v,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],a=!0,n=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){n=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(){u.Platform.OS},r=function(){u.Platform.OS},o=!1,s={},u={GCanvasModule:null,Platform:null,callEnable:function(e,t){return s[e]=[],u.GCanvasModule.enable({componentId:e,config:t})},callEnableDebug:function(){o=!0},callEnableDisableCombo:function(){},callSetContextType:function(e,t){u.GCanvasModule.setContextType(t,e)},render:function(e){return u.GCanvasModule.extendCallNative({contextId:e,type:1610612737})},render2d:function(e,t){o&&(console.log(">>> >>> render2d ==="),console.log(">>> commands: "+t)),u.GCanvasModule.render(t,e)},flushNative:function(e){},callNative:function(e,t,i){},texImage2D:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];if(n()){if(6===i.length){var s=a(i,6),d=s[0],c=s[1],l=s[2],f=s[3],_=s[4],h=s[5];u.GBridge.callNative(e,GLmethod.texImage2D+",6,"+d+","+c+","+l+","+f+","+_+","+h.src)}else if(9===i.length){var v=a(i,9),E=v[0],m=v[1],g=v[2],T=v[3],p=v[4],A=v[5],N=v[6],b=v[7],R=v[8];u.GBridge.callNative(e,GLmethod.texImage2D+",9,"+E+","+m+","+g+","+T+","+p+","+A+","+ +N+","+b+","+(R?R.src:0))}}else if(r())if(6===i.length){var C=a(i,6),I=C[0],y=C[1],B=C[2],S=C[3],x=C[4],G=C[5];u.GCanvasModule.texImage2D(e,I,y,B,S,x,G.src)}else if(9===i.length){var F=a(i,9),O=F[0],P=F[1],w=F[2],L=F[3],U=F[4],M=F[5],D=F[6],k=F[7],X=F[8];u.GCanvasModule.texImage2D(e,O,P,w,L,U,M,D,k,X?X.src:0)}},texSubImage2D:function(e,t,i,a,o,s,d,c){n()?8===arguments.length&&u.callNative(e,GLmethod.texSubImage2D+",6,"+t+","+i+","+a+","+o,NaN+s+","+d+","+c.src):r()&&GCanvasModule.texSubImage2D(e,t,i,a,o,s,d,c.src)},bindImageTexture:function(e,t,i){u.GCanvasModule.bindImageTexture([t,i],e,function(e){})},perloadImage:function(e,t){var i=a(e,2),n=i[0],r=i[1];u.GCanvasModule.preLoadImage([n,r],function(e){e.url=n,e.id=r,t(e)})}};t.default=u,e.exports=t.default}])},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isWeb="object"===("undefined"==typeof navigator?"undefined":a(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),t.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),t.isWeex="function"==typeof callNative||"object"===("undefined"==typeof WXEnvironment?"undefined":a(WXEnvironment))&&"Web"!==WXEnvironment.platform,t.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig;t.default=e.exports,t.default=e.exports},function(e,t){e.exports=function(){var e;if(!e)try{e=require("rax")}catch(e){}return e}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(2),o=i(1),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(i(0));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 d=function(e){function t(){var e,i,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,d=Array(n),c=0;c<n;c++)d[c]=arguments[c];return i=a=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(d))),a.getContext=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"2d",t=(0,r.findDOMNode)(a.refs.canvas);if(o.isWeex)return a._canvasHolder=s.enable(a.refs.canvas,{bridge:s.WeexBridge}),a._canvasHolder.getContext(e);if(t&&t.getContext){var i=t.getContext(e);return i.render=function(){},i}},u(a,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,r.Component),n(t,[{key:"render",value:function(){var e=this.props.style,t=void 0===e?{}:e;return o.isWeex?(0,r.createElement)("gcanvas",a({},this.props,{ref:"canvas"})):(0,r.createElement)("canvas",a({},this.props,{width:t.width,height:t.height,ref:"canvas"}))}}]),t}();d.createImage=function(){return o.isWeex?new s.Image:new Image},t.default=d,e.exports=t.default}])}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-canvas",function(t,i,a){a.exports=e()});else{("undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this).RaxCanvas=e()}}(function(){return function(e){var t={};function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.w={},i(i.s=3)}([function(e,t,i){"undefined"!=typeof self&&self,e.exports=function(e){function t(a){if(i[a])return i[a].exports;var n=i[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,a){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransferedObjectUUID=function(e,t){return e.toLowerCase()+"-"+t}},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(7),o=a(r),s=i(8),u=a(s),d=i(9),c=a(d),l=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._drawCommands="",this._globalAlpha=1,this._fillStyle="rgb(0,0,0)",this._strokeStyle="rgb(0,0,0)",this._lineWidth=1,this._lineCap="butt",this._lineJoin="miter",this._miterLimit=10,this._globalCompositeOperation="source-over",this._textAlign="start",this._textBaseline="alphabetic",this._font="10px sans-serif",this._savedGlobalAlpha=[],this.timer=null,this.componentId=null,this.createRadialGradient=function(e,t,i,a,n,r){return new c.default(e,t,i,a,n,r)},this.quadraticCurveTo=function(e,t,i,a){this._drawCommands=this._drawCommands.concat("u"+e+","+t+","+i+","+a+";")},this.strokeText=function(e,t,i){var a=e.replace(/!/g,"!!");a=(a=a.replace(/,/g,"!,")).replace(/;/g,"!;"),this._drawCommands=this._drawCommands.concat("U"+a+","+t+","+i+",0.0;")},this.measureText=function(e){throw new Error("GCanvas not supported yet")},this.isPointInPath=function(e,t){throw new Error("GCanvas not supported yet")},this.className="CanvasRenderingContext2D"}return n(e,[{key:"setTransform",value:function(e,t,i,a,n,r){this._drawCommands=this._drawCommands.concat("t"+(1===e?"1":e.toFixed(2))+","+(0===t?"0":t.toFixed(2))+","+(0===i?"0":i.toFixed(2))+","+(1===a?"1":a.toFixed(2))+","+n.toFixed(2)+","+r.toFixed(2)+";")}},{key:"transform",value:function(e,t,i,a,n,r){this._drawCommands=this._drawCommands.concat("f"+(1===e?"1":e.toFixed(2))+","+(0===t?"0":t.toFixed(2))+","+(0===i?"0":i.toFixed(2))+","+(1===a?"1":a.toFixed(2))+","+n+","+r+";")}},{key:"resetTransform",value:function(){this._drawCommands=this._drawCommands.concat("m;")}},{key:"scale",value:function(e,t){this._drawCommands=this._drawCommands.concat("k"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"rotate",value:function(e){this._drawCommands=this._drawCommands.concat("r"+e.toFixed(6)+";")}},{key:"translate",value:function(e,t){this._drawCommands=this._drawCommands.concat("l"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"save",value:function(){this._savedGlobalAlpha.push(this._globalAlpha),this._drawCommands=this._drawCommands.concat("v;")}},{key:"restore",value:function(){this._drawCommands=this._drawCommands.concat("e;"),this._globalAlpha=this._savedGlobalAlpha.pop()}},{key:"createPattern",value:function(e,t){return new o.default(e,t)}},{key:"createLinearGradient",value:function(e,t,i,a){return new u.default(e,t,i,a)}},{key:"strokeRect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("s"+e+","+t+","+i+","+a+";")}},{key:"clearRect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("c"+e+","+t+","+i+","+a+";")}},{key:"clip",value:function(){this._drawCommands=this._drawCommands.concat("p;")}},{key:"resetClip",value:function(){this._drawCommands=this._drawCommands.concat("q;")}},{key:"closePath",value:function(){this._drawCommands=this._drawCommands.concat("o;")}},{key:"moveTo",value:function(e,t){this._drawCommands=this._drawCommands.concat("g"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"lineTo",value:function(e,t){this._drawCommands=this._drawCommands.concat("i"+e.toFixed(2)+","+t.toFixed(2)+";")}},{key:"bezierCurveTo",value:function(e,t,i,a,n,r){this._drawCommands=this._drawCommands.concat("z"+e.toFixed(2)+","+t.toFixed(2)+","+i.toFixed(2)+","+a.toFixed(2)+","+n.toFixed(2)+","+r.toFixed(2)+";")}},{key:"arcTo",value:function(e,t,i,a,n){this._drawCommands=this._drawCommands.concat("h"+e+","+t+","+i+","+a+","+n+";")}},{key:"beginPath",value:function(){this._drawCommands=this._drawCommands.concat("b;")}},{key:"fillRect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("n"+e+","+t+","+i+","+a+";")}},{key:"rect",value:function(e,t,i,a){this._drawCommands=this._drawCommands.concat("w"+e+","+t+","+i+","+a+";")}},{key:"fill",value:function(){this._drawCommands=this._drawCommands.concat("L;")}},{key:"stroke",value:function(e){this._drawCommands=this._drawCommands.concat("x;")}},{key:"arc",value:function(e,t,i,a,n,r){var o=0;r&&(o=1),this._drawCommands=this._drawCommands.concat("y"+e.toFixed(2)+","+t.toFixed(2)+","+i.toFixed(2)+","+a+","+n+","+o+";")}},{key:"fillText",value:function(e,t,i){var a=e.replace(/!/g,"!!");a=(a=a.replace(/,/g,"!,")).replace(/;/g,"!;"),this._drawCommands=this._drawCommands.concat("T"+a+","+t+","+i+",0.0;")}},{key:"drawImage",value:function(t,i,a,n,r,o,s,u,d){var c=arguments.length;e.GBridge.bindImageTexture(this.componentId,t.src,t._id),this._drawCommands+=function(){if(3===c){var e=parseFloat(i)||0,l=parseFloat(a)||0;return"d"+t._id+",0,0,"+t.width+","+t.height+","+e+","+l+","+t.width+","+t.height+";"}if(5===c){var f=parseFloat(i)||0,_=parseFloat(a)||0,h=parseInt(n)||t.width,v=parseInt(r)||t.height;return"d"+t._id+",0,0,"+t.width+","+t.height+","+f+","+_+","+h+","+v+";"}if(9===c)return i=parseFloat(i)||0,a=parseFloat(a)||0,n=parseInt(n)||t.width,r=parseInt(r)||t.height,o=parseFloat(o)||0,s=parseFloat(s)||0,u=parseInt(u)||t.width,d=parseInt(d)||t.height,"d"+t._id+","+i+","+a+","+n+","+r+","+o+","+s+","+u+","+d+";"}()}},{key:"fillStyle",set:function(t){if(this._fillStyle=t,"string"==typeof t)this._drawCommands=this._drawCommands.concat("F"+t+";");else if(t instanceof o.default){var i=t._img;e.GBridge.bindImageTexture(this.componentId,i.src,i._id),this._drawCommands=this._drawCommands.concat("G"+i._id+","+t._style+";")}else if(t instanceof u.default){for(var a="D"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}else if(t instanceof c.default){for(var a="H"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._start_pos._r.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y.toFixed(2)+","+t._end_pos._r.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}},get:function(){return this._fillStyle}},{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(e){this._globalAlpha=e,this._drawCommands=this._drawCommands.concat("a"+e.toFixed(2)+";")}},{key:"strokeStyle",get:function(){return this._strokeStyle},set:function(t){if(this._strokeStyle=t,"string"==typeof t)this._drawCommands=this._drawCommands.concat("S"+t+";");else if(t instanceof o.default){var i=t._img;e.GBridge.bindImageTexture(this.componentId,i.src,i._id),this._drawCommands=this._drawCommands.concat("G"+i._id+","+t._style+";")}else if(t instanceof u.default){for(var a="D"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}else if(t instanceof c.default){for(var a="H"+t._start_pos._x.toFixed(2)+","+t._start_pos._y.toFixed(2)+","+t._start_pos._r.toFixed(2)+","+t._end_pos._x.toFixed(2)+","+t._end_pos._y+",".toFixed(2)+t._end_pos._r.toFixed(2)+","+t._stop_count,n=0;n<t._stop_count;++n)a+=","+t._stops[n]._pos+","+t._stops[n]._color;this._drawCommands=this._drawCommands.concat(a+";")}}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(e){this._lineWidth=e,this._drawCommands=this._drawCommands.concat("W"+e+";")}},{key:"lineCap",get:function(){return this._lineCap},set:function(e){this._lineCap=e,this._drawCommands=this._drawCommands.concat("C"+e+";")}},{key:"lineJoin",get:function(){return this._lineJoin},set:function(e){this._lineJoin=e,this._drawCommands=this._drawCommands.concat("J"+e+";")}},{key:"miterLimit",get:function(){return this._miterLimit},set:function(e){this._miterLimit=e,this._drawCommands=this._drawCommands.concat("M"+e+";")}},{key:"globalCompositeOperation",get:function(){return this._globalCompositeOperation},set:function(e){this._globalCompositeOperation=e;var t=0;switch(e){case"source-over":t=0;break;case"source-atop":t=5;break;case"source-in":t=0;break;case"source-out":t=2;break;case"destination-over":case"destination-atop":case"destination-in":t=4;break;case"destination-out":t=3;break;case"lighter":t=1;break;case"copy":t=2;break;case"xor":t=6;break;default:t=0}this._drawCommands=this._drawCommands.concat("B"+t+";")}},{key:"textAlign",get:function(){return this._textAlign},set:function(e){this._textAlign=e;var t=0;switch(e){case"start":t=0;break;case"end":t=1;break;case"left":t=2;break;case"center":t=3;break;case"right":t=4;break;default:t=0}this._drawCommands=this._drawCommands.concat("A"+t+";")}},{key:"textBaseline",get:function(){return this._textBaseline},set:function(e){this._textBaseline=e;var t=0;switch(e){case"alphabetic":t=0;break;case"middle":t=1;break;case"top":t=2;break;case"hanging":t=3;break;case"bottom":t=4;break;case"ideographic":t=5;break;default:t=0}this._drawCommands=this._drawCommands.concat("E"+t+";")}},{key:"font",get:function(){return this._font},set:function(e){this._font=e,this._drawCommands=this._drawCommands.concat("j"+e+";")}}]),e}();t.default=l,e.exports=t.default},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function n(e){return Array.isArray(e)?e:Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],a=!0,n=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){n=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=i(10),d=a(u),c=i(11),l=a(c),f=i(12),_=a(f),h=i(13),v=a(h),E=i(14),m=a(E),g=i(15),T=a(g),p=i(16),A=a(p),N=i(17),b=a(N),R=i(18),y=a(R),C=i(19),I=a(C),S=i(3),B=a(S),x=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="Float32Array";if(t)if(e instanceof Uint8Array)i="Uint8Array";else if(e instanceof Uint16Array)i="Uint16Array";else if(e instanceof Uint32Array)i="Uint32Array";else{if(!(e instanceof Float32Array))throw new Error("Check array type failed. Array type is "+(void 0===e?"undefined":s(e)));i="Float32Array"}return{Uint8Array:1,Uint16Array:2,Uint32Array:4,Float32Array:14}[i]+","+btoa(function(e,t){for(var i="",a=0;a<e.length;a++)0!==a&&(i+=","),i+=e[a];return i}(e))},G=function(){function e(t,i,a){var n=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),F.call(this),this._canvas=t,this._type=i,this._version="WebGL 1.0",this._attrs=a,this._map=new Map,Object.keys(d.default).forEach(function(e){return Object.defineProperty(n,e,{value:d.default[e]})})}return o(e,[{key:"canvas",get:function(){return this._canvas}}]),e}(),F=function(){this.className="WebGLRenderingContext",this.activeTexture=function(e){G.GBridge.callNative(this._canvas.id,B.default.activeTexture+","+e,!0)},this.attachShader=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.attachShader+","+e.id+","+t.id,!0)},this.bindAttribLocation=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.bindAttribLocation+","+e.id+","+t+","+i,!0)},this.bindBuffer=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.bindBuffer+","+e+","+(t?t.id:0),!0)},this.bindFramebuffer=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.bindFramebuffer+","+e+","+(t?t.id:0),!0)},this.bindRenderbuffer=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.bindRenderbuffer+","+e+","+(t?t.id:0),!0)},this.bindTexture=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.bindTexture+","+e+","+(t?t.id:0),!0)},this.blendColor=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.blendColor+","+target+","+e+","+t+","+i+","+a,!0)},this.blendEquation=function(e){G.GBridge.callNative(this._canvas.id,B.default.blendEquation+","+e,!0)},this.blendEquationSeparate=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.blendEquationSeparate+","+e+","+t,!0)},this.blendFunc=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.blendFunc+","+e+","+t,!0)},this.blendFuncSeparate=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.blendFuncSeparate+","+e+","+t+","+i+","+a,!0)},this.bufferData=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.bufferData+","+e+","+x(t,!0)+","+i,!0)},this.bufferSubData=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.bufferSubData+","+e+","+t+","+x(i,!0),!0)},this.checkFramebufferStatus=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.checkFramebufferStatus+","+e);return Number(t)},this.clear=function(e){G.GBridge.callNative(this._canvas.id,B.default.clear+","+e),this._canvas._needRender=!0},this.clearColor=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.clearColor+","+e+","+t+","+i,!0)},this.clearDepth=function(e){G.GBridge.callNative(this._canvas.id,B.default.clearDepth+","+e,!0)},this.clearStencil=function(e){G.GBridge.callNative(this._canvas.id,B.default.clearStencil+","+e)},this.colorMask=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.colorMask+","+e+","+t+","+i+","+a)},this.compileShader=function(e){G.GBridge.callNative(this._canvas.id,B.default.compileShader+","+e.id,!0)},this.compressedTexImage2D=function(e,t,i,a,n,r,o){G.GBridge.callNative(this._canvas.id,B.default.compressedTexImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+x(o),!0)},this.compressedTexSubImage2D=function(e,t,i,a,n,r,o,s){G.GBridge.callNative(this._canvas.id,B.default.compressedTexSubImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+o+","+x(s),!0)},this.copyTexImage2D=function(e,t,i,a,n,r,o,s){G.GBridge.callNative(this._canvas.id,B.default.copyTexImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+o+","+s,!0)},this.copyTexSubImage2D=function(e,t,i,a,n,r,o,s){G.GBridge.callNative(this._canvas.id,B.default.copyTexSubImage2D+","+e+","+t+","+i+","+a+","+n+","+r+","+o+","+s)},this.createBuffer=function(){var e=G.GBridge.callNative(this._canvas.id,B.default.createBuffer+""),t=new _.default(e);return this._map.set(t.uuid(),t),t},this.createFramebuffer=function(){var e=G.GBridge.callNative(this._canvas.id,B.default.createFramebuffer+""),t=new v.default(e);return this._map.set(t.uuid(),t),t},this.createProgram=function(){var e=G.GBridge.callNative(this._canvas.id,B.default.createProgram+""),t=new A.default(e);return this._map.set(t.uuid(),t),t},this.createRenderbuffer=function(){var e=G.GBridge.callNative(this._canvas.id,B.default.createRenderbuffer+""),t=new m.default(e);return this._map.set(t.uuid(),t),t},this.createShader=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.createShader+","+e),i=new b.default(t,e);return this._map.set(i.uuid(),i),i},this.createTexture=function(){var e=G.GBridge.callNative(this._canvas.id,B.default.createTexture+""),t=new T.default(e);return this._map.set(t.uuid(),t),t},this.cullFace=function(e){G.GBridge.callNative(this._canvas.id,B.default.cullFace+","+e,!0)},this.deleteBuffer=function(e){G.GBridge.callNative(this._canvas.id,B.default.deleteBuffer+","+e.id,!0)},this.deleteFramebuffer=function(e){G.GBridge.callNative(this._canvas.id,B.default.deleteFramebuffer+","+e.id,!0)},this.deleteProgram=function(e){G.GBridge.callNative(this._canvas.id,B.default.deleteProgram+","+e.id,!0)},this.deleteRenderbuffer=function(e){G.GBridge.callNative(this._canvas.id,B.default.deleteRenderbuffer+","+e.id,!0)},this.deleteShader=function(e){G.GBridge.callNative(this._canvas.id,B.default.deleteShader+","+e.id,!0)},this.deleteTexture=function(e){G.GBridge.callNative(this._canvas.id,B.default.deleteTexture+","+e.id,!0)},this.depthFunc=function(e){G.GBridge.callNative(this._canvas.id,B.default.depthFunc+","+e)},this.depthMask=function(e){G.GBridge.callNative(this._canvas.id,B.default.depthMask+","+Number(e),!0)},this.depthRange=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.depthRange+","+e+","+t,!0)},this.detachShader=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.detachShader+","+e.id+","+t.id,!0)},this.disable=function(e){G.GBridge.callNative(this._canvas.id,B.default.disable+","+e,!0)},this.disableVertexAttribArray=function(e){G.GBridge.callNative(this._canvas.id,B.default.disableVertexAttribArray+","+e,!0)},this.drawArrays=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.drawArrays+","+e+","+t+","+i),this._canvas._needRender=!0},this.drawElements=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.drawElements+","+e+","+t+","+i+","+a+";"),this._canvas._needRender=!0},this.enable=function(e){G.GBridge.callNative(this._canvas.id,B.default.enable+","+e,!0)},this.enableVertexAttribArray=function(e){G.GBridge.callNative(this._canvas.id,B.default.enableVertexAttribArray+","+e,!0)},this.flush=function(){G.GBridge.callNative(this._canvas.id,B.default.flush+"")},this.framebufferRenderbuffer=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.framebufferRenderbuffer+","+e+","+t+","+i+","+(a?a.id:0),!0)},this.framebufferTexture2D=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,B.default.framebufferTexture2D+","+e+","+t+","+i+","+(a?a.id:0)+","+n,!0)},this.frontFace=function(e){G.GBridge.callNative(this._canvas.id,B.default.frontFace+","+e,!0)},this.generateMipmap=function(e){G.GBridge.callNative(this._canvas.id,B.default.generateMipmap+","+e,!0)},this.getActiveAttrib=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getActiveAttrib+","+e.id+","+t),a=i.split(","),n=r(a,3),o=n[0],s=n[1],u=n[2];return new l.default({type:Number(o),size:Number(s),name:u})},this.getActiveUniform=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getActiveUniform+","+e.id+","+t),a=i.split(","),n=r(a,3),o=n[0],s=n[1],u=n[2];return new l.default({type:Number(o),size:Number(s),name:u})},this.getAttachedShaders=function(e){var t=this,i=G.GBridge.callNative(this._canvas.id,B.default.getAttachedShaders+","+e.id),a=n(i);return a[0],a.slice(1).map(function(e){return t._map.get(b.default.uuid(e))})},this.getAttribLocation=function(e,t){return G.GBridge.callNative(this._canvas.id,B.default.getAttribLocation+","+e.id+","+t)},this.getBufferParameter=function(e,t){var i=(G.GBridge.callNative(this._canvas.id,B.default.getBufferParameter+","+e+","+t),getBufferParameter),a=r(i,2);return a[0],a[1]},this.getError=function(){return G.GBridge.callNative(this._canvas.id,B.default.getError+"")},this.getExtension=function(e){return null},this.getFramebufferAttachmentParameter=function(e,t,i){var a=G.GBridge.callNative(this._canvas.id,B.default.getFramebufferAttachmentParameter+","+e+","+t+","+i);switch(i){case d.default.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return this._map.get(m.default.uuid(a))||this._map.get(T.default.uuid(a))||null;default:return a}},this.getParameter=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.getParameter+","+e);switch(e){case d.default.VERSION:return this._version;case d.default.ARRAY_BUFFER_BINDING:case d.default.ELEMENT_ARRAY_BUFFER_BINDING:return this._map.get(_.default.uuid(t))||null;case d.default.CURRENT_PROGRAM:return this._map.get(A.default.uuid(t))||null;case d.default.FRAMEBUFFER_BINDING:return this._map.get(v.default.uuid(t))||null;case d.default.RENDERBUFFER_BINDING:return this._map.get(m.default.uuid(t))||null;case d.default.TEXTURE_BINDING_2D:case d.default.TEXTURE_BINDING_CUBE_MAP:return this._map.get(T.default.uuid(t))||null;case d.default.ALIASED_LINE_WIDTH_RANGE:case d.default.ALIASED_POINT_SIZE_RANGE:case d.default.BLEND_COLOR:case d.default.COLOR_CLEAR_VALUE:case d.default.DEPTH_RANGE:case d.default.MAX_VIEWPORT_DIMS:case d.default.SCISSOR_BOX:case d.default.VIEWPORT:case d.default.COMPRESSED_TEXTURE_FORMATS:default:var i=t.split(","),a=n(i),r=(a[0],a.slice(1));return 1===r.length?Number(r[0]):r.map(Number)}},this.getProgramInfoLog=function(e){return G.GBridge.callNative(this._canvas.id,B.default.getProgramInfoLog+","+e.id)},this.getProgramParameter=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getProgramParameter+","+e.id+","+t),a=i.split(",").map(function(e){return parseInt(e)}),n=r(a,2),o=n[0],u=n[1];if(1===o)return Boolean(u);if(2===o)return u;throw new Error("Unrecongized program paramater "+i+", type: "+(void 0===i?"undefined":s(i)))},this.getRenderbufferParameter=function(e,t){return G.GBridge.callNative(this._canvas.id,B.default.getRenderbufferParameter+","+e+","+t)},this.getShaderInfoLog=function(e){return G.GBridge.callNative(this._canvas.id,B.default.getShaderInfoLog+","+e.id)},this.getShaderParameter=function(e,t){return G.GBridge.callNative(this._canvas.id,B.default.getShaderParameter+","+e.id+","+t)},this.getShaderPrecisionFormat=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getShaderPrecisionFormat+","+e+","+t),a=r(i,3),n=a[0],o=a[1],s=a[2];return new y.default({rangeMin:Number(n),rangeMax:Number(o),precision:Number(s)})},this.getShaderSource=function(e){return G.GBridge.callNative(this._canvas.id,B.default.getShaderSource+","+e.id)},this.getSupportedExtensions=function(){return Object.keys({})},this.getTexParameter=function(e,t){return G.GBridge.callNative(this._canvas.id,B.default.getTexParameter+","+e+","+t)},this.getUniformLocation=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getUniformLocation+","+e.id+","+t);return-1===i?null:new I.default(Number(i))},this.getVertexAttrib=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getVertexAttrib+","+e+","+t);switch(t){case d.default.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return this._map.get(_.default.uuid(i))||null;case d.default.CURRENT_VERTEX_ATTRIB:default:return i}},this.getVertexAttribOffset=function(e,t){var i=G.GBridge.callNative(this._canvas.id,B.default.getVertexAttribOffset+","+e+","+t);return Number(i)},this.isBuffer=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isBuffer+","+e.id);return Boolean(t)},this.isContextLost=function(){return!1},this.isEnabled=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isEnabled+","+e);return Boolean(t)},this.isFramebuffer=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isFramebuffer+","+e.id);return Boolean(t)},this.isProgram=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isProgram+","+e.id);return Boolean(t)},this.isRenderbuffer=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isRenderbuffer+","+renderbuffer.id);return Boolean(t)},this.isShader=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isShader+","+e.id);return Boolean(t)},this.isTexture=function(e){var t=G.GBridge.callNative(this._canvas.id,B.default.isTexture+","+e.id);return Boolean(t)},this.lineWidth=function(e){G.GBridge.callNative(this._canvas.id,B.default.lineWidth+","+e,!0)},this.linkProgram=function(e){G.GBridge.callNative(this._canvas.id,B.default.linkProgram+","+e.id,!0)},this.pixelStorei=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.pixelStorei+","+e+","+Number(t))},this.polygonOffset=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.polygonOffset+","+e+","+t)},this.readPixels=function(e,t,i,a,r,o,s){for(var u=G.GBridge.callNative(this._canvas.id,B.default.readPixels+","+e+","+t+","+i+","+a+","+r+","+o),d=u.split(","),c=n(d),l=(c[0],c.slice(1)),f=0;f<l.length;f++)s[f]=parseInt(l[f])},this.renderbufferStorage=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.renderbufferStorage+","+e+","+t+","+i+","+a,!0)},this.sampleCoverage=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.sampleCoverage+","+e+","+Number(t),!0)},this.scissor=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.scissor+","+e+","+t+","+i+","+a,!0)},this.shaderSource=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.shaderSource+","+e.id+","+t)},this.stencilFunc=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.stencilFunc+","+e+","+t+","+i,!0)},this.stencilFuncSeparate=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.stencilFuncSeparate+","+e+","+t+","+i+","+a,!0)},this.stencilMask=function(e){G.GBridge.callNative(this._canvas.id,B.default.stencilMask+","+e,!0)},this.stencilMaskSeparate=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.stencilMaskSeparate+","+e+","+t,!0)},this.stencilOp=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.stencilOp+","+e+","+t+","+i)},this.stencilOpSeparate=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.stencilOp+","+e+","+t+","+i+","+a,!0)},this.texImage2D=function(){for(var e,t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=G.GBridge).texImage2D.apply(e,[this._canvas.id].concat(i))},this.texParameterf=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.texParameterf+","+e+","+t+","+i,!0)},this.texParameteri=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.texParameteri+","+e+","+t+","+i)},this.texSubImage2D=function(){for(var e,t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=G.GBridge).texSubImage2D.apply(e,[this._canvas.id].concat(i))},this.uniform1f=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform1f+","+e.id+","+t)},this.uniform1fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform1fv+","+e.id+","+x(t),!0)},this.uniform1i=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform1i+","+e.id+","+t)},this.uniform1iv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform1iv+","+e.id+","+x(t),!0)},this.uniform2f=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.uniform2f+","+e.id+","+t+","+i,!0)},this.uniform2fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform2fv+","+e.id+","+x(t),!0)},this.uniform2i=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.uniform2i+","+e.id+","+t+","+i,!0)},this.uniform2iv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform2iv+","+e.id+","+x(t),!0)},this.uniform3f=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.uniform3f+","+e.id+","+t+","+i+","+a,!0)},this.uniform3fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform3fv+","+e.id+","+x(t),!0)},this.uniform3i=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.uniform3i+","+e.id+","+t+","+i+","+a,!0)},this.uniform3iv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform3iv+","+e.id+","+x(t),!0)},this.uniform4f=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,B.default.uniform4f+","+e.id+","+t+","+i+","+a+","+n,!0)},this.uniform4fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform4fv+","+e.id+","+x(t),!0)},this.uniform4i=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,B.default.uniform4i+","+e.id+","+t+","+i+","+a+","+n,!0)},this.uniform4iv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.uniform4iv+","+e.id+","+x(t,!0),!0)},this.uniformMatrix2fv=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.uniformMatrix2fv+","+e.id+","+Number(t)+","+x(i),!0)},this.uniformMatrix3fv=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.uniformMatrix3fv+","+e.id+","+Number(t)+","+x(i),!0)},this.uniformMatrix4fv=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.uniformMatrix4fv+","+e.id+","+Number(t)+","+x(i),!0)},this.useProgram=function(e){G.GBridge.callNative(this._canvas.id,B.default.useProgram+","+e.id,!0)},this.validateProgram=function(e){G.GBridge.callNative(this._canvas.id,B.default.validateProgram+","+e.id,!0)},this.vertexAttrib1f=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib1f+","+e+","+t,!0)},this.vertexAttrib2f=function(e,t,i){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib2f+","+e+","+t+","+i,!0)},this.vertexAttrib3f=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib3f+","+e+","+t+","+i+","+a,!0)},this.vertexAttrib4f=function(e,t,i,a,n){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib4f+","+e+","+t+","+i+","+a+","+n,!0)},this.vertexAttrib1fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib1fv+","+e+","+x(t),!0)},this.vertexAttrib2fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib2fv+","+e+","+x(t),!0)},this.vertexAttrib3fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib3fv+","+e+","+x(t),!0)},this.vertexAttrib4fv=function(e,t){G.GBridge.callNative(this._canvas.id,B.default.vertexAttrib4fv+","+e+","+x(t),!0)},this.vertexAttribPointer=function(e,t,i,a,n,r){G.GBridge.callNative(this._canvas.id,B.default.vertexAttribPointer+","+e+","+t+","+i+","+Number(a)+","+n+","+r,!0)},this.viewport=function(e,t,i,a){G.GBridge.callNative(this._canvas.id,B.default.viewport+","+e+","+t+","+i+","+a,!0)}};t.default=G,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=1,n={};n.activeTexture=a++,n.attachShader=a++,n.bindAttribLocation=a++,n.bindBuffer=a++,n.bindFramebuffer=a++,n.bindRenderbuffer=a++,n.bindTexture=a++,n.blendColor=a++,n.blendEquation=a++,n.blendEquationSeparate=a++,n.blendFunc=a++,n.blendFuncSeparate=a++,n.bufferData=a++,n.bufferSubData=a++,n.checkFramebufferStatus=a++,n.clear=a++,n.clearColor=a++,n.clearDepth=a++,n.clearStencil=a++,n.colorMask=a++,n.compileShader=a++,n.compressedTexImage2D=a++,n.compressedTexSubImage2D=a++,n.copyTexImage2D=a++,n.copyTexSubImage2D=a++,n.createBuffer=a++,n.createFramebuffer=a++,n.createProgram=a++,n.createRenderbuffer=a++,n.createShader=a++,n.createTexture=a++,n.cullFace=a++,n.deleteBuffer=a++,n.deleteFramebuffer=a++,n.deleteProgram=a++,n.deleteRenderbuffer=a++,n.deleteShader=a++,n.deleteTexture=a++,n.depthFunc=a++,n.depthMask=a++,n.depthRange=a++,n.detachShader=a++,n.disable=a++,n.disableVertexAttribArray=a++,n.drawArrays=a++,n.drawArraysInstancedANGLE=a++,n.drawElements=a++,n.drawElementsInstancedANGLE=a++,n.enable=a++,n.enableVertexAttribArray=a++,n.flush=a++,n.framebufferRenderbuffer=a++,n.framebufferTexture2D=a++,n.frontFace=a++,n.generateMipmap=a++,n.getActiveAttrib=a++,n.getActiveUniform=a++,n.getAttachedShaders=a++,n.getAttribLocation=a++,n.getBufferParameter=a++,n.getContextAttributes=a++,n.getError=a++,n.getExtension=a++,n.getFramebufferAttachmentParameter=a++,n.getParameter=a++,n.getProgramInfoLog=a++,n.getProgramParameter=a++,n.getRenderbufferParameter=a++,n.getShaderInfoLog=a++,n.getShaderParameter=a++,n.getShaderPrecisionFormat=a++,n.getShaderSource=a++,n.getSupportedExtensions=a++,n.getTexParameter=a++,n.getUniform=a++,n.getUniformLocation=a++,n.getVertexAttrib=a++,n.getVertexAttribOffset=a++,n.isBuffer=a++,n.isContextLost=a++,n.isEnabled=a++,n.isFramebuffer=a++,n.isProgram=a++,n.isRenderbuffer=a++,n.isShader=a++,n.isTexture=a++,n.lineWidth=a++,n.linkProgram=a++,n.pixelStorei=a++,n.polygonOffset=a++,n.readPixels=a++,n.renderbufferStorage=a++,n.sampleCoverage=a++,n.scissor=a++,n.shaderSource=a++,n.stencilFunc=a++,n.stencilFuncSeparate=a++,n.stencilMask=a++,n.stencilMaskSeparate=a++,n.stencilOp=a++,n.stencilOpSeparate=a++,n.texImage2D=a++,n.texParameterf=a++,n.texParameteri=a++,n.texSubImage2D=a++,n.uniform1f=a++,n.uniform1fv=a++,n.uniform1i=a++,n.uniform1iv=a++,n.uniform2f=a++,n.uniform2fv=a++,n.uniform2i=a++,n.uniform2iv=a++,n.uniform3f=a++,n.uniform3fv=a++,n.uniform3i=a++,n.uniform3iv=a++,n.uniform4f=a++,n.uniform4fv=a++,n.uniform4i=a++,n.uniform4iv=a++,n.uniformMatrix2fv=a++,n.uniformMatrix3fv=a++,n.uniformMatrix4fv=a++,n.useProgram=a++,n.validateProgram=a++,n.vertexAttrib1f=a++,n.vertexAttrib2f=a++,n.vertexAttrib3f=a++,n.vertexAttrib4f=a++,n.vertexAttrib1fv=a++,n.vertexAttrib2fv=a++,n.vertexAttrib3fv=a++,n.vertexAttrib4fv=a++,n.vertexAttribPointer=a++,n.viewport=a++,t.default=n,e.exports=t.default},function(e,t,i){e.exports=i(5)},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ReactNativeBridge=t.WeexBridge=t.Image=void 0,t.enable=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.bridge,a=t.debug,n=t.disableAutoSwap,o=t.disableComboCommands,u=s.default.GBridge=r.default.GBridge=d.default.GBridge=l.default.GBridge=i;u.callEnable(e.ref,[0,-1,!1,!1,1,"white",!1]),!0===a&&u.callEnableDebug(),o&&u.callEnableDisableCombo();var c=new r.default(e.ref,{disableAutoSwap:n});return c.width=e.style.width,c.height=e.style.height,c};var n=i(6),r=a(n),o=i(20),s=a(o),u=i(2),d=a(u),c=i(1),l=a(c),f=i(21),_=a(f),h=i(22),v=a(h);t.Image=s.default,t.WeexBridge=_.default,t.ReactNativeBridge=v.default},function(e,t,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(1),o=a(r),s=i(2),u=a(s),d=function(){function e(t,i){var a=this,n=i.disableAutoSwap;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.id=null,this._needRender=!0,this.id=t,this._disableAutoSwap=n,n&&(this._swapBuffers=function(){e.GBridge.render(a.id)})}return n(e,[{key:"getContext",value:function(t){var i=this,a=null;if(t.match(/webgl/i))(a=new u.default(this)).componentId=this.id,this._disableAutoSwap||setInterval(function(){i._needRender&&(e.GBridge.render(i.id),i._needRender=!1)},16),e.GBridge.callSetContextType(this.id,1);else{if(!t.match(/2d/i))throw new Error("not supported context "+t);(a=new o.default(this)).componentId=this.id,setInterval(function(){var t=a._drawCommands;a._drawCommands="",e.GBridge.render2d(i.id,t),i._needRender=!1},16),e.GBridge.callSetContextType(this.id,0)}return a}},{key:"reset",value:function(){e.GBridge.callReset(this.id)}}]),e}();t.default=d,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._style=i,this._img=t},e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,i,a,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.addColorStop=function(e,t){this._stop_count<5&&0<=e&&e<=1&&(this._stops[this._stop_count]={_pos:e,_color:t},this._stop_count++)},this._start_pos={_x:t,_y:i},this._end_pos={_x:a,_y:n},this._stop_count=0,this._stops=[0,0,0,0,0]},e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),n=function(){function e(t,i,a,n,r,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._start_pos={_x:t,_y:i,_r:a},this._end_pos={_x:n,_y:r,_r:o},this._stop_count=0,this._stops=[0,0,0,0,0]}return a(e,[{key:"addColorStop",value:function(e,t){this._stop_count<5&&0<=e&&e<=1&&(this._stops[this._stop_count]={_pos:e,_color:t},this._stop_count++)}}]),e}();t.default=n,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,TEXTURE_2D:3553,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444},e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var i=t.type,a=t.name,n=t.size;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className="WebGLActiveInfo",this.type=i,this.name=a,this.size=n},e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLBuffer",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLFrameBuffer",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLRenderBuffer",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLTexture",s=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t,this.type=i}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLProgram",s=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLShader",s=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t,this.type=i}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var i=t.rangeMin,a=t.rangeMax,n=t.precision;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className="WebGLShaderPrecisionFormat",this.rangeMin=i,this.rangeMax=a,this.precision=n},e.exports=t.default},function(e,t,i){"use strict";function a(e){return(0,r.getTransferedObjectUUID)(o,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(0),o="WebGLUniformLocation",s=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.className=o,this.id=t,this.type=i}return n(e,[{key:"uuid",value:function(){return a(this.id)}}]),e}();s.uuid=a,t.default=s,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),n=1,r=function(){},o=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._id=n++,this._width=0,this._height=0,this._src=void 0,this._onload=r,this._onerror=r,this.complete=!1}return a(e,[{key:"addEventListener",value:function(e,t){"load"===e?this.onload=t:"error"===e&&(this.onerror=t)}},{key:"removeEventListener",value:function(e,t){"load"===e?this.onload=r:"error"===e&&(this.onerror=r)}},{key:"width",get:function(){return this._width},set:function(e){this._width=e}},{key:"height",get:function(){return this._height},set:function(e){this._height=e}},{key:"src",get:function(){return this._src},set:function(t){var i=this;t.startsWith("//")&&(t="http:"+t),this._src=t,e.GBridge.perloadImage([this._src,this._id],function(e){if("string"==typeof e&&(e=JSON.parse(e)),e.error){var t={type:"error",target:i};i.onerror(t)}else{i.complete=!0,i.width="number"==typeof e.width?e.width:0,i.height="number"==typeof e.height?e.height:0;var t={type:"load",target:i};i.onload(t)}})}},{key:"onload",get:function(){return this._onload},set:function(e){this._onload=e}},{key:"onerror",get:function(){return this._onerror},set:function(e){this._onerror=e}}]),e}();o.GBridge=null,t.default=o,e.exports=t.default},function(e,t,i){"use strict";function a(e,t){for(var i="",a=0;a<e.length;a++)0!==a&&(i+=t),i+=e[a];return i}Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],a=!0,n=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){n=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=i(3),o=function(e){return e&&e.__esModule?e:{default:e}}(r),s="undefined"!=typeof WXEnvironment,u=s&&/ios/i.test(WXEnvironment.platform),d=s&&!u,c="undefined"!=typeof weex&&weex.requireModule?weex.requireModule("gcanvas"):"undefined"!=typeof __weex_require__?__weex_require__("@weex-module/gcanvas"):{},l=!1,f=!1,_=function(){var e=[];Object.keys(o.default).forEach(function(t){e[o.default[t]]=t});var t=function(t){return e[parseInt(t)]||"NotFoundMethod"};return function(e,i){var a=i.split(",")[0],n=t(a);console.log("=== callNative - componentId:"+e+"; method: "+n+"; cmds: "+i)}}(),h={},v={callEnable:function(e,t){return h[e]=[],c.enable({componentId:e,config:t})},callEnableDebug:function(){l=!0},callEnableDisableCombo:function(){f=!0},callSetContextType:function(e,t){c.setContextType(t,e)},callReset:function(e){c.resetComponent&&canvasModule.resetComponent(componentId)},render:u?function(e){return c.extendCallNative({contextId:e,type:1610612737})}:function(e){return callGCanvasLinkNative(e,1610612737,"render")},render2d:u?function(e,t){l&&(console.log(">>> >>> render2d ==="),console.log(">>> commands: "+t)),c.render(t,e)}:function(e,t){l&&(console.log(">>> >>> render2d ==="),console.log(">>> commands: "+t)),callGCanvasLinkNative(e,536870913,t)},callExtendCallNative:function(e,t){throw"should not be here anymore "+t},flushNative:u?function(e){var t=a(h[e],";");h[e]=[],l&&(console.log(">>> >>> flush native ==="),console.log(">>> commands: "+t));var i=c.extendCallNative({contextId:e,type:1610612736,args:t}),n=i&&i.result;return l&&console.log(">>> result: "+n),n}:function(e){var t=a(h[e],";");h[e]=[],l&&(console.log(">>> >>> flush native ==="),console.log(">>> commands: "+t));var i=callGCanvasLinkNative(e,1610612736,t);return l&&console.log(">>> result: "+i),i},callNative:function(e,t,i){return l&&_(e,t),h[e].push(t),!i||f?v.flushNative(e):void 0},texImage2D:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];if(u){if(6===i.length){var r=n(i,6),s=r[0],l=r[1],f=r[2],_=r[3],h=r[4],E=r[5];v.callNative(e,o.default.texImage2D+",6,"+s+","+l+","+f+","+_+","+h+","+E.src)}else if(9===i.length){var m=n(i,9),g=m[0],T=m[1],p=m[2],A=m[3],N=m[4],b=m[5],R=m[6],y=m[7],C=m[8];v.callNative(e,o.default.texImage2D+",9,"+g+","+T+","+p+","+A+","+N+","+b+","+ +R+","+y+","+(C?C.src:0))}}else if(d)if(6===i.length){var I=n(i,6),S=I[0],B=I[1],x=I[2],G=I[3],F=I[4],O=I[5];c.texImage2D(e,S,B,x,G,F,O.src)}else if(9===i.length){var P=n(i,9),w=P[0],L=P[1],U=P[2],M=P[3],D=P[4],k=P[5],X=P[6],V=P[7],H=P[8];c.texImage2D(e,w,L,U,M,D,k,X,V,H?H.src:0)}},texSubImage2D:function(e,t,i,a,n,r,s,l){u?8===arguments.length&&v.callNative(e,o.default.texSubImage2D+",6,"+t+","+i+","+a+","+n,NaN+r+","+s+","+l.src):d&&c.texSubImage2D(e,t,i,a,n,r,s,l.src)},bindImageTexture:function(e,t,i){c.bindImageTexture([t,i],e)},perloadImage:function(e,t){var i=n(e,2),a=i[0],r=i[1];c.preLoadImage([a,r],function(e){e.url=a,e.id=r,t(e)})}};t.default=v,e.exports=t.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],a=!0,n=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(e){n=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(){u.Platform.OS},r=function(){u.Platform.OS},o=!1,s={},u={GCanvasModule:null,Platform:null,callEnable:function(e,t){return s[e]=[],u.GCanvasModule.enable({componentId:e,config:t})},callEnableDebug:function(){o=!0},callEnableDisableCombo:function(){},callSetContextType:function(e,t){u.GCanvasModule.setContextType(t,e)},render:function(e){return u.GCanvasModule.extendCallNative({contextId:e,type:1610612737})},render2d:function(e,t){o&&(console.log(">>> >>> render2d ==="),console.log(">>> commands: "+t)),u.GCanvasModule.render(t,e)},flushNative:function(e){},callNative:function(e,t,i){},texImage2D:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];if(n()){if(6===i.length){var s=a(i,6),d=s[0],c=s[1],l=s[2],f=s[3],_=s[4],h=s[5];u.GBridge.callNative(e,GLmethod.texImage2D+",6,"+d+","+c+","+l+","+f+","+_+","+h.src)}else if(9===i.length){var v=a(i,9),E=v[0],m=v[1],g=v[2],T=v[3],p=v[4],A=v[5],N=v[6],b=v[7],R=v[8];u.GBridge.callNative(e,GLmethod.texImage2D+",9,"+E+","+m+","+g+","+T+","+p+","+A+","+ +N+","+b+","+(R?R.src:0))}}else if(r())if(6===i.length){var y=a(i,6),C=y[0],I=y[1],S=y[2],B=y[3],x=y[4],G=y[5];u.GCanvasModule.texImage2D(e,C,I,S,B,x,G.src)}else if(9===i.length){var F=a(i,9),O=F[0],P=F[1],w=F[2],L=F[3],U=F[4],M=F[5],D=F[6],k=F[7],X=F[8];u.GCanvasModule.texImage2D(e,O,P,w,L,U,M,D,k,X?X.src:0)}},texSubImage2D:function(e,t,i,a,o,s,d,c){n()?8===arguments.length&&u.callNative(e,GLmethod.texSubImage2D+",6,"+t+","+i+","+a+","+o,NaN+s+","+d+","+c.src):r()&&GCanvasModule.texSubImage2D(e,t,i,a,o,s,d,c.src)},bindImageTexture:function(e,t,i){u.GCanvasModule.bindImageTexture([t,i],e,function(e){})},perloadImage:function(e,t){var i=a(e,2),n=i[0],r=i[1];u.GCanvasModule.preLoadImage([n,r],function(e){e.url=n,e.id=r,t(e)})}};t.default=u,e.exports=t.default}])},function(e,t,i){"use strict";var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":a(e)};t.isWeb="object"===("undefined"==typeof navigator?"undefined":n(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product),t.isNode="undefined"!=typeof process&&!(!process.versions||!process.versions.node),t.isWeex="function"==typeof callNative||"object"===("undefined"==typeof WXEnvironment?"undefined":n(WXEnvironment))&&"Web"!==WXEnvironment.platform,t.isReactNative="undefined"!=typeof __fbBatchedBridgeConfig;t.default=e.exports,t.default=e.exports},function(e,t){e.exports=function(){var e;if(!e)try{e=require("rax")}catch(e){}return e}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),r=i(2),o=i(1),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(i(0));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 d=function(e){function t(){var e,i,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,d=Array(n),c=0;c<n;c++)d[c]=arguments[c];return i=a=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(d))),a.getContext=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"2d",t=(0,r.findDOMNode)(a.refs.canvas);if(o.isWeex)return a._canvasHolder=s.enable(a.refs.canvas,{bridge:s.WeexBridge}),a._canvasHolder.getContext(e);if(t&&t.getContext){var i=t.getContext(e);return i.render=function(){},i}},u(a,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,r.Component),n(t,[{key:"render",value:function(){var e=this.props.style,t=void 0===e?{}:e;return o.isWeex?(0,r.createElement)("gcanvas",a({},this.props,{ref:"canvas"})):(0,r.createElement)("canvas",a({},this.props,{width:t.width,height:t.height,ref:"canvas"}))}}]),t}();d.createImage=function(){return o.isWeex?new s.Image:new Image},t.default=d,e.exports=t.default}])}); | ||
//# sourceMappingURL=canvas.min.map |
{ | ||
"name": "rax-canvas", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "canvas for Rax.", | ||
@@ -25,3 +25,3 @@ "license": "BSD-3-Clause", | ||
"gcanvas.js": "^0.0.7", | ||
"universal-env": "^0.6.2" | ||
"universal-env": "^0.6.3" | ||
}, | ||
@@ -32,4 +32,4 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"rax-test-renderer": "^0.6.2" | ||
"rax-test-renderer": "^0.6.3" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
484987
1161
Updateduniversal-env@^0.6.3