0x35ed1634…9501sent to0x0a1bbd57…3676·#15,983,557·view on Etherscan
() {\n\n vec2 scale = vec2(1., 1.);\n vec2 pos = aPosition;\n vec2 center = aCenter ;//+ vec2(0., -aCenter.y*scale.y);\n pos *= scale;\n\n pos -= center;\n pos = rotate(pos, aCenter.x);\n pos += center;\n\n // // translate\n // vec2 translate = pos;\n // st -= translate;\n \n // // rotate\n // st -= center;\n // st = rotate2d(rot) * st;\n // st += center;\n\n gl_Position = vec4(pos, 0., 1.);\n\n vTexCoord = aTexCoord;\n}"},{}],24:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CONSTS=void 0;n.CONSTS={MARKER_WIDTH:12,MARKER_HEIGHT:12,SPACE_CANVAS_STOPS:12}},{}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ColorRamp=void 0;var r=e("./const"),o=e("./stop_prod"),i=e("../../settings");n.ColorRamp=class{constructor(){this.width=256,this.height=16+r.CONSTS.MARKER_HEIGHT+r.CONSTS.SPACE_CANVAS_STOPS,this.cvs=document.createElement("canvas"),this.cvs.style.width=`${this.width}px`,this.cvs.style.height=`${this.height}px`,this.cvs.style.boxShadow="none",this.cvs.width=this.width,this.cvs.height=this.height,this.ctx=this.cvs.getContext("2d"),this.cvsMetrics={},this.paddingX=10;const e=this.height-r.CONSTS.MARKER_HEIGHT-r.CONSTS.SPACE_CANVAS_STOPS;this.grdCvs=document.createElement("canvas"),this.grdCvs.style.width=`${this.width}px`,this.grdCvs.style.height=`${e}px`,this.grdCvs.width=this.width,this.grdCvs.height=e,this.grdCtx=this.grdCvs.getContext("2d"),this.palette=i.settings.palette,this.colors=this.palette.c,this.domains=this.palette.w,this.stops=[],this._populateStops()}_makeStop(e,t){const n=new o.Stop({cvs:this.cvs,pos:e,color:t});this.stops.push(n)}_populateStops(){const e=this.domains.length>0;for(let t=0;t<this.colors.length;t++){this._makeStop(e?this.domains[t]:t/this.colors.length,this.colors[t])}}_renderGradient(e){const t=this.grdCvs.width,n=this.grdCvs.height,r=this.grdCtx,o=r.createLinearGradient(20,0,220,0);this.stops.forEach((e=>{o.addColorStop(e.pos,e.color)})),r.clearRect(0,0,t,n),r.fillStyle=o,r.fillRect(0,0,this.grdCvs.width,this.grdCvs.height)}_render(){this._renderGradient();this.ctx.drawImage(this.grdCvs,0,0),this.onChange()}getEl(){return this.container}getCanvas(){return this.grdCvs}onAppendedToDOM(){this._render()}onChange(){}}},{"../../settings":43,"./const":24,"./stop_prod":26}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Stop=void 0;let r=-1;n.Stop=class{constructor(e){this.id=r++,this.color=e.color||"#000000",this.pos=e.pos||0}}},{}],27:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=(r=e("./basebuffer"))&&r.__esModule?r:{default:r},i=e("./utils");const s=34962;n.default=class extends o.default{constructor(e,t,n=e.STATIC_DRAW,r){super(),this.gl=e,this.usage=n,this.buffer=void 0!==r?r:e.createBuffer(),this.attribs=[],this.stride=0,this.byteLength=0,this.length=0,t&&this.data(t)}bind(){this.gl.bindBuffer(s,this.buffer)}attrib(e,t,n,r=!1){return this.attribs.push({name:e,type:0|n,size:0|t,normalize:r,offset:this.stride,stride:0}),this.stride+=(0,i.getComponentSize)(n)*t,this._computeLength(),this}data(e){const t=this.gl;t.bindBuffer(s,this.buffer),t.bufferData(s,e,this.usage),t.bindBuffer(s,null),this.byteLength=(0,i.isBufferSource)(e)?e.byteLength:e,this._computeLength()}subData(e,t){const n=this.gl;n.bindBuffer(s,this.buffer),n.bufferSubData(s,t,e),n.bindBuffer(s,null)}attribPointer(e){const t=this.gl;t.bindBuffer(s,this.buffer);for(var n=0;n<this.attribs.length;n++){var r=this.attribs[n];if(void 0!==e[r.name]){var o=e[r.name]();t.enableVertexAttribArray(o),t.vertexAttribPointer(o,r.size,r.type,r.normalize,r.stride||this.stride,r.offset)}}}draw(e,t=this.length,n=0){this.gl.drawArrays(e,n,0|t)}dispose(){this.gl.deleteBuffer(this.buffer)}_computeLength(){this.stride>0&&(this.length=this.byteLength/this.stride)}}},{"./basebuffer":28,"./utils":35}],28:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=class{drawPoints(e,t){this.draw(0,e,t)}drawLines(e,t){this.draw(1,e,t)}drawLineLoop(e,t){this.draw(2,e,t)}drawLineStrip(e,t){this.draw(3,e,t)}drawTriangles(e,t){this.draw(4,e,t)}drawTriangleStrip(e,t){this.draw(5,e,t)}drawTriangleFan(e,t){this.draw(6,e,t)}}},{}],29:[function(e,t,n){"use strict";function r(e){return e.id instanceof WebGLTexture}Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Attachment=void 0;class o{constructor(e){this.target=e,this.level=0,this._isTexture=r(e)}isTexture(){return this._isTexture}_resize(e,t){e>0&&t>0&&(r(this.target)?this.target.fromData(e,t,null):(this.target.resize(e,t),this.target.allocate()))}_attach(e){var t=this.target.gl;this._isTexture?t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_2D,this.target.id,this.level):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,this.target.id)}_detach(e){var t=this.target.gl;this._isTexture?t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_2D,null,this.level):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}n.Attachment=o;n.default=class{constructor(e){this.gl=e,this.width=0,this.height=0,this.fbo=e.createFramebuffer(),this.bind(),this.attachments={},this.attachmentsList=[]}attach(e,t){const n=new o(t);return this.detach(e|=0),this.attachments[e.toString()]=n,this.attachmentsList.push(n),n._resize(this.width,this.height),n._attach(e),n}detach(e){const t=this.attachments[e.toString()];if(void 0!==t){const n=this.attachmentsList.indexOf(t);this.attachmentsList.splice(n,1),t._detach(e)}delete this.attachments[e.toString()]}getAttachment(e){const t=this.attachments[e.toString()];return void 0!==t?t:null}getColor(e=0){const t=this.getAttachment(36064+e);return t?t.target:null}resize(e,t){this.width===e&&this.height===t||(this.width=0|e,this.height=0|t,this._allocate())}bind(){const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.fbo)}clear(){this.gl.clear(17664)}isValid(){const e=this.gl;return e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE}_allocate(){for(var e of this.attachmentsList)e._resize(this.width,this.height)}}},{}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./types");let o=0;class i{constructor(e,t,n,r){this.gl=e,this.program=e.createProgram(),this.vShader=e.createShader(e.VERTEX_SHADER),this.fShader=e.createShader(e.FRAGMENT_SHADER),this.dyns=[],this.ready=!1,e.attachShader(this.program,this.vShader),e.attachShader(this.program,this.fShader),this._uid=0|o++,this._cuid=0|o++,void 0!==t&&void 0!==n&&this.compile(t,n,r)}use(){this.ready||this._grabParameters(),this.gl.useProgram(this.program)}bind(){this.use()}compile(e,t,n){this.ready=!1;const r=this.gl;if(!u(r,this.fShader,(n=void 0===n?"":n+"\n")+t)||!u(r,this.vShader,n+e))return!1;if(r.linkProgram(this.program),!r.getProgramParameter(this.program,r.LINK_STATUS))return i.debug&&s(r.getProgramInfoLog(this.program)),!1;for(;this.dyns.length>0;)delete this[this.dyns.pop()];return this._cuid=0|o++,!0}dispose(){null!==this.gl&&(this.gl.deleteProgram(this.program),this.gl.deleteShader(this.fShader),this.gl.deleteShader(this.vShader))}_grabParameters(){const e=this.gl,t=this.program,n={texIndex:0,ublockIndex:0},o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(var i=0;i<o;++i){var s=e.getActiveUniform(t,i);if(null!==s){var a=s.name,l=a.indexOf("[");l>=0&&(a=a.substring(0,l));var c=e.getUniformLocation(t,s.name);null!==c&&(this[a]=g(s.type,c,e,n),this.dyns.push(a))}else e.getError()}const d=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(var u=0;u<d;++u){var f=e.getActiveAttrib(t,u).name,h=e.getAttribLocation(t,f);this[f]=p(h),this.dyns.push(f)}if((0,r.isWebgl2)(e)){const r=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(var b=0;b<r;++b){var m=e.getActiveUniformBlockName(t,b);this[m]=v(b,e,n),this.dyns.push(m)}}this.ready=!0}}function s(e){console.warn(e)}i.debug=!1;const a=[""," "," "," ",""];function l(e,t){return a[String(t+1).length]+(t+1)+": "+e}const c=/^ERROR:\s?(\d+):(\d+)/;function d(e,t){const n=t.split("\n");e=e.split("\n").map((e=>{const t=c.exec(e);return t&&(e+="\n > "+n[parseInt(t[2])-1]),e})).join("\n"),t=t.split("\n").map(l).join("\n"),s(e),s(t)}function u(e,t,n){return e.shaderSource(t,n),e.compileShader(t),!!e.getShaderParameter(t,e.COMPILE_STATUS)||(i.debug&&d(e.getShaderInfoLog(t),n),!1)}const f={};function h(e){return"uniform"+f[String(e)]}function g(e,t,n,r){switch(e){case n.FLOAT_MAT2:case n.FLOAT_MAT3:case n.FLOAT_MAT4:return function(e,t,n,r){const o=h(e);return function(){arguments.length>0&&void 0!==arguments[0].length&&n[o+"v"](t,arguments.length>1&&!!arguments[1],arguments[0]);return t}}(e,t,n);case n.SAMPLER_2D:case n.SAMPLER_CUBE:case 35682:case 35679:return function(e,t,n,r){const o=r.texIndex++;return function(){return 1===arguments.length&&(void 0!==arguments[0].bind?(arguments[0].bind(o),n.uniform1i(t,o)):n.uniform1i(t,arguments[0])),t}}(0,t,n,r);default:return function(e,t,n,r){const o=h(e);return function(...e){return 1===e.length&&null!=e[0].length?n[o+"v"](t,e[0]):e.length>0&&n[o](t,...e),t}}(e,t,n)}}function v(e,t,n){const r=n.ublockIndex++;return function(){return 1===arguments.length&&(arguments[0]instanceof WebGLBuffer?(t.uniformBlockBinding(this.program,e,r),t.bindBufferBase(t.UNIFORM_BUFFER,r,arguments[0])):t.uniformBlockBinding(this.program,e,arguments[0])),e}}function p(e){return function(){return e}}f[String(5126)]="1f",f[String(35664)]="2f",f[String(35665)]="3f",f[String(35666)]="4f",f[String(35670)]=f[String(5124)]=f[String(35678)]=f[String(35680)]="1i",f[String(35671)]=f[String(35667)]="2i",f[String(35672)]=f[String(35668)]="3i",f[String(35673)]=f[String(35669)]="4i",f[String(35674)]="Matrix2f",f[String(35675)]="Matrix3f",f[String(35676)]="Matrix4f",n.default=i},{"./types":34}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./types");let o=0;const i=36161;n.default=class{constructor(e,t,n=0){if(this.samples=0,this._uid=o++,this.gl=e,this.id=e.createRenderbuffer(),n>0&&(0,r.isWebgl2)(e)){const t=e.getParameter(e.MAX_SAMPLES);this.samples=n>t?t:n}this.width=0,this.height=0,this.format=t||e.DEPTH_COMPONENT16,this._valid=!1,this._storage()}resi