PageSourceSearch

https://acompchemlabexplorer.netlify.app/static/js/main.d7b2e370.js

js acompchemlabexplorer.netlify.app collected 2026-10-03 10:24:30 UTC 777,082 bytes, 3 lines download raw bytes

1/*! For license information please see main.d7b2e370.js.LICENSE.txt */
2(()=>{var __webpack_modules__={188:function(module){var factory;factory=()=>(()=>{var __webpack_modules__={
vendor: 6,170 bytes, line 2
2"./node_modules/iobuffer/lib-esm/IOBuffer.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{IOBuffer:()=>a});var n=r("./node_modules/iobuffer/lib-esm/text.browser.js");const i=(()=>{const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),s={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8192,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!1;"number"===typeof e?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const n=t.offset?t.offset>>>0:0,i=e.byteLength-n;let s=n;(ArrayBuffer.isView(e)||e instanceof a)&&(e.byteLength!==e.buffer.byteLength&&(s=e.byteOffset+n),e=e.buffer),this.lastWrittenByte=r?i:0,this.buffer=e,this.length=i,this.byteLength=i,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,i),this._mark=0,this._marks=[]}available(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.offset+=e,this}back(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(!this.available(e)){const t=2*(this.offset+e),r=new Uint8Array(t);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.readArray(e,"uint8")}readArray(e,t){const r=s[t].BYTES_PER_ELEMENT*e,n=this.byteOffset+this.offset,a=this.buffer.slice(n,n+r);if(this.littleEndian===i&&"uint8"!==t&&"int8"!==t){const e=new Uint8Array(this.buffer.slice(n,n+r));e.reverse();const i=new s[t](e.buffer);return this.offset+=r,i.reverse(),i}const o=new s[t](a);return this.offset+=r,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t="";for(let r=0;r<e;r++)t+=this.readChar();return t}readUtf8(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,n.decode)(this.readBytes(e))}decodeText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return(0,n.decode)(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes((0,n.encode)(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}},
vendor: 2,525 bytes, line 2
2"./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js":function(){"use strict";!function(e){if(e.TextEncoder&&e.TextDecoder)return!1;function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf-8";if("utf-8"!==e)throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('".concat(e,"') is invalid."))}function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf-8",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fatal:!1};if("utf-8"!==e)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('".concat(e,"') is invalid."));if(t.fatal)throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e){if((arguments.length>1&&void 0!==arguments[1]?arguments[1]:{stream:!1}).stream)throw new Error("Failed to encode: the 'stream' option is unsupported.");let t=0;const r=e.length;let n=0,i=Math.max(32,r+(r>>1)+7),s=new Uint8Array(i>>3<<3);for(;t<r;){let a=e.charCodeAt(t++);if(a>=55296&&a<=56319){if(t<r){const r=e.charCodeAt(t);56320===(64512&r)&&(++t,a=((1023&a)<<10)+(1023&r)+65536)}if(a>=55296&&a<=56319)continue}if(n+4>s.length){i+=8,i*=1+t/e.length*2,i=i>>3<<3;const r=new Uint8Array(i);r.set(s),s=r}if(0!==(4294967168&a)){if(0===(4294965248&a))s[n++]=a>>6&31|192;else if(0===(4294901760&a))s[n++]=a>>12&15|224,s[n++]=a>>6&63|128;else{if(0!==(4292870144&a))continue;s[n++]=a>>18&7|240,s[n++]=a>>12&63|128,s[n++]=a>>6&63|128}s[n++]=63&a|128}else s[n++]=a}return s.slice(0,n)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1}),r.prototype.decode=function(e){if((arguments.length>1&&void 0!==arguments[1]?arguments[1]:{stream:!1}).stream)throw new Error("Failed to decode: the 'stream' option is unsupported.");const t=new Uint8Array(e);let r=0;const n=t.length,i=[];for(;r<n;){const e=t[r++];if(0===e)break;if(0===(128&e))i.push(e);else if(192===(224&e)){const n=63&t[r++];i.push((31&e)<<6|n)}else if(224===(240&e)){const n=63&t[r++],s=63&t[r++];i.push((31&e)<<12|n<<6|s)}else if(240===(248&e)){let n=(7&e)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++];n>65535&&(n-=65536,i.push(n>>>10&1023|55296),n=56320|1023&n),i.push(n)}}return String.fromCharCode.apply(null,i)},e.TextEncoder=t,e.TextDecoder=r}("undefined"!==typeof window?window:"undefined"!==typeof self?self:this)},
vendor: 347 bytes, line 2
2"./node_modules/iobuffer/lib-esm/text.browser.js":(e,t,r)=>{"use strict";function n(e){return new TextDecoder(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8").decode(e)}r.r(t),r.d(t,{decode:()=>n,encode:()=>s}),r("./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js");const i=new TextEncoder;function s(e){return i.encode(e)}},
vendor: 586 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/data.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{nonRecord:()=>i,record:()=>s});var n=r("./node_modules/netcdfjs/lib-esm/types.js");function i(e,t){const r=(0,n.str2num)(t.type),i=t.size/(0,n.num2bytes)(r),s=new Array(i);for(let a=0;a<i;a++)s[a]=(0,n.readType)(e,r,1);return s}function s(e,t,r){const i=(0,n.str2num)(t.type),s=t.size?t.size/(0,n.num2bytes)(i):1,a=r.length,o=new Array(a),l=r.recordStep;if(!l)throw new Error("recordDimension.recordStep is undefined");for(let c=0;c<a;c++){const t=e.offset;o[c]=(0,n.readType)(e,i,s),e.seek(t+l)}return o}},
vendor: 2,202 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/header.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{header:()=>u});var n=r("./node_modules/netcdfjs/lib-esm/types.js"),i=r("./node_modules/netcdfjs/lib-esm/utils.js");const s=0,a=10,o=11,l=12,c=0;function u(e,t){const r={version:t},l={length:e.readUint32()},u=function(e){const t={};let r,n;const o=e.readUint32();let l;if(o===s)return(0,i.notNetcdf)(e.readUint32()!==s,"wrong empty tag for list of dimensions"),[];{(0,i.notNetcdf)(o!==a,"wrong tag for list of dimensions");const t=e.readUint32();l=new Array(t);for(let s=0;s<t;s++){const t=(0,i.readName)(e),a=e.readUint32();a===c&&(r=s,n=t),l[s]={name:t,size:a}}}return void 0!==r&&(t.recordId=r),void 0!==n&&(t.recordName=n),t.dimensions=l,t}(e);Array.isArray(u)||(l.id=u.recordId,l.name=u.recordName,r.dimensions=u.dimensions),r.globalAttributes=h(e);const d=function(e,t,r){const a=e.readUint32();let l,c=0;if(a===s)return(0,i.notNetcdf)(e.readUint32()!==s,"wrong empty tag for list of variables"),[];{(0,i.notNetcdf)(a!==o,"wrong tag for list of variables");const s=e.readUint32();l=new Array(s);for(let a=0;a<s;a++){const s=(0,i.readName)(e),o=e.readUint32(),u=new Array(o);for(let t=0;t<o;t++)u[t]=e.readUint32();const d=h(e),f=e.readUint32();(0,i.notNetcdf)(f<1&&f>6,"non valid type ".concat(f));const p=e.readUint32();let m=e.readUint32();2===r&&((0,i.notNetcdf)(m>0,"offsets larger than 4GB not supported"),m=e.readUint32());let g=!1;"undefined"!==typeof t&&u[0]===t&&(c+=p,g=!0),l[a]={name:s,dimensions:u,attributes:d,type:(0,n.num2str)(f),size:p,offset:m,record:g}}}return{variables:l,recordStep:c}}(e,null===l||void 0===l?void 0:l.id,t);return Array.isArray(d)||(r.variables=d.variables,l.recordStep=d.recordStep),r.recordDimension=l,r}function h(e){const t=e.readUint32();let r;if(t===s)return(0,i.notNetcdf)(e.readUint32()!==s,"wrong empty tag for list of attributes"),[];{(0,i.notNetcdf)(t!==l,"wrong tag for list of attributes");const s=e.readUint32();r=new Array(s);for(let t=0;t<s;t++){const s=(0,i.readName)(e),a=e.readUint32();(0,i.notNetcdf)(a<1||a>6,"non valid type ".concat(a));const o=e.readUint32(),l=(0,n.readType)(e,a,o);(0,i.padding)(e),r[t]={name:s,type:(0,n.num2str)(a),value:l}}}return r}},
vendor: 168 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/index.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{NetCDFReader:()=>n.NetCDFReader});var n=r("./node_modules/netcdfjs/lib-esm/parser.js")},
vendor: 1,547 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/parser.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{NetCDFReader:()=>l});var n=r("./node_modules/iobuffer/lib-esm/IOBuffer.js"),i=r("./node_modules/netcdfjs/lib-esm/data.js"),s=r("./node_modules/netcdfjs/lib-esm/header.js"),a=r("./node_modules/netcdfjs/lib-esm/toString.js"),o=r("./node_modules/netcdfjs/lib-esm/utils.js");class l{constructor(e){this.toString=a.toString;const t=new n.IOBuffer(e);t.setBigEndian(),(0,o.notNetcdf)("CDF"!==t.readChars(3),"should start with CDF");const r=t.readByte();(0,o.notNetcdf)(r>2,"unknown version"),this.header=(0,s.header)(t,r),this.buffer=t}get version(){return 1===this.header.version?"classic format":"64-bit offset format"}get recordDimension(){return this.header.recordDimension}get dimensions(){return this.header.dimensions}get globalAttributes(){return this.header.globalAttributes}getAttribute(e){const t=this.globalAttributes.find((t=>t.name===e));return t?t.value:null}getDataVariableAsString(e){const t=this.getDataVariable(e);return t?t.join(""):null}get variables(){return this.header.variables}getDataVariable(e){let t;if(t="string"===typeof e?this.header.variables.find((t=>t.name===e)):e,void 0===t)throw new Error("Not a valid NetCDF v3.x file: variable not found");return this.buffer.seek(t.offset),t.record?(0,i.record)(this.buffer,t,this.header.recordDimension):(0,i.nonRecord)(this.buffer,t)}dataVariableExists(e){return void 0!==this.header.variables.find((t=>t.name===e))}attributeExists(e){return void 0!==this.globalAttributes.find((t=>t.name===e))}}},
vendor: 721 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/toString.js":(e,t,r)=>{"use strict";function n(){const e=[];e.push("DIMENSIONS");for(const r of this.dimensions)e.push("  ".concat(r.name.padEnd(30)," = size: ").concat(r.size));e.push(""),e.push("GLOBAL ATTRIBUTES");for(const r of this.globalAttributes)e.push("  ".concat(r.name.padEnd(30)," = ").concat(r.value));const t=JSON.parse(JSON.stringify(this.variables));e.push(""),e.push("VARIABLES:");for(const r of t){r.value=this.getDataVariable(r);let t=JSON.stringify(r.value);t.length>50&&(t=t.substring(0,50)),isNaN(r.value.length)||(t+=" (length: ".concat(r.value.length,")")),e.push("  ".concat(r.name.padEnd(30)," = ").concat(t))}return e.join("\n")}r.r(t),r.d(t,{toString:()=>n})},
vendor: 1,285 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/types.js":(e,t,r)=>{"use strict";r.r(t),r.d(t,{num2bytes:()=>s,num2str:()=>i,readType:()=>l,str2num:()=>a});const n={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function i(e){switch(Number(e)){case n.BYTE:return"byte";case n.CHAR:return"char";case n.SHORT:return"short";case n.INT:return"int";case n.FLOAT:return"float";case n.DOUBLE:return"double";default:return"undefined"}}function s(e){switch(Number(e)){case n.BYTE:case n.CHAR:return 1;case n.SHORT:return 2;case n.INT:case n.FLOAT:return 4;case n.DOUBLE:return 8;default:return-1}}function a(e){switch(String(e)){case"byte":return n.BYTE;case"char":return n.CHAR;case"short":return n.SHORT;case"int":return n.INT;case"float":return n.FLOAT;case"double":return n.DOUBLE;default:return-1}}function o(e,t){if(1!==e){const r=new Array(e);for(let n=0;n<e;n++)r[n]=t();return r}return t()}function l(e,t,r){switch(t){case n.BYTE:return Array.from(e.readBytes(r));case n.CHAR:return 0===(i=e.readChars(r)).charCodeAt(i.length-1)?i.substring(0,i.length-1):i;case n.SHORT:return o(r,e.readInt16.bind(e));case n.INT:return o(r,e.readInt32.bind(e));case n.FLOAT:return o(r,e.readFloat32.bind(e));case n.DOUBLE:return o(r,e.readFloat64.bind(e));default:throw new Error("non valid type ".concat(t))}var i}},
vendor: 28,784 bytes, line 2
2"./node_modules/netcdfjs/lib-esm/utils.js":(e,t,r)=>{"use strict";function n(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: ".concat(t))}function i(e){e.offset%4!==0&&e.skip(4-e.offset%4)}function s(e){const t=e.readUint32(),r=e.readChars(t);return i(e),r}r.r(t),r.d(t,{notNetcdf:()=>n,padding:()=>i,readName:()=>s})},"./src/WebGL/shaders/lib/basic/basic.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform mat4 viewMatrix;\nuniform float opacity;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\nvoid main() {\n    gl_FragColor = vec4( vColor, opacity );\n    float depth = gl_FragCoord.z / gl_FragCoord.w;\n    float fogFactor = smoothstep( fogNear, fogFar, depth );\n    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}"},"./src/WebGL/shaders/lib/basic/basic.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\n\nattribute vec3 position;\nattribute vec3 color;\n\nvarying vec3 vColor;\n\nvoid main() {\n\n    vColor = color;\n    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n    gl_Position = projectionMatrix * mvPosition;\n\n}"},"./src/WebGL/shaders/lib/instanced/instanced.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform mat4 viewMatrix;\nuniform float opacity;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLightFront;\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n\n    #ifndef WIREFRAME\n    gl_FragColor.xyz *= vLightFront;\n    #endif\n\n    gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n    float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n    float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n}\n\n\n"},"./src/WebGL/shaders/lib/instanced/instanced.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 offset;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\n\nvarying vec3 vColor;\nvarying vec3 vLightFront;\n\nvoid main() {\n\n    vColor = color;\n\n    vec3 objectNormal = normal;\n    vec3 transformedNormal = normalMatrix * objectNormal;\n    vec4 mvPosition = modelViewMatrix * vec4( position * radius + offset, 1.0 );\n\n    vLightFront = vec3( 0.0 );\n\n    transformedNormal = normalize( transformedNormal );\n\n    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n    vec3 dirVector = normalize( lDirection.xyz );\n    float dotProduct = dot( transformedNormal, dirVector );\n    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n\n    gl_Position = projectionMatrix * mvPosition;\n}\n\n"},"./src/WebGL/shaders/lib/lambert/lambert.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform mat4 viewMatrix;\nuniform float opacity;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLightFront;\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n\n    #ifndef WIREFRAME\n    gl_FragColor.xyz *= vLightFront;\n    #endif\n\n    gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n    float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n    float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n}"},"./src/WebGL/shaders/lib/lambert/lambert.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec3 vColor;\nvarying vec3 vLightFront;\n\nvoid main() {\n\n    vColor = color;\n\n    vec3 objectNormal = normal;\n    vec3 transformedNormal = normalMatrix * objectNormal;\n    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n    vLightFront = vec3( 0.0 );\n\n    transformedNormal = normalize( transformedNormal );\n\n    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n    vec3 dirVector = normalize( lDirection.xyz );\n    float dotProduct = dot( transformedNormal, dirVector );\n    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n\n    gl_Position = projectionMatrix * mvPosition;\n}"},"./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 viewMatrix;\nuniform float opacity;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLightFront;\nvarying vec3 vLightBack;\n\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n\n    #ifndef WIREFRAME\n    if ( gl_FrontFacing )\n       gl_FragColor.xyz *= vLightFront;\n    else\n       gl_FragColor.xyz *= vLightBack;\n    #endif\n\n    gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n    float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n    float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n}\n\n\n"},"./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec3 vColor;\nvarying vec3 vLightFront;\nvarying vec3 vLightBack;\n\nvoid main() {\n\n    vColor = color;\n\n    vec3 objectNormal = normal;\n    vec3 transformedNormal = normalMatrix * objectNormal;\n    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n    vLightFront = vec3( 0.0 );\n    vLightBack = vec3( 0.0 );\n\n    transformedNormal = normalize( transformedNormal );\n\n    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n    vec3 dirVector = normalize( lDirection.xyz );\n    float dotProduct = dot( transformedNormal, dirVector );\n    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n    vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n    vLightBack += directionalLightColor[ 0 ] * directionalLightWeightingBack;\n\n    gl_Position = projectionMatrix * mvPosition;\n}\n\n"},"./src/WebGL/shaders/lib/outline/outline.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform float opacity;\nuniform vec3 outlineColor;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n    gl_FragColor = vec4( outlineColor, 1 );\n}\n\n\n"},"./src/WebGL/shaders/lib/outline/outline.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float outlineWidth;\nuniform float outlinePushback;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvoid main() {\n\n    vec4 norm = modelViewMatrix*vec4(normalize(normal),0.0);\n    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n    mvPosition.xy += norm.xy*outlineWidth;\n    gl_Position = projectionMatrix * mvPosition;\n    mvPosition.z -= outlinePushback; //go backwards in model space\n    vec4 pushpos = projectionMatrix*mvPosition; //project to get z in projection space, I'm probably missing some simple math to do the same thing..\n    gl_Position.z = gl_Position.w*pushpos.z/pushpos.w;\n}\n\n"},"./src/WebGL/shaders/lib/screen/screen.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform sampler2D colormap;\nvarying highp vec2 vTexCoords;\nuniform vec2 dimensions;\n//DEFINEFRAGCOLOR\nvoid main (void) {\n   gl_FragColor = texture2D(colormap, vTexCoords);\n}\n        "},"./src/WebGL/shaders/lib/screen/screen.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="attribute vec2 vertexPosition;\nvarying highp vec2 vTexCoords;\nconst vec2 scale = vec2(0.5, 0.5);\n\nvoid main() {\n   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range\n   gl_Position = vec4(vertexPosition, 0.0, 1.0);\n}\n        "},"./src/WebGL/shaders/lib/screenaa/screenaa.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform sampler2D colormap;\nvarying highp vec2 vTexCoords;\nuniform vec2 dimensions;\n\n// Basic FXAA implementation based on the code on geeks3d.com \n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#define FXAA_SPAN_MAX 8.0\n\nvec4 applyFXAA(vec2 fragCoord, sampler2D tex)\n{\n    vec4 color;\n    vec2 inverseVP = vec2(1.0 / dimensions.x, 1.0 / dimensions.y);\n    vec3 rgbNW = texture2D(tex, fragCoord + vec2(-1.0, -1.0) * inverseVP).xyz;\n    vec3 rgbNE = texture2D(tex, fragCoord + vec2(1.0, -1.0) * inverseVP).xyz;\n    vec3 rgbSW = texture2D(tex, fragCoord + vec2(-1.0, 1.0) * inverseVP).xyz;\n    vec3 rgbSE = texture2D(tex, fragCoord + vec2(1.0, 1.0) * inverseVP).xyz;\n    vec3 rgbM  = texture2D(tex, fragCoord  * inverseVP).xyz;\n    vec3 luma = vec3(0.299, 0.587, 0.114);\n    float lumaNW = dot(rgbNW, luma);\n    float lumaNE = dot(rgbNE, luma);\n    float lumaSW = dot(rgbSW, luma);\n    float lumaSE = dot(rgbSE, luma);\n    float lumaM  = dot(rgbM,  luma);\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n    vec2 dir;\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n                        (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n            max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n            dir * rcpDirMin)) * inverseVP;\n\n    vec3 rgbA = 0.5 * (\n        texture2D(tex, fragCoord + dir * (1.0 / 3.0 - 0.5)).xyz +\n        texture2D(tex, fragCoord  + dir * (2.0 / 3.0 - 0.5)).xyz);\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\n        texture2D(tex, fragCoord  + dir * -0.5).xyz +\n        texture2D(tex, fragCoord  + dir * 0.5).xyz);\n\n    float lumaB = dot(rgbB, luma);\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\n        color = vec4(rgbA, 1.0);\n    else\n        color = vec4(rgbB, 1.0);\n    return color;\n}\n//DEFINEFRAGCOLOR\nvoid main (void) {\n   gl_FragColor = applyFXAA(vTexCoords, colormap);\n}\n        "},"./src/WebGL/shaders/lib/screenaa/screenaa.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="attribute vec2 vertexPosition;\nvarying highp vec2 vTexCoords;\nconst vec2 scale = vec2(0.5, 0.5);\n\nvoid main() {\n   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range\n   gl_Position = vec4(vertexPosition, 0.0, 1.0);\n}\n        "},"./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\nuniform mat4 viewMatrix;\nuniform float opacity;\nuniform mat4 projectionMatrix;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nuniform float uDepth;\nuniform vec3 directionalLightColor[ 1 ];\n\nvarying vec3 vColor;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 vLight;\nvarying vec3 center;\n\n//DEFINEFRAGCOLOR\n\nvoid main() {\n    float lensqr = dot(mapping,mapping);\n    float rsqr = rval*rval;\n    if(lensqr > rsqr)\n       discard;\n    float z = sqrt(rsqr-lensqr);\n    vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z);\n    vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);\n    float ndcDepth = clipPos.z / clipPos.w;\n    gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n    vec3 norm = normalize(vec3(mapping.x,mapping.y,z));\n    float dotProduct = dot( norm, vLight );\n    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n    vec3 vLight = directionalLightColor[ 0 ] * directionalLightWeighting;\n    gl_FragColor = vec4(vLight*vColor, opacity*opacity );\n    float fogFactor = smoothstep( fogNear, fogFar, gl_FragDepthEXT/gl_FragCoord.w );\n    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n\n}\n\n"},"./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec2 mapping;\nvarying vec3 vColor;\nvarying float rval;\nvarying vec3 vLight;\nvarying vec3 center;\n\nvoid main() {\n\n    vColor = color;\n    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n    center = mvPosition.xyz;\n    vec4 projPosition = projectionMatrix * mvPosition;\n    vec4 adjust = projectionMatrix* vec4(normal,0.0); adjust.z = 0.0; adjust.w = 0.0;\n    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n    vLight = normalize( lDirection.xyz );\n    mapping = normal.xy;\n    rval = abs(normal.x);\n    gl_Position = projPosition+adjust;\n\n}\n"},"./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform float opacity;\nuniform vec3 outlineColor;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nuniform mat4 projectionMatrix;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 center;\n\nuniform float outlinePushback;\n\n//DEFINEFRAGCOLOR\n\nvoid main() {\n    float lensqr = dot(mapping,mapping);\n    float rsqr = rval*rval;\n    if(lensqr > rsqr)\n       discard;\n    float z = sqrt(rsqr-lensqr);\n    vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z-outlinePushback);\n    vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);\n    float ndcDepth = clipPos.z / clipPos.w;\n    gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n    gl_FragColor = vec4(outlineColor, 1 );\n}\n\n\n"},"./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float outlineWidth;\nuniform float outlinePushback;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 center;\n\nvoid main() {\n\n    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n    center = mvPosition.xyz;\n    vec4 projPosition = projectionMatrix * mvPosition;\n    vec2 norm = normal.xy + vec2(sign(normal.x)*outlineWidth,sign(normal.y)*outlineWidth);\n    vec4 adjust = projectionMatrix* vec4(norm,normal.z,0.0); adjust.z = 0.0; adjust.w = 0.0;\n    mapping = norm.xy;\n    rval = abs(norm.x);\n    gl_Position = projPosition+adjust;\n}\n\n"},"./src/WebGL/shaders/lib/sprite/sprite.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\n\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\n\nvarying vec2 vUV;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n    vec4 texture = texture2D(map, vUV);\n\n    if (texture.a < alphaTest) discard;\n\n    gl_FragColor = vec4(color * texture.xyz, texture.a * opacity);\n\n    if (fogType > 0) {\n\n        float depth = gl_FragCoord.z / gl_FragCoord.w;\n        float fogFactor = 0.0;\n\n        if (fogType == 1) {\n            fogFactor = smoothstep(fogNear, fogFar, depth);\n        }\n\n        else {\n            const float LOG2 = 1.442695;\n            float fogFactor = exp2(- fogDensity * fogDensity * depth * depth * LOG2);\n            fogFactor = 1.0 - clamp(fogFactor, 0.0, 1.0);\n        }\n\n        gl_FragColor = mix(gl_FragColor, vec4(fogColor, gl_FragColor.w), fogFactor);\n\n    }\n}\n\n"},"./src/WebGL/shaders/lib/sprite/sprite.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform int useScreenCoordinates;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\n\nattribute vec2 position;\nattribute vec2 uv;\n\nvarying vec2 vUV;\n\nvoid main() {\n\n    vUV = uvOffset + uv * uvScale;\n\n    vec2 alignedPosition = position + alignment;\n\n    vec2 rotatedPosition;\n    rotatedPosition.x = ( cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y ) * scale.x;\n    rotatedPosition.y = ( sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y ) * scale.y;\n\n    vec4 finalPosition;\n\n    if(useScreenCoordinates != 0) {\n        finalPosition = vec4(screenPosition.xy + rotatedPosition, screenPosition.z, 1.0);\n    }\n\n    else {\n        finalPosition = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0); finalPosition /= finalPosition.w;\n        finalPosition.xy += rotatedPosition; \n    }\n\n    gl_Position = finalPosition;\n\n}\n\n"},"./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="    float dotProduct = dot( norm, vLight );\n    vec3 light = vec3( max( dotProduct, 0.0 ) );\n    gl_FragColor = vec4(light*color, opacity*opacity );\n    float fogFactor = smoothstep( fogNear, fogFar, depth );\n    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}"},"./src/WebGL/shaders/lib/stickimposter/stickimposter.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\n\nvarying vec3 vColor;\nvarying vec3 vLight;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\n\nvoid main() {\n\n    vColor = color; vColor.z = abs(vColor.z); //z indicates which vertex and so would vary\n    r = abs(radius);\n    vec4 to = modelViewMatrix*vec4(normal, 1.0); //normal is other point of cylinder\n    vec4 pt = modelViewMatrix*vec4(position, 1.0);\n    vec4 mvPosition = pt;\n    p1 = pt.xyz; p2 = to.xyz;\n    vec3 norm = to.xyz-pt.xyz;\n    float mult = 1.1; //slop to account for perspective of sphere\n    if(length(p1) > length(p2)) { //billboard at level of closest point\n       mvPosition = to;\n    }\n    vec3 n = normalize(mvPosition.xyz);\n//intersect with the plane defined by the camera looking at the billboard point\n    if(color.z >= 0.0) { //p1\n       if(projectionMatrix[3][3] == 0.0) { //perspective\n         vec3 pnorm = normalize(p1);\n         float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);\n         mvPosition.xyz = p1+t*pnorm; \n       } else { //orthographic\n         mvPosition.xyz = p1;\n       }\n    } else {\n      if(projectionMatrix[3][3] == 0.0) { //perspective\n         vec3 pnorm = normalize(p2);\n         float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);\n         mvPosition.xyz = p2+t*pnorm;\n       } else { //orthographic\n         mvPosition.xyz = p2;\n       } \n       mult *= -1.0;\n    }\n    vec3 cr = normalize(cross(mvPosition.xyz,norm))*radius;\n    vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*radius;\n    mvPosition.xyz +=  mult*(cr + doublecr).xyz;\n    cposition = mvPosition.xyz;\n    gl_Position = projectionMatrix * mvPosition;\n    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n    vLight = normalize( lDirection.xyz )*directionalLightColor[0]; //not really sure this is right, but color is always white so..\n}\n\n"},"./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nuniform vec3 outlineColor;\nuniform float outlineWidth;\nuniform float outlinePushback;\n\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\n\nvarying vec3 vColor;\nvarying vec3 vLight;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\n\nvoid main() {\n\n    vColor = outlineColor;\n    float rad = radius+sign(radius)*outlineWidth;\n    r = abs(rad);\n    vec4 to = modelViewMatrix*vec4(normal, 1.0); //normal is other point of cylinder\n    vec4 pt = modelViewMatrix*vec4(position, 1.0);\n//pushback\n    to.xyz += normalize(to.xyz)*outlinePushback;\n    pt.xyz += normalize(pt.xyz)*outlinePushback;\n\n    vec4 mvPosition = pt;\n    p1 = pt.xyz; p2 = to.xyz;\n    vec3 norm = to.xyz-pt.xyz;\n    float mult = 1.1; //slop to account for perspective of sphere\n    if(length(p1) > length(p2)) { //billboard at level of closest point\n       mvPosition = to;\n    }\n    vec3 n = normalize(mvPosition.xyz);\n//intersect with the plane defined by the camera looking at the billboard point\n    if(color.z >= 0.0) { //p1\n       vec3 pnorm = normalize(p1);\n       float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);\n       mvPosition.xyz = p1+t*pnorm;\n    } else {\n       vec3 pnorm = normalize(p2);\n       float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);\n       mvPosition.xyz = p2+t*pnorm;\n       mult *= -1.0;\n    }\n    vec3 cr = normalize(cross(mvPosition.xyz,norm))*rad;\n    vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*rad;\n    mvPosition.xy +=  mult*(cr + doublecr).xy;\n    cposition = mvPosition.xyz;\n    gl_Position = projectionMatrix * mvPosition;\n    vLight = vec3(1.0,1.0,1.0);\n}\n\n"},"./src/WebGL/shaders/lib/volumetric/volumetric.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="\nuniform highp sampler3D data;\nuniform highp sampler2D colormap;\nuniform highp sampler2D depthmap;\n\n\nuniform mat4 textmat;\nuniform mat4 projinv;\nuniform mat4 projectionMatrix;\n\nuniform float step;\nuniform float subsamples;\nuniform float maxdepth;\nuniform float transfermin;\nuniform float transfermax;\nin  vec4 mvPosition;\nout vec4 color;\nvoid main(void) {\n\n   vec4 pos = mvPosition;\n   bool seengood = false;\n   float i = 0.0;\n   color = vec4(1,1,1,0);\n   float increment = 1.0/subsamples;\n   float maxsteps = (maxdepth*subsamples/step);\n//there's probably a better way to do this..\n//calculate farthest possible point in model coordinates\n   vec4 maxpos = vec4(pos.x,pos.y,pos.z-maxdepth,1.0);\n// convert to projection\n   maxpos = projectionMatrix*maxpos;\n   vec4 startp = projectionMatrix*pos;\n// homogonize\n   maxpos /= maxpos.w;\n   startp /= startp.w;\n//take x,y from start and z from max\n   maxpos = vec4(startp.x,startp.y,maxpos.z,1.0);\n//convert back to model space\n   maxpos = projinv*maxpos;\n   maxpos /= maxpos.w;\n   float incr = step/subsamples;\n//get depth from depthmap\n//startp is apparently [-1,1]\n   vec2 tpos = startp.xy/2.0+0.5;\n   float depth = texture(depthmap, tpos).r;\n//compute vector between start and end\n   vec4 direction = maxpos-pos;\n   for( i = 0.0; i <= maxsteps; i++) {\n      vec4 pt = (pos+(i/maxsteps)*direction);\n      vec4 ppt = projectionMatrix*pt;\n      float ptdepth = ppt.z/ppt.w;\n      ptdepth = ((gl_DepthRange.diff * ptdepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n      if(ptdepth > depth) break;\n      pt = textmat*pt;\n//       pt /= pt.w;\n      if(pt.x >= -0.01 && pt.y >= -0.01 && pt.z >= -0.01 && pt.x <= 1.01 && pt.y <= 1.01 && pt.z <= 1.01) {\n         seengood = true;\n      } else if(seengood) {\n         break;\n      }\n      if( pt.x < -0.01 || pt.x > 1.01 || pt.y < -0.01 || pt.y > 1.01 || pt.z < -0.01 || pt.z > 1.01  ){\n          color.a = 0.0;\n          continue;\n      }\n      else {\n         float val = texture(data, pt.zyx).r;\n         if(isinf(val)) continue; //masked out\n         float cval = (val-transfermin)/(transfermax-transfermin); //scale to texture 0-1 range\n         vec4 val_color = texture(colormap, vec2(cval,0.5));\n         color.rgb = color.rgb*color.a + (1.0-color.a)*val_color.a*val_color.rgb;\n         color.a += (1.0 - color.a) * val_color.a; \n         if(color.a > 0.0) color.rgb /= color.a;\n//          color = vec4(pt.x, pt.y, pt.z, 1.0);\n      }\n//       color = vec4(pt.x, pt.y, pt.z, 0.0)\n    }\n}\n\n        "},"./src/WebGL/shaders/lib/volumetric/volumetric.vert":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\n\nin vec3 position;\nout vec4 mvPosition;\nvoid main() {\n\n    mvPosition = modelViewMatrix * vec4( position, 1.0 );\n    gl_Position = projectionMatrix*mvPosition;\n}\n"},"./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag":(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="uniform float opacity;\nuniform mat4 projectionMatrix;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLight;\nvarying vec3 vColor;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\n\n//DEFINEFRAGCOLOR\n\n//cylinder-ray intersection testing taken from http://mrl.nyu.edu/~dzorin/cg05/lecture12.pdf\n//also useful: http://stackoverflow.com/questions/9595300/cylinder-impostor-in-glsl\n//with a bit more care (caps) this could be a general cylinder imposter (see also outline)\nvoid main() {\n    vec3 color = abs(vColor);\n    vec3 pos = cposition;\n    vec3 p = pos; //ray point\n    vec3 v = vec3(0.0,0.0,-1.0); //ray normal - orthographic\n    if(projectionMatrix[3][3] == 0.0) v = normalize(pos); //ray normal - perspective\n    vec3 pa = p1; //cyl start\n    vec3 va = normalize(p2-p1); //cyl norm\n    vec3 tmp1 = v-(dot(v,va)*va);\n    vec3 deltap = p-pa;\n    float A = dot(tmp1,tmp1);\n    if(A == 0.0) discard;\n    vec3 tmp2 = deltap-(dot(deltap,va)*va);\n    float B = 2.0*dot(tmp1, tmp2);\n    float C = dot(tmp2,tmp2)-r*r;\n//quadratic equation!\n    float det = (B*B) - (4.0*A*C);\n    if(det < 0.0) discard;\n    float sqrtDet = sqrt(det);\n    float posT = (-B+sqrtDet)/(2.0*A);\n    float negT = (-B-sqrtDet)/(2.0*A);\n    float intersectionT = min(posT,negT);\n    vec3 qi = p+v*intersectionT;\n    float dotp1 = dot(va,qi-p1);\n    float dotp2 = dot(va,qi-p2);\n    vec3 norm;\n    if( dotp1 < 0.0 || dotp2 > 0.0) { //(p-c)^2 + 2(p-c)vt +v^2+t^2 - r^2 = 0\n       vec3 cp;\n       if( dotp1 < 0.0) {  \n//        if(vColor.x < 0.0 ) discard; //color sign bit indicates if we should cap or not\n        cp = p1;\n       } else {\n//          if(vColor.y < 0.0 ) discard;\n          cp = p2;\n       }\n       vec3 diff = p-cp;\n       A = dot(v,v);\n       B = dot(diff,v)*2.0;\n       C = dot(diff,diff)-r*r;\n       det = (B*B) - (4.0*C);\n       if(det < 0.0) discard;\n       sqrtDet = sqrt(det);\n       posT = (-B+sqrtDet)/(2.0);\n       negT = (-B-sqrtDet)/(2.0);\n       float t = min(posT,negT);\n       qi = p+v*t; \n       norm = normalize(qi-cp); \n    } else {\n       norm = normalize(qi-(dotp1*va + p1));\n    }\n    vec4 clipPos = projectionMatrix * vec4(qi, 1.0);\n    float ndcDepth = clipPos.z / clipPos.w;\n    float depth = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n    gl_FragDepthEXT = depth;"},
vendor: 16,380 bytes, line 2
2"./src/GLDraw.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{CAP:()=>n,GLDraw:()=>i});var n,i,s=r("./src/WebGL/math/index.ts");!function(e){e[e.NONE=0]="NONE",e[e.FLAT=1]="FLAT",e[e.ROUND=2]="ROUND"}(n||(n={})),function(e){function t(e,t,r){var n,i,s,a,o,l=Math.hypot(e,t);l<1e-4?(i=0,s=1):(i=-e/l,s=t/l),t=-i*e+s*t,(n=Math.hypot(t,r))<1e-4?(a=0,o=1):(a=r/n,o=t/n);var c=new Float32Array(9);return c[0]=s,c[1]=i,c[2]=0,c[3]=-i*o,c[4]=s*o,c[5]=a,c[6]=i*a,c[7]=-s*a,c[8]=o,c}var r=new class{constructor(){this.cache={};let e,t=[],r=Math.pow(2,4),n=2,i=Math.pow(2,n),a=r/i;for(t[0]=new s.Vector3(-1,0,0),t[a]=new s.Vector3(0,0,1),t[2*a]=new s.Vector3(1,0,0),t[3*a]=new s.Vector3(0,0,-1),n=3;n<=4;n++){for(i=Math.pow(2,n-1),a=r/i,e=0;e<i-1;e++)t[a/2+e*a]=t[e*a].clone().add(t[(e+1)*a]).normalize();e=i-1,t[a/2+e*a]=t[e*a].clone().add(t[0]).normalize()}this.basisVectors=t}getVerticesForRadius(e,t,r){if("undefined"!==typeof this.cache&&void 0!==this.cache[e]&&void 0!==this.cache[e][t+r])return this.cache[e][t+r];for(var i,a=this.basisVectors.length,o=[],l=[],c=0;c<a;c++)o.push(this.basisVectors[c].clone().multiplyScalar(e)),o.push(this.basisVectors[c].clone().multiplyScalar(e)),i=this.basisVectors[c].clone().normalize(),l.push(i),l.push(i);var u,h,d=[],f=10,p=a,m=2*Math.PI,g=Math.PI,v=!1,b=!1;for(h=0;h<=f;h++){v=0===h||h===f,b=5===h;var y=[],_=[];for(u=0;u<=p;u++)if(b){var w=u<p?2*u:0;_.push(w+1),y.push(w)}else{var x=u/p,S=h/f;if(v&&0!==u)v&&y.push(o.length-1);else if(u<p){var C=new s.Vector3;C.x=-e*Math.cos(0+x*m)*Math.sin(0+S*g),C.y=1==t?0:e*Math.cos(0+S*g),C.z=e*Math.sin(0+x*m)*Math.sin(0+S*g),Math.abs(C.x)<1e-5&&(C.x=0),Math.abs(C.y)<1e-5&&(C.y=0),Math.abs(C.z)<1e-5&&(C.z=0),t==n.FLAT?(i=new s.Vector3(0,Math.cos(0+S*g),0)).normalize():(i=new s.Vector3(C.x,C.y,C.z)).normalize(),o.push(C),l.push(i),y.push(o.length-1)}else y.push(o.length-p)}b&&d.push(_),d.push(y)}var k={vertices:o,normals:l,verticesRows:d,w:p,h:f};return e in this.cache||(this.cache[e]={}),this.cache[e][t+r]=k,k}};e.drawCylinder=function(e,n,i,s,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(n&&i){var c=l||o;a=a||{r:0,g:0,b:0};var u,h,d,f,p,m,g=t(i.x-n.x,i.y-n.y,i.z-n.z),v=r.getVerticesForRadius(s,l,"to"),b=v.w,y=v.h,_=c?y*b+2:2*b,w=e.updateGeoGroup(_),x=v.vertices,S=v.normals,C=v.verticesRows,k=C[y/2],E=C[y/2+1],A=w.vertices,L=w.vertexArray,M=w.normalArray,z=w.colorArray,T=w.faceArray;for(d=0;d<b;++d){var O=2*d;f=g[0]*x[O].x+g[3]*x[O].y+g[6]*x[O].z,p=g[1]*x[O].x+g[4]*x[O].y+g[7]*x[O].z,m=g[5]*x[O].y+g[8]*x[O].z,u=3*(A+O),h=w.faceidx,L[u]=f+n.x,L[u+1]=p+n.y,L[u+2]=m+n.z,L[u+3]=f+i.x,L[u+4]=p+i.y,L[u+5]=m+i.z,M[u]=f,M[u+3]=f,M[u+1]=p,M[u+4]=p,M[u+2]=m,M[u+5]=m,z[u]=a.r,z[u+3]=a.r,z[u+1]=a.g,z[u+4]=a.g,z[u+2]=a.b,z[u+5]=a.b,T[h]=E[d]+A,T[h+1]=E[d+1]+A,T[h+2]=k[d]+A,T[h+3]=k[d]+A,T[h+4]=E[d+1]+A,T[h+5]=k[d+1]+A,w.faceidx+=6}if(c){var P,D,N,F,R,I,j,G,B,U,W,V,H,q,Y,Z,X,K,$,Q,J,ee,te,re,ne,ie,se,ae,oe,le,ce,ue,he=o?y+1:y/2+1;for(p=l?0:y/2;p<he;p++)if(p!==y/2){var de=p<=y/2?i:n,fe=r.getVerticesForRadius(s,l,"to"),pe=r.getVerticesForRadius(s,o,"from");for(de===i?(x=fe.vertices,S=fe.normals,C=fe.verticesRows):de==n&&(x=pe.vertices,S=pe.normals,C=pe.verticesRows),f=0;f<b;f++)h=w.faceidx,oe=3*((P=C[p][f+1])+A),le=3*((D=C[p][f])+A),ce=3*((N=C[p+1][f])+A),ue=3*((F=C[p+1][f+1])+A),R=g[0]*x[P].x+g[3]*x[P].y+g[6]*x[P].z,I=g[0]*x[D].x+g[3]*x[D].y+g[6]*x[D].z,j=g[0]*x[N].x+g[3]*x[N].y+g[6]*x[N].z,G=g[0]*x[F].x+g[3]*x[F].y+g[6]*x[F].z,B=g[1]*x[P].x+g[4]*x[P].y+g[7]*x[P].z,U=g[1]*x[D].x+g[4]*x[D].y+g[7]*x[D].z,W=g[1]*x[N].x+g[4]*x[N].y+g[7]*x[N].z,V=g[1]*x[F].x+g[4]*x[F].y+g[7]*x[F].z,H=g[5]*x[P].y+g[8]*x[P].z,q=g[5]*x[D].y+g[8]*x[D].z,Y=g[5]*x[N].y+g[8]*x[N].z,Z=g[5]*x[F].y+g[8]*x[F].z,L[oe]=R+de.x,L[le]=I+de.x,L[ce]=j+de.x,L[ue]=G+de.x,L[oe+1]=B+de.y,L[le+1]=U+de.y,L[ce+1]=W+de.y,L[ue+1]=V+de.y,L[oe+2]=H+de.z,L[le+2]=q+de.z,L[ce+2]=Y+de.z,L[ue+2]=Z+de.z,z[oe]=a.r,z[le]=a.r,z[ce]=a.r,z[ue]=a.r,z[oe+1]=a.g,z[le+1]=a.g,z[ce+1]=a.g,z[ue+1]=a.g,z[oe+2]=a.b,z[le+2]=a.b,z[ce+2]=a.b,z[ue+2]=a.b,X=g[0]*S[P].x+g[3]*S[P].y+g[6]*S[P].z,K=g[0]*S[D].x+g[3]*S[D].y+g[6]*S[D].z,$=g[0]*S[N].x+g[3]*S[N].y+g[6]*S[N].z,Q=g[0]*S[F].x+g[3]*S[F].y+g[6]*S[F].z,J=g[1]*S[P].x+g[4]*S[P].y+g[7]*S[P].z,ee=g[1]*S[D].x+g[4]*S[D].y+g[7]*S[D].z,te=g[1]*S[N].x+g[4]*S[N].y+g[7]*S[N].z,re=g[1]*S[F].x+g[4]*S[F].y+g[7]*S[F].z,ne=g[5]*S[P].y+g[8]*S[P].z,ie=g[5]*S[D].y+g[8]*S[D].z,se=g[5]*S[N].y+g[8]*S[N].z,ae=g[5]*S[F].y+g[8]*S[F].z,0===p?(M[oe]=X,M[ce]=$,M[ue]=Q,M[oe+1]=J,M[ce+1]=te,M[ue+1]=re,M[oe+2]=ne,M[ce+2]=se,M[ue+2]=ae,T[h]=P+A,T[h+1]=N+A,T[h+2]=F+A,w.faceidx+=3):p===he-1?(M[oe]=X,M[le]=K,M[ce]=$,M[oe+1]=J,M[le+1]=ee,M[ce+1]=te,M[oe+2]=ne,M[le+2]=ie,M[ce+2]=se,T[h]=P+A,T[h+1]=D+A,T[h+2]=N+A,w.faceidx+=3):(M[oe]=X,M[le]=K,M[ue]=Q,M[oe+1]=J,M[le+1]=ee,M[ue+1]=re,M[oe+2]=ne,M[le+2]=ie,M[ue+2]=ae,M[le]=K,M[ce]=$,M[ue]=Q,M[le+1]=ee,M[ce+1]=te,M[ue+1]=re,M[le+2]=ie,M[ce+2]=se,M[ue+2]=ae,T[h]=P+A,T[h+1]=D+A,T[h+2]=F+A,T[h+3]=D+A,T[h+4]=N+A,T[h+5]=F+A,w.faceidx+=6)}}w.vertices+=_}},e.drawCone=function(e,n,i,a,o){if(!n||!i)return;o=o||{r:0,g:0,b:0};let l=new s.Vector3(i.x-n.x,i.y-n.y,i.z-n.z);var c=t(l.x,l.y,l.z);l=l.normalize();var u,h,d,f,p,m,g=r.basisVectors.length,v=r.basisVectors,b=g+2,y=e.updateGeoGroup(b),_=y.vertices,w=y.vertexArray,x=y.normalArray,S=y.colorArray,C=y.faceArray;for(w[u=3*_]=n.x,w[u+1]=n.y,w[u+2]=n.z,x[u]=-l.x,x[u+1]=-l.y,x[u+2]=-l.z,S[u]=o.r,S[u+1]=o.g,S[u+2]=o.b,w[u+3]=i.x,w[u+4]=i.y,w[u+5]=i.z,x[u+3]=l.x,x[u+4]=l.y,x[u+5]=l.z,S[u+3]=o.r,S[u+4]=o.g,S[u+5]=o.b,u+=6,d=0;d<g;++d){var k=v[d].clone();k.multiplyScalar(a),f=c[0]*k.x+c[3]*k.y+c[6]*k.z,p=c[1]*k.x+c[4]*k.y+c[7]*k.z,m=c[5]*k.y+c[8]*k.z,w[u]=f+n.x,w[u+1]=p+n.y,w[u+2]=m+n.z,x[u]=f,x[u+1]=p,x[u+2]=m,S[u]=o.r,S[u+1]=o.g,S[u+2]=o.b,u+=3}for(y.vertices+=g+2,h=y.faceidx,d=0;d<g;d++){var E=_+2+d,A=_+2+(d+1)%g;C[h]=E,C[h+1]=A,C[h+2]=_,C[h+=3]=E,C[h+1]=A,C[h+2]=_+1,h+=3}y.faceidx+=6*g};var i=new class{constructor(){this.cache=new Map}getVerticesForRadius(e,t){t=t||2,this.cache.has(t)||this.cache.set(t,new Map);let r=this.cache.get(t);if(r.has(e))return r.get(e);var n={vertices:[],verticesRows:[],normals:[]},i=16*t,a=10*t;e<1&&(i=10*t,a=8*t);var o,l,c=2*Math.PI,u=Math.PI;for(l=0;l<=a;l++){let t=[];for(o=0;o<=i;o++){let r=o/i,d=l/a,f=-e*Math.cos(0+r*c)*Math.sin(0+d*u),p=e*Math.cos(0+d*u),m=e*Math.sin(0+r*c)*Math.sin(0+d*u);var h=new s.Vector3(f,p,m);h.normalize(),n.vertices.push({x:f,y:p,z:m}),n.normals.push(h),t.push(n.vertices.length-1)}n.verticesRows.push(t)}return r.set(e,n),n}};e.drawSphere=function(e,t,r,n,s){var a=i.getVerticesForRadius(r,s),o=a.vertices,l=a.normals,c=e.updateGeoGroup(o.length),u=c.vertices,h=c.vertexArray,d=c.colorArray,f=c.faceArray,p=c.lineArray,m=c.normalArray;for(let i=0,b=o.length;i<b;++i){let e=3*(u+i),r=o[i];h[e]=r.x+t.x,h[e+1]=r.y+t.y,h[e+2]=r.z+t.z,d[e]=n.r,d[e+1]=n.g,d[e+2]=n.b}c.vertices+=o.length;let g=a.verticesRows,v=g.length-1;for(let i=0;i<v;i++){let e=g[i].length-1;for(let t=0;t<e;t++){let e=c.faceidx,n=c.lineidx,s=g[i][t+1]+u,a=3*s,h=g[i][t]+u,d=3*h,v=g[i+1][t]+u,b=3*v,y=g[i+1][t+1]+u,_=3*y,w=l[s-u],x=l[h-u],S=l[v-u],C=l[y-u];Math.abs(o[s-u].y)===r?(m[a]=w.x,m[b]=S.x,m[_]=C.x,m[a+1]=w.y,m[b+1]=S.y,m[_+1]=C.y,m[a+2]=w.z,m[b+2]=S.z,m[_+2]=C.z,f[e]=s,f[e+1]=v,f[e+2]=y,p[n]=s,p[n+1]=v,p[n+2]=s,p[n+3]=y,p[n+4]=v,p[n+5]=y,c.faceidx+=3,c.lineidx+=6):Math.abs(o[v-u].y)===r?(m[a]=w.x,m[d]=x.x,m[b]=S.x,m[a+1]=w.y,m[d+1]=x.y,m[b+1]=S.y,m[a+2]=w.z,m[d+2]=x.z,m[b+2]=S.z,f[e]=s,f[e+1]=h,f[e+2]=v,p[n]=s,p[n+1]=h,p[n+2]=s,p[n+3]=v,p[n+4]=h,p[n+5]=v,c.faceidx+=3,c.lineidx+=6):(m[a]=w.x,m[d]=x.x,m[_]=C.x,m[a+1]=w.y,m[d+1]=x.y,m[_+1]=C.y,m[a+2]=w.z,m[d+2]=x.z,m[_+2]=C.z,m[d]=x.x,m[b]=S.x,m[_]=C.x,m[d+1]=x.y,m[b+1]=S.y,m[_+1]=C.y,m[d+2]=x.z,m[b+2]=S.z,m[_+2]=C.z,f[e]=s,f[e+1]=h,f[e+2]=y,f[e+3]=h,f[e+4]=v,f[e+5]=y,p[n]=s,p[n+1]=h,p[n+2]=s,p[n+3]=y,p[n+4]=h,p[n+5]=v,p[n+6]=v,p[n+7]=y,c.faceidx+=6,c.lineidx+=8)}}}}(i||(i={}))},"./src/GLModel.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{GLModel:()=>g});var n=r("./src/WebGL/index.ts"),i=r("./src/WebGL/shapes/index.ts"),s=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts"),o=r("./src/GLDraw.ts"),l=r("./src/glcartoon.ts"),c=r("./src/utilities.ts"),u=r("./src/Gradient.ts"),h=r("./src/parsers/index.ts"),d=r("./node_modules/netcdfjs/lib-esm/index.js"),f=r("./node_modules/pako/dist/pako.esm.mjs"),p=r("./src/parsers/utils/assignBonds.ts");function m(e){let t;return t="string"===typeof e?(new TextEncoder).encode(e):new Uint8Array(e),(0,f.inflate)(t,{to:"string"})}class g{static sameObj(e,t){return e&&t?JSON.stringify(e)==JSON.stringify(t):e==t}constructor(e,t){this.atoms=[],this.frames=[],this.box=null,this.atomdfs=null,this.id=0,this.hidden=!1,this.molObj=null,this.renderedMolObj=null,this.lastColors=null,this.modelData={},this.modelDatas=null,this.idMatrix=new s.Matrix4,this.dontDuplicateAtoms=!0,this.defaultColor=a.elementColors.defaultColor,this.defaultStickRadius=.25,this.options=t||{},this.ElementColors=this.options.defaultcolors?this.options.defaultcolors:a.elementColors.defaultColors,this.defaultSphereRadius=this.options.defaultSphereRadius?this.options.defaultSphereRadius:1.5,this.defaultCartoonQuality=this.options.cartoonQuality?this.options.cartoonQuality:10,this.id=e}getRadiusFromStyle(e,t){var r=this.defaultSphereRadius;if("undefined"!=typeof t.radius)r=t.radius;else if(g.vdwRadii[e.elem])r=g.vdwRadii[e.elem];else if(e.elem.length>1){let t=e.elem;t=t[0].toUpperCase()+t[1].toLowerCase(),g.vdwRadii[t]&&(r=g.vdwRadii[t])}return"undefined"!=typeof t.scale&&(r*=t.scale),r}drawAtomCross(e,t){if(e.style.cross){var r=e.style.cross;if(!r.hidden){var i=r.linewidth||g.defaultlineWidth;t[i]||(t[i]=new n.Geometry);var a=t[i].updateGeoGroup(6),o=this.getRadiusFromStyle(e,r),l=[[o,0,0],[-o,0,0],[0,o,0],[0,-o,0],[0,0,o],[0,0,-o]],u=e.clickable||e.hoverable;u&&void 0===e.intersectionShape&&(e.intersectionShape={sphere:[],cylinder:[],line:[]});for(var h=(0,c.getColorFromStyle)(e,r),d=a.vertexArray,f=a.colorArray,p=0;p<6;p++){var m=3*a.vertices;if(a.vertices++,d[m]=e.x+l[p][0],d[m+1]=e.y+l[p][1],d[m+2]=e.z+l[p][2],f[m]=h.r,f[m+1]=h.g,f[m+2]=h.b,u){var v=new s.Vector3(l[p][0],l[p][1],l[p][2]);v.multiplyScalar(.1),v.set(v.x+e.x,v.y+e.y,v.z+e.z),e.intersectionShape.line.push(v)}}}}}getGoodCross(e,t,r,n){for(var i=null,a=-1,o=0,l=e.bonds.length;o<l;o++)if(e.bonds[o]!=t.index){let t=e.bonds[o],l=this.atoms[t],u=new s.Vector3(l.x,l.y,l.z).clone();u.sub(r);let h=u.clone();h.cross(n);var c=h.lengthSq();if(c>a&&(i=h,(a=c)>.1))return i}return i}getSideBondV(e,t,r){var n,i,a,o,l=new s.Vector3(e.x,e.y,e.z),c=new s.Vector3(t.x,t.y,t.z).clone(),u=null;if(c.sub(l),1===e.bonds.length)1===t.bonds.length?(u=c.clone(),Math.abs(u.x)>1e-4?u.y+=1:u.x+=1):(n=(r+1)%t.bonds.length,i=t.bonds[n],a=this.atoms[i],(o=new s.Vector3(a.x,a.y,a.z).clone()).sub(l),(u=o.clone()).cross(c));else if((u=this.getGoodCross(e,t,l,c)).lengthSq()<.01){var h=this.getGoodCross(t,e,l,c);null!=h&&(u=h)}return u.lengthSq()<.01&&(u=c.clone(),Math.abs(u.x)>1e-4?u.y+=1:u.x+=1),u.cross(c),u.normalize(),u}addLine(e,t,r,n,i,s){e[r]=n.x,e[r+1]=n.y,e[r+2]=n.z,t[r]=s.r,t[r+1]=s.g,t[r+2]=s.b,e[r+3]=i.x,e[r+4]=i.y,e[r+5]=i.z,t[r+3]=s.r,t[r+4]=s.g,t[r+5]=s.b}drawBondLines(e,t,r){if(e.style.line){var i=e.style.line;if(!i.hidden){var o,l,u,h,d=i.linewidth||g.defaultlineWidth;r[d]||(r[d]=new n.Geometry);for(var f=r[d].updateGeoGroup(6*e.bonds.length),p=f.vertexArray,m=f.colorArray,v=0;v<e.bonds.length;v++){var b=t[e.bonds[v]];if(b.style.line&&!(e.index>=b.index)){var y=new s.Vector3(e.x,e.y,e.z),_=new s.Vector3(b.x,b.y,b.z),w=y.clone().add(_).multiplyScalar(.5),x=!1,S=e.clickable||e.hoverable,C=b.clickable||b.hoverable;(S||C)&&(S&&(void 0===e.intersectionShape&&(e.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),e.intersectionShape.line.push(y),e.intersectionShape.line.push(w)),C&&(void 0===b.intersectionShape&&(b.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),b.intersectionShape.line.push(w),b.intersectionShape.line.push(_)));var k=(0,c.getColorFromStyle)(e,e.style.line),E=(0,c.getColorFromStyle)(b,b.style.line);if(e.bondStyles&&e.bondStyles[v]){var A=e.bondStyles[v];if(!A.iswire)continue;A.singleBond&&(x=!0),"undefined"!=typeof A.color1&&(k=a.CC.color(A.color1)),"undefined"!=typeof A.color2&&(E=a.CC.color(A.color2))}var L,M,z=3*f.vertices;if(e.bondOrder[v]>1&&e.bondOrder[v]<4&&!x){var T=this.getSideBondV(e,b,v),O=_.clone();O.sub(y),2==e.bondOrder[v]?(T.multiplyScalar(.1),(o=y.clone()).add(T),(l=y.clone()).sub(T),(u=o.clone()).add(O),(h=l.clone()).add(O),k==E?(f.vertices+=4,this.addLine(p,m,z,o,u,k),this.addLine(p,m,z+6,l,h,k)):(f.vertices+=8,O.multiplyScalar(.5),(L=o.clone()).add(O),(M=l.clone()).add(O),this.addLine(p,m,z,o,L,k),this.addLine(p,m,z+6,L,u,E),this.addLine(p,m,z+12,l,M,k),this.addLine(p,m,z+18,M,h,E))):3==e.bondOrder[v]&&(T.multiplyScalar(.1),(o=y.clone()).add(T),(l=y.clone()).sub(T),(u=o.clone()).add(O),(h=l.clone()).add(O),k==E?(f.vertices+=6,this.addLine(p,m,z,y,_,k),this.addLine(p,m,z+6,o,u,k),this.addLine(p,m,z+12,l,h,k)):(f.vertices+=12,O.multiplyScalar(.5),(L=o.clone()).add(O),(M=l.clone()).add(O),this.addLine(p,m,z,y,w,k),this.addLine(p,m,z+6,w,_,E),this.addLine(p,m,z+12,o,L,k),this.addLine(p,m,z+18,L,u,E),this.addLine(p,m,z+24,l,M,k),this.addLine(p,m,z+30,M,h,E)))}else k==E?(f.vertices+=2,this.addLine(p,m,z,y,_,k)):(f.vertices+=4,this.addLine(p,m,z,y,w,k),this.addLine(p,m,z+6,w,_,E))}}}}}drawAtomSphere(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=(0,c.getColorFromStyle)(e,r),a=this.getRadiusFromStyle(e,r);if((!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var l=new s.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new i.Sphere(l,a))}o.GLDraw.drawSphere(t,e,a,n)}}}drawAtomClickSphere(e){if(e.style.clicksphere){var t=e.style.clicksphere;if(!t.hidden){var r=this.getRadiusFromStyle(e,t);if((!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var n=new s.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new i.Sphere(n,r))}}}}drawAtomInstanced(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=this.getRadiusFromStyle(e,r),a=(0,c.getColorFromStyle)(e,r),o=t.updateGeoGroup(1),l=o.vertices,u=3*l,h=o.vertexArray,d=o.colorArray,f=o.radiusArray;if(h[u]=e.x,h[u+1]=e.y,h[u+2]=e.z,d[u]=a.r,d[u+1]=a.g,d[u+2]=a.b,f[l]=n,(!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var p=new s.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new i.Sphere(p,n))}o.vertices+=1}}}drawSphereImposter(e,t,r,n){var i,s=e.updateGeoGroup(4),a=s.vertices,o=3*a,l=s.vertexArray,c=s.colorArray;for(i=0;i<4;i++)l[o+3*i]=t.x,l[o+3*i+1]=t.y,l[o+3*i+2]=t.z;var u=s.normalArray;for(i=0;i<4;i++)c[o+3*i]=n.r,c[o+3*i+1]=n.g,c[o+3*i+2]=n.b;u[o+0]=-r,u[o+1]=r,u[o+2]=0,u[o+3]=-r,u[o+4]=-r,u[o+5]=0,u[o+6]=r,u[o+7]=-r,u[o+8]=0,u[o+9]=r,u[o+10]=r,u[o+11]=0,s.vertices+=4;var h=s.faceArray,d=s.faceidx;h[d+0]=a,h[d+1]=a+1,h[d+2]=a+2,h[d+3]=a+2,h[d+4]=a+3,h[d+5]=a,s.faceidx+=6}drawAtomImposter(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=this.getRadiusFromStyle(e,r),a=(0,c.getColorFromStyle)(e,r);if((!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var o=new s.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new i.Sphere(o,n))}this.drawSphereImposter(t,e,n,a)}}}static drawStickImposter(e,t,r,n,i){for(var s=e.updateGeoGroup(4),a=s.vertices,o=3*a,l=s.vertexArray,c=s.colorArray,u=s.radiusArray,h=s.normalArray,d=i.r,f=i.g,p=i.b,m=function(e){var t=-e;return 0==t&&(t=-1e-4),t},g=o,v=0;v<4;v++)l[g]=t.x,h[g]=r.x,c[g]=d,l[++g]=t.y,h[g]=r.y,c[g]=f,l[++g]=t.z,h[g]=r.z,c[g]=v<2?p:m(p),g++;s.vertices+=4,u[a]=-n,u[a+1]=n,u[a+2]=-n,u[a+3]=n;var b=s.faceArray,y=s.faceidx;b[y+0]=a,b[y+1]=a+1,b[y+2]=a+2,b[y+3]=a+2,b[y+4]=a+3,b[y+5]=a,s.faceidx+=6}drawBondSticks(e,t,r){if(e.style.stick){var n=e.style.stick;if(!n.hidden){var l,u,h,d,f,p,m,v,b,y,_,w,x,S,C=n.radius||this.defaultStickRadius,k=n.doubleBondScaling||.4,E=n.tripleBondScaling||.25,A=C,L=n.singleBonds||!1,M=0,z=0,T=(0,c.getColorFromStyle)(e,n);!e.capDrawn&&e.bonds.length<4&&(M=2);var O=o.GLDraw.drawCylinder;for(r.imposter&&(O=g.drawStickImposter),h=0;h<e.bonds.length;h++){var P=t[e.bonds[h]];if(w=x=S=null,e.index<P.index){var D=P.style;if(!D.stick||D.stick.hidden)continue;var N=(0,c.getColorFromStyle)(P,D.stick);if(A=C,d=L,e.bondStyles&&e.bondStyles[h]){if((f=e.bondStyles[h]).iswire)continue;
2f.radius&&(A=f.radius),f.singleBond&&(d=!0),"undefined"!=typeof f.color1&&(T=a.CC.color(f.color1)),"undefined"!=typeof f.color2&&(N=a.CC.color(f.color2))}var F=new s.Vector3(e.x,e.y,e.z),R=new s.Vector3(P.x,P.y,P.z);if(e.bondOrder[h]<=1||d||e.bondOrder[h]>3){if(e.bondOrder[h]<1&&(A*=e.bondOrder[h]),!P.capDrawn&&P.bonds.length<4&&(z=2),T!=N?(O(r,F,w=(new s.Vector3).addVectors(F,R).multiplyScalar(.5),A,T,M,0),O(r,w,R,A,N,0,z)):O(r,F,R,A,T,M,z),l=e.clickable||e.hoverable,u=P.clickable||P.hoverable,l||u){if(w||(w=(new s.Vector3).addVectors(F,R).multiplyScalar(.5)),l){var I=new i.Cylinder(F,w,A),j=new i.Sphere(F,A);e.intersectionShape.cylinder.push(I),e.intersectionShape.sphere.push(j)}if(u){var G=new i.Cylinder(R,w,A),B=new i.Sphere(R,A);P.intersectionShape.cylinder.push(G),P.intersectionShape.sphere.push(B)}}}else if(e.bondOrder[h]>1){var U=0,W=0;A!=C&&(U=2,W=2);var V,H,q,Y,Z,X=R.clone(),K=null;X.sub(F),K=this.getSideBondV(e,P,h),2==e.bondOrder[h]?(V=A*k,K.multiplyScalar(1.5*V),(H=F.clone()).add(K),(q=F.clone()).sub(K),(Y=H.clone()).add(X),(Z=q.clone()).add(X),T!=N?(w=(new s.Vector3).addVectors(H,Y).multiplyScalar(.5),x=(new s.Vector3).addVectors(q,Z).multiplyScalar(.5),O(r,H,w,V,T,U,0),O(r,w,Y,V,N,0,W),O(r,q,x,V,T,U,0),O(r,x,Z,V,N,0,W)):(O(r,H,Y,V,T,U,W),O(r,q,Z,V,T,U,W)),l=e.clickable||e.hoverable,u=P.clickable||P.hoverable,(l||u)&&(w||(w=(new s.Vector3).addVectors(H,Y).multiplyScalar(.5)),x||(x=(new s.Vector3).addVectors(q,Z).multiplyScalar(.5)),l&&(p=new i.Cylinder(H,w,V),m=new i.Cylinder(q,x,V),e.intersectionShape.cylinder.push(p),e.intersectionShape.cylinder.push(m)),u&&(b=new i.Cylinder(Y,w,V),y=new i.Cylinder(Z,x,V),P.intersectionShape.cylinder.push(b),P.intersectionShape.cylinder.push(y)))):3==e.bondOrder[h]&&(V=A*E,K.cross(X),K.normalize(),K.multiplyScalar(3*V),(H=F.clone()).add(K),(q=F.clone()).sub(K),(Y=H.clone()).add(X),(Z=q.clone()).add(X),T!=N?(w=(new s.Vector3).addVectors(H,Y).multiplyScalar(.5),x=(new s.Vector3).addVectors(q,Z).multiplyScalar(.5),S=(new s.Vector3).addVectors(F,R).multiplyScalar(.5),O(r,H,w,V,T,U,0),O(r,w,Y,V,N,0,W),O(r,F,S,V,T,M,0),O(r,S,R,V,N,0,z),O(r,q,x,V,T,U,0),O(r,x,Z,V,N,0,W)):(O(r,H,Y,V,T,U,W),O(r,F,R,V,T,M,z),O(r,q,Z,V,T,U,W)),l=e.clickable||e.hoverable,u=P.clickable||P.hoverable,(l||u)&&(w||(w=(new s.Vector3).addVectors(H,Y).multiplyScalar(.5)),x||(x=(new s.Vector3).addVectors(q,Z).multiplyScalar(.5)),S||(S=(new s.Vector3).addVectors(F,R).multiplyScalar(.5)),l&&(p=new i.Cylinder(H.clone(),w.clone(),V),m=new i.Cylinder(q.clone(),x.clone(),V),v=new i.Cylinder(F.clone(),S.clone(),V),e.intersectionShape.cylinder.push(p),e.intersectionShape.cylinder.push(m),e.intersectionShape.cylinder.push(v)),u&&(b=new i.Cylinder(Y.clone(),w.clone(),V),y=new i.Cylinder(Z.clone(),x.clone(),V),_=new i.Cylinder(R.clone(),S.clone(),V),P.intersectionShape.cylinder.push(b),P.intersectionShape.cylinder.push(y),P.intersectionShape.cylinder.push(_))))}}}var $=!1,Q=0,J=!1;for(h=0;h<e.bonds.length;h++)d=L,e.bondStyles&&e.bondStyles[h]&&((f=e.bondStyles[h]).singleBond&&(d=!0),f.radius&&f.radius!=C&&(J=!0)),(d||1==e.bondOrder[h])&&Q++;J?Q>0&&($=!0):0==Q&&(e.bonds.length>0||n.showNonBonded)&&($=!0),$&&(A=C,r.imposter?this.drawSphereImposter(r.sphereGeometry,e,A,T):o.GLDraw.drawSphere(r,e,A,T))}}}createMolObj(e,t){t=t||{};var r,i,s,c,u=new n.Object3D,h=[],d={},f={},p=this.drawAtomSphere,m=null,g=null;t.supportsImposters?(p=this.drawAtomImposter,(m=new n.Geometry(!0)).imposter=!0,(g=new n.Geometry(!0,!0)).imposter=!0,g.sphereGeometry=new n.Geometry(!0),g.sphereGeometry.imposter=!0,g.drawnCaps={}):t.supportsAIA?(p=this.drawAtomInstanced,(m=new n.Geometry(!1,!0,!0)).instanced=!0,g=new n.Geometry(!0)):(m=new n.Geometry(!0),g=new n.Geometry(!0));var v,b={},y=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(r=0,s=e.length;r<s;r++){var _=e[r];if(_&&_.style){for(i in(_.clickable||_.hoverable)&&void 0===_.intersectionShape&&(_.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),c={line:void 0,cross:void 0,stick:void 0,sphere:void 0})_.style[i]?_.style[i].opacity?c[i]=parseFloat(_.style[i].opacity):c[i]=1:c[i]=void 0,b[i]?void 0!=c[i]&&b[i]!=c[i]&&(console.log("Warning: "+i+" opacity is ambiguous"),b[i]=1):b[i]=c[i];p.call(this,_,m),this.drawAtomClickSphere(_),this.drawAtomCross(_,f),this.drawBondLines(_,e,d),this.drawBondSticks(_,e,g),"undefined"===typeof _.style.cartoon||_.style.cartoon.hidden||("spectrum"!==_.style.cartoon.color||"number"!==typeof _.resi||_.hetflag||(_.resi<y[0]&&(y[0]=_.resi),_.resi>y[1]&&(y[1]=_.resi)),h.push(_))}}if(h.length>0&&(0,l.drawCartoon)(u,h,y,this.defaultCartoonQuality),m&&m.vertices>0){m.initTypedArrays();var w=null,x=null;m.imposter?w=new n.SphereImposterMaterial({ambient:0,vertexColors:!0,reflectivity:0}):m.instanced?(x=new n.Geometry(!0),o.GLDraw.drawSphere(x,{x:0,y:0,z:0},1,new a.Color(.5,.5,.5)),x.initTypedArrays(),w=new n.InstancedMaterial({sphereMaterial:new n.MeshLambertMaterial({ambient:0,vertexColors:!0,reflectivity:0}),sphere:x})):w=new n.MeshLambertMaterial({ambient:0,vertexColors:!0,reflectivity:0}),b.sphere<1&&b.sphere>=0&&(w.transparent=!0,w.opacity=b.sphere),x=new n.Mesh(m,w),u.add(x)}if(g.vertices>0){var S=null,C=null,k=g.sphereGeometry;k&&"undefined"!==typeof k.vertices&&0!=k.vertices||(k=null),g.initTypedArrays(),k&&k.initTypedArrays();var E={ambient:0,vertexColors:!0,reflectivity:0};g.imposter?(S=new n.StickImposterMaterial(E),C=new n.SphereImposterMaterial(E)):(S=new n.MeshLambertMaterial(E),C=new n.MeshLambertMaterial(E),S.wireframe&&(g.setUpWireframe(),k&&k.setUpWireframe())),b.stick<1&&b.stick>=0&&(S.transparent=!0,S.opacity=b.stick,C.transparent=!0,C.opacity=b.stick);var A=new n.Mesh(g,S);if(u.add(A),k){var L=new n.Mesh(k,C);u.add(L)}}for(r in d)if(d.hasOwnProperty(r)){v=r;var M=new n.LineBasicMaterial({linewidth:v,vertexColors:!0});b.line<1&&b.line>=0&&(M.transparent=!0,M.opacity=b.line),d[r].initTypedArrays();
2var z=new n.Line(d[r],M,n.LineStyle.LinePieces);u.add(z)}for(r in f)if(f.hasOwnProperty(r)){v=r;var T=new n.LineBasicMaterial({linewidth:v,vertexColors:!0});b.cross<1&&b.cross>=0&&(T.transparent=!0,T.opacity=b.cross),f[r].initTypedArrays();var O=new n.Line(f[r],T,n.LineStyle.LinePieces);u.add(O)}if(this.dontDuplicateAtoms&&this.modelData.symmetries&&this.modelData.symmetries.length>0){var P,D=new n.Object3D;for(P=0;P<this.modelData.symmetries.length;P++){var N=new n.Object3D;(N=u.clone()).matrix.copy(this.modelData.symmetries[P]),N.matrixAutoUpdate=!1,D.add(N)}return D}return u}getInternalState(){return{atoms:this.atoms,frames:this.frames}}setInternalState(e){this.atoms=e.atoms,this.frames=e.frames,this.molObj=null}getCrystData(){if(this.modelData.cryst){if(!this.modelData.cryst.matrix){const e=this.modelData.cryst;this.modelData.cryst.matrix=(0,s.conversionMatrix3)(e.a,e.b,e.c,e.alpha,e.beta,e.gamma)}return this.modelData.cryst}return null}setCrystData(e,t,r,n,i,a){e=e||1,t=t||1,r=r||1,n=n||90,i=i||90,a=a||90;const o=(0,s.conversionMatrix3)(e,t,r,n,i,a);this.modelData.cryst={a:e,b:t,c:r,alpha:n,beta:i,gamma:a,matrix:o}}setCrystMatrix(e){e=e||new s.Matrix3(1,0,0,0,1,0,0,0,1),this.modelData.cryst={matrix:e}}getSymmetries(){return"undefined"==typeof this.modelData.symmetries&&(this.modelData.symmetries=[this.idMatrix]),this.modelData.symmetries}setSymmetries(e){this.modelData.symmetries="undefined"==typeof e?[this.idMatrix]:e}getID(){return this.id}getNumFrames(){return void 0!=this.frames.numFrames?this.frames.numFrames:this.frames.length}adjustCoord(e,t,r,n){var i=t-e;return i<-r?t+n:i>r?t-n:t}adjustCoordinatesToBox(){if(this.box&&this.atomdfs)for(var e=this.box[0],t=this.box[1],r=this.box[2],n=.9*e,i=.9*t,s=.9*r,a=0;a<this.atomdfs.length;a++)for(var o=this.atomdfs[a],l=1;l<o.length;l++){var c=this.atoms[o[l][0]],u=this.atoms[o[l][1]];c.x=this.adjustCoord(u.x,c.x,n,e),c.y=this.adjustCoord(u.y,c.y,i,t),c.z=this.adjustCoord(u.z,c.z,s,r)}}setFrame(e,t){var r=this.getNumFrames();let n=this;return new Promise((function(i,s){if(0==r&&i(),(e<0||e>=r)&&(e=r-1),void 0!=n.frames.url){var a=n.frames.url;(0,c.getbin)(a+"/traj/frame/"+e+"/"+n.frames.path,void 0,"POST",void 0).then((function(e){for(var t=new Float32Array(e,44),r=0,s=0;s<n.atoms.length;s++)n.atoms[s].x=t[r++],n.atoms[s].y=t[r++],n.atoms[s].z=t[r++];n.box&&n.atomdfs&&n.adjustCoordinatesToBox(),i()})).catch(s)}else n.atoms=n.frames[e],i();n.molObj=null,n.modelDatas&&e<n.modelDatas.length&&(n.modelData=n.modelDatas[e],n.unitCellObjects&&t&&(t.removeUnitCell(n),t.addUnitCell(n)))}))}addFrame(e){this.frames.push(e)}vibrate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;var a=0,o=e;r&&(a=-e,o=e),void 0!==this.frames&&void 0!==this.frames.origIndex?this.setFrame
vendor: 50,610 bytes, line 2
2(this.frames.origIndex):this.setFrame(0),a<o&&(this.frames=[]),r&&(this.frames.origIndex=e);for(var l=a;l<o;l++){var u=[],h=this.frames.length;if(0!=l||i){for(var d=0;d<this.atoms.length;d++){var f=(0,c.getAtomProperty)(this.atoms[d],"dx"),p=(0,c.getAtomProperty)(this.atoms[d],"dy"),m=(0,c.getAtomProperty)(this.atoms[d],"dz"),g=new s.Vector3(f,p,m),v=new s.Vector3(this.atoms[d].x,this.atoms[d].y,this.atoms[d].z),b=l*t/e;g.multiplyScalar(b),v.add(g);var y={};for(var _ in this.atoms[d])y[_]=this.atoms[d][_];if(y.x=v.x,y.y=v.y,y.z=v.z,u.push(y),n&&i){var w=(0,c.extend)({},i),x=new s.Vector3(f,p,m);if(x.multiplyScalar(t),x.add(v),w.start=v,w.end=x,w.frame=h,!w.color){var S=y.style.sphere;S||(S=y.style.stick),S||(S=y.style.line),w.color=(0,c.getColorFromStyle)(y,S)}n.addArrow(w)}}this.frames.push(u)}else this.frames.push(this.atoms)}}setAtomDefaults(e){for(let t=0;t<e.length;t++){let r=e[t];r&&(r.style=r.style||(0,c.deepCopy)(g.defaultAtomStyle),r.color=r.color||this.ElementColors[r.elem]||this.defaultColor,r.model=this.id,(r.clickable||r.hoverable)&&(r.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}))}}addMolData(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var n=g.parseMolData(e,t,r);this.dontDuplicateAtoms=!r.duplicateAssemblyAtoms;var i=n.modelData;if(i&&(Array.isArray(i)?(this.modelData=i[0],r.frames&&(this.modelDatas=i)):this.modelData=i),n.box?this.box=n.box:this.box=null,0==this.frames.length){for(let e=0;e<n.length;e++)0!=n[e].length&&this.frames.push(n[e]);this.frames[0]&&(this.atoms=this.frames[0])}else if(r.frames)for(let a=0;a<n.length;a++)this.frames.push(n[a]);else for(var s=0;s<n.length;s++)this.addAtoms(n[s]);for(let a=0;a<this.frames.length;a++)this.setAtomDefaults(this.frames[a]);r.vibrate&&r.vibrate.frames&&r.vibrate.amplitude&&this.vibrate(r.vibrate.frames,r.vibrate.amplitude),r.style&&this.setStyle({},r.style)}setDontDuplicateAtoms(e){this.dontDuplicateAtoms=e}setModelData(e){this.modelData=e}propertyMatches(e,t){if(e==t)return!0;if("string"==typeof t&&"number"==typeof e){var r=t.match(/(-?\d+)\s*-\s*(-?\d+)/);if(r){var n=parseInt(r[1]),i=parseInt(r[2]);if(r&&e>=n&&e<=i)return!0}}return!1}static deepCopyAndCache(e,t){if("object"!=typeof e||null==e)return e;if(e.__cache_created)return e;const r={};for(const n in e){const i=e[n];if(Array.isArray(i)){r[n]=[];for(let e=0;e<i.length;e++)r[n].push(g.deepCopyAndCache(i[e],t))}else r[n]="object"===typeof i&&"properties"!=n&&"model"!=n?g.deepCopyAndCache(i,t):i;if("and"==n||"or"==n){const e=[];for(const i of r[n]){const r=new Set;for(const e of t.selectedAtoms(i))r.add(e.index);e.push(r)}if("and"==n){const t=function(e,t){const r=new Set;for(const n of t)e.has(n)&&r.add(n);return r};let i=new Set(e[0]);for(const r of e.splice(1))i=t(i,r);r[n].__cached_results=i}else if("or"==n){const t=new Set;for(const r of e)for(const e of r)t.add(e);r[n].__cached_results=t}}}return r.__cache_created=!0,r}atomIsSelected(e,t){if("undefined"===typeof t)return!0;var r=!!t.invert,n=!0;for(var i in t)if("and"==i||"or"==i||"not"==i){if("not"==i){if(this.atomIsSelected(e,t[i])){n=!1;break}}else if(void 0===t[i].__cached_results&&(t=g.deepCopyAndCache(t,this)),!(n=t[i].__cached_results.has(e.index)))break}else if("predicate"===i){if(!t.predicate(e)){n=!1;break}}else if("properties"==i&&e[i]){for(var s in t.properties)if(!s.startsWith("__cache")){if("undefined"===typeof e.properties[s]){n=!1;break}if(e.properties[s]!=t.properties[s]){n=!1;break}}}else if(t.hasOwnProperty(i)&&!g.ignoredKeys.has(i)&&!i.startsWith("__cache")){if("undefined"===typeof e[i]){n=!1;break}var a=!1;if("bonds"===i){if(t[i]!=e.bonds.length){n=!1;break}}else if(Array.isArray(t[i])){var o=t[i],l=e[i];for(let e=0;e<o.length;e++)if(this.propertyMatches(l,o[e])){a=!0;break}if(!a){n=!1;break}}else{let r=t[i];if(!this.propertyMatches(e[i],r)){n=!1;break}}}return r?!n:n}static squaredDistance(e,t){var r=t.x-e.x,n=t.y-e.y,i=t.z-e.z;return r*r+n*n+i*i}expandAtomList(e,t){if(t<=0)return e;for(var r=(0,c.getExtent)(e,void 0),n=[[],[],[]],i=0;i<3;i++)n[0][i]=r[0][i]-t,n[1][i]=r[1][i]+t,n[2][i]=r[2][i];var s=[];for(let c=0;c<this.atoms.length;c++){var a=this.atoms[c].x,o=this.atoms[c].y,l=this.atoms[c].z;a>=n[0][0]&&a<=n[1][0]&&o>=n[0][1]&&o<=n[1][1]&&l>=n[0][2]&&l<=n[1][2]&&(a>=r[0][0]&&a<=r[1][0]&&o>=r[0][1]&&o<=r[1][1]&&l>=r[0][2]&&l<=r[1][2]||s.push(this.atoms[c]))}return s}static getFloat(e){return"number"===typeof e?e:parseFloat(e)}selectedAtoms(e,t){var r=[];e=g.deepCopyAndCache(e||{},this),t||(t=this.atoms);for(var n=t.length,i=0;i<n;i++){var s=t[i];s&&this.atomIsSelected(s,e)&&r.push(s)}if(e.hasOwnProperty("expand")){const t=g.getFloat(e.expand);let n=this.expandAtomList(r,t),i=r.length;const s=t*t;for(let e=0;e<n.length;e++)for(let t=0;t<i;t++){var a=g.squaredDistance(n[e],r[t]);a<s&&a>0&&r.push(n[e])}}if(e.hasOwnProperty("within")&&e.within.hasOwnProperty("sel")&&e.within.hasOwnProperty("distance")){var o=this.selectedAtoms(e.within.sel,this.atoms),l={};const t=g.getFloat(e.within.distance),n=t*t;for(let e=0;e<o.length;e++)for(let t=0;t<r.length;t++){let i=g.squaredDistance(o[e],r[t]);i<n&&i>0&&(l[t]=1)}var c=[];if(e.within.invert)for(let e=0;e<r.length;e++)l[e]||c.push(r[e]);else for(let e in l)c.push(r[e]);r=c}if(e.hasOwnProperty("byres")){var u={},h=[],d=[];for(let e=0;e<r.length;e++){let t=r[e];var f=t.chain,p=t.resi;if(void 0===u[f]&&(u[f]={}),t.hasOwnProperty("resi")&&void 0===u[f][p])for(u[f][p]=!0,d.push(t);d.length>0;)if(t=d.pop(),f=t.chain,p=t.resi,void 0===h[t.index]){h[t.index]=!0;for(var m=0;m<t.bonds.length;m++){var v=this.atoms[t.bonds[m]];void 0===h[v.index]&&v.hasOwnProperty("resi")&&v.chain==f&&v.resi==p&&(d.push(v),r.push(v))}}}}return r}addAtoms(e){this.molObj=null;var t,r=this.atoms.length,n=[];for(t=0;t<e.length;t++)"undefined"==typeof e[t].index&&(e[t].index=t),"undefined"==typeof e[t].serial&&(e[t].serial=t),n[e[t].index]=r+t;for(t=0;t<e.length;t++){var i=e[t],s=n[i.index],a=(0,c.extend)({},i);a.index=s,a.bonds=[],a.bondOrder=[],a.model=this.id,a.style=a.style||(0,c.deepCopy)(g.defaultAtomStyle),"undefined"==typeof a.color&&(a.color=this.ElementColors[a.elem]||this.defaultColor);for(var o=i.bonds?i.bonds.length:0,l=0;l<o;l++){var u=n[i.bonds[l]];"undefined"!=typeof u&&(a.bonds.push(u),a.bondOrder.push(i.bondOrder?i.bondOrder[l]:1))}this.atoms.push(a)}}assignBonds(){(0,p.assignBonds)(this.atoms)}removeAtoms(e){this.molObj=null;var t,r=[];for(t=0;t<e.length;t++)r[e[t].index]=!0;var n=[];for(t=0;t<this.atoms.length;t++){var i=this.atoms[t];r[i.index]||n.push(i)}this.atoms=[],this.addAtoms(n)}setStyle(e,t,r){"undefined"===typeof t&&"undefined"==typeof r&&(t=e,e={}),"string"===typeof t&&(t=(0,c.specStringToObject)(t));var n=!1,i=this,s=function(s){var a=i.selectedAtoms(e,s);for(let e=0;e<s.length;e++)s[e]&&(s[e].capDrawn=!1);for(let e=0;e<a.length;e++){n=!0,(a[e].clickable||a[e].hoverable)&&(a[e].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),r||(a[e].style={});for(let r in t)t.hasOwnProperty(r)&&(a[e].style[r]=a[e].style[r]||{},Object.assign(a[e].style[r],t[r]))}};if(void 0!==e.frame&&e.frame<this.frames.length){let t=e.frame;t<0&&(t=this.frames.length+t),s(this.frames[t])}else{s(this.atoms);for(var a=0;a<this.frames.length;a++)this.frames[a]!==this.atoms&&s(this.frames[a])}n&&(this.molObj=null)}setClickable(e,t,r){if(t=!!t,null!==(r=(0,c.makeFunction)(r))){var n=this.selectedAtoms(e,this.atoms),i=n.length;for(let e=0;e<i;e++)n[e].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},n[e].clickable=t,r&&(n[e].callback=r);i>0&&(this.molObj=null)}else console.log("Callback is not a function")}setHoverable(e,t,r,n){if(t=!!t,r=(0,c.makeFunction)(r),n=(0,c.makeFunction)(n),null!==r)if(null!==n){var i=this.selectedAtoms(e,this.atoms),s=i.length;for(let e=0;e<s;e++)i[e].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},i[e].hoverable=t,r&&(i[e].hover_callback=r),n&&(i[e].unhover_callback=n);s>0&&(this.molObj=null)}else console.log("Unhover_callback is not a function");else console.log("Hover_callback is not a function")}enableContextMenu(e,t){var r;t=!!t;var n=this.selectedAtoms(e,this.atoms),i=n.length;for(r=0;r<i;r++)n[r].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},n[r].contextMenuEnabled=t;i>0&&(this.molObj=null)}setColorByElement(e,t){if(null===this.molObj||!g.sameObj(t,this.lastColors)){this.lastColors=t;var r=this.selectedAtoms(e,r);r.length>0&&(this.molObj=null);for(var n=0;n<r.length;n++){var i=r[n];"undefined"!==typeof t[i.elem]&&(i.color=t[i.elem])}}}setColorByProperty(e,t,r,n){var i,s,a=this.selectedAtoms(e,a);for(this.lastColors=null,a.length>0&&(this.molObj=null),"string"===typeof r&&"undefined"!=typeof u.Gradient.builtinGradients[r]&&(r=new u.Gradient.builtinGradients[r]),n||(n=r.range()),n||(n=(0,c.getPropertyRange)(a,t)),i=0;i<a.length;i++)s=a[i],null!=(0,c.getAtomProperty)(s,t)&&(s.color=r.valueToHex(parseFloat(s.properties[t]),n))}setColorByFunction(e,t){var r=this.selectedAtoms(e,r);if("function"===typeof t){this.lastColors=null,r.length>0&&(this.molObj=null);for(let e=0;e<r.length;e++){let n=r[e];n.color=t(n)}}}toCDObject(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t={a:[],b:[]};e&&(t.s=[]);for(let n=0;n<this.atoms.length;n++){let i={},s=this.atoms[n];if(i.x=s.x,i.y=s.y,i.z=s.z,"C"!=s.elem&&(i.l=s.elem),e){for(var r=0;r<t.s.length&&JSON.stringify(s.style)!==JSON.stringify(t.s[r]);)r++;r===t.s.length&&t.s.push(s.style),0!==r&&(i.s=r)}t.a.push(i);for(let e=0;e<s.bonds.length;e++){let r=n,i=s.bonds[e];if(r>=i)continue;let a={b:r,e:i},o=s.bondOrder[e];1!=o&&(a.o=o),t.b.push(a)}}return t}globj(e,t){(null===this.molObj||t.regen)&&(this.molObj=this.createMolObj(this.atoms,t),this.renderedMolObj&&(e.remove(this.renderedMolObj),this.renderedMolObj=null),this.renderedMolObj=this.molObj.clone(),this.hidden&&(this.renderedMolObj.setVisible(!1),this.molObj.setVisible(!1)),e.add(this.renderedMolObj))}exportVRML(){return this.createMolObj(this.atoms,{supportsImposters:!1,supportsAIA:!1}).vrml()}removegl(e){this.renderedMolObj&&(void 0!==this.renderedMolObj.geometry&&this.renderedMolObj.geometry.dispose(),void 0!==this.renderedMolObj.material&&this.renderedMolObj.material.dispose(),e.remove(this.renderedMolObj),this.renderedMolObj=null),this.molObj=null}hide(){this.hidden=!0,this.renderedMolObj&&this.renderedMolObj.setVisible(!1),this.molObj&&this.molObj.setVisible(!1)}show(){this.hidden=!1,this.renderedMolObj&&this.renderedMolObj.setVisible(!0),this.molObj&&this.molObj.setVisible(!0)}addPropertyLabels(e,t,r,n){for(var i=this.selectedAtoms(t,i),s=(0,c.deepCopy)(n),a=0;a<i.length;a++){var o=i[a],l=null;"undefined"!=typeof o[e]?l=String(o[e]):"undefined"!=typeof o.properties[e]&&(l=String(o.properties[e])),null!=l&&(s.position=o,r.addLabel(l,s))}}addResLabels(e,t,r){var n=[],i=function(i,a){for(var o=i.selectedAtoms(e,o),l={},u=0;u<o.length;u++){var h=o[u],d=h.chain,f=h.resn+""+h.resi;l[d]||(l[d]={}),l[d][f]||(l[d][f]=[]),l[d][f].push(h)}var p=(0,c.deepCopy)(r);for(let e in l)if(l.hasOwnProperty(e)){var m=l[e];for(let e in m)if(m.hasOwnProperty(e)){let r=m[e],i=new s.Vector3(0,0,0);for(let e=0;e<r.length;e++){let t=r[e];i.x+=t.x,i.y+=t.y,i.z+=t.z}i.divideScalar(r.length),p.position=i,p.frame=a;let o=t.addLabel(e,p,void 0,!0);n.push(o)}}};if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){var a=this.getNumFrames();let e=this.atoms;for(let t=0;t<a;t++)this.frames[t]&&(this.atoms=this.frames[t],i(this,t));this.atoms=e}else i(this);return n}setupDFS(){this.atomdfs=[];var e=this,t=new Int8Array(this.atoms.length);t.fill(0);for(var r=function(n,i,s){s.push([n,i]);var a=e.atoms[n];t[n]=1;for(var o=0;o<a.bonds.length;o++){var l=a.bonds[o];e.atoms[l]&&!t[l]&&r(l,n,s)}},n=0;n<this.atoms.length;n++)if(this.atoms[n]&&!t[n]){var i=[];r(n,-1,i),this.atomdfs.push(i)}}setCoordinatesFromURL(e,t){this.frames=[];var r=this;return this.box&&this.setupDFS(),e.startsWith("http")||(e="http://"+e),(0,c.get)(e+"/traj/numframes/"+t,(function(n){if(!isNaN(parseInt(n)))return r.frames.push(r.atoms),r.frames.numFrames=n,r.frames.url=e,r.frames.path=t,r.setFrame(0)}))}setCoordinates(e,t){if(!e)return[];if(/\.gz$/.test(t=t||"")){t=t.replace(/\.gz$/,"");try{e=m(e)}catch(c){console.log(c)}}if({mdcrd:"",inpcrd:"",pdb:"",netcdf:"",array:""}.hasOwnProperty(t)){this.frames=[];for(var r=this.atoms.length,n=g.parseCrd(e,t),i=0;i<n.length;){for(var s=[],a=0;a<r;a++){var o={};for(var l in this.atoms[a])o[l]=this.atoms[a][l];s[a]=o,s[a].x=n[i++],s[a].y=n[i++],s[a].z=n[i++]}this.frames.push(s)}return this.atoms=this.frames[0],this.frames}return[]}addAtomSpecs(e){}static parseCrd(e,t){var r=[],n=0;if("pdb"==t)for(var i=e.indexOf("\nATOM");-1!=i;){for(;"\nATOM"==e.slice(i,i+5)||"\nHETATM"==e.slice(i,i+7);)r[n++]=parseFloat(e.slice(i+31,i+39)),r[n++]=parseFloat(e.slice(i+39,i+47)),r[n++]=parseFloat(e.slice(i+47,i+55)),i=e.indexOf("\n",i+54),"\nTER"==e.slice(i,i+4)&&(i=e.indexOf("\n",i+5));i=e.indexOf("\nATOM",i)}else if("netcdf"==t){var s=new d.NetCDFReader(e);r=[].concat.apply([],s.getDataVariable("coordinates"))}else{if("array"==t||Array.isArray(e))return e.flat(2);{let n=e.indexOf("\n");"inpcrd"==t&&(n=e.indexOf("\n",n+1)),r=(e=e.slice(n+1)).match(/\S+/g).map(parseFloat)}}return r}static parseMolData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;if(!e)return[];if(/\.gz$/.test(t)){t=t.replace(/\.gz$/,"");try{e=m(e)}catch(n){console.log(n)}}return"undefined"==typeof h.Parsers[t]&&(t=t.split(".").pop(),"undefined"==typeof h.Parsers[t]&&(console.log("Unknown format: "+t),t=e instanceof Uint8Array?"mmtf":e.match(/^@<TRIPOS>MOLECULE/gm)?"mol2":e.match(/^data_/gm)&&e.match(/^loop_/gm)?"cif":e.match(/^HETATM/gm)||e.match(/^ATOM/gm)?"pdb":e.match(/ITEM: TIMESTEP/gm)?"lammpstrj":e.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm)?"sdf":e.match(/^%VERSION\s+VERSION_STAMP/gm)?"prmtop":"xyz",console.log("Best guess: "+t))),(0,h.Parsers[t])(e,r)}}g.defaultAtomStyle={line:{}},g.defaultlineWidth=1,g.vdwRadii={H:1.2,He:1.4,Li:1.82,Be:1.53,B:1.92,C:1.7,N:1.55,O:1.52,F:1.47,Ne:1.54,Na:2.27,Mg:1.73,Al:1.84,Si:2.1,P:1.8,S:1.8,Cl:1.75,Ar:1.88,K:2.75,Ca:2.31,Ni:1.63,Cu:1.4,Zn:1.39,Ga:1.87,Ge:2.11,As:1.85,Se:1.9,Br:1.85,Kr:2.02,Rb:3.03,Sr:2.49,Pd:1.63,Ag:1.72,Cd:1.58,In:1.93,Sn:2.17,Sb:2.06,Te:2.06,I:1.98,Xe:2.16,Cs:3.43,Ba:2.68,Pt:1.75,Au:1.66,Hg:1.55,Tl:1.96,Pb:2.02,Bi:2.07,Po:1.97,At:2.02,Rn:2.2,Fr:3.48,Ra:2.83,U:1.86},g.ignoredKeys=new Set(["props","invert","model","frame","byres","expand","within","and","or","not"])},"./src/GLShape.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{GLShape:()=>d,splitMesh:()=>f});var n=r("./src/WebGL/index.ts"),i=r("./src/WebGL/shapes/index.ts"),s=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts"),o=r("./src/ProteinSurface4.ts"),l=r("./src/VolumeData.ts"),c=r("./src/GLDraw.ts"),u=r("./src/glcartoon.ts"),h=r("./src/utilities.ts");class d{static finalizeGeo(e){var t=e.updateGeoGroup(0);t.vertices>0&&t.truncateArrayBuffers(!0,!0)}static updateColor(e,t){var r,n,i;t=t||a.CC.color(t),e.colorsNeedUpdate=!0,t.constructor!==Array&&(r=t.r,n=t.g,i=t.b);for(let s in e.geometryGroups){let a=e.geometryGroups[s],o=a.colorArray;for(let e=0,s=a.vertices;e<s;++e){if(t.constructor===Array){let s=t[e];r=s.r,n=s.g,i=s.b}o[3*e]=r,o[3*e+1]=n,o[3*e+2]=i}}}static drawArrow(e,t,r){var n=r.start,a=r.end,o=r.radius,l=r.radiusRatio,c=r.mid,u=r.midpos;if(!n||!a)return;var h=t.updateGeoGroup(51),d=new s.Vector3(a.x,a.y,a.z).sub(n);if(u){let e=d.length();c=u>0?u/e:(e+u)/e}d.multiplyScalar(c);var f=new s.Vector3(n.x,n.y,n.z).add(d),p=d.clone().negate();let m=new s.Vector3(n.x,n.y,n.z);e.intersectionShape.cylinder.push(new i.Cylinder(m,f.clone(),o)),e.intersectionShape.sphere.push(new i.Sphere(m,o));var g=[];g[0]=d.clone(),Math.abs(g[0].x)>1e-4?g[0].y+=1:g[0].x+=1,g[0].cross(d),g[0].normalize(),g[4]=g[0].clone(),g[4].crossVectors(g[0],d),g[4].normalize(),g[8]=g[0].clone().negate(),g[12]=g[4].clone().negate(),g[2]=g[0].clone().add(g[4]).normalize(),g[6]=g[4].clone().add(g[8]).normalize(),g[10]=g[8].clone().add(g[12]).normalize(),g[14]=g[12].clone().add(g[0]).normalize(),g[1]=g[0].clone().add(g[2]).normalize(),g[3]=g[2].clone().add(g[4]).normalize(),g[5]=g[4].clone().add(g[6]).normalize(),g[7]=g[6].clone().add(g[8]).normalize(),g[9]=g[8].clone().add(g[10]).normalize(),g[11]=g[10].clone().add(g[12]).normalize(),g[13]=g[12].clone().add(g[14]).normalize(),g[15]=g[14].clone().add(g[0]).normalize();var v,b,y,_,w,x,S,C,k,E,A,L,M,z,T,O,P,D,N,F,R,I,j=h.vertices,G=h.vertexArray,B=h.faceArray,U=h.normalArray,W=h.lineArray;for(b=0,y=g.length;b<y;++b){v=3*(j+3*b);var V=g[b].clone().multiplyScalar(o).add(n),H=g[b].clone().multiplyScalar(o).add(f),q=g[b].clone().multiplyScalar(o*l).add(f);if(G[v]=V.x,G[v+1]=V.y,G[v+2]=V.z,G[v+3]=H.x,G[v+4]=H.y,G[v+5]=H.z,G[v+6]=q.x,G[v+7]=q.y,G[v+8]=q.z,b>0){var Y=G[v-3],Z=G[v-2],X=G[v-1],K=new s.Vector3(Y,Z,X),$=new s.Vector3(a.x,a.y,a.z),Q=f.clone(),J=new s.Vector3(q.x,q.y,q.z);e.intersectionShape.triangle.push(new i.Triangle(J,$,K)),e.intersectionShape.triangle.push(new i.Triangle(K.clone(),Q,J.clone()))}}h.vertices+=48,G[v=3*h.vertices]=n.x,G[v+1]=n.y,G[v+2]=n.z,G[v+3]=f.x,G[v+4]=f.y,G[v+5]=f.z,G[v+6]=a.x,G[v+7]=a.y,G[v+8]=a.z,h.vertices+=3;var ee=h.vertices-3,te=h.vertices-2,re=h.vertices-1,ne=3*ee,ie=3*te,se=3*re;for(b=0,y=g.length-1;b<y;++b){var ae=j+3*b;v=3*ae,w=h.faceidx,x=h.lineidx,M=3*(S=ae),z=3*(C=ae+1),T=3*(k=ae+2),O=3*(E=ae+4),P=3*(A=ae+5),D=3*(L=ae+3),N=F=g[b],R=I=g[b+1],U[M]=N.x,U[z]=F.x,U[D]=I.x,U[M+1]=N.y,U[z+1]=F.y,U[D+1]=I.y,U[M+2]=N.z,U[z+2]=F.z,U[D+2]=I.z,U[z]=F.x,U[O]=R.x,U[D]=I.x,U[z+1]=F.y,U[O+1]=R.y,U[D+1]=I.y,U[z+2]=F.z,U[O+2]=R.z,U[D+2]=I.z,U[T]=F.x,U[P]=R.x,U[T+1]=F.y,U[P+1]=R.y,U[T+2]=F.z,U[P+2]=R.z,B[w]=S,B[w+1]=C,B[w+2]=L,B[w+3]=C,B[w+4]=E,B[w+5]=L,B[w+6]=S,B[w+7]=L,B[w+8]=ee,B[w+9]=k,B[w+10]=te,B[w+11]=A,B[w+12]=k,B[w+13]=re,B[w+14]=A,W[x]=S,W[x+1]=C,W[x+2]=S,W[x+3]=L,W[x+4]=E,W[x+5]=L,W[x+6]=S,W[x+7]=L,W[x+8]=k,W[x+9]=C,W[x+10]=k,W[x+11]=A,W[x+12]=E,W[x+13]=A,W[x+14]=k,W[x+15]=re,W[x+16]=k,W[x+17]=A,W[x+18]=re,W[x+19]=A,h.faceidx+=15,h.lineidx+=20}_=[j+45,j+46,j+1,j,j+47,j+2],w=h.faceidx,x=h.lineidx,M=3*(S=_[0]),z=3*(C=_[1]),T=3*(k=_[4]),O=3*(E=_[2]),P=3*(A=_[5]),D=3*(L=_[3]),N=F=g[15],R=I=g[0],U[M]=N.x,U[z]=F.x,U[D]=I.x,U[M+1]=N.y,U[z+1]=F.y,U[D+1]=I.y,U[M+2]=N.z,U[z+2]=F.z,U[D+2]=I.z,U[z]=F.x,U[O]=R.x,U[D]=I.x,U[z+1]=F.y,U[O+1]=R.y,U[D+1]=I.y,U[z+2]=F.z,U[O+2]=R.z,U[D+2]=I.z,U[T]=F.x,U[P]=R.x,U[T+1]=F.y,U[P+1]=R.y,U[T+2]=F.z,U[P+2]=R.z,d.normalize(),p.normalize(),U[ne]=p.x,U[ie]=U[se]=d.x,U[ne+1]=p.y,U[ie+1]=U[se+1]=d.y,U[ne+2]=p.z,U[ie+2]=U[se+2]=d.z,B[w]=S,B[w+1]=C,B[w+2]=L,B[w+3]=C,B[w+4]=E,B[w+5]=L,B[w+6]=S,B[w+7]=L,B[w+8]=ee,B[w+9]=k,B[w+10]=te,B[w+11]=A,B[w+12]=k,B[w+13]=re,B[w+14]=A,W[x]=S,W[x+1]=C,W[x+2]=S,W[x+3]=L,W[x+4]=E,W[x+5]=L,W[x+6]=S,W[x+7]=L,W[x+8]=k,W[x+9]=C,W[x+10]=k,W[x+11]=A,W[x+12]=E,W[x+13]=A,W[x+14]=k,W[x+15]=re,W[x+16]=k,W[x+17]=A,W[x+18]=re,W[x+19]=A,h.faceidx+=15,h.lineidx+=20}static updateBoundingFromPoints(e,t,r,n){e.center.set(0,0,0);let i=1/0,s=1/0,a=1/0,o=-1/0,l=-1/0,c=-1/0;e.box&&(i=e.box.min.x,o=e.box.max.x,s=e.box.min.y,l=e.box.max.y,a=e.box.min.z,c=e.box.max.z);for(let f=0,p=n;f<p;f++){var u=r[3*f],h=r[3*f+1],d=r[3*f+2];u<i&&(i=u),h<s&&(s=h),d<a&&(a=d),u>o&&(o=u),h>l&&(l=h),d>c&&(c=d)}e.center.set((o+i)/2,(l+s)/2,(c+a)/2),e.radius=e.center.distanceTo({x:o,y:l,z:c}),e.box={min:{x:i,y:s,z:a},max:{x:o,y:l,z:c}}}static addCustomGeo(e,t,r,n,a){var o,l,c,u,h,f,p,m,g,v=t.addGeoGroup(),b=r.vertexArr,y=r.normalArr,_=r.faceArr;v.vertices=b.length,v.faceidx=_.length;var w=v.vertexArray,x=v.colorArray;for(n.constructor!==Array&&(m=n.r,g=n.g,u=n.b),f=0,p=v.vertices;f<p;++f)o=3*f,l=b[f],w[o]=l.x,w[o+1]=l.y,w[o+2]=l.z,n.constructor===Array&&(m=(h=n[f]).r,g=h.g,u=h.b),x[o]=m,x[o+1]=g,x[o+2]=u;if(a)for(f=0,p=v.faceidx/3;f<p;++f){c=_[o=3*f],u=_[o+1],h=_[o+2];var S=new s.Vector3,C=new s.Vector3,k=new s.Vector3;e.intersectionShape.triangle.push(new i.Triangle(S.copy(b[c]),C.copy(b[u]),k.copy(b[h])))}if(a){var E=new s.Vector3(0,0,0),A=0;for(let e=0;e<t.geometryGroups.length;e++)E.add(t.geometryGroups[e].getCentroid()),A++;E.divideScalar(A),d.updateBoundingFromPoints(e.boundingSphere,{centroid:E},w,v.vertices)}if(v.faceArray=new Uint16Array(_),v.truncateArrayBuffers(!0,!0),y.length<v.vertices)v.setNormals();else{var L,M=v.normalArray=new Float32Array(3*v.vertices);for(f=0,p=v.vertices;f<p;++f)o=3*f,L=y[f],M[o]=L.x,M[o+1]=L.y,M[o+2]=L.z}v.setLineIndices(),v.lineidx=v.lineArray.length}static updateFromStyle(e,t){"undefined"!=typeof t.color?(e.color=t.color||new a.Color,t.color instanceof a.Color||(e.color=a.CC.color(t.color))):e.color=a.CC.color(0),e.wireframe=!!t.wireframe,e.opacity=t.alpha?(0,s.clamp)(t.alpha,0,1):1,"undefined"!=typeof t.opacity&&(e.opacity=(0,s.clamp)(t.opacity,0,1)),e.side=void 0!==t.side?t.side:n.DoubleSide,e.linewidth="undefined"==typeof t.linewidth?1:t.linewidth,e.clickable=!!t.clickable,e.callback=(0,h.makeFunction)(t.callback),e.hoverable=!!t.hoverable,e.hover_callback=(0,h.makeFunction)(t.hover_callback),e.unhover_callback=(0,h.makeFunction)(t.unhover_callback),e.hidden=t.hidden,e.frame=t.frame}constructor(e){this.color=16777215,this.hidden=!1,this.wireframe=!1,this.opacity=1,this.linewidth=1,this.clickable=!1,this.hoverable=!1,this.side=n.DoubleSide,this.stylespec=e||{},this.boundingSphere=new i.Sphere,this.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},d.updateFromStyle(this,this.stylespec),this.components=[],this.shapeObj=null,this.renderedShapeObj=null,this.geo=new n.Geometry(!0),this.linegeo=new n.Geometry(!0)}updateStyle(e){for(var t in e)this.stylespec[t]=e[t];if(d.updateFromStyle(this,this.stylespec),e.voldata&&e.volscheme){(0,h.adjustVolumeStyle)(e);const t=e.volscheme,r=e.voldata,n=a.CC,i=t.range()||[-1,1];this.geo.setColors((function(e,s,a){let o=r.getVal(e,s,a);return n.color(t.valueToHex(o,i))})),delete this.color}}addCustom(e){e.vertexArr=e.vertexArr||[],e.faceArr=e.faceArr||[],e.normalArr=e.normalArr||[],d.drawCustom(this,this.geo,e)}addSphere(e){e.center||(e.center=new s.Vector3(0,0,0)),e.radius=e.radius?(0,s.clamp)(e.radius,0,1/0):1.5,e.color=a.CC.color(e.color),this.intersectionShape.sphere.push(new i.Sphere(e.center,e.radius)),c.GLDraw.drawSphere(this.geo,e.center,e.radius,e.color,e.quality),this.components.push({centroid:new s.Vector3(e.center.x,e.center.y,e.center.z)});var t=this.geo.updateGeoGroup(0);d.updateBoundingFromPoints(this.boundingSphere,this.components,t.vertexArray,t.vertices)}addBox(e){var t,r,n,i=e.dimensions||{w:1,h:1,d:1};t="number"==typeof i.w?{x:i.w,y:0,z:0}:i.w,r="number"==typeof i.h?{x:0,y:i.h,z:0}:i.h,n="number"==typeof i.d?{x:0,y:0,z:i.d}:i.d;var a=e.corner;void 0==a&&(a=void 0!==e.center?{x:e.center.x-.5*(t.x+r.x+n.x),y:e.center.y-.5*(t.y+r.y+n.y),z:e.center.z-.5*(t.z+r.z+n.z)}:{x:0,y:0,z:0});var o=[{x:a.x,y:a.y,z:a.z},{x:a.x+t.x,y:a.y+t.y,z:a.z+t.z},{x:a.x+r.x,y:a.y+r.y,z:a.z+r.z},{x:a.x+t.x+r.x,y:a.y+t.y+r.y,z:a.z+t.z+r.z},{x:a.x+n.x,y:a.y+n.y,z:a.z+n.z},{x:a.x+t.x+n.x,y:a.y+t.y+n.y,z:a.z+t.z+n.z},{x:a.x+r.x+n.x,y:a.y+r.y+n.y,z:a.z+r.z+n.z},{x:a.x+t.x+r.x+n.x,y:a.y+t.y+r.y+n.y,z:a.z+t.z+r.z+n.z}],l=[],c=[];l.splice(l.length,0,o[0],o[1],o[2],o[3]),c.splice(c.length,0,0,2,1,1,2,3);var u=4;l.splice(l.length,0,o[2],o[3],o[6],o[7]),c.splice(c.length,0,u+0,u+2,u+1,u+1,u+2,u+3),u+=4,l.splice(l.length,0,o[4],o[5],o[0],o[1]),c.splice(c.length,0,u+0,u+2,u+1,u+1,u+2,u+3),u+=4,l.splice(l.length,0,o[6],o[7],o[4],o[5]),c.splice(c.length,0,u+0,u+2,u+1,u+1,u+2,u+3),u+=4,l.splice(l.length,0,o[3],o[1],o[7],o[5]),c.splice(c.length,0,u+0,u+2,u+1,u+1,u+2,u+3),u+=4,l.splice(l.length,0,o[2],o[6],o[0],o[4]),c.splice(c.length,0,u+0,u+2,u+1,u+1,u+2,u+3),u+=4;var f=(0,h.extend)({},e);f.vertexArr=l,f.faceArr=c,f.normalArr=[],d.drawCustom(this,this.geo,f);var p=new s.Vector3;this.components.push({centroid:p.addVectors(o[0],o[7]).multiplyScalar(.5)});var m=this.geo.updateGeoGroup(0);d.updateBoundingFromPoints(this.boundingSphere,this.components,m.vertexArray,m.vertices)}addCylinder(e){var t,r;t=e.start?new s.Vector3(e.start.x||0,e.start.y||0,e.start.z||0):new s.Vector3(0,0,0),e.end?"undefined"==typeof(r=new s.Vector3(e.end.x,e.end.y||0,e.end.z||0)).x&&(r.x=3):r=new s.Vector3(0,0,0);var n=e.radius||.1,o=a.CC.color(e.color);this.intersectionShape.cylinder.push(new i.Cylinder(t,r,n)),c.GLDraw.drawCylinder(this.geo,t,r,n,o,e.fromCap,e.toCap);var l=new s.Vector3;this.components.push({centroid:l.addVectors(t,r).multiplyScalar(.5)});var u=this.geo.updateGeoGroup(0);d.updateBoundingFromPoints(this.boundingSphere,this.components,u.vertexArray,u.vertices)}addDashedCylinder(e){var t,r;e.dashLength=e.dashLength||.25,e.gapLength=e.gapLength||.25,t=e.start?new s.Vector3(e.start.x||0,e.start.y||0,e.start.z||0):new s.Vector3(0,0,0),e.end?"undefined"==typeof(r=new s.Vector3(e.end.x,e.end.y||0,e.end.z||0)).x&&(r.x=3):r=new s.Vector3(3,0,0);for(var n=e.radius||.1,o=a.CC.color(e.color),l=Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2)+Math.pow(t.z-r.z,2)),u=l/(e.gapLength+e.dashLength),h=new s.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),f=new s.Vector3(e.end.x,e.end.y||0,e.end.z||0),p=new s.Vector3((r.x-t.x)/(l/e.gapLength),(r.y-t.y)/(l/e.gapLength),(r.z-t.z)/(l/e.gapLength)),m=new s.Vector3((r.x-t.x)/(l/e.dashLength),(r.y-t.y)/(l/e.dashLength),(r.z-t.z)/(l/e.dashLength)),g=0;g<u;g++)f=new s.Vector3(h.x+m.x,h.y+m.y,h.z+m.z),this.intersectionShape.cylinder.push(new i.Cylinder(h,f,n)),c.GLDraw.drawCylinder(this.geo,h,f,n,o,e.fromCap,e.toCap),h=new s.Vector3(f.x+p.x,f.y+p.y,f.z+p.z);var v=new s.Vector3;this.components.push({centroid:v.addVectors(t,r).multiplyScalar(.5)});var b=this.geo.updateGeoGroup(0);d.updateBoundingFromPoints(this.boundingSphere,this.components,b.vertexArray,b.vertices)}addCurve(e){e.points=e.points||[],e.smooth=e.smooth||10,"undefined"==typeof e.fromCap&&(e.fromCap=2),"undefined"==typeof e.toCap&&(e.toCap=2);var t=(0,u.subdivide_spline)(e.points,e.smooth);if(t.length<3)console.log("Too few points in addCurve");else{var r=e.radius||.1,n=a.CC.color(e.color),i=0,s=t.length-1,o=t[0].distanceTo(t[1]),l=Math.ceil(2*r/o);if(e.toArrow){let e={start:t[s-=l],end:t[t.length-1],radius:r,color:n,mid:1e-4};this.addArrow(e)}if(e.fromArrow){let e={start:t[i+=l],end:t[0],radius:r,color:n,mid:1e-4};this.addArrow(e)}for(var c=Math.ceil(t.length/2),h={radius:r,color:n,fromCap:2,toCap:2},d=i;d<s;d++)h.start=t[d],h.end=t[d+1],h.fromCap=2,h.toCap=2,d<c?(h.fromCap=2,h.toCap=0):d>c?(h.fromCap=0,h.toCap=2):(h.fromCap=2,h.toCap=2),this.addCylinder(h)}}addLine(e){var t,r;t=e.start?new s.Vector3(e.start.x||0,e.start.y||0,e.start.z||0):new s.Vector3(0,0,0),e.end?"undefined"==typeof(r=new s.Vector3(e.end.x,e.end.y||0,e.end.z||0)).x&&(r.x=3):r=new s.Vector3(3,0,0);var n=this.geo.updateGeoGroup(2),i=n.vertices,a=3*i,o=n.vertexArray;o[a]=t.x,o[a+1]=t.y,o[a+2]=t.z,o[a+3]=r.x,o[a+4]=r.y,o[a+5]=r.z,n.vertices+=2;var l=n.lineArray,c=n.lineidx;l[c]=i,l[c+1]=i+1,n.lineidx+=2;var u=new s.Vector3;this.components.push({centroid:u.addVectors(t,r).multiplyScalar(.5)}),n=this.geo.updateGeoGroup(0),d.updateBoundingFromPoints(this.boundingSphere,this.components,n.vertexArray,n.vertices)}addArrow(e){if(e.start?e.start=new s.Vector3(e.start.x||0,e.start.y||0,e.start.z||0):e.start=new s.Vector3(0,0,0),e.dir instanceof s.Vector3&&"number"===typeof e.length){var t=e.dir.clone().multiplyScalar(e.length).add(e.start);e.end=t}else e.end?(e.end=new s.Vector3(e.end.x,e.end.y||0,e.end.z||0),"undefined"==typeof e.end.x&&(e.end.x=3)):e.end=new s.Vector3(3,0,0);e.radius=e.radius||.1,e.radiusRatio=e.radiusRatio||1.618034,e.mid=0<e.mid&&e.mid<1?e.mid:.618034,d.drawArrow(this,this.geo,e);var r=new s.Vector3;this.components.push({centroid:r.addVectors(e.start,e.end).multiplyScalar(.5)});var n=this.geo.updateGeoGroup(0);d.updateBoundingFromPoints(this.boundingSphere,this.components,n.vertexArray,n.vertices)}static distance_from(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)+Math.pow(e.z-t.z,2))}static inSelectedRegion(e,t,r){for(var n=0;n<t.length;n++)if(d.distance_from(t[n],e)<=r)return!0;return!1}addIsosurface(e,t,r){var n,i,a=void 0!==t.isoval&&"number"===typeof t.isoval?t.isoval:0,l=!!t.voxel,c=void 0===t.smoothness?1:t.smoothness,u=e.size.x,h=e.size.y,f=e.size.z,p=new Int16Array(u*h*f),m=e.data;for(n=0,i=p.length;n<i;++n)p[n]=-1;var g=new Uint8Array(u*h*f);for(n=0,i=m.length;n<i;++n)(a>=0?m[n]-a:a-m[n])>0&&(g[n]|=d.ISDONE);var v=[],b=[];o.MarchingCube.march(g,v,b,{fulltable:!0,voxel:l,unitCube:e.unit,origin:e.origin,matrix:e.matrix,nX:u,nY:h,nZ:f}),!l&&c>0&&o.MarchingCube.laplacianSmooth(c,v,b);var y=[],_=[],w=[];if(t.selectedRegion&&void 0===t.coords&&(t.coords=t.selectedRegion),void 0!==t.coords){var x=t.coords[0].x,S=t.coords[0].y,C=t.coords[0].z,k=t.coords[0].x,E=t.coords[0].y,A=t.coords[0].z;for(let e=0;e<t.coords.length;e++)t.coords[e].x>x?x=t.coords[e].x:t.coords[e].x<k&&(k=t.coords[e].x),t.coords[e].y>S?S=t.coords[e].y:t.coords[e].y<E&&(E=t.coords[e].y),t.coords[e].z>C?C=t.coords[e].z:t.coords[e].z<A&&(A=t.coords[e].z);var L=2;void 0!==t.radius&&(L=t.radius),void 0!==t.selectedOffset&&(L=t.selectedOffset),void 0!==t.seldist&&(L=t.seldist),k-=L,x+=L,E-=L,S+=L,A-=L,C+=L;for(let e=0;e<v.length;e++)v[e].x>k&&v[e].x<x&&v[e].y>E&&v[e].y<S&&v[e].z>A&&v[e].z<C&&d.inSelectedRegion(v[e],t.coords,L)?(y.push(_.length),_.push(v[e])):y.push(-1);for(let e=0;e+2<b.length;e+=3)-1!==y[b[e]]&&-1!==y[b[e+1]]&&-1!==y[b[e+2]]&&(w.push(b[e]-(b[e]-y[b[e]])),w.push(b[e+1]-(b[e+1]-y[b[e+1]])),w.push(b[e+2]-(b[e+2]-y[b[e+2]])));v=_,b=w}d.drawCustom(this,this.geo,{vertexArr:v,faceArr:b,normalArr:[],clickable:t.clickable,hoverable:t.hoverable}),this.updateStyle(t);var M=new s.Vector3(e.origin.x,e.origin.y,e.origin.z),z=new s.Vector3(e.size.x*e.unit.x,e.size.y*e.unit.y,e.size.z*e.unit.z),T=new s.Vector3(0,0,0),O=M.clone(),P=M.clone().add(z);for(let s=0;s<v.length;s++)T.add(v[s]),O.max(v[s]),P.min(v[s]);T.divideScalar(v.length);var D=T.distanceTo(P),N=T.distanceTo(O);this.boundingSphere.center=T,this.boundingSphere.radius=Math.max(D,N),"function"==typeof r&&r()}addVolumetricData(e,t,r){e=new l.VolumeData(e,t),this.addIsosurface(e,r)}finalize(){return d.finalizeGeo(this.geo),this.geo.initTypedArrays(),this.geo}globj(e){if(this.renderedShapeObj&&(e.remove(this.renderedShapeObj),this.renderedShapeObj=null),!this.hidden){d.finalizeGeo(this.geo),this.geo.initTypedArrays(),this.wireframe&&this.geo.setUpWireframe(),"undefined"!=typeof this.color&&d.updateColor(this.geo,this.color),this.shapeObj=new n.Object3D;var t=null;t=this.side==n.DoubleSide?new n.MeshDoubleLambertMaterial({wireframe:this.wireframe,side:this.side,transparent:this.opacity<1,opacity:this.opacity,wireframeLinewidth:this.linewidth,vertexColors:n.Coloring.VertexColors}):new n.MeshLambertMaterial({wireframe:this.wireframe,side:this.side,transparent:this.opacity<1,opacity:this.opacity,wireframeLinewidth:this.linewidth,vertexColors:n.Coloring.VertexColors});var r=new n.Mesh(this.geo,t);this.shapeObj.add(r);var i=new n.LineBasicMaterial({linewidth:this.linewidth,color:this.color}),s=new n.Line(this.linegeo,i,n.LineStyle.LinePieces);this.shapeObj.add(s),this.renderedShapeObj=this.shapeObj.clone(),e.add(this.renderedShapeObj)}}removegl(e){this.renderedShapeObj&&(void 0!==this.renderedShapeObj.geometry&&this.renderedShapeObj.geometry.dispose(),void 0!==this.renderedShapeObj.material&&this.renderedShapeObj.material.dispose(),e.remove(this.renderedShapeObj),this.renderedShapeObj=null),this.shapeObj=null}get position(){return this.boundingSphere.center}get x(){return this.boundingSphere.center.x}get y(){return this.boundingSphere.center.y}get z(){return this.boundingSphere.center.z}}function f(e){if(e.vertexArr.length<64e3)return[e];var t=[{vertexArr:[],normalArr:[],faceArr:[]}];e.colorArr&&(t.colorArr=[]);var r=[],n=[],i=0,s=e.faceArr;for(let o=0,l=s.length;o<l;o+=3){let l=t[i];for(let t=0;t<3;t++){var a=s[o+t];r[a]!==i&&(r[a]=i,n[a]=l.vertexArr.length,l.vertexArr.push(e.vertexArr[a]),e.normalArr&&e.normalArr[a]&&l.normalArr.push(e.normalArr[a]),e.colorArr&&e.colorArr[a]&&l.colorArr.push(e.colorArr[a])),l.faceArr.push(n[a])}l.vertexArr.length>=64e3&&(t.push({vertexArr:[],normalArr:[],faceArr:[]}),e.colorArr&&(t.colorArr=[]),i++)}return t}d.ISDONE=2,d.drawCustom=function(e,t,r){var n=r,i=n.vertexArr,s=n.faceArr;0!==i.length&&0!==s.length||console.warn("Error adding custom shape component: No vertices and/or face indices supplied!");var o=r.color;"undefined"==typeof o&&(o=e.color),o=a.CC.color(o);for(var l=f(n),c=0,u=l.length;c<u;c++)d.addCustomGeo(e,t,l[c],l[c].colorArr?l[c].colorArr:o,r.clickable)}},"./src/GLViewer.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{GLViewer:()=>m,createStereoViewer:()=>b,createViewer:()=>g,createViewerGrid:()=>v});var n=r("./src/WebGL/index.ts"),i=r("./src/WebGL/math/index.ts"),s=r("./src/colors.ts"),a=r("./src/utilities.ts"),o=r("./src/Gradient.ts"),l=r("./src/GLModel.ts"),c=r("./src/Label.ts"),u=r("./src/GLShape.ts"),h=r("./src/VolumeData.ts"),d=r("./src/ProteinSurface4.ts"),f=r("./src/VolumetricRender.ts"),p=r("./node_modules/upng-js/UPNG.js");class m{getRect(){let e=this.container,t=e.getBoundingClientRect();if(0==t.width&&0==t.height&&"none"===e.style.display){let r=e.style.position,n=e.style.visibility;e.style.display="block",e.style.visibility="hidden",e.style.position="absolute",t=e.getBoundingClientRect(),e.style.display="none",e.style.visibility=n,e.style.position=r}return t}getWidth(){return this.getRect().width}getHeight(){return this.getRect().height}setupRenderer(){this.renderer=new n.Renderer({antialias:this.config.antialias,preserveDrawingBuffer:!0,premultipliedAlpha:!1,id:this.config.id,row:this.config.row,col:this.config.col,rows:this.config.rows,cols:this.config.cols,canvas:this.config.canvas,containerWidth:this.WIDTH||1,containerHeight:this.HEIGHT||1}),this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.renderer.domElement.style.padding="0",this.renderer.domElement.style.position="absolute",this.renderer.domElement.style.top="0px",this.renderer.domElement.style.left="0px",this.renderer.domElement.style.zIndex="0"}initializeScene(){this.scene=new n.Scene,this.scene.fog=new n.Fog(this.bgColor,100,200),this.modelGroup=new n.Object3D,this.rotationGroup=new n.Object3D,this.rotationGroup.useQuaternion=!0,this.rotationGroup.quaternion=new i.Quaternion(0,0,0,1),this.rotationGroup.add(this.modelGroup),this.scene.add(this.rotationGroup);var e=new n.Light(16777215);e.position=new i.Vector3(.2,.2,1).normalize(),e.intensity=1,this.scene.add(e)}initContainer(e){this.container=e,this.WIDTH=this.getWidth(),this.HEIGHT=this.getHeight(),this.ASPECT=this.renderer.getAspect(this.WIDTH,this.HEIGHT),this.renderer.setSize(this.WIDTH,this.HEIGHT),this.container.append(this.renderer.domElement),this.glDOM=this.renderer.domElement,this.nomouse||(this.glDOM.addEventListener("mousedown",this._handleMouseDown.bind(this),{passive:!1}),this.glDOM.addEventListener("touchstart",this._handleMouseDown.bind(this),{passive:!1}),this.glDOM.addEventListener("wheel",this._handleMouseScroll.bind(this),{passive:!1}),this.glDOM.addEventListener("mousemove",this._handleMouseMove.bind(this),{passive:!1}),this.glDOM.addEventListener("touchmove",this._handleMouseMove.bind(this),{passive:!1}),this.glDOM.addEventListener("contextmenu",this._handleContextMenu.bind(this),{passive:!1}))}decAnim(){this.animated--,this.animated<0&&(this.animated=0)}incAnim(){this.animated++}nextSurfID(){var e=0;for(let r in this.surfaces)if(this.surfaces.hasOwnProperty(r)){var t=parseInt(r);isNaN(t)||t>e&&(e=t)}return e+1}setSlabAndFog(){let e=this.camera.position.z-this.rotationGroup.position.z;e<1&&(e=1),this.camera.near=e+this.slabNear,this.camera.near<1&&(this.camera.near=1),this.camera.far=e+this.slabFar,this.camera.near+1>this.camera.far&&(this.camera.far=this.camera.near+1),this.camera.fov=this.fov,this.camera.right=e*Math.tan(Math.PI/180*this.fov),this.camera.left=-this.camera.right,this.camera.top=this.camera.right/this.ASPECT,this.camera.bottom=-this.camera.top,this.camera.updateProjectionMatrix(),this.scene.fog.near=this.camera.near+this.fogStart*(this.camera.far-this.camera.near),this.scene.fog.far=this.camera.far,this.config.disableFog&&(this.scene.fog.near=this.scene.fog.far)}show(e){if(this.renderer.setViewport(),this.scene&&(this.setSlabAndFog(),this.renderer.render(this.scene,this.camera),this.viewChangeCallback&&this.viewChangeCallback(this._viewer.getView()),!e&&this.linkedViewers.length>0))for(var t=this._viewer.getView(),r=0;r<this.linkedViewers.length;r++)this.linkedViewers[r].setView(t,!0)}updateClickables(){this.clickables.splice(0,this.clickables.length),this.hoverables.splice(0,this.hoverables.length),this.contextMenuEnabledAtoms.splice(0,this.contextMenuEnabledAtoms.length);for(let e=0,t=this.models.length;e<t;e++){let t=this.models[e];if(t){let e=t.selectedAtoms({clickable:!0}),r=t.selectedAtoms({hoverable:!0}),n=t.selectedAtoms({contextMenuEnabled:!0});for(let t=0;t<r.length;t++)this.hoverables.push(r[t]);for(let t=0;t<e.length;t++)this.clickables.push(e[t]);for(let t=0;t<n.length;t++)this.contextMenuEnabledAtoms.push(n[t])}}for(let e=0,t=this.shapes.length;e<t;e++){let t=this.shapes[e];t&&t.clickable&&this.clickables.push(t),t&&t.hoverable&&this.hoverables.push(t)}}handleClickSelection(e,t,r){let n=this.targetedObjects(e,t,this.clickables);if(n.length){var i=n[0].clickable;void 0!==i.callback&&("function"!=typeof i.callback&&(i.callback=(0,a.makeFunction)(i.callback)),"function"===typeof i.callback&&i.callback(i,this._viewer,r,this.container,n))}}canvasOffset(){let e=this.glDOM,t=e.getBoundingClientRect(),r=e.ownerDocument,n=r.documentElement,i=r.defaultView;return{top:t.top+i.pageYOffset-n.clientTop,left:t.left+i.pageXOffset-n.clientLeft}}setHover(e,t,r){this.current_hover!=e&&(this.current_hover&&("function"!=typeof this.current_hover.unhover_callback&&(this.current_hover.unhover_callback=(0,a.makeFunction)(this.current_hover.unhover_callback)),this.current_hover.unhover_callback(this.current_hover,this._viewer,t,this.container,r)),this.current_hover=e,e&&void 0!==e.hover_callback&&("function"!=typeof e.hover_callback&&(e.hover_callback=(0,a.makeFunction)(e.hover_callback)),"function"===typeof e.hover_callback&&e.hover_callback(e,this._viewer,t,this.container,r)))}handleHoverSelection(e,t,r){if(0==this.hoverables.length)return;let n=this.targetedObjects(e,t,this.hoverables);if(n.length){var i=n[0].clickable;this.setHover(i,r,n),this.current_hover=i}else this.setHover(null)}handleHoverContinue(e,t){let r=this.targetedObjects(e,t,this.hoverables);0!=r.length&&void 0!==r[0]||this.setHover(null),void 0!==r[0]&&r[0].clickable!==this.current_hover&&this.setHover(null)}closeEnoughForClick(e){let{allowTolerance:t=e.targetTouches,tolerance:r=5}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getX(e),i=this.getY(e);if(t){const e=Math.abs(n-this.mouseStartX),t=Math.abs(i-this.mouseStartY);return e<=r&&t<=r}return n===this.mouseStartX&&i===this.mouseStartY}calcTouchDistance(e){var t=e.targetTouches[0].pageX-e.targetTouches[1].pageX,r=e.targetTouches[0].pageY-e.targetTouches[1].pageY;return Math.hypot(t,r)}getX(e){var t=e.pageX;return void 0==t&&(t=e.pageX),e.targetTouches&&e.targetTouches[0]?t=e.targetTouches[0].pageX:e.changedTouches&&e.changedTouches[0]&&(t=e.changedTouches[0].pageX),t}getY(e){var t=e.pageY;return void 0==t&&(t=e.pageY),e.targetTouches&&e.targetTouches[0]?t=e.targetTouches[0].pageY:e.changedTouches&&e.changedTouches[0]&&(t=e.changedTouches[0].pageY),t}isInViewer(e,t){if(void 0!=this.viewers){var r=this.WIDTH/this.cols,n=this.HEIGHT/this.rows,i=this.canvasOffset(),s=e-i.left,a=t-i.top,o=this.rows-Math.floor(a/n)-1,l=Math.floor(s/r);if(o!=this.row||l!=this.col)return!1}return!0}adjustZoomToLimits(e){if(this.config.lowerZoomLimit&&this.config.lowerZoomLimit>0){let t=this.CAMERA_Z-this.config.lowerZoomLimit;e>t&&(e=t)}if(this.config.upperZoomLimit&&this.config.upperZoomLimit>0){let t=this.CAMERA_Z-this.config.upperZoomLimit;e<t&&(e=t)}return e>this.CAMERA_Z-1&&(e=this.CAMERA_Z-1),e}static slerp(e,t,r){if(1==r)return t.clone();if(0==r)return e.clone();let n=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(n>.9995){let n=new i.Quaternion(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y),e.z+r*(t.z-e.z),e.w+r*(t.w-e.w));return n.normalize(),n}n<0&&(t=t.clone().multiplyScalar(-1),n=-n),n>1?n=1:n<-1&&(n=-1);var s=Math.acos(n)*r,a=t.clone();a.sub(e.clone().multiplyScalar(n)),a.normalize();var o=Math.cos(s),l=Math.sin(s),c=new i.Quaternion(e.x*o+a.x*l,e.y*o+a.y*l,e.z*o+a.z*l,e.w*o+a.w*l);return c.normalize(),c}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.nomouse=!1,this.glDOM=null,this.models=[],this.surfaces={},this.shapes=[],this.labels=[],this.clickables=[],this.hoverables=[],this.contextMenuEnabledAtoms=[],this.current_hover=null,this.hoverDuration=500,this.viewer_frame=0,this.viewChangeCallback=null,this.stateChangeCallback=null,this.NEAR=1,this.FAR=800,this.CAMERA_Z=150,this.fov=20,this.linkedViewers=[],this.renderer=null,this.control_all=!1,this.scene=null,this.rotationGroup=null,this.modelGroup=null,this.fogStart=.4,this.slabNear=-50,this.slabFar=50,this.cq=new i.Quaternion(0,0,0,1),this.dq=new i.Quaternion(0,0,0,1),this.animated=0,this.animationTimers=new Set,this.isDragging=!1,this.mouseStartX=0,this.mouseStartY=0,this.touchDistanceStart=0,this.touchHold=!1,this.currentModelPos=0,this.cz=0,this.cslabNear=0,this.cslabFar=0,this.userContextMenuHandler=null,this.config=t,this.callback=this.config.callback,this.defaultcolors=this.config.defaultcolors,this.defaultcolors||(this.defaultcolors=s.elementColors.defaultColors),this.nomouse=this.config.nomouse,this.bgColor=0,this.config.backgroundColor=this.config.backgroundColor||"#ffffff","undefined"!=typeof this.config.backgroundColor&&(this.bgColor=s.CC.color(this.config.backgroundColor).getHex()),this.config.backgroundAlpha=void 0==this.config.backgroundAlpha?1:this.config.backgroundAlpha,this.camerax=0,"undefined"!=typeof this.config.camerax&&(this.camerax=parseFloat(this.config.camerax)),this._viewer=this,this.container=e,void 0!=this.config.hoverDuration&&(this.hoverDuration=this.config.hoverDuration),void 0===this.config.antialias&&(this.config.antialias=!0),void 0===this.config.cartoonQuality&&(this.config.cartoonQuality=10),this.WIDTH=this.getWidth(),this.HEIGHT=this.getHeight(),this.setupRenderer(),this.row=void 0==this.config.row?0:this.config.row,this.col=void 0==this.config.col?0:this.config.col,this.cols=this.config.cols,this.rows=this.config.rows,this.viewers=this.config.viewers,this.control_all=this.config.control_all,this.ASPECT=this.renderer.getAspect(this.WIDTH,this.HEIGHT),this.camera=new n.Camera(this.fov,this.ASPECT,this.NEAR,this.FAR,this.config.orthographic),this.camera.position=new i.Vector3(this.camerax,0,this.CAMERA_Z),this.lookingAt=new i.Vector3,this.camera.lookAt(this.lookingAt),this.raycaster=new n.Raycaster(new i.Vector3(0,0,0),new i.Vector3(0,0,0)),this.projector=new n.Projector,this.initializeScene(),this.renderer.setClearColorHex(this.bgColor,this.config.backgroundAlpha),this.scene.fog.color=s.CC.color(this.bgColor),document.body.addEventListener("mouseup",this._handleMouseUp.bind(this)),document.body.addEventListener("touchend",this._handleMouseUp.bind(this)),this.initContainer(this.container),this.config.style&&this.setViewStyle(this.config),window.addEventListener("resize",this.resize.bind(this)),"undefined"!==typeof window.ResizeObserver&&(this.divwatcher=new window.ResizeObserver(this.resize.bind(this)),this.divwatcher.observe(this.container));try{"function"===typeof this.callback&&this.callback(this)}catch(r){console.log("error with glviewer callback: "+r)}}targetedObjects(e,t,r){var n={x:e,y:t,z:-1};return Array.isArray(r)||(r=this.selectedAtoms(r)),0==r.length?[]:(this.raycaster.setFromCamera(n,this.camera),this.raycaster.intersectObjects(this.modelGroup,r))}modelToScreen(e){let t=!1;Array.isArray(e)||(e=[e],t=!0);let r=this.renderer.getXRatio(),n=this.renderer.getYRatio(),s=this.col,a=this.row,o=s*(this.WIDTH/r),l=(n-a-1)*(this.HEIGHT/n),c=[],u=this.canvasOffset();return e.forEach((e=>{let t=new i.Vector3(e.x,e.y,e.z);t.applyMatrix4(this.modelGroup.matrixWorld),this.projector.projectVector(t,this.camera);let s=this.WIDTH/r*(t.x+1)/2+u.left+o,a=-this.HEIGHT/n*(t.y-1)/2+u.top+l;c.push({x:s,y:a})})),t&&(c=c[0]),c}screenOffsetToModel(e,t,r){var n=e/this.WIDTH,s=t/this.HEIGHT,a=void 0===r?this.rotationGroup.position.z:r,o=this.rotationGroup.quaternion,l=new i.Vector3(0,0,a);return this.projector.projectVector(l,this.camera),l.x+=2*n,l.y-=2*s,this.projector.unprojectVector(l,this.camera),l.z=0,l.applyQuaternion(o),l}screenToModelDistance(e,t){let r=this.canvasOffset(),n=new i.Vector3(t.x,t.y,t.z);n.applyMatrix4(this.modelGroup.matrixWorld);let s=n.clone();this.projector.projectVector(n,this.camera);let a=new i.Vector3(2*(e.x-r.left)/this.WIDTH-1,2*(e.y-r.top)/-this.HEIGHT+1,n.z);return this.projector.unprojectVector(a,this.camera),a.distanceTo(s)}setViewChangeCallback(e){"function"!==typeof e&&null!=e||(this.viewChangeCallback=e)}setStateChangeCallback(e){"function"!==typeof e&&null!=e||(this.stateChangeCallback=e)}getConfig(){return this.config}setConfig(e){this.config=e}getInternalState(){var e={models:[],surfaces:[],shapes:[],labels:[]};for(let t=0;t<this.models.length;t++)this.models[t]&&(e.models[t]=this.models[t].getInternalState());return e}setInternalState(e){this.clear();var t=e.models;for(let r=0;r<t.length;r++)t[r]&&(this.models[r]=new l.GLModel(r),this.models[r].setInternalState(t[r]));this.render()}setZoomLimits(e,t){"undefined"!==typeof e&&(this.config.lowerZoomLimit=e),t&&(this.config.upperZoomLimit=t),this.rotationGroup.position.z=this.adjustZoomToLimits(this.rotationGroup.position.z),this.show()}setCameraParameters(e){void 0!==e.fov&&(this.fov=e.fov,this.camera.fov=this.fov),void 0!==e.z&&(this.CAMERA_Z=e.z,this.camera.z=this.CAMERA_Z),void 0!==e.orthographic&&(this.camera.ortho=e.orthographic)}_handleMouseDown(e){if(e.preventDefault(),!this.scene)return;var t=this.getX(e),r=this.getY(e);if(void 0===t)return;this.isDragging=!0,this.mouseButton=e.which,this.mouseStartX=t,this.mouseStartY=r,this.touchHold=!0,this.touchDistanceStart=0,e.targetTouches&&2==e.targetTouches.length&&(this.touchDistanceStart=this.calcTouchDistance(e)),this.cq=this.rotationGroup.quaternion.clone(),this.cz=this.rotationGroup.position.z,this.currentModelPos=this.modelGroup.position.clone(),this.cslabNear=this.slabNear,this.cslabFar=this.slabFar;let n=this;setTimeout((function(){e.targetTouches&&1==n.touchHold&&(n.glDOM=n.renderer.domElement,n.glDOM.dispatchEvent(new Event("contextmenu")))}),1e3)}_handleMouseUp(e){if(this.touchHold=!1,this.isDragging&&this.scene){var t=this.getX(e),r=this.getY(e);if(this.closeEnoughForClick(e)&&this.isInViewer(t,r)){let n=this.mouseXY(t,r);this.handleClickSelection(n.x,n.y,e)}}this.isDragging=!1}_handleMouseScroll(e){if(e.preventDefault(),this.scene){var t=this.getX(e),r=this.getY(e);if(void 0!==t&&(this.control_all||this.isInViewer(t,r))){var n=.85*(this.CAMERA_Z-this.rotationGroup.position.z),i=1;if(e.ctrlKey&&(i=-1),e.detail)this.rotationGroup.position.z+=i*n*e.detail/10;else if(e.wheelDelta){let t=600*e.wheelDelta/(e.wheelDelta+600);this.rotationGroup.position.z-=i*n*t/400}this.rotationGroup.position.z=this.adjustZoomToLimits(this.rotationGroup.position.z),this.show()}}}pngURI(){return this.getCanvas().toDataURL("image/png")}apngURI(e){let t=this;return e=e||1,new Promise((function(r){let n=0,i=t.viewChangeCallback,s=[],a=[],o=Date.now();t.viewChangeCallback=function(){a.push(Date.now()-o),o=Date.now(),s.push(new Promise((e=>{t.getCanvas().toBlob((function(t){t.arrayBuffer().then(e)}),"image/png")}))),n+=1,n==e&&(t.viewChangeCallback=i,Promise.all(s).then((e=>{let n=[];for(let t=0;t<e.length;t++){let r=(0,p.decode)(e[t]);n.push((0,p.toRGBA8)(r)[0])}let i=t.getCanvas().width,s=t.getCanvas().height,o=(0,p.encode)(n,i,s,0,a),l=new Blob([o],{type:"image/png"}),c=new FileReader;c.onload=function(e){r(e.target.result)},c.readAsDataURL(l)})))}}))}getCanvas(){return this.glDOM}getRenderer(){return this.renderer}setHoverDuration(e){this.hoverDuration=e}mouseXY(e,t){let r=this.canvasOffset(),n=this.renderer.getXRatio(),i=this.renderer.getYRatio(),s=this.col,a=this.row,o=s*(this.WIDTH/n),l=(i-a-1)*(this.HEIGHT/i);return{x:(e-r.left-o)/(this.WIDTH/n)*2-1,y:-(t-r.top-l)/(this.HEIGHT/i)*2+1}}_handleMouseMove(e){clearTimeout(this.hoverTimeout),e.preventDefault();let t=this.getX(e),r=this.getY(e);if(void 0===t)return;let n=this.renderer.getXRatio(),i=this.renderer.getYRatio(),s=this.mouseXY(t,r),a=this;null!==this.current_hover&&this.handleHoverContinue(s.x,s.y);var o=0;if((this.control_all||this.isInViewer(t,r))&&this.scene&&(this.hoverables.length>0&&(this.hoverTimeout=setTimeout((function(){a.handleHoverSelection(s.x,s.y,e)}),this.hoverDuration)),this.isDragging)){var l=(t-this.mouseStartX)/this.WIDTH,c=(r-this.mouseStartY)/this.HEIGHT;0!=this.touchDistanceStart&&e.targetTouches&&2==e.targetTouches.length?(o=2,c=2*(this.calcTouchDistance(e)-this.touchDistanceStart)/(this.WIDTH+this.HEIGHT)):e.targetTouches&&3==e.targetTouches.length&&(o=1),l*=n,c*=i;var u,h=Math.hypot(l,c);if(3==o||3==this.mouseButton&&e.ctrlKey)this.slabNear=this.cslabNear+100*l,this.slabFar=this.cslabFar-100*c;else if(2==o||3==this.mouseButton||e.shiftKey)(u=.85*(this.CAMERA_Z-this.rotationGroup.position.z))<80&&(u=80),this.rotationGroup.position.z=this.cz+c*u,this.rotationGroup.position.z=this.adjustZoomToLimits(this.rotationGroup.position.z);else if(1==o||2==this.mouseButton||e.ctrlKey){var d=this.screenOffsetToModel(n*(t-this.mouseStartX),i*(r-this.mouseStartY));this.modelGroup.position.addVectors(this.currentModelPos,d)}else if((0===o||1==this.mouseButton)&&0!==h){var f=Math.sin(h*Math.PI)/h;this.dq.x=Math.cos(h*Math.PI),this.dq.y=0,this.dq.z=f*l,this.dq.w=-f*c,this.rotationGroup.quaternion.set(1,0,0,0),this.rotationGroup.quaternion.multiply(this.dq),this.rotationGroup.quaternion.multiply(this.cq)}this.show()}}_handleContextMenu(e){e.preventDefault();var t=this.getX(e),r=this.getY(e);if(t==this.mouseStartX&&r==this.mouseStartY){var n=this.mouseStartX,i=this.mouseStartY,s=this.canvasOffset();let e=this.mouseXY(n,i),t=e.x,r=e.y,o=this.targetedObjects(t,r,this.contextMenuEnabledAtoms);var a=null;o.length&&(a=o[0].clickable),s=this.canvasOffset(),n=this.mouseStartX-s.left,i=this.mouseStartY-s.top,this.userContextMenuHandler&&this.userContextMenuHandler(a,n,i,o)}}setContainer(e){let t=(0,a.getElement)(e)||this.container;return this.initContainer(t),this}
2setBackgroundColor(e,t){("undefined"==typeof t||t<0||t>1)&&(t=1);var r=s.CC.color(e);return this.scene.fog.color=r,this.bgColor=r.getHex(),this.renderer.setClearColorHex(r.getHex(),t),this.show(),this}setProjection(e){this.camera.ortho="orthographic"===e,this.setSlabAndFog()}setViewStyle(e){if("outline"===e.style){var t={};e.color&&(t.color=s.CC.color(e.color)),e.width&&(t.width=e.width),this.renderer.enableOutline(t)}else this.renderer.disableOutline();return this}updateSize(){this.renderer.setSize(this.WIDTH,this.HEIGHT),this.ASPECT=this.renderer.getAspect(this.WIDTH,this.HEIGHT),this.renderer.setSize(this.WIDTH,this.HEIGHT),this.camera.aspect=this.ASPECT,this.camera.updateProjectionMatrix()}setWidth(e){return this.WIDTH=e||this.WIDTH,this.updateSize(),this}setHeight(e){return this.HEIGHT=e||this.HEIGHT,this.updateSize(),this}resize(){this.WIDTH=this.getWidth(),this.HEIGHT=this.getHeight();let e=!1;if(this.renderer.isLost()&&this.WIDTH>0&&this.HEIGHT>0&&(this.container.querySelector("canvas").remove(),this.setupRenderer(),this.initContainer(this.container),e=!0),0==this.WIDTH||0==this.HEIGHT?this.animated&&this._viewer.pauseAnimate():this.animated&&this._viewer.resumeAnimate(),this.updateSize(),e){let e=this.renderer.supportedExtensions();e.regen=!0,this._viewer.render(null,e)}else this.show();return this}getModel(e){return void 0===e?0==this.models.length?null:this.models[this.models.length-1]:e instanceof l.GLModel?e:e in this.models?this.models[e]:0==this.models.length?null:this.models[this.models.length-1]}spin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(clearInterval(this.spinInterval),"undefined"==typeof e&&(e="y"),"boolean"==typeof e){if(!e)return;e="y"}Array.isArray(e)&&(e={x:e[0],y:e[1],z:e[2]});var r=this;this.spinInterval=setInterval((function(){!r.getCanvas().isConnected&&r.renderer.isLost()&&clearInterval(r.spinInterval),r.rotate(1*t,e)}),25)}animateMotion(e,t,r,n,i,s){var a=Math.ceil(e/20);a<1&&(a=1),this.incAnim();var o={mpos:this.modelGroup.position.clone(),rz:this.rotationGroup.position.z,rot:this.rotationGroup.quaternion.clone(),cam:this.lookingAt.clone()};if(t){let e=new Array(a);for(let u=0;u<a;u++){let t=(u+1)/a,l={mpos:o.mpos,rz:o.rz,rot:o.rot};l.mpos=r.clone().sub(o.mpos).multiplyScalar(t).add(o.mpos),l.rz=o.rz+t*(n-o.rz),l.rot=m.slerp(o.rot,i,t),l.cam=s.clone().sub(o.cam).multiplyScalar(t).add(o.cam),e[u]=l}let t=0,l=this,c=function(){var r=e[t];t+=1,l.modelGroup.position=r.mpos,l.rotationGroup.position.z=r.rz,l.rotationGroup.quaternion=r.rot,l.camera.lookAt(r.cam),t<e.length?setTimeout(c,20):l.decAnim(),l.show()};setTimeout(c,20)}else{var l={};let e=1/a;if(r&&(l.mpos=r.clone().sub(o.mpos).multiplyScalar(e)),"undefined"!=typeof n&&null!=n&&(l.rz=e*(n-o.rz)),i){var c=m.slerp(o.rot,i,e);l.rot=o.rot.clone().inverse().multiply(c)}s&&(l.cam=s.clone().sub(o.cam).multiplyScalar(e));let t=0,u=this,h=function(){t+=1,l.mpos&&u.modelGroup.position.add(l.mpos),l.rz&&(u.rotationGroup.position.z+=l.rz),l.rot&&u.rotationGroup.quaternion.multiply(l.rot),l.cam&&(u.lookingAt.add(l.cam),u.camera.lookAt(u.lookingAt)),t<a?setTimeout(h,20):u.decAnim(),u.show()};setTimeout(h,20)}}rotate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("x"==t?t={x:1,y:0,z:0}:"y"==t?t={x:0,y:1,z:0}:"z"==t&&(t={x:0,y:0,z:1}),"vx"==t?t={vx:1,vy:0,vz:0}:"vy"==t?t={vx:0,vy:1,vz:0}:"vz"==t&&(t={vx:0,vy:0,vz:1}),"undefined"!==typeof t.vx){var s=new i.Vector3(t.vx,t.vy,t.vz);s.applyQuaternion(this.rotationGroup.quaternion),t={x:s.x,y:s.y,z:s.z}}var a=function(e){var r,n,s,a=Math.sin(e/2),o=Math.cos(e/2);return r=t.x*a,n=t.y*a,s=t.z*a,new i.Quaternion(r,n,s,o).normalize()}(Math.PI*e/180);if(r){var o=(new i.Quaternion).copy(this.rotationGroup.quaternion).multiply(a);this.animateMotion(r,n,this.modelGroup.position,this.rotationGroup.position.z,o,this.lookingAt)}else this.rotationGroup.quaternion.multiply(a),this.show();return this}surfacesFinished(){for(var e in this.surfaces)if(!this.surfaces[e][0].done)return!1;return!0}
2getView(){if(!this.modelGroup)return[0,0,0,0,0,0,0,1];var e=this.modelGroup.position,t=this.rotationGroup.quaternion;return[e.x,e.y,e.z,this.rotationGroup.position.z,t.x,t.y,t.z,t.w]}setView(e,t){return void 0!==e&&(e instanceof Array||8!==e.length)&&this.modelGroup&&this.rotationGroup?(this.modelGroup.position.x=e[0],this.modelGroup.position.y=e[1],this.modelGroup.position.z=e[2],this.rotationGroup.position.z=e[3],this.rotationGroup.quaternion.x=e[4],this.rotationGroup.quaternion.y=e[5],this.rotationGroup.quaternion.z=e[6],this.rotationGroup.quaternion.w=e[7],"undefined"!=typeof e[8]&&(this.rotationGroup.position.x=e[8],this.rotationGroup.position.y=e[9]),this.show(t),this):this}render(e,t){this.renderer.setViewport(),this.updateClickables();var r,i,s=this.getView();for(this.stateChangeCallback&&this.stateChangeCallback(this.getInternalState()),t||(t=this.renderer.supportedExtensions()),r=0;r<this.models.length;r++)this.models[r]&&this.models[r].globj(this.modelGroup,t);for(r=0;r<this.shapes.length;r++)this.shapes[r]&&("undefined"===typeof this.shapes[r].frame||this.viewer_frame<0||this.shapes[r].frame<0||this.shapes[r].frame==this.viewer_frame?this.shapes[r].globj(this.modelGroup,t):this.shapes[r].removegl(this.modelGroup));for(r=0;r<this.labels.length;r++)this.labels[r]&&"undefined"!=typeof this.labels[r].frame&&this.labels[r].frame>=0&&(this.modelGroup.remove(this.labels[r].sprite),(this.viewer_frame<0||this.labels[r].frame==this.viewer_frame)&&this.modelGroup.add(this.labels[r].sprite));for(r in this.surfaces)if(this.surfaces.hasOwnProperty(r)){var a=this.surfaces[r];for(i=0;i<a.length;i++)if(a.hasOwnProperty(i)){var o=a[i].geo;if(!a[i].finished||t.regen){o.verticesNeedUpdate=!0,o.elementsNeedUpdate=!0,o.normalsNeedUpdate=!0,o.colorsNeedUpdate=!0,o.buffersNeedUpdate=!0,o.boundingSphere=null,a[i].done&&(a[i].finished=!0),a[i].lastGL&&this.modelGroup.remove(a[i].lastGL);var l=null;if(l=a[i].mat instanceof n.LineBasicMaterial?new n.Line(o,a[i].mat):new n.Mesh(o,a[i].mat),a[i].mat.transparent&&0==a[i].mat.opacity?l.visible=!1:l.visible=!0,a[i].symmetries.length>1||1==a[i].symmetries.length&&!a[i].symmetries[i].isIdentity()){var c,u=new n.Object3D;for(c=0;c<a[i].symmetries.length;c++){var h=l.clone();h.matrix=a[i].symmetries[c],h.matrixAutoUpdate=!1,u.add(h)}a[i].lastGL=u,this.modelGroup.add(u)}else a[i].lastGL=l,this.modelGroup.add(l)}}}return this.setView(s),"function"===typeof e&&e(this),this}getModelList(e){let t=[];if("undefined"===typeof e||"undefined"===typeof e.model)for(let n=0;n<this.models.length;n++)this.models[n]&&t.push(this.models[n]);else{let n=e.model;Array.isArray(n)||(n=[n]);for(let e=0;e<n.length;e++)if("number"===typeof n[e]){var r=n[e];r<0&&(r+=this.models.length),t.push(this.models[r])}else t.push(n[e])}return t}getAtomsFromSel(e){var t=[];"undefined"===typeof e&&(e={});var r=this.getModelList(e);for(let n=0;n<r.length;n++)t=t.concat(r[n].selectedAtoms(e));return t}atomIsSelected(e,t){"undefined"===typeof t&&(t={});for(var r=this.getModelList(t),n=0;n<r.length;n++)if(r[n].atomIsSelected(e,t))return!0;return!1}selectedAtoms(e){return this.getAtomsFromSel(e)}getUniqueValues(e,t){"undefined"===typeof t&&(t={});var r=this.getAtomsFromSel(t),n={};for(var i in r)r[i].hasOwnProperty(e)&&(n[r[i][e]]=!0);return Object.keys(n)}pdbData(e){for(var t=this.getAtomsFromSel(e),r="",n=0,i=t.length;n<i;++n)r+=t[n].pdbline+"\n";return r}zoom(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n=(this.CAMERA_Z-this.rotationGroup.position.z)/e,i=this.CAMERA_Z-n;return t>0?this.animateMotion(t,r,this.modelGroup.position,this.adjustZoomToLimits(i),this.rotationGroup.quaternion,this.lookingAt):(this.rotationGroup.position.z=this.adjustZoomToLimits(i),this.show()),this}translate(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var s=e/this.WIDTH,a=t/this.HEIGHT,o=new i.Vector3(0,0,-this.CAMERA_Z);this.projector.projectVector(o,this.camera),o.x-=s,o.y-=a,this.projector.unprojectVector(o,this.camera),o.z=0;var l=this.lookingAt.clone().add(o);return r>0?this.animateMotion(r,n,this.modelGroup.position,this.rotationGroup.position.z,this.rotationGroup.quaternion,l):(this.lookingAt=l,this.camera.lookAt(this.lookingAt),this.show()),this}translateScene(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var i=this.screenOffsetToModel(e,t),s=this.modelGroup.position.clone().add(i);return r>0?this.animateMotion(r,n,this.modelGroup.position,this.rotationGroup.position.z,this.rotationGroup.quaternion,this.lookingAt):(this.modelGroup.position=s,this.show()),this}fitSlab(e){e=e||{};var t=this.getAtomsFromSel(e),r=(0,a.getExtent)(t),n=r[1][0]-r[0][0],i=r[1][1]-r[0][1],s=r[1][2]-r[0][2],o=Math.hypot(n,i,s);return o<5&&(o=5),this.slabNear=-o/1.9,this.slabFar=o/2,this}center(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n,s,o=this.getAtomsFromSel(e),l=(0,a.getExtent)(o);
vendor: 9,176 bytes, line 2
2(0,a.isEmptyObject)(e)?(this.shapes.forEach((e=>{if(e&&e.boundingSphere&&e.boundingSphere.center){var t=e.boundingSphere.center,r=e.boundingSphere.radius;r>0?(o.push(new i.Vector3(t.x+r,t.y,t.z)),o.push(new i.Vector3(t.x-r,t.y,t.z)),o.push(new i.Vector3(t.x,t.y+r,t.z)),o.push(new i.Vector3(t.x,t.y-r,t.z)),o.push(new i.Vector3(t.x,t.y,t.z+r)),o.push(new i.Vector3(t.x,t.y,t.z-r))):o.push(t)}})),l=(0,a.getExtent)(o),n=o,s=l):(n=this.getAtomsFromSel({}),s=(0,a.getExtent)(n));var c=new i.Vector3(l[2][0],l[2][1],l[2][2]),u=s[1][0]-s[0][0],h=s[1][1]-s[0][1],d=s[1][2]-s[0][2],f=Math.hypot(u,h,d);f<5&&(f=5),this.slabNear=-f/1.9,this.slabFar=f/2,u=l[1][0]-l[0][0],h=l[1][1]-l[0][1],d=l[1][2]-l[0][2],(f=Math.hypot(u,h,d))<5&&(f=5);for(var p=25,m=0;m<o.length;m++)if(o[m]){var g=c.distanceToSquared(o[m]);g>p&&(p=g)}f=2*Math.sqrt(p);var v=c.clone().multiplyScalar(-1);return t>0?this.animateMotion(t,r,v,this.rotationGroup.position.z,this.rotationGroup.quaternion,this.lookingAt):(this.modelGroup.position=v,this.show()),this}zoomTo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.getAtomsFromSel(e),s=(0,a.getExtent)(n),o=s;if((0,a.isEmptyObject)(e)){let e=n&&n.length;if(this.shapes.forEach((e=>{if(e&&e.boundingSphere)if(e.boundingSphere.box){let t=e.boundingSphere.box;n.push(new i.Vector3(t.min.x,t.min.y,t.min.z)),n.push(new i.Vector3(t.max.x,t.max.y,t.max.z))}else if(e.boundingSphere.center){var t=e.boundingSphere.center,r=e.boundingSphere.radius;r>0?(n.push(new i.Vector3(t.x+r,t.y,t.z)),n.push(new i.Vector3(t.x-r,t.y,t.z)),n.push(new i.Vector3(t.x,t.y+r,t.z)),n.push(new i.Vector3(t.x,t.y-r,t.z)),n.push(new i.Vector3(t.x,t.y,t.z+r)),n.push(new i.Vector3(t.x,t.y,t.z-r))):n.push(t)}})),o=(0,a.getExtent)(n),!e)for(let t=0;t<3;t++)s[2][t]=(o[0][t]+o[1][t])/2}else{let e=this.getAtomsFromSel({});o=(0,a.getExtent)(e)}var l=new i.Vector3(s[2][0],s[2][1],s[2][2]),c=o[1][0]-o[0][0],u=o[1][1]-o[0][1],h=o[1][2]-o[0][2],d=Math.hypot(c,u,h);d<5&&(d=5),this.slabNear=-d/1.9,this.slabFar=d/2,0===Object.keys(e).length&&(this.slabNear=Math.min(2*-d,-50),this.slabFar=Math.max(2*d,50));var f=this.config.minimumZoomToDistance||5;c=s[1][0]-s[0][0],u=s[1][1]-s[0][1],h=s[1][2]-s[0][2],(d=Math.hypot(c,u,h))<f&&(d=f);for(var p=f*f,m=0;m<n.length;m++)if(n[m]){var g=l.distanceToSquared(n[m]);g>p&&(p=g)}d=2*Math.sqrt(p);var v=l.clone().multiplyScalar(-1),b=-(.5*d/Math.tan(Math.PI/180*this.camera.fov/2)-this.CAMERA_Z);return b=this.adjustZoomToLimits(b),t>0?this.animateMotion(t,r,v,b,this.rotationGroup.quaternion,this.lookingAt):(this.modelGroup.position=v,this.rotationGroup.position.z=b,this.show()),this}setSlab(e,t){this.slabNear=e,this.slabFar=t}getSlab(){return{near:this.slabNear,far:this.slabFar}}addLabel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(r){var i=(0,a.getExtent)(this.getAtomsFromSel(r));t.position={x:i[2][0],y:i[2][1],z:i[2][2]}}var s=new c.Label(e,t);return s.setContext(),this.modelGroup.add(s.sprite),this.labels.push(s),n||this.show(),s}addResLabels(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.labels.length;return this.applyToModels("addResLabels",e,this,t,r),this.show(),this.labels.slice(n)}addPropertyLabels(e,t,r){return this.applyToModels("addPropertyLabels",e,t,this,r),this.show(),this}removeLabel(e){for(var t=0;t<this.labels.length;t++)if(this.labels[t]==e){this.labels.splice(t,1),e.dispose(),this.modelGroup.remove(e.sprite);break}return this.show(),this}removeAllLabels(){for(var e=0;e<this.labels.length;e++)this.labels[e]&&this.labels[e].sprite&&this.modelGroup.remove(this.labels[e].sprite);return this.labels.splice(0,this.labels.length),this.show(),this}setLabelStyle(e,t){return this.modelGroup.remove(e.sprite),e.dispose(),e.stylespec=t,e.setContext(),this.modelGroup.add(e.sprite),this.show(),e}setLabelText(e,t){return this.modelGroup.remove(e.sprite),e.dispose(),e.text=t,e.setContext(),this.modelGroup.add(e.sprite),this.show(),e}addShape(e){e=e||{};var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,this.shapes.push(t),t}removeShape(e){if(!e)return this;for(e.removegl(this.modelGroup),delete this.shapes[e.shapePosition];this.shapes.length>0&&"undefined"===typeof this.shapes[this.shapes.length-1];)this.shapes.pop();return this}removeAllShapes(){for(var e=0;e<this.shapes.length;e++){var t=this.shapes[e];t&&t.removegl(this.modelGroup)}return this.shapes.splice(0,this.shapes.length),this}getSelectionCenter(e){if(e.hasOwnProperty("x")&&e.hasOwnProperty("y")&&e.hasOwnProperty("z"))return e;var t=this.getAtomsFromSel(e);if(0==t.length)return{x:0,y:0,z:0};var r=(0,a.getExtent)(t);return{x:r[0][0]+(r[1][0]-r[0][0])/2,y:r[0][1]+(r[1][1]-r[0][1])/2,z:r[0][2]+(r[1][2]-r[0][2])/2}}addSphere(e){(e=e||{}).center=this.getSelectionCenter(e.center);var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,t.addSphere(e),this.shapes.push(t),t.finalize(),t}addBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!=e.corner&&(e.corner=this.getSelectionCenter(e.corner)),void 0!=e.center&&(e.center=this.getSelectionCenter(e.center));var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,t.addBox(e),this.shapes.push(t),t.finalize(),t}addArrow(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.start=this.getSelectionCenter(e.start),e.end=this.getSelectionCenter(e.end);var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,t.addArrow(e),this.shapes.push(t),t.finalize(),t}addCylinder(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.start=this.getSelectionCenter(e.start),e.end=this.getSelectionCenter(e.end);var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,e.dashed?t.addDashedCylinder(e):t.addCylinder(e),this.shapes.push(t),t.finalize(),t}addCurve(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,t.addCurve(e),this.shapes.push(t),t.finalize(),t}addLine(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.start=this.getSelectionCenter(e.start),e.end=this.getSelectionCenter(e.end),e.wireframe=!0;var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,e.dashed?t=this.addLineDashed(e,t):t.addLine(e),this.shapes.push(t),t.finalize(),t}addUnitCell(e,t){e=this.getModel(e),(t=t||{alabel:"a",blabel:"b",clabel:"c"}).box=t.box||{},t.astyle=t.astyle||{color:"red",radius:.1,midpos:-1},t.bstyle=t.bstyle||{color:"green",radius:.1,midpos:-1},t.cstyle=t.cstyle||{color:"blue",radius:.1,midpos:-1},t.alabelstyle=t.alabelstyle||{fontColor:"red",showBackground:!1,alignment:"center",inFront:!1},t.blabelstyle=t.blabelstyle||{fontColor:"green",showBackground:!1,alignment:"center",inFront:!1},t.clabelstyle=t.clabelstyle||{fontColor:"blue",showBackground:!1,alignment:"center",inFront:!1},e.unitCellObjects&&this.removeUnitCell(e),e.unitCellObjects={shapes:[],labels:[]};var r=e.getCrystData(),n=null;if(r){if(r.matrix)n=r.matrix;else{var s,a,o,l=r.a,c=r.b,h=r.c,d=r.alpha,f=r.beta,p=r.gamma;d=d*Math.PI/180,f=f*Math.PI/180,p=p*Math.PI/180,s=Math.cos(f),a=(Math.cos(d)-Math.cos(f)*Math.cos(p))/Math.sin(p),o=Math.sqrt(Math.max(0,1-s*s-a*a)),n=new i.Matrix3(l,c*Math.cos(p),h*s,0,c*Math.sin(p),h*a,0,0,h*o)}var m=[new i.Vector3(0,0,0),new i.Vector3(1,0,0),new i.Vector3(0,1,0),new i.Vector3(0,0,1),new i.Vector3(1,1,0),new i.Vector3(0,1,1),new i.Vector3(1,0,1),new i.Vector3(1,1,1)];if(r.matrix4)for(let e=0;e<m.length;e++)r.size&&m[e].multiplyVectors(m[e],r.size),m[e]=m[e].applyMatrix4(r.matrix4);else for(let e=0;e<m.length;e++)m[e]=m[e].applyMatrix3(n);if(t.box&&!t.box.hidden){t.box.wireframe=!0;var g=new u.GLShape(t.box);g.shapePosition=this.shapes.length,g.addLine({start:m[0],end:m[1]}),g.addLine({start:m[0],end:m[2]}),g.addLine({start:m[1],end:m[4]}),g.addLine({start:m[2],end:m[4]}),g.addLine({start:m[0],end:m[3]}),g.addLine({start:m[3],end:m[5]}),g.addLine({start:m[2],end:m[5]}),g.addLine({start:m[1],end:m[6]}),g.addLine({start:m[4],end:m[7]}),g.addLine({start:m[6],end:m[7]}),g.addLine({start:m[3],end:m[6]}),g.addLine({start:m[5],end:m[7]}),this.shapes.push(g),e.unitCellObjects.shapes.push(g),g.finalize()}if(!t.astyle.hidden){t.astyle.start=m[0],t.astyle.end=m[1];let r=this.addArrow(t.astyle);e.unitCellObjects.shapes.push(r)}if(!t.bstyle.hidden){t.bstyle.start=m[0],t.bstyle.end=m[2];let r=this.addArrow(t.bstyle);e.unitCellObjects.shapes.push(r)}if(!t.cstyle.hidden){t.cstyle.start=m[0],t.cstyle.end=m[3];let r=this.addArrow(t.cstyle);e.unitCellObjects.shapes.push(r)}if(t.alabel){t.alabelstyle.position=m[1];let r=this.addLabel(t.alabel,t.alabelstyle);e.unitCellObjects.labels.push(r)}if(t.blabel){t.blabelstyle.position=m[2];let r=this.addLabel(t.blabel,t.blabelstyle);e.unitCellObjects.labels.push(r)}if(t.clabel){t.clabelstyle.position=m[3];let r=this.addLabel(t.clabel,t.clabelstyle);e.unitCellObjects.labels.push(r)}}}removeUnitCell(e){if((e=this.getModel(e)).unitCellObjects){let t=this;
2e.unitCellObjects.shapes.forEach((function(e){t.removeShape(e)})),e.unitCellObjects.labels.forEach((function(e){t.removeLabel(e)}))}delete e.unitCellObjects}replicateUnitCell(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;n=this.getModel(n);let a=n.getCrystData();if(a){const o=n.selectedAtoms({}),l=a.matrix;let c=function(e){return e%2==0?-e/2:Math.ceil(e/2)};for(let s=0;s<e;s++)for(let e=0;e<t;e++)for(let t=0;t<r;t++){if(0==s&&0==e&&0==t)continue;let r=new i.Vector3(c(s),c(e),c(t));r.applyMatrix3(l);let a=[];for(let e=0;e<o.length;e++){let t={};for(let r in o[e])t[r]=o[e][r];t.x+=r.x,t.y+=r.y,t.z+=r.z,a.push(t)}n.addAtoms(a)}s&&n.assignBonds()}}addLineDashed(e,t){var r,n;e.dashLength=e.dashLength||.5,e.gapLength=e.gapLength||.5,r=e.start?new i.Vector3(e.start.x||0,e.start.y||0,e.start.z||0):new i.Vector3(0,0,0),n=e.end?new i.Vector3(e.end.x,e.end.y||0,e.end.z||0):new i.Vector3(0,0,0);var s,a,o,l=new i.Vector3,c=new i.Vector3,u=new i.Vector3,h=r.clone(),d=0;for(l.subVectors(n,r),s=l.length(),l.normalize(),c=l.clone(),u=l.clone(),c.multiplyScalar(e.dashLength),u.multiplyScalar(e.gapLength),a=c.length(),o=u.length();d<s;){if(d+a>s){e.start=r,e.end=n,t.addLine(e);break}h.addVectors(r,c),e.start=r,e.end=h,t.addLine(e),r=h.clone(),d+=a,h.addVectors(r,u),r=h.clone(),d+=o}return t.finalize(),t}addCustom(e){e=e||{};var t=new u.GLShape(e);return t.shapePosition=this.shapes.length,t.addCustom(e),this.shapes.push(t),t.finalize(),t}addVolumetricData(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var n=new h.VolumeData(e,t);return r.hasOwnProperty("transferfn")?this.addVolumetricRender(n,r):this.addIsosurface(n,r)}addIsosurface(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;var n=new u.GLShape(t);return n.shapePosition=this.shapes.length,n.addIsosurface(e,t,r),this.shapes.push(n),n}addVolumetricRender(e,t){t=t||{};var r=new f.GLVolumetricRender(e,t);return r.shapePosition=this.shapes.length,this.shapes.push(r),r}hasVolumetricRender(){return this.renderer.supportsVolumetric()}enableFog(e){e?this.scene.fog=new n.Fog(this.bgColor,100,200):(this.config.disableFog=!0,this.show())}setFrame(e){this.viewer_frame=e;let t=this;return new Promise((function(r){var n=t.models.map((function(r){return r.setFrame(e,t)}));Promise.all(n).then((function(){r()}))}))}getFrame(){return this.viewer_frame}getNumFrames(){var e=0;for(let t=0;t<this.models.length;t++)this.models[t].getNumFrames()>e&&(e=this.models[t].getNumFrames());for(let t=0;t<this.shapes.length;t++)this.shapes[t].frame&&this.shapes[t].frame>=e&&(e=this.shapes[t].frame+1);for(let t=0;t<this.labels.length;t++)this.labels[t].frame&&this.labels[t].frame>=e&&(e=this.labels[t].frame+1);return e}animate(e){this.incAnim();var t=100,r="forward",n=0;(e=e||{}).interval&&(t=e.interval),e.loop&&(r=e.loop),e.reps&&(n=e.reps);var i=this.getNumFrames(),s=this,o=0;e.startFrame&&(o=e.startFrame%i);var l=1;e.step&&(n/=l=e.step);var c,u,h=0,d=i*n,f=new Date,p=function(e){f=new Date,"forward"==e?s.setFrame(o).then((function(){o=(o+l)%i,c()})):"backward"==e?s.setFrame(i-1-o).then((function(){o=(o+l)%i,c()})):s.setFrame(o).then((function(){l*=(o+=l)%(i-1)==0?-1:1,c()}))};return c=function(){if(s.render(),s.getCanvas().isConnected)if(++h!=d&&s.isAnimated()){var e=t-((new Date).getTime()-f.getTime());e=e>0?e:0,s.animationTimers.delete(u),u=new a.PausableTimer(p,e,r),s.animationTimers.add(u)}else u.cancel(),s.animationTimers.delete(u),s.decAnim();else s.stopAnimate()},u=new a.PausableTimer(p,0,r),this.animationTimers.add(u),this}stopAnimate(){return this.animated=0,this.animationTimers.forEach((function(e){e.cancel()})),this.animationTimers=new Set,this}pauseAnimate(){return this.animationTimers.forEach((function(e){e.pause()})),this}resumeAnimate(){return this.animationTimers.forEach((function(e){e.resume()})),this}isAnimated(){return this.animated>0}addModel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;r&&!r.defaultcolors?(r.defaultcolors=this.defaultcolors,r.cartoonQuality=r.cartoonQuality||this.config.cartoonQuality):"undefined"===typeof r&&(r={defaultcolors:this.defaultcolors,cartoonQuality:this.config.cartoonQuality});var n=new l.GLModel(this.models.length,r);return n.addMolData(e,t,r),this.models.push(n),n}addModels(e,t,r){(r=r||{}).multimodel=!0,r.frames=!0;for(var n=l.GLModel.parseMolData(e,t,r),i=0;i<n.length;i++){var s=new l.GLModel(this.models.length,this.defaultcolors);
vendor: 4,178 bytes, line 2
2s.setAtomDefaults(n[i]),s.addFrame(n[i]),s.setFrame(0),n.modelData&&s.setModelData(n.modelData[i]),s.setDontDuplicateAtoms(!r.duplicateAssemblyAtoms),this.models.push(s)}return this.models}addModelsAsFrames(e,t,r){(r=r||{}).multimodel=!0,r.frames=!0;var n=new l.GLModel(this.models.length,this.defaultcolors);return n.addMolData(e,t,r),this.models.push(n),n}addAsOneMolecule(e,t,r){(r=r||{}).multimodel=!0,r.onemol=!0;var n=new l.GLModel(this.models.length,this.defaultcolors);return n.addMolData(e,t,r),this.models.push(n),n}removeModel(e){if(e=this.getModel(e)){for(e.removegl(this.modelGroup),delete this.models[e.getID()];this.models.length>0&&"undefined"===typeof this.models[this.models.length-1];)this.models.pop();return this}}removeAllModels(){for(var e=0;e<this.models.length;e++){var t=this.models[e];t&&t.removegl(this.modelGroup)}return this.models.splice(0,this.models.length),this}exportJSON(e,t){var r={};return r.m=void 0===t?this.models.map((function(t){return t.toCDObject(e)})):[this.models[t].toCDObject()],JSON.stringify(r)}exportVRML(){var e=this.modelGroup;this.applyToModels("removegl",this.modelGroup),this.modelGroup=new n.Object3D,this.render(null,{supportsImposters:!1,supportsAIA:!1,regen:!0});var t="#VRML V2.0 utf8\n"+this.modelGroup.vrml()+"\n";return this.applyToModels("removegl",this.modelGroup),this.modelGroup=e,t}createModelFrom(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var r=new l.GLModel(this.models.length,this.defaultcolors),n=0;n<this.models.length;n++)if(this.models[n]){var i=this.models[n].selectedAtoms(e);r.addAtoms(i),t&&this.models[n].removeAtoms(i)}return this.models.push(r),r}applyToModels(e,t,r,n,i,s,a){for(var o=this.getModelList(t),l=0;l<o.length;l++)o[l][e](t,r,n,i,s,a)}setStyle(e,t){return"undefined"===typeof t&&(t=e,e={}),this.applyToModels("setStyle",e,t,!1),this}addStyle(e,t){return"undefined"===typeof t&&(t=e,e={}),this.applyToModels("setStyle",e,t,!0),this}setClickable(e,t,r){return this.applyToModels("setClickable",e,t,r),this}setHoverable(e,t,r,n){return this.applyToModels("setHoverable",e,t,r,n),this}enableContextMenu(e,t){return this.applyToModels("enableContextMenu",e,t),this}vibrate(e,t,r,n){return this.applyToModels("vibrate",e,t,r,this,n),this}setColorByProperty(e,t,r,n){return this.applyToModels("setColorByProperty",e,t,r,n),this}setColorByElement(e,t){return this.applyToModels("setColorByElement",e,t),this}static getAtomsWithin(e,t){var r=[];for(let i=0;i<e.length;i++){var n=e[i];"undefined"!=typeof n&&(n.x<t[0][0]||n.x>t[1][0]||n.y<t[0][1]||n.y>t[1][1]||n.z<t[0][2]||n.z>t[1][2]||r.push(n))}return r}static volume(e){return(e[1][0]-e[0][0])*(e[1][1]-e[0][1])*(e[1][2]-e[0][2])}carveUpExtent(e,t,r){let n=[],i={};for(let c=0,u=t.length;c<u;c++)i[t[c].index]=c;let s=function(e){let t=[];for(let r=0,n=e.length;r<n;r++)e[r].index in i&&t.push(i[e[r].index]);return t},a=function(e){let t=[];return t[0]=[e[0][0],e[0][1],e[0][2]],t[1]=[e[1][0],e[1][1],e[1][2]],t},o=function(e){if(m.volume(e)<m.maxVolume)return[e];var t,r=e[1][0]-e[0][0],n=e[1][1]-e[0][1],i=e[1][2]-e[0][2];t=r>n&&r>i?0:n>r&&n>i?1:2;var s=a(e),l=a(e),c=(e[1][t]-e[0][t])/2+e[0][t];s[1][t]=c,l[0][t]=c;var u=o(s),h=o(l);return u.concat(h)},l=o(e);for(let c=0,u=l.length;c<u;c++){let e=a(l[c]);e[0][0]-=6,e[0][1]-=6,e[0][2]-=6,e[1][0]+=6,e[1][1]+=6,e[1][2]+=6;let i=m.getAtomsWithin(t,e),o=m.getAtomsWithin(r,l[c]);n.push({extent:l[c],atoms:s(i),toshow:s(o)})}return n}static generateSurfaceMesh(e,t,r){var a=new n.Geometry(!0),o=a.updateGeoGroup(0),l=[];for(let n=0,i=e.length;n<i;n++){var c=e[n];c&&("undefined"!=typeof c.surfaceColor?l[n]=c.surfaceColor:c.color&&(l[n]=s.CC.color(c.color)))}var u=o.vertexArray,h=t.vertices;for(let n=0,i=h.length;n<i;n++){let e=3*o.vertices;u[e]=h[n].x,u[e+1]=h[n].y,u[e+2]=h[n].z,o.vertices++}var d=o.colorArray;if(r.voldata&&r.volscheme){var f=r.volscheme,p=r.voldata,m=f.range()||[-1,1];for(let e=0,t=h.length;e<t;e++){let t=p.getVal(h[e].x,h[e].y,h[e].z),r=s.CC.color(f.valueToHex(t,m)),n=3*e;d[n]=r.r,d[n+1]=r.g,d[n+2]=r.b}}else if(l.length>0)for(let n=0,i=h.length;n<i;n++){let e=h[n].atomid,t=3*n;d[t]=l[e].r,d[t+1]=l[e].g,d[t+2]=l[e].b}var g=t.faces;
2o.faceidx=g.length,a.initTypedArrays();var v,b,y,_,w=o.vertexArray,x=o.normalArray;for(let n=0,s=g.length;n<s;n+=3){var S=3*g[n],C=3*g[n+1],k=3*g[n+2];v=new i.Vector3(w[S],w[S+1],w[S+2]),b=new i.Vector3(w[C],w[C+1],w[C+2]),(y=new i.Vector3(w[k],w[k+1],w[k+2])).subVectors(y,b),v.subVectors(v,b),y.cross(v),(_=y).normalize(),x[S]+=_.x,x[C]+=_.x,x[k]+=_.x,x[S+1]+=_.y,x[C+1]+=_.y,x[k+1]+=_.y,x[S+2]+=_.z,x[C+2]+=_.z,x[k+2]+=_.z}return o.faceArray=new Uint16Array(g),new n.Mesh(a,r)}static generateMeshSyncHelper(e,t,r,n,i,s){var a=new d.ProteinSurface;return a.initparm(t,1!==e,s),a.fillvoxels(i,r),a.buildboundary(),e!=d.SurfaceType.SES&&e!=d.SurfaceType.MS||(a.fastdistancemap(),a.boundingatom(!1),a.fillvoxelswaals(i,r)),a.marchingcube(e),a.getFacesAndVertices(n)}static getMatWithStyle(e){var t=new n.MeshLambertMaterial;for(var r in t.vertexColors=n.Coloring.VertexColors,e)"color"===r||"map"===r||e.hasOwnProperty(r)&&(t[r]=e[r]);return void 0!==e.opacity&&(1===e.opacity?t.transparent=!1:t.transparent=!0),t}addMesh(e){var t={geo:e.geometry,mat:e.material,done:!0,finished:!1},r=this.nextSurfID();return this.surfaces[r]=t,r}static shallowCopy(e){var t=[];let r=e.length;for(let n=0;n<r;n++)t[n]=(0,a.extend)({},e[n]);return t}addSurface(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,h=this.nextSurfID(),f=null,p=this,g=d.SurfaceType.VDW;"string"==typeof e?void 0!==m.surfaceTypeMap[e.toUpperCase()]?g=m.surfaceTypeMap[e]:console.log("Surface type : "+e+" is not recognized"):"number"==typeof e&&(g=e);var v=null,b=null,y=m.shallowCopy(this.getAtomsFromSel(r));v=s?m.shallowCopy(this.getAtomsFromSel(s)):y,(0,a.adjustVolumeStyle)(t);var _,w=!1;for(_=0;_<this.models.length;_++)if(this.models[_]){var x=this.models[_].getSymmetries();if(x.length>1||1==x.length&&!x[0].isIdentity()){w=!0;break}}var S=function(e,r,n){var i;b=l?m.shallowCopy(p.getAtomsFromSel(l)):n;var s=(0,a.getExtent)(n,!0);if(t.map&&t.map.prop){var c=t.map.prop;let e=(0,o.getGradient)(t.map.scheme||t.map.gradient||new o.Gradient.RWB),r=e.range();r||(r=(0,a.getPropertyRange)(n,c)),t.colorscheme={prop:c,gradient:e}}for(let o=0,l=r.length;o<l;o++)(i=r[o]).surfaceColor=(0,a.getColorFromStyle)(i,t);var v=m.volume(s),y=p.carveUpExtent(s,r,n);if(b&&b.length&&b.length>0){var _=(0,a.getExtent)(b,!0);y.sort((function(e,t){var r=function(e,t){var r=e.extent,n=r[1][0]-r[0][0],i=r[1][1]-r[0][1],s=r[1][2]-r[0][2],a=n-t[2][0];a*=a;var o=i-t[2][1];o*=o;var l=s-t[2][2];return a+o+(l*=l)};return r(e,_)-r(t,_)}))}var w=[];for(let t=0,a=r.length;t<a;t++)i=r[t],w[t]={x:i.x,y:i.y,z:i.z,serial:t,elem:i.elem};if(d.syncSurface){var x=function(t){return new Promise((function(n){for(var i=m.generateMeshSyncHelper(g,y[t].extent,y[t].atoms,y[t].toshow,w,v),s=(0,u.splitMesh)({vertexArr:i.vertices,faceArr:i.faces}),o=0,l=s.length;o<l;o++){i={vertices:s[o].vertexArr,faces:s[o].faceArr};var c=m.generateSurfaceMesh(r,i,f);(0,a.mergeGeos)(e.geo,c)}p.render(),n()}))},S=[];for(let e=0;e<y.length;e++)S.push(x(e));return Promise.all(S).then((function(){return e.done=!0,Promise.resolve(h)}))}var C=[];g<0&&(g=0);for(let t=0,a=m.numWorkers;t<a;t++){var k=new Worker($3Dmol.SurfaceWorker);C.push(k),k.postMessage({type:-1,atoms:w,volume:v})}return new Promise((function(t,n){var i=0,s=function(){C&&C.length&&C.forEach((function(e){e&&e.terminate&&e.terminate()}))},o=function(n){for(var o=(0,u.splitMesh)({vertexArr:n.data.vertices,faceArr:n.data.faces}),l=0,c=o.length;l<c;l++){var d={vertices:o[l].vertexArr,faces:o[l].faceArr},g=m.generateSurfaceMesh(r,d,f);(0,a.mergeGeos)(e.geo,g)}p.render(),++i==y.length&&(e.done=!0,s(),t(h))},l=function(e){s(),console.log(e.message+" ("+e.filename+":"+e.lineno+")"),n(e)};for(let e=0;e<y.length;e++){var c=C[e%C.length];c.onmessage=o,c.onerror=l,c.postMessage({type:g,expandedExtent:y[e].extent,extendedAtoms:y[e].atoms,atomsToShow:y[e].toshow})}}))};t=t||{},f=m.getMatWithStyle(t);var C=[];C.style=t,C.atomsel=r,C.allsel=s,C.focus=l;var k=null;if(w){var E={},A={};for(_=0;_<this.models.length;_++)E[_]=[],A[_]=[];for(_=0;_<v.length;_++)E[v[_].model].push(v[_]);for(_=0;_<y.length;_++)A[y[_].model].push(y[_]);var L=[];for(_=0;_<this.models.length;_++)A[_].length>0&&(C.push({geo:new n.Geometry(!0),mat:f,done:!1,finished:!1,symmetries:this.models[_].getSymmetries()}),L.push(S(C[C.length-1],E[_],A[_])));k=Promise.all(L)}else C.push({geo:new n.Geometry(!0),mat:f,done:!1,finished:!1,symmetries:[new i.Matrix4]}),k=S(C[C.length-1],v,y);return this.surfaces[h]=C,k.surfid=h,c&&"function"==typeof c?(k.then((function(e){c(e)})),h):k}setSurfaceMaterialStyle(e,t){if((0,a.adjustVolumeStyle)(t),this.surfaces[e]){var r=this.surfaces[e];r.style=t;for(var i=0;i<r.length;i++){var o=r[i].mat=m.getMatWithStyle(t);if(r[i].mat.side=n.FrontSide,t.color){r[i].mat.color=t.color,r[i].geo.colorsNeedUpdate=!0;const e=s.CC.color(t.color);r[i].geo.setColors((function(){return e}))}else if(o.voldata&&o.volscheme){const e=o.volscheme,t=o.voldata,n=s.CC,a=e.range()||[-1,1];r[i].geo.setColors((function(r,i,s){let o=t.getVal(r,i,s);return n.color(e.valueToHex(o,a))}))}r[i].finished=!1}}return this}getSurface(e){return this.surfaces[e]}removeSurface(e){for(var t=this.surfaces[e],r=0;r<t.length;r++)t[r]&&t[r].lastGL&&(void 0!==t[r].geo&&t[r].geo.dispose(),void 0!==t[r].mat&&t[r].mat.dispose(),this.modelGroup.remove(t[r].lastGL
vendor: 47,883 bytes, line 2
2));return delete this.surfaces[e],this.show(),this}removeAllSurfaces(){for(var e in this.surfaces)if(this.surfaces.hasOwnProperty(e)){for(var t=this.surfaces[e],r=0;r<t.length;r++)t[r]&&t[r].lastGL&&(void 0!==t[r].geo&&t[r].geo.dispose(),void 0!==t[r].mat&&t[r].mat.dispose(),this.modelGroup.remove(t[r].lastGL));delete this.surfaces[e]}return this.show(),this}jmolMoveTo(){var e=this.modelGroup.position,t="center { "+-e.x+" "+-e.y+" "+-e.z+" }; ",r=this.rotationGroup.quaternion;return t+="moveto .5 quaternion { "+r.x+" "+r.y+" "+r.z+" "+r.w+" };"}clear(){return this.removeAllSurfaces(),this.removeAllModels(),this.removeAllLabels(),this.removeAllShapes(),this.show(),this}mapAtomProperties(e,t){t=t||{};var r=this.getAtomsFromSel(t);if("function"==typeof e)for(let s=0,a=r.length;s<a;s++)e(r[s]);else for(let s=0,a=r.length;s<a;s++){var n=r[s];for(let t=0,r=e.length;t<r;t++){let r=e[t];if(r.props)for(var i in r.props)r.props.hasOwnProperty(i)&&this.atomIsSelected(n,r)&&(n.properties||(n.properties={}),n.properties[i]=r.props[i])}}return this}linkViewer(e){return this.linkedViewers.push(e),this}getPerceivedDistance(){return this.CAMERA_Z-this.rotationGroup.position.z}setPerceivedDistance(e){this.rotationGroup.position.z=this.CAMERA_Z-e}setAutoEyeSeparation(e,t){var r=this.getPerceivedDistance();return t||(t=5),e||this.camera.position.x>0?this.camera.position.x=r*Math.tan(Math.PI/180*t):this.camera.position.x=-r*Math.tan(Math.PI/180*t),this.camera.lookAt(new i.Vector3(0,0,this.rotationGroup.position.z)),this.camera.position.x}setDefaultCartoonQuality(e){this.config.cartoonQuality=e}}function g(e,t){if(e=(0,a.getElement)(e)){t=t||{};try{return new m(e,t)}catch(r){throw"error creating viewer: "+r}}}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e=(0,a.getElement)(e)){var n=[],i=document.createElement("canvas");r.rows=t.rows,r.cols=t.cols,r.control_all=void 0!=t.control_all&&t.control_all,e.appendChild(i);try{for(var s=0;s<t.rows;s++){for(var o=[],l=0;l<t.cols;l++){r.row=s,r.col=l,r.canvas=i,r.viewers=n,r.control_all=t.control_all;var c=g(e,(0,a.extend)({},r));o.push(c)}n.unshift(o)}}catch(u){throw"error creating viewer grid: "+u}return n}}function b(e){var t=this;if(e=(0,a.getElement)(e)){var r=v(e,{rows:1,cols:2,control_all:!0});this.glviewer1=r[0][0],this.glviewer2=r[0][1],this.glviewer1.setAutoEyeSeparation(!1),this.glviewer2.setAutoEyeSeparation(!0),this.glviewer1.linkViewer(this.glviewer2),this.glviewer2.linkViewer(this.glviewer1);for(var n=Object.getOwnPropertyNames(this.glviewer1.__proto__).filter((function(e){return"function"==typeof t.glviewer1[e]})),i=0;i<n.length;i++)this[n[i]]=function(e){return function(){return[this.glviewer1[e].apply(this.glviewer1,arguments),this.glviewer2[e].apply(this.glviewer2,arguments)]}}(n[i]);this.setCoordinates=function(e,t,r){for(var n=0;n<e.length;n++)e[n].setCoordinates(t,r)},this.surfacesFinished=function(){return this.glviewer1.surfacesFinished()&&this.glviewer2.surfacesFinished()},this.isAnimated=function(){return this.glviewer1.isAnimated()||this.glviewer2.isAnimated()},this.render=function(e){this.glviewer1.render(),this.glviewer2.render(),e&&e(this)},this.getCanvas=function(){return this.glviewer1.getCanvas()}}}m.numWorkers=4,m.maxVolume=64e3,m.surfaceTypeMap={VDW:d.SurfaceType.VDW,MS:d.SurfaceType.MS,SAS:d.SurfaceType.SAS,SES:d.SurfaceType.SES}},"./src/Gradient.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{CustomLinear:()=>u,Gradient:()=>d,GradientType:()=>i,ROYGB:()=>l,RWB:()=>o,Sinebow:()=>c,builtinGradients:()=>h,getGradient:()=>a,normalizeValue:()=>s});var n=r("./src/colors.ts");class i{}function s(e,t,r){return t>=e?(r<e&&(r=e),r>t&&(r=t),{lo:e,hi:t,val:r}):(r>e&&(r=e),r<t&&(r=t),{lo:t,hi:e,val:r=e-r+t})}function a(e){if(e instanceof i)return e;if(void 0!==e.gradient&&h[e.gradient]){let t=void 0===e.min?-1:e.min,r=void 0===e.max?1:e.max;return void 0===e.mid?void 0===e.colors?new h[e.gradient](t,r):new h[e.gradient](t,r,e.colors):new h[e.gradient](t,r,e.mid)}return e}class o extends i{constructor(e,t,r){super(),this.gradient="RWB",this.mult=1,this.mid=r,this.min=e,this.max=t,"undefined"==typeof t&&Array.isArray(e)&&e.length>=2?(this.max=e[1],this.min=e[0]):e&&t&&!Array.isArray(e)&&(this.min=e,this.max=t)}range(){return"undefined"!=typeof this.min&&"undefined"!=typeof this.max?[this.min,this.max]:null}valueToHex(e,t){var r,n;if(e=this.mult*e,t?(r=t[0],n=t[1]):(r=this.min,n=this.max),void 0===e)return 16777215;var i=s(r,n,e);r=i.lo;var a,o=((n=i.hi)+r)/2;return(e=i.val)<(o=t&&"undefined"!=typeof t[2]?t[2]:"undefined"!=typeof this.mid?this.mid:(r+n)/2)?16711680+256*(a=Math.floor(255*Math.sqrt((e-r)/(o-r))))+a:e>o?65536*(a=Math.floor(255*Math.sqrt(1-(e-o)/(n-o))))+256*a+255:16777215}}class l extends i{constructor(e,t){super(),this.gradient="ROYGB",this.mult=1,this.min=e,this.max=t,"undefined"==typeof t&&Array.isArray(e)&&e.length>=2?(this.max=e[1],this.min=e[0]):e&&t&&!Array.isArray(e)&&(this.min=e,this.max=t)}valueToHex(e,t){var r,n;if(e=this.mult*e,t?(r=t[0],n=t[1]):(r=this.min,n=this.max),"undefined"==typeof e)return 16777215;var i=s(r,n,e),a=((r=i.lo)+(n=i.hi))/2,o=(r+a)/2,l=(a+n)/2;return(e=i.val)<o?16711680+256*Math.floor(255*Math.sqrt((e-r)/(o-r)))+0:e<a?65536*Math.floor(255*Math.sqrt(1-(e-o)/(a-o)))+65280+0:e<l?65280+1*Math.floor(255*Math.sqrt((e-a)/(l-a))):0+256*Math.floor(255*Math.sqrt(1-(e-l)/(n-l)))+255}range(){return"undefined"!=typeof this.min&&"undefined"!=typeof this.max?[this.min,this.max]:null}}class c extends i{constructor(e,t){super(),this.gradient="Sinebow",this.mult=1,this.min=e,this.max=t,"undefined"==typeof t&&Array.isArray(e)&&e.length>=2&&(this.max=e[1],this.min=e[0]),t<e&&(this.mult=-1,this.min*=-1,this.max*=-1)}valueToHex(e,t){var r,n;if(e=this.mult*e,t?(r=t[0],n=t[1]):(r=this.min,n=this.max),"undefined"==typeof e)return 16777215;var i=d.normalizeValue(r,n,e);r=i.lo,n=i.hi;var s=((e=i.val)-r)/(n-r)*5/6+.5,a=Math.sin(Math.PI*s);a*=255*a;var o=Math.sin(Math.PI*(s+1/3));o*=255*o;var l=Math.sin(Math.PI*(s+2/3));return l*=255*l,65536*Math.floor(a)+256*Math.floor(l)+1*Math.floor(o)}range(){return"undefined"!=typeof this.min&&"undefined"!=typeof this.max?[this.min,this.max]:null}}class u extends i{constructor(e,t,r){var i;if(super(),this.gradient="linear",this.colors=new Array,Array.isArray(e)&&e.length>=2?(this.max=e[1],this.min=e[0],i=t):(this.min=e,this.max=t,i=r),i)for(let s of i)this.colors.push(n.CC.color(s));else this.colors.push(n.CC.color(0))}range(){return"undefined"!=typeof this.min&&"undefined"!=typeof this.max?[this.min,this.max]:null}valueToHex(e,t){var r,i;if(t?(r=t[0],i=t[1]):(r=this.min,i=this.max),void 0===e)return 16777215;var a=s(r,i,e);r=a.lo,i=a.hi,e=a.val;let o=this.colors.length,l=(i-r)/o,c=Math.min(Math.floor((e-r)/l),o-1),u=Math.min(c+1,o-1),h=(e-r-c*l)/l,d=this.colors[c],f=this.colors[u];return new n.Color(d.r+h*(f.r-d.r),d.g+h*(f.g-d.g),d.b+h*(f.b-d.b)).getHex()}}const h={rwb:o,RWB:o,roygb:l,ROYGB:l,sinebow:c,linear:u};class d extends i{valueToHex(e,t){return 0}range(){return null}}d.RWB=o,d.ROYGB=l,d.Sinebow=c,d.CustomLinear=u,d.builtinGradients=h,d.normalizeValue=s,d.getGradient=a},"./src/Label.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Label:()=>l,LabelCount:()=>a});var n=r("./src/WebGL/index.ts"),i=r("./src/Gradient.ts"),s=r("./src/colors.ts");let a=0;function o(e,t,r){var n=r;return"undefined"!=typeof e&&(e instanceof s.Color?n=e.scaled():"undefined"!=typeof(n=s.CC.color(e)).scaled&&(n=n.scaled())),"undefined"!=typeof t&&(n.a=parseFloat(t)),n}class l{constructor(e,t){this.id=a++,this.stylespec=t||{},this.canvas=document.createElement("canvas"),this.canvas.width=134,this.canvas.height=35,this.context=this.canvas.getContext("2d"),this.sprite=new n.Sprite,this.text=e,this.frame=this.stylespec.frame}getStyle(){return this.stylespec}setContext(){var e=this.stylespec,t="undefined"!=typeof e.useScreen&&e.useScreen,r=e.showBackground;"0"!==r&&"false"!==r||(r=!1),"undefined"==typeof r&&(r=!0);var s=e.font?e.font:"sans-serif",a=parseInt(e.fontSize)?parseInt(e.fontSize):18,l=o(e.fontColor,e.fontOpacity,{r:255,g:255,b:255,a:1}),c=e.padding?e.padding:4,u=e.borderThickness?e.borderThickness:0,h=o(e.backgroundColor,e.backgroundOpacity,{r:0,g:0,b:0,a:1}),d=o(e.borderColor,e.borderOpacity,h),f=e.position?e.position:{x:-10,y:1,z:1},p=void 0===e.inFront||e.inFront;"false"!==p&&"0"!==p||(p=!1);var m=e.alignment||n.SpriteAlignment.topLeft;"string"==typeof m&&m in n.SpriteAlignment&&(m=n.SpriteAlignment[m]);var g="";e.bold&&(g="bold "),this.context.font=g+a+"px  "+s;var v=this.context.measureText(this.text).width;r||(u=0);var b=v+2.5*u+2*c,y=1.25*a+2*u+2*c;if(e.backgroundImage){var _=e.backgroundImage,w=e.backgroundWidth?e.backgroundWidth:_.width,x=e.backgroundHeight?e.backgroundHeight:_.height;w>b&&(b=w),x>y&&(y=x)}if(this.canvas.width=b,this.canvas.height=y,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),g="",e.bold&&(g="bold "),this.context.font=g+a+"px  "+s,this.context.fillStyle="rgba("+h.r+","+h.g+","+h.b+","+h.a+")",this.context.strokeStyle="rgba("+d.r+","+d.g+","+d.b+","+d.a+")",e.backgroundGradient){let t=this.context.createLinearGradient(0,y/2,b,y/2),r=i.Gradient.getGradient(e.backgroundGradient),n=r.range(),s=-1,a=1;n&&(s=n[0],a=n[1]);let l=a-s;for(let e=0;e<1.01;e+=.1){let n=o(r.valueToHex(s+l*e)),i="rgba("+n.r+","+n.g+","+n.b+","+n.a+")";t.addColorStop(e,i)}this.context.fillStyle=t}this.context.lineWidth=u,r&&function(e,t,r,n,i,s,a){e.beginPath(),e.moveTo(t+s,r),e.lineTo(t+n-s,r),e.quadraticCurveTo(t+n,r,t+n,r+s),e.lineTo(t+n,r+i-s),e.quadraticCurveTo(t+n,r+i,t+n-s,r+i),e.lineTo(t+s,r+i),e.quadraticCurveTo(t,r+i,t,r+i-s),e.lineTo(t,r+s),e.quadraticCurveTo(t,r,t+s,r),e.closePath(),e.fill(),a&&e.stroke()}(this.context,u,u,b-2*u,y-2*u,6,u>0),e.backgroundImage&&this.context.drawImage(_,0,0,b,y),this.context.fillStyle="rgba("+l.r+","+l.g+","+l.b+","+l.a+")",this.context.fillText(this.text,u+c,a+u+c,v);var S=new n.Texture(this.canvas);S.needsUpdate=!0,this.sprite.material=new n.SpriteMaterial({map:S,useScreenCoordinates:t,alignment:m,depthTest:!p,screenOffset:e.screenOffset||null}),this.sprite.scale.set(1,1,1),this.sprite.position.set(f.x,f.y,f.z)}dispose(){void 0!==this.sprite.material.map&&this.sprite.material.map.dispose(),void 0!==this.sprite.material&&this.sprite.material.dispose()}}},"./src/ProteinSurface4.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{MarchingCube:()=>l,MarchingCubeInitializer:()=>o,PointGrid:()=>c,ProteinSurface:()=>u,SurfaceType:()=>n,setSyncSurface:()=>a,syncSurface:()=>s});var n,i=r("./src/WebGL/math/index.ts");!function(e){e[e.VDW=1]="VDW",e[e.MS=2]="MS",e[e.SAS=3]="SAS",e[e.SES=4]="SES"}(n||(n={}));var s=!1;function a(e){s=e}(window.navigator.userAgent.indexOf("MSIE ")>=0||window.navigator.userAgent.indexOf("Trident/")>=0)&&(s=!0);class o{constructor(){this.ISDONE=2,this.edgeTable=new Uint32Array([0,0,0,0,0,0,0,2816,0,0,0,1792,0,3328,3584,3840,0,0,0,138,0,21,0,134,0,0,0,652,0,2067,3865,3600,0,0,0,42,0,0,0,294,0,0,21,28,0,3875,1049,3360,0,168,162,170,0,645,2475,2210,0,687,293,172,4010,3747,3497,3232,0,0,0,0,0,69,0,900,0,0,0,1792,138,131,1608,1920,0,81,0,2074,84,85,84,86,0,81,0,3676,330,1105,1881,1616,0,0,0,42,0,69,0,502,0,0,21,3580,138,2035,1273,1520,2816,104,2337,106,840,581,367,102,2816,3695,3429,3180,1898,1635,1385,1120,0,0,0,0,0,0,0,3910,0,0,69,588,42,2083,41,2880,0,0,0,1722,0,2293,4095,3830,0,255,757,764,2538,2291,3065,2800,0,0,81,338,0,3925,1119,3414,84,855,85,340,2130,2899,89,2384,1792,712,194,1162,4036,3781,3535,3270,708,719,197,204,3018,2755,2505,2240,0,0,0,0,168,420,168,1958,162,162,676,2988,170,163,680,928,3328,3096,3328,3642,52,53,1855,1590,2340,2111,2869,2620,298,51,825,560,3584,3584,3090,3482,1668,1941,1183,1430,146,2975,2069,2460,154,915,153,400,3840,3592,3329,3082,1796,1541,1295,1030,2818,2575,2309,2060,778,515,265,0]),this.triTable=[[],[],[],[],[],[],[],[11,9,8],[],[],[],[8,10,9],[],[10,8,11],[9,11,10],[8,10,9,8,11,10],[],[],[],[1,7,3],[],[4,2,0],[],[2,1,7],[],[],[],[2,7,3,2,9,7],[],[1,4,11,1,0,4],[3,8,0,11,9,4,11,10,9],[4,11,9,11,10,9],[],[],[],[5,3,1],[],[],[],[2,5,8,2,1,5],[],[],[2,4,0],[3,2,4],[],[0,9,1,8,10,5,8,11,10],[3,4,0,3,10,4],[5,8,10,8,11,10],[],[3,5,7],[7,1,5],[1,7,3,1,5,7],[],[9,2,0,9,7,2],[0,3,8,1,7,11,1,5,7],[11,1,7,1,5,7],[],[9,1,0,5,3,2,5,7,3],[8,2,5,8,0,2],[2,5,3,5,7,3],[3,9,1,3,8,9,7,11,10,7,10,5],[9,1,0,10,7,11,10,5,7],[3,8,0,7,10,5,7,11,10],[11,5,7,11,10,5],[],[],[],[],[],[0,6,2],[],[7,2,9,7,9,8],[],[],[],[8,10,9],[7,1,3],[7,1,0],[6,9,3,6,10,9],[7,10,8,10,9,8],[],[6,0,4],[],[11,1,4,11,3,1],[2,4,6],[2,0,4,2,4,6],[2,4,6],[1,4,2,4,6,2],[],[6,0,4],[],[2,11,3,6,9,4,6,10,9],[8,6,1,8,1,3],[10,0,6,0,4,6],[8,0,3,9,6,10,9,4,6],[10,4,6,10,9,4],[],[],[],[5,3,1],[],[0,6,2],[],[7,4,8,5,2,1,5,6,2],[],[],[2,4,0],[7,4,8,2,11,3,10,5,6],[7,1,3],[5,6,10,0,9,1,8,7,4],[5,6,10,7,0,3,7,4,0],[10,5,6,4,8,7],[9,11,8],[3,5,6],[0,5,11,0,11,8],[6,3,5,3,1,5],[3,9,6,3,8,9],[9,6,0,6,2,0],[0,3,8,2,5,6,2,1,5],[1,6,2,1,5,6],[9,11,8],[1,0,9,6,10,5,11,3,2],[6,10,5,2,8,0,2,11,8],[3,2,11,10,5,6],[10,5,6,9,3,8,9,1,3],[0,9,1,5,6,10],[8,0,3,10,5,6],[10,5,6],[],[],[],[],[],[],[],[1,10,2,9,11,6,9,8,11],[],[],[6,0,2],[3,6,9,3,2,6],[3,5,1],[0,5,1,0,11,5],[0,3,5],[6,9,11,9,8,11],[],[],[],[4,5,9,7,1,10,7,3,1],[],[11,6,7,2,4,5,2,0,4],[11,6,7,8,0,3,1,10,2,9,4,5],[6,7,11,1,10,2,9,4,5],[],[4,1,0,4,5,1,6,7,3,6,3,2],[9,4,5,0,6,7,0,2,6],[4,5,9,6,3,2,6,7,3],[6,7,11,5,3,8,5,1,3],[6,7,11,4,1,0,4,5,1],[4,5,9,3,8,0,11,6,7],[9,4,5,7,11,6],[],[],[0,6,4],[8,6,4,8,1,6],[],[0,10,2,0,9,10,4,8,11,4,11,6],[10,2,1,6,0,3,6,4,0],[10,2,1,11,4,8,11,6,4],[4,2,6],[1,0,9,2,4,8,2,6,4],[2,4,0,2,6,4],[8,2,4,2,6,4],[11,4,1,11,6,4],[0,9,1,4,11,6,4,8,11],[3,6,0,6,4,0],[8,6,4,8,11,6],[10,8,9],[6,3,9,6,7,3],[6,7,1],[10,7,1,7,3,1],[7,11,6,8,10,2,8,9,10],[11,6,7,10,0,9,10,2,0],[2,1,10,7,11,6,8,0,3],[1,10,2,6,7,11],[7,2,6,7,9,2],[1,0,9,3,6,7,3,2,6],[7,0,6,0,2,6],[2,7,3,2,6,7],[7,11,6,3,9,1,3,8,9],[9,1,0,11,6,7],[0,3,8,11,6,7],[11,6,7],[],[],[],[],[5,3,7],[8,5,2,8,7,5],[5,3,7],[1,10,2,5,8,7,5,9,8],[1,7,5],[1,7,5],[9,2,7,9,7,5],[11,3,2,8,5,9,8,7,5],[1,3,7,1,7,5],[0,7,1,7,5,1],[9,3,5,3,7,5],[9,7,5,9,8,7],[8,10,11],[3,4,10,3,10,11],[8,10,11],[5,9,4,1,11,3,1,10,11],[2,4,5],[5,2,4,2,0,4],[0,3,8,5,9,4,10,2,1],[2,1,10,9,4,5],[2,8,5,2,11,8],[3,2,11,1,4,5,1,0,4],[9,4,5,8,2,11,8,0,2],[11,3,2,9,4,5],[8,5,3,5,1,3],[5,0,4,5,1,0],[3,8,0,4,5,9],[9,4,5],[11,9,10],[11,9,10],[1,11,4,1,10,11],[8,7,4,11,1,10,11,3,1],[2,7,9,2,9,10],[4,8,7,0,10,2,0,9,10],[2,1,10,0,7,4,0,3,7],[10,2,1,8,7,4],[1,7,4],[3,2,11,4,8,7,9,1,0],[11,4,2,4,0,2],[2,11,3,7,4,8],[4,1,7,1,3,7],[1,0,9,8,7,4],[3,4,0,3,7,4],[8,7,4],[8,9,10,8,10,11],[3,9,11,9,10,11],[0,10,8,10,11,8],[10,3,1,10,11,3],[2,8,10,8,9,10],[9,2,0,9,10,2],[8,0,3,1,10,2],[10,2,1],[1,11,9,11,8,9],[11,3,2,0,9,1],[11,0,2,11,8,0],[11,3,2],[8,1,3,8,9,1],[9,1,0],[8,0,3],[]],this.edgeTable2=[0,265,515,778,2060,2309,2575,2822,1030,1295,1541,1804,3082,3331,3593,3840,400,153,915,666,2460,2197,2975,2710,1430,1183,1941,1692,3482,3219,3993,3728,560,825,51,314,2620,2869,2111,2358,1590,1855,1077,1340,3642,3891,3129,3376,928,681,419,170,2988,2725,2479,2214,1958,1711,1445,1196,4010,3747,3497,3232,2240,2505,2755,3018,204,453,719,966,3270,3535,3781,4044,1226,1475,1737,1984,2384,2137,2899,2650,348,85,863,598,3414,3167,3925,3676,1370,1107,1881,1616,2800,3065,2291,2554,764,1013,255,502,3830,4095,3317,3580,1786,2035,1273,1520,2912,2665,2403,2154,876,613,367,102,3942,3695,3429,3180,1898,1635,1385,1120,1120,1385,1635,1898,3180,3429,3695,3942,102,367,613,876,2154,2403,2665,2912,1520,1273,2035,1786,3580,3317,4095,3830,502,255,1013,764,2554,2291,3065,2800,1616,1881,1107,1370,3676,3925,3167,3414,598,863,85,348,2650,2899,2137,2384,1984,1737,1475,1226,4044,3781,3535,3270,966,719,453,204,3018,2755,2505,2240,3232,3497,3747,4010,1196,1445,1711,1958,2214,2479,2725,2988,170,419,681,928,3376,3129,3891,3642,1340,1077,1855,1590,2358,2111,2869,2620,314,51,825,560,3728,3993,3219,3482,1692,1941,1183,1430,2710,2975,2197,2460,666,915,153,400,3840,3593,3331,3082,1804,1541,1295,1030,2822,2575,2309,2060,778,515,265,0],this.triTable2=[[],[8,3,0],[9,0,1],[8,3,1,8,1,9],[11,2,3],[11,2,0,11,0,8],[11,2,3,0,1,9],[2,1,11,1,9,11,11,9,8],[10,1,2],[8,3,0,1,2,10],[9,0,2,9,2,10],[3,2,8,2,10,8,8,10,9],[10,1,3,10,3,11],[1,0,10,0,8,10,10,8,11],[0,3,9,3,11,9,9,11,10],[8,10,9,8,11,10],[8,4,7],[3,0,4,3,4,7],[1,9,0,8,4,7],[9,4,1,4,7,1,1,7,3],[2,3,11,7,8,4],[7,11,4,11,2,4,4,2,0],[3,11,2,4,7,8,9,0,1],[2,7,11,2,1,7,1,4,7,1,9,4],[10,1,2,8,4,7],[2,10,1,0,4,7,0,7,3],[4,7,8,0,2,10,0,10,9],[2,7,3,2,9,7,7,9,4,2,10,9],[8,4,7,11,10,1,11,1,3],[11,4,7,1,4,11,1,11,10,1,0,4],[3,8,0,7,11,4,11,9,4,11,10,9],[7,11,4,4,11,9,11,10,9],[9,5,4],[3,0,8,4,9,5],[5,4,0,5,0,1],[4,8,5,8,3,5,5,3,1],[11,2,3,9,5,4],[9,5,4,8,11,2,8,2,0],[3,11,2,1,5,4,1,4,0],[8,5,4,2,5,8,2,8,11,2,1,5],[2,10,1,9,5,4],[0,8,3,5,4,9,10,1,2],[10,5,2,5,4,2,2,4,0],[3,4,8,3,2,4,2,5,4,2,10,5],[5,4,9,1,3,11,1,11,10],[0,9,1,4,8,5,8,10,5,8,11,10],[3,4,0,3,10,4,4,10,5,3,11,10],[4,8,5,5,8,10,8,11,10],[9,5,7,9,7,8],[0,9,3,9,5,3,3,5,7],[8,0,7,0,1,7,7,1,5],[1,7,3,1,5,7],[11,2,3,8,9,5,8,5,7],[9,2,0,9,7,2,2,7,11,9,5,7],[0,3,8,2,1,11,1,7,11,1,5,7],[2,1,11,11,1,7,1,5,7],[1,2,10,5,7,8,5,8,9],[9,1,0,10,5,2,5,3,2,5,7,3],[5,2,10,8,2,5,8,5,7,8,0,2],[10,5,2,2,5,3,5,7,3],[3,9,1,3,8,9,7,11,10,7,10,5],[9,1,0,10,7,11,10,5,7],[3,8,0,7,10,5,7,11,10],[11,5,7,11,10,5],[11,7,6],[0,8,3,11,7,6],[9,0,1,11,7,6],[7,6,11,3,1,9,3,9,8],[2,3,7,2,7,6],[8,7,0,7,6,0,0,6,2],[1,9,0,3,7,6,3,6,2],[7,6,2,7,2,9,2,1,9,7,9,8],[1,2,10,6,11,7],[2,10,1,7,6,11,8,3,0],[11,7,6,10,9,0,10,0,2],[7,6,11,3,2,8,8,2,10,8,10,9],[6,10,7,10,1,7,7,1,3],[6,10,1,6,1,7,7,1,0,7,0,8],[9,0,3,6,9,3,6,10,9,6,3,7],[6,10,7,7,10,8,10,9,8],[8,4,6,8,6,11],[11,3,6,3,0,6,6,0,4],[0,1,9,4,6,11,4,11,8],[1,9,4,11,1,4,11,3,1,11,4,6],[3,8,2,8,4,2,2,4,6],[2,0,4,2,4,6],[1,9,0,3,8,2,2,8,4,2,4,6],[9,4,1,1,4,2,4,6,2],[10,1,2,11,8,4,11,4,6],[10,1,2,11,3,6,6,3,0,6,0,4],[0,2,10,0,10,9,4,11,8,4,6,11],[2,11,3,6,9,4,6,10,9],[8,4,6,8,6,1,6,10,1,8,1,3],[1,0,10,10,0,6,0,4,6],[8,0,3,9,6,10,9,4,6],[10,4,6,10,9,4],[9,5,4,7,6,11],[4,9,5,3,0,8,11,7,6],[6,11,7,4,0,1,4,1,5],[6,11,7,4,8,5,5,8,3,5,3,1],[4,9,5,6,2,3,6,3,7],[9,5,4,8,7,0,0,7,6,0,6,2],[4,0,1,4,1,5,6,3,7,6,2,3],[7,4,8,5,2,1,5,6,2],[6,11,7,1,2,10,9,5,4],[11,7,6,8,3,0,1,2,10,9,5,4],[11,7,6,10,5,2,2,5,4,2,4,0],[7,4,8,2,11,3,10,5,6],[4,9,5,6,10,7,7,10,1,7,1,3],[5,6,10,0,9,1,8,7,4],[5,6,10,7,0,3,7,4,0],[10,5,6,4,8,7],[5,6,9,6,11,9,9,11,8],[0,9,5,0,5,3,3,5,6,3,6,11],[0,1,5,0,5,11,5,6,11,0,11,8],[11,3,6,6,3,5,3,1,5],[9,5,6,3,9,6,3,8,9,3,6,2],[5,6,9,9,6,0,6,2,0],[0,3,8,2,5,6,2,1,5],[1,6,2,1,5,6],[1,2,10,5,6,9,9,6,11,9,11,8],[1,0,9,6,10,5,11,3,2],[6,10,5,2,8,0,2,11,8],[3,2,11,10,5,6],[10,5,6,9,3,8,9,1,3],[0,9,1,5,6,10],[8,0,3,10,5,6],[10,5,6],[10,6,5],[8,3,0,10,6,5],[0,1,9,5,10,6],[10,6,5,9,8,3,9,3,1],[3,11,2,10,6,5],[6,5,10,2,0,8,2,8,11],[1,9,0,6,5,10,11,2,3],[1,10,2,5,9,6,9,11,6,9,8,11],[1,2,6,1,6,5],[0,8,3,2,6,5,2,5,1],[5,9,6,9,0,6,6,0,2],[9,6,5,3,6,9,3,9,8,3,2,6],[11,6,3,6,5,3,3,5,1],[0,5,1,0,11,5,5,11,6,0,8,11],[0,5,9,0,3,5,3,6,5,3,11,6],[5,9,6,6,9,11,9,8,11],[10,6,5,4,7,8],[5,10,6,7,3,0,7,0,4],[5,10,6,0,1,9,8,4,7],[4,5,9,6,7,10,7,1,10,7,3,1],[7,8,4,2,3,11,10,6,5],[11,6,7,10,2,5,2,4,5,2,0,4],[11,6,7,8,0,3,1,10,2,9,4,5],[6,7,11,1,10,2,9,4,5],[7,8,4,5,1,2,5,2,6],[4,1,0,4,5,1,6,7,3,6,3,2],[9,4,5,8,0,7,0,6,7,0,2,6],[4,5,9,6,3,2,6,7,3],[6,7,11,4,5,8,5,3,8,5,1,3],[6,7,11,4,1,0,4,5,1],[4,5,9,3,8,0,11,6,7],[9,4,5,7,11,6],[10,6,4,10,4,9],[8,3,0,9,10,6,9,6,4],[1,10,0,10,6,0,0,6,4],[8,6,4,8,1,6,6,1,10,8,3,1],[2,3,11,6,4,9,6,9,10],[0,10,2,0,9,10,4,8,11,4,11,6],[10,2,1,11,6,3,6,0,3,6,4,0],[10,2,1,11,4,8,11,6,4],[9,1,4,1,2,4,4,2,6],[1,0,9,3,2,8,2,4,8,2,6,4],[2,4,0,2,6,4],[3,2,8,8,2,4,2,6,4],[1,4,9,11,4,1,11,1,3,11,6,4],[0,9,1,4,11,6,4,8,11],[11,6,3,3,6,0,6,4,0],[8,6,4,8,11,6],[6,7,10,7,8,10,10,8,9],[9,3,0,6,3,9,6,9,10,6,7,3],[6,1,10,6,7,1,7,0,1,7,8,0],[6,7,10,10,7,1,7,3,1],[7,11,6,3,8,2,8,10,2,8,9,10],[11,6,7,10,0,9,10,2,0],[2,1,10,7,11,6,8,0,3],[1,10,2,6,7,11],[7,2,6,7,9,2,2,9,1,7,8,9],[1,0,9,3,6,7,3,2,6],[8,0,7,7,0,6,0,2,6],[2,7,3,2,6,7],[7,11,6,3,9,1,3,8,9],[9,1,0,11,6,7],[0,3,8,11,6,7],[11,6,7],[11,7,5,11,5,10],[3,0,8,7,5,10,7,10,11],[9,0,1,10,11,7,10,7,5],[3,1,9,3,9,8,7,10,11,7,5,10],[10,2,5,2,3,5,5,3,7],[5,10,2,8,5,2,8,7,5,8,2,0],[9,0,1,10,2,5,5,2,3,5,3,7],[1,10,2,5,8,7,5,9,8],[2,11,1,11,7,1,1,7,5],[0,8,3,2,11,1,1,11,7,1,7,5],[9,0,2,9,2,7,2,11,7,9,7,5],[11,3,2,8,5,9,8,7,5],[1,3,7,1,7,5],[8,7,0,0,7,1,7,5,1],[0,3,9,9,3,5,3,7,5],[9,7,5,9,8,7],[4,5,8,5,10,8,8,10,11],[3,0,4,3,4,10,4,5,10,3,10,11],[0,1,9,4,5,8,8,5,10,8,10,11],[5,9,4,1,11,3,1,10,11],[3,8,4,3,4,2,2,4,5,2,5,10],[10,2,5,5,2,4,2,0,4],[0,3,8,5,9,4,10,2,1],[2,1,10,9,4,5],[8,4,5,2,8,5,2,11,8,2,5,1],[3,2,11,1,4,5,1,0,4],[9,4,5,8,2,11,8,0,2],[11,3,2,9,4,5],[4,5,8,8,5,3,5,1,3],[5,0,4,5,1,0],[3,8,0,4,5,9],[9,4,5],[7,4,11,4,9,11,11,9,10],[3,0,8,7,4,11,11,4,9,11,9,10],[11,7,4,1,11,4,1,10,11,1,4,0],[8,7,4,11,1,10,11,3,1],[2,3,7,2,7,9,7,4,9,2,9,10],[4,8,7,0,10,2,0,9,10],[2,1,10,0,7,4,0,3,7],[10,2,1,8,7,4],[2,11,7,2,7,1,1,7,4,1,4,9],[3,2,11,4,8,7,9,1,0],[7,4,11,11,4,2,4,0,2],[2,11,3,7,4,8],[9,1,4,4,1,7,1,3,7],[1,0,9,8,7,4],[3,4,0,3,7,4],[8,7,4],[8,9,10,8,10,11],[0,9,3,3,9,11,9,10,11],[1,10,0,0,10,8,10,11,8],[10,3,1,10,11,3],[3,8,2,2,8,10,8,9,10],[9,2,0,9,10,2],[8,0,3,1,10,2],[10,2,1],[2,11,1,1,11,9,11,8,9],[11,3,2,0,9,1],[11,0,2,11,8,0],[11,3,2],[8,1,3,8,9,1],[9,1,0],[8,0,3],[]]}march(e,t,r,n){let s=!!n.fulltable,a=n.hasOwnProperty("origin")&&n.origin.hasOwnProperty("x")?n.origin:{x:0,y:0,z:0},o=!!n.voxel,l=n.matrix,c=n.nX||0,u=n.nY||0,h=n.nZ||0,d=n.scale||1,f=null;f=n.unitCube?n.unitCube:{x:d,y:d,z:d};let p,m,g=new Int32Array(c*u*h);for(p=0,m=g.length;p<m;++p)g[p]=-1;let v=function(e,r,n,s,c,d){let p={x:0,y:0,z:0},m=c;if(!(s&1<<c)&&!!(s&1<<d)&&(m=d),1&m&&n++,2&m&&r++,4&m&&e++,l){let t=new i.Vector3(e,r,n);t=t.applyMatrix4(l),p={x:t.x,y:t.y,z:t.z}}else p.x=a.x+f.x*e,p.y=a.y+f.y*r,p.z=a.z+f.z*n;let v=(u*e+r)*h+n;return o?(t.push(p),t.length-1):(g[v]<0&&(g[v]=t.length,t.push(p)),g[v])},b=new Int32Array(12),y=s?this.edgeTable2:this.edgeTable,_=s?this.triTable2:this.triTable;for(p=0;p<c-1;++p)for(let n=0;n<u-1;++n)for(let i=0;i<h-1;++i){let s=0;for(let t=0;t<8;++t)s|=!!(e[(u*(p+((4&t)>>2))+n+((2&t)>>1))*h+i+(1&t)]&this.ISDONE)<<t;if(0===s||255===s)continue;let a=y[s];if(0===a)continue;let l=_[s];1&a&&(b[0]=v(p,n,i,s,0,1)),2&a&&(b[1]=v(p,n,i,s,1,3)),4&a&&(b[2]=v(p,n,i,s,3,2)),8&a&&(b[3]=v(p,n,i,s,2,0)),16&a&&(b[4]=v(p,n,i,s,4,5)),32&a&&(b[5]=v(p,n,i,s,5,7)),64&a&&(b[6]=v(p,n,i,s,7,6)),128&a&&(b[7]=v(p,n,i,s,6,4)),256&a&&(b[8]=v(p,n,i,s,0,4)),512&a&&(b[9]=v(p,n,i,s,1,5)),1024&a&&(b[10]=v(p,n,i,s,3,7)),2048&a&&(b[11]=v(p,n,i,s,2,6));for(let e=0;e<l.length;e+=3){let n=b[l[e]],i=b[l[e+1]],s=b[l[e+2]];o&&e>=3&&(t.push(t[n]),n=t.length-1,t.push(t[i]),i=t.length-1,t.push(t[s]),s=t.length-1),r.push(n),r.push(i),r.push(s)}}}laplacianSmooth(e,t,r){let n,i,s,a,o,l=new Array(t.length);for(n=0,i=t.length;n<i;n++)l[n]={x:0,y:0,z:0};let c,u=new Array(20);for(n=0;n<20;n++)u[n]=new Array(t.length);for(n=0,i=t.length;n<i;n++)u[0][n]=0;for(n=0,i=r.length/3;n<i;n++){let e=3*n,t=3*n+1,i=3*n+2;for(c=!0,s=0,a=u[0][r[e]];s<a;s++)if(r[t]==u[s+1][r[e]]){c=!1;break}for(c&&(u[0][r[e]]++,u[u[0][r[e]]][r[e]]=r[t]),c=!0,s=0,a=u[0][r[e]];s<a;s++)if(r[i]==u[s+1][r[e]]){c=!1;break}for(c&&(u[0][r[e]]++,u[u[0][r[e]]][r[e]]=r[i]),c=!0,s=0,a=u[0][r[t]];s<a;s++)if(r[e]==u[s+1][r[t]]){c=!1;break}for(c&&(u[0][r[t]]++,u[u[0][r[t]]][r[t]]=r[e]),c=!0,s=0,a=u[0][r[t]];s<a;s++)if(r[i]==u[s+1][r[t]]){c=!1;break}for(c&&(u[0][r[t]]++,u[u[0][r[t]]][r[t]]=r[i]),c=!0,s=0;s<u[0][r[i]];s++)if(r[e]==u[s+1][r[i]]){c=!1;break}for(c&&(u[0][r[i]]++,u[u[0][r[i]]][r[i]]=r[e]),c=!0,s=0,a=u[0][r[i]];s<a;s++)if(r[t]==u[s+1][r[i]]){c=!1;break}c&&(u[0][r[i]]++,u[u[0][r[i]]][r[i]]=r[t])}let h=.5;for(o=0;o<e;o++){for(n=0,i=t.length;n<i;n++)if(u[0][n]<3)l[n].x=t[n].x,l[n].y=t[n].y,l[n].z=t[n].z;else if(3==u[0][n]||4==u[0][n]){for(l[n].x=0,l[n].y=0,l[n].z=0,s=0,a=u[0][n];s<a;s++)l[n].x+=t[u[s+1][n]].x,l[n].y+=t[u[s+1][n]].y,l[n].z+=t[u[s+1][n]].z;l[n].x+=h*t[n].x,l[n].y+=h*t[n].y,l[n].z+=h*t[n].z,l[n].x/=h+u[0][n],l[n].y/=h+u[0][n],l[n].z/=h+u[0][n]}else{for(l[n].x=0,l[n].y=0,l[n].z=0,s=0,a=u[0][n];s<a;s++)l[n].x+=t[u[s+1][n]].x,l[n].y+=t[u[s+1][n]].y,l[n].z+=t[u[s+1][n]].z;l[n].x+=1*t[n].x,l[n].y+=1*t[n].y,l[n].z+=1*t[n].z,l[n].x/=1+u[0][n],l[n].y/=1+u[0][n],l[n].z/=1+u[0][n]}for(n=0,i=t.length;n<i;n++)t[n].x=l[n].x,t[n].y=l[n].y,t[n].z=l[n].z}}}let l=new o;class c{constructor(e,t,r){this.data=new Int32Array(e*t*r*3),this.width=t,this.height=r}set(e,t,r,n){let i=3*((e*this.width+t)*this.height+r);this.data[i]=n.ix,this.data[i+1]=n.iy,this.data[i+2]=n.iz}get(e,t,r){let n=3*((e*this.width+t)*this.height+r);return{ix:this.data[n],iy:this.data[n+1],iz:this.data[n+2]}}}class u{constructor(){this.INOUT=1,this.ISDONE=2,this.ISBOUND=4,this.ptranx=0,this.ptrany=0,this.ptranz=0,this.probeRadius=1.4,this.defaultScaleFactor=2,this.scaleFactor=this.defaultScaleFactor,this.pHeight=0,this.pWidth=0,this.pLength=0,this.cutRadius=0,this.vpBits=null,this.vpDistance=null,this.vpAtomID=null,this.pminx=0,this.pminy=0,this.pminz=0,this.pmaxx=0,this.pmaxy=0,this.pmaxz=0,this.depty={},this.widxz={},this.faces=[],this.verts=[],this.vdwRadii={H:1.2,Li:1.82,Na:2.27,K:2.75,C:1.7,N:1.55,O:1.52,F:1.47,P:1.8,S:1.8,CL:1.75,BR:1.85,SE:1.9,ZN:1.39,CU:1.4,NI:1.63,X:2},this.nb=[new Int32Array([1,0,0]),new Int32Array([-1,0,0]),new Int32Array([0,1,0]),new Int32Array([0,-1,0]),new Int32Array([0,0,1]),new Int32Array([0,0,-1]),new Int32Array([1,1,0]),new Int32Array([1,-1,0]),new Int32Array([-1,1,0]),new Int32Array([-1,-1,0]),new Int32Array([1,0,1]),new Int32Array([1,0,-1]),new Int32Array([-1,0,1]),new Int32Array([-1,0,-1]),new Int32Array([0,1,1]),new Int32Array([0,1,-1]),new Int32Array([0,-1,1]),new Int32Array([0,-1,-1]),new Int32Array([1,1,1]),new Int32Array([1,1,-1]),new Int32Array([1,-1,1]),new Int32Array([-1,1,1]),new Int32Array([1,-1,-1]),new Int32Array([-1,-1,1]),new Int32Array([-1,1,-1]),new Int32Array([-1,-1,-1])],u.MarchingCube||(u.MarchingCube=new o)}getVDWIndex(e){return e.elem&&"undefined"!=typeof this.vdwRadii[e.elem]?e.elem:"X"}getFacesAndVertices(e){let t={};for(let i=0,s=e.length;i<s;i++)t[e[i]]=!0;let r=this.verts;for(let i=0,s=r.length;i<s;i++)r[i].x=r[i].x/this.scaleFactor-this.ptranx,r[i].y=r[i].y/this.scaleFactor-this.ptrany,r[i].z=r[i].z/this.scaleFactor-this.ptranz;let n=[];for(let i=0,s=this.faces.length;i<s;i+=3){let e=this.faces[i],s=this.faces[i+1],a=this.faces[i+2],o=r[e].atomid,l=r[s].atomid,c=r[a].atomid,u=o;l<u&&(u=l),c<u&&(u=c),t[u]&&e!==s&&s!==a&&e!==a&&(n.push(e),n.push(s),n.push(a))}return this.vpBits=null,this.vpDistance=null,this.vpAtomID=null,{vertices:r,faces:n}}initparm(e,t,r){r>1e6&&(this.scaleFactor=this.defaultScaleFactor/2);let n=1/this.scaleFactor*5.5;this.pminx=e[0][0],this.pmaxx=e[1][0],this.pminy=e[0][1],this.pmaxy=e[1][1],this.pminz=e[0][2],this.pmaxz=e[1][2],t?(this.pminx-=this.probeRadius+n,this.pminy-=this.probeRadius+n,this.pminz-=this.probeRadius+n,this.pmaxx+=this.probeRadius+n,this.pmaxy+=this.probeRadius+n,this.pmaxz+=this.probeRadius+n):(this.pminx-=n,this.pminy-=n,this.pminz-=n,this.pmaxx+=n,this.pmaxy+=n,this.pmaxz+=n),this.pminx=Math.floor(this.pminx*this.scaleFactor)/this.scaleFactor,this.pminy=Math.floor(this.pminy*this.scaleFactor)/this.scaleFactor,this.pminz=Math.floor(this.pminz*this.scaleFactor)/this.scaleFactor,this.pmaxx=Math.ceil(this.pmaxx*this.scaleFactor)/this.scaleFactor,this.pmaxy=Math.ceil(this.pmaxy*this.scaleFactor)/this.scaleFactor,this.pmaxz=Math.ceil(this.pmaxz*this.scaleFactor)/this.scaleFactor,this.ptranx=-this.pminx,this.ptrany=-this.pminy,this.ptranz=-this.pminz,this.pLength=Math.ceil(this.scaleFactor*(this.pmaxx-this.pminx))+1,this.pWidth=Math.ceil(this.scaleFactor*(this.pmaxy-this.pminy))+1,this.pHeight=Math.ceil(this.scaleFactor*(this.pmaxz-this.pminz))+1,this.boundingatom(t),this.cutRadius=this.probeRadius*this.scaleFactor,this.vpBits=new Uint8Array(this.pLength*this.pWidth*this.pHeight),this.vpDistance=new Float64Array(this.pLength*this.pWidth*this.pHeight),this.vpAtomID=new Int32Array(this.pLength*this.pWidth*this.pHeight)}boundingatom(e){let t={};for(const r in this.vdwRadii){let n=this.vdwRadii[r];t[r]=e?(n+this.probeRadius)*this.scaleFactor+.5:n*this.scaleFactor+.5;let i=t[r]*t[r];this.widxz[r]=Math.floor(t[r])+1,this.depty[r]=new Int32Array(this.widxz[r]*this.widxz[r]);let s=0;for(let e=0;e<this.widxz[r];e++)for(let t=0;t<this.widxz[r];t++){let n=e*e+t*t;if(n>i)this.depty[r][s]=-1;else{let e=Math.sqrt(i-n);this.depty[r][s]=Math.floor(e)}s++}}}fillvoxels(e,t){for(let r=0,n=this.vpBits.length;r<n;r++)this.vpBits[r]=0,this.vpDistance[r]=-1,this.vpAtomID[r]=-1;for(let r in t){let n=e[t[r]];void 0!==n&&this.fillAtom(n,e)}for(let r=0,n=this.vpBits.length;r<n;r++)this.vpBits[r]&this.INOUT&&(this.vpBits[r]|=this.ISDONE)}fillAtom(e,t){let r=Math.floor(.5+this.scaleFactor*(e.x+this.ptranx)),n=Math.floor(.5+this.scaleFactor*(e.y+this.ptrany)),i=Math.floor(.5+this.scaleFactor*(e.z+this.ptranz)),s=this.getVDWIndex(e),a=0,o=this.pWidth*this.pHeight;for(let l=0,c=this.widxz[s];l<c;l++)for(let u=0;u<c;u++){if(-1!=this.depty[s][a])for(let c=-1;c<2;c++)for(let h=-1;h<2;h++)for(let d=-1;d<2;d++)if(0!==c&&0!==h&&0!==d){let f=c*l,p=d*u;for(let l=0;l<=this.depty[s][a];l++){let s=l*h,a=r+f,c=n+s,u=i+p;if(a<0||c<0||u<0||a>=this.pLength||c>=this.pWidth||u>=this.pHeight)continue;let d=a*o+c*this.pHeight+u;if(this.vpBits[d]&this.INOUT){let a=t[this.vpAtomID[d]];if(a.serial!=e.serial){let t=r+f-Math.floor(.5+this.scaleFactor*(a.x+this.ptranx)),o=n+s-Math.floor(.5+this.scaleFactor*(a.y+this.ptrany)),l=i+p-Math.floor(.5+this.scaleFactor*(a.z+this.ptranz));f*f+s*s+p*p<t*t+o*o+l*l&&(this.vpAtomID[d]=e.serial)}}else this.vpBits[d]|=this.INOUT,this.vpAtomID[d]=e.serial}}a++}}fillvoxelswaals(e,t){for(let r=0,n=this.vpBits.length;r<n;r++)this.vpBits[r]&=~this.ISDONE;for(let r in t){let n=e[t[r]];void 0!==n&&this.fillAtomWaals(n,e)}}fillAtomWaals(e,t){let r=0,n=Math.floor(.5+this.scaleFactor*(e.x+this.ptranx)),i=Math.floor(.5+this.scaleFactor*(e.y+this.ptrany)),s=Math.floor(.5+this.scaleFactor*(e.z+this.ptranz)),a=this.getVDWIndex(e),o=this.pWidth*this.pHeight;for(let l=0,c=this.widxz[a];l<c;l++)for(let u=0;u<c;u++){if(-1!=this.depty[a][r])for(let c=-1;c<2;c++)for(let h=-1;h<2;h++)for(let d=-1;d<2;d++)if(0!==c&&0!==h&&0!==d){let f=c*l,p=d*u;for(let l=0;l<=this.depty[a][r];l++){let r=l*h,a=n+f,c=i+r,u=s+p;if(a<0||c<0||u<0||a>=this.pLength||c>=this.pWidth||u>=this.pHeight)continue;let d=a*o+c*this.pHeight+u;if(this.vpBits[d]&this.ISDONE){let a=t[this.vpAtomID[d]];if(a.serial!=e.serial){let t=n+f-Math.floor(.5+this.scaleFactor*(a.x+this.ptranx)),o=i+r-Math.floor(.5+this.scaleFactor*(a.y+this.ptrany)),l=s+p-Math.floor(.5+this.scaleFactor*(a.z+this.ptranz));f*f+r*r+p*p<t*t+o*o+l*l&&(this.vpAtomID[d]=e.serial)}}else this.vpBits[d]|=this.ISDONE,this.vpAtomID[d]=e.serial}}r++}}buildboundary(){let e=this.pWidth*this.pHeight;for(let t=0;t<this.pLength;t++)for(let r=0;r<this.pHeight;r++)for(let n=0;n<this.pWidth;n++){let i=t*e+n*this.pHeight+r;if(this.vpBits[i]&this.INOUT){let s=0;for(;s<26;){let a=t+this.nb[s][0],o=r+this.nb[s][2],l=n+this.nb[s][1];if(a>-1&&a<this.pLength&&l>-1&&l<this.pWidth&&o>-1&&o<this.pHeight&&!(this.vpBits[a*e+l*this.pHeight+o]&this.INOUT)){this.vpBits[i]|=this.ISBOUND;break}s++}}}}fastdistancemap(){let e,t=new c(this.pLength,this.pWidth,this.pHeight),r=this.pWidth*this.pHeight,n=this.cutRadius*this.cutRadius,i=[],s=[];for(let l=0;l<this.pLength;l++)for(let n=0;n<this.pWidth;n++)for(let s=0;s<this.pHeight;s++)if(e=l*r+n*this.pHeight+s,this.vpBits[e]&=~this.ISDONE,this.vpBits[e]&this.INOUT&&this.vpBits[e]&this.ISBOUND){let r={ix:l,iy:n,iz:s};t.set(l,n,s,r),i.push(r),this.vpDistance[e]=0,this.vpBits[e]|=this.ISDONE,this.vpBits[e]&=~this.ISBOUND}do{s=this.fastoneshell(i,t),i=[];for(let t=0,a=s.length;t<a;t++)e=r*s[t].ix+this.pHeight*s[t].iy+s[t].iz,this.vpBits[e]&=~this.ISBOUND,this.vpDistance[e]<=1.0404*n&&i.push({ix:s[t].ix,iy:s[t].iy,iz:s[t].iz})}while(0!==i.length);i=[],s=[],t=null;let a=this.scaleFactor-.5;a<0&&(a=0);let o=n-.5/(.1+a);for(let l=0;l<this.pLength;l++)for(let t=0;t<this.pWidth;t++)for(let n=0;n<this.pHeight;n++)e=l*r+t*this.pHeight+n,this.vpBits[e]&=~this.ISBOUND,this.vpBits[e]&this.INOUT&&(this.vpBits[e]&this.ISDONE&&!(this.vpBits[e]&this.ISDONE&&this.vpDistance[e]>=o)||(this.vpBits[e]|=this.ISBOUND))}fastoneshell(e,t){let r,n,i,s,a,o,l,c,u,h=[];if(0===e.length)return h;let d={ix:-1,iy:-1,iz:-1},f=this.pWidth*this.pHeight;for(let p=0,m=e.length;p<m;p++){r=e[p].ix,n=e[p].iy,i=e[p].iz,c=t.get(r,n,i);for(let e=0;e<6;e++)d.ix=r+this.nb[e][0],d.iy=n+this.nb[e][1],d.iz=i+this.nb[e][2],d.ix<this.pLength&&d.ix>-1&&d.iy<this.pWidth&&d.iy>-1&&d.iz<this.pHeight&&d.iz>-1&&(u=d.ix*f+this.pHeight*d.iy+d.iz,this.vpBits[u]&this.INOUT&&!(this.vpBits[u]&this.ISDONE)?(t.set(d.ix,d.iy,i+this.nb[e][2],c),s=d.ix-c.ix,a=d.iy-c.iy,o=d.iz-c.iz,l=s*s+a*a+o*o,this.vpDistance[u]=l,this.vpBits[u]|=this.ISDONE,this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})):this.vpBits[u]&this.INOUT&&this.vpBits[u]&this.ISDONE&&(s=d.ix-c.ix,a=d.iy-c.iy,o=d.iz-c.iz,l=s*s+a*a+o*o,l<this.vpDistance[u]&&(t.set(d.ix,d.iy,d.iz,c),this.vpDistance[u]=l,this.vpBits[u]&this.ISBOUND||(this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})))))}for(let p=0,m=e.length;p<m;p++){r=e[p].ix,n=e[p].iy,i=e[p].iz,c=t.get(r,n,i);for(let e=6;e<18;e++)d.ix=r+this.nb[e][0],d.iy=n+this.nb[e][1],d.iz=i+this.nb[e][2],d.ix<this.pLength&&d.ix>-1&&d.iy<this.pWidth&&d.iy>-1&&d.iz<this.pHeight&&d.iz>-1&&(u=d.ix*f+this.pHeight*d.iy+d.iz,this.vpBits[u]&this.INOUT&&!(this.vpBits[u]&this.ISDONE)?(t.set(d.ix,d.iy,i+this.nb[e][2],c),s=d.ix-c.ix,a=d.iy-c.iy,o=d.iz-c.iz,l=s*s+a*a+o*o,this.vpDistance[u]=l,this.vpBits[u]|=this.ISDONE,this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})):this.vpBits[u]&this.INOUT&&this.vpBits[u]&this.ISDONE&&(s=d.ix-c.ix,a=d.iy-c.iy,o=d.iz-c.iz,l=s*s+a*a+o*o,l<this.vpDistance[u]&&(t.set(d.ix,d.iy,d.iz,c),this.vpDistance[u]=l,this.vpBits[u]&this.ISBOUND||(this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})))))}for(let p=0,m=e.length;p<m;p++){r=e[p].ix,n=e[p].iy,i=e[p].iz,c=t.get(r,n,i);for(let e=18;e<26;e++)d.ix=r+this.nb[e][0],d.iy=n+this.nb[e][1],d.iz=i+this.nb[e][2],d.ix<this.pLength&&d.ix>-1&&d.iy<this.pWidth&&d.iy>-1&&d.iz<this.pHeight&&d.iz>-1&&(u=d.ix*f+this.pHeight*d.iy+d.iz,this.vpBits[u]&this.INOUT&&!(this.vpBits[u]&this.ISDONE)?(t.set(d.ix,d.iy,i+this.nb[e][2],c),s=d.ix-c.ix,a=d.iy-c.iy,o=d.iz-c.iz,l=s*s+a*a+o*o,this.vpDistance[u]=l,this.vpBits[u]|=this.ISDONE,this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})):this.vpBits[u]&this.INOUT&&this.vpBits[u]&this.ISDONE&&(s=d.ix-c.ix,a=d.iy-c.iy,o=d.iz-c.iz,l=s*s+a*a+o*o,l<this.vpDistance[u]&&(t.set(d.ix,d.iy,d.iz,c),this.vpDistance[u]=l,this.vpBits[u]&this.ISBOUND||(this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})))))}return h}marchingcubeinit(e){for(let t=0,r=this.vpBits.length;t<r;t++)1==e?this.vpBits[t]&=~this.ISBOUND:4==e?(this.vpBits[t]&=~this.ISDONE,this.vpBits[t]&this.ISBOUND&&(this.vpBits[t]|=this.ISDONE),this.vpBits[t]&=~this.ISBOUND):2==e?this.vpBits[t]&this.ISBOUND&&this.vpBits[t]&this.ISDONE?this.vpBits[t]&=~this.ISBOUND:this.vpBits[t]&this.ISBOUND&&!(this.vpBits[t]&this.ISDONE)&&(this.vpBits[t]|=this.ISDONE):3==e&&(this.vpBits[t]&=~this.ISBOUND)}marchingcube(e){this.marchingcubeinit(e),this.verts=[],this.faces=[],u.MarchingCube.march(this.vpBits,this.verts,this.faces,{smooth:1,nX:this.pLength,nY:this.pWidth,nZ:this.pHeight});let t=this.pWidth*this.pHeight;for(let r=0,n=this.verts.length;r<n;r++)this.verts[r].atomid=this.vpAtomID[this.verts[r].x*t+this.pHeight*this.verts[r].y+this.verts[r].z];u.MarchingCube.laplacianSmooth(1,this.verts,this.faces)}}u.MarchingCube=new o},"./src/VolumeData.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{VolumeData:()=>l});var n=r("./src/utilities.ts"),i=r("./src/WebGL/math/index.ts"),s=r("./src/parsers/VASP.ts"),a=r("./src/parsers/CUBE.ts"),o=r("./node_modules/pako/dist/pako.esm.mjs");class l{constructor(e,t,r){if(this.unit={x:1,y:1,z:1},this.origin={x:0,y:0,z:0},this.size={x:0,y:0,z:0},this.data=new Float32Array([]),this.matrix=null,this.inversematrix=null,this.isbinary=new Set(["ccp4","CCP4"]),this.getCoordinates=function(e){var t=e/(this.size.y*this.size.z),r=e%(this.size.y*this.size.z),n=e%this.size.z;return t*=this.unit.x,r*=this.unit.y,n*=this.unit.z,{x:t+=this.origin.x,y:r+=this.origin.y,z:n+=this.origin.z}},this.vasp=function(e){var t=e.replace(/^\s+/,"").split(/[\n\r]/),r=(0,s.VASP)(e)[0].length;if(0==r)return console.log("No good formating of CHG or CHGCAR file, not atomic information provided in the file."),void(this.data=[]);var n,a=1.889725992,o=parseFloat(t[1]);n=t[2].replace(/^\s+/,"").split(/\s+/);var l=new i.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(o*a);n=t[3].replace(/^\s+/,"").split(/\s+/);var c=new i.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(o*a);n=t[4].replace(/^\s+/,"").split(/\s+/);var u=new i.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(o*a),h=l.x*(c.y*u.z-u.y*c.z)-c.x*(l.y*u.z-u.y*l.z)+u.x*(l.y*c.z-c.y*l.z),d=1/(h=Math.abs(h)/Math.pow(a,3));t.splice(0,8+r+1);var f=t[0].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),p=Math.abs(parseFloat(f[0])),m=Math.abs(parseFloat(f[1])),g=Math.abs(parseFloat(f[2])),v=this.origin=new i.Vector3(0,0,0);this.size={x:p,y:m,z:g},this.unit=new i.Vector3(l.x,c.y,u.z),l=l.multiplyScalar(1/(a*p)),c=c.multiplyScalar(1/(a*m)),u=u.multiplyScalar(1/(a*g)),0==l.y&&0==l.z&&0==c.x&&0==c.z&&0==u.x&&0==u.y||(this.matrix=new i.Matrix4(l.x,c.x,u.x,0,l.y,c.y,u.y,0,l.z,c.z,u.z,0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new i.Matrix4).makeTranslation(v.x,v.y,v.z)),this.origin=new i.Vector3(0,0,0),this.unit=new i.Vector3(1,1,1)),t.splice(0,1);var b=t.join(" "),y=(b=b.replace(/^\s+/,"")).split(/[\s\r]+/);y.splice(p*m*g+1);for(var _=Float32Array.from(y,parseFloat),w=0;w<_.length;w++)_[w]=_[w]*d*.036749309;this.data=_},this.dx=function(e){var t,r=e.split(/[\n\r]+/),n=/gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/,s=/^origin\s+(\S+)\s+(\S+)\s+(\S+)/,a=/^delta\s+(\S+)\s+(\S+)\s+(\S+)/,o=/data follows/,l=0;for(l=0;l<r.length;l++){var c=r[l];if(t=n.exec(c)){var u=parseInt(t[1]),h=parseInt(t[2]),d=parseInt(t[3]);this.size={x:u,y:h,z:d}}else if(t=a.exec(c)){var f=parseFloat(t[1]);if(0==parseFloat(t[2])&&0==parseFloat(t[3])||console.log("Non-orthogonal delta matrix not currently supported in dx format"),c=r[l+=1],null==(t=a.exec(c)))return void console.log("Parse error in dx delta matrix");var p=parseFloat(t[2]);if(0==parseFloat(t[1])&&0==parseFloat(t[3])||console.log("Non-orthogonal delta matrix not currently supported in dx format"),c=r[l+=1],null==(t=a.exec(c)))return void console.log("Parse error in dx delta matrix");var m=parseFloat(t[3]);0==parseFloat(t[1])&&0==parseFloat(t[2])||console.log("Non-orthogonal delta matrix not currently supported in dx format"),this.unit=new i.Vector3(f,p,m)}else if(t=s.exec(c)){var g=parseFloat(t[1]),v=parseFloat(t[2]),b=parseFloat(t[3]);this.origin=new i.Vector3(g,v,b)}else if(t=o.exec(c))break}if(l+=1,this.size&&this.origin&&this.unit&&this.size){var y=r.splice(l).join(" ").split(/[\s\r]+/);this.data=Float32Array.from(y,parseFloat)}else console.log("Error parsing dx format")},t=t.toLowerCase(),/\.gz$/.test(t)){t=t.replace(/\.gz$/,"");try{this[t]&&this.isbinary.has(t)?("string"==typeof e&&(e=(0,n.base64ToArray)(e)),e=(0,o.inflate)(e)):e=new TextDecoder("utf-8").decode((0,o.inflate)(e))}catch(h){console.log(h)}}if(this[t]&&(this.isbinary.has(t)&&"string"==typeof e&&(e=(0,n.base64ToArray)(e)),this[t](e)),r){if(r.negate)for(let e=0,t=this.data.length;e<t;e++)this.data[e]=-this.data[e];if(r.normalize){var a=0;for(let e=0,t=this.data.length;e<t;e++)a+=this.data[e];var l=a/this.data.length;a=0;for(let e=0,t=this.data.length;e<t;e++){var c=this.data[e]-l;a+=c*c}var u=a/this.data.length;for(let e=0,t=this.data.length;e<t;e++)this.data[e]=(this.data[e]-l)/u}}}getIndex(e,t,r){if(this.matrix){null==this.inversematrix&&(this.inversematrix=(new i.Matrix4).getInverse(this.matrix));var n=new i.Vector3(e,t,r);e=(n=n.applyMatrix4(this.inversematrix)).x,t=n.y,r=n.z}else e-=this.origin.x,t-=this.origin.y,r-=this.origin.z,e/=this.unit.x,t/=this.unit.y,r/=this.unit.z;return e=Math.round(e),t=Math.round(t),r=Math.round(r),e<0||e>=this.size.x||t<0||t>=this.size.y||r<0||r>=this.size.z?-1:e*this.size.y*this.size.z+t*this.size.z+r}getVal(e,t,r){let n=this.getIndex(e,t,r);return n<0?0:this.data[n]}cube(e){var t=e.split(/\r?\n/);if(!(t.length<6)){var r=(0,a.CUBE)(e,{}).modelData[0].cryst,n=t[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),i=parseFloat(n[0]),s=Math.abs(i);this.origin=r.origin,this.size=r.size,this.unit=r.unit,this.matrix=r.matrix4;var o=6;i<0&&o++;var l=t.splice(s+o).join(" "),c=(l=l.replace(/^\s+/,"")).split(/[\s\r]+/);this.data=Float32Array.from(c,parseFloat)}}ccp4(e){var t={};e=new Int8Array(e);var r=new Int32Array(e.buffer,0,56),n=new Float32Array(e.buffer,0,56),s=new DataView(e.buffer);if(t.MAP=String.fromCharCode(s.getUint8(208),s.getUint8(209),s.getUint8(210),s.getUint8(211)),t.MACHST=[s.getUint8(212),s.getUint8(213)],17===t.MACHST[0]&&17===t.MACHST[1])for(var a=e.byteLength,o=0;o<a;o+=4)s.setFloat32(o,s.getFloat32(o),!0);t.NX=r[0],t.NY=r[1],t.NZ=r[2],t.MODE=r[3],t.NXSTART=r[4],t.NYSTART=r[5],t.NZSTART=r[6],t.MX=r[7],t.MY=r[8],t.MZ=r[9],t.xlen=n[10],t.ylen=n[11],t.zlen=n[12],t.alpha=n[13],t.beta=n[14],t.gamma=n[15],t.MAPC=r[16],t.MAPR=r[17],t.MAPS=r[18],t.DMIN=n[19],t.DMAX=n[20],t.DMEAN=n[21],t.ISPG=r[22],t.NSYMBT=r[23],t.LSKFLG=r[24],t.originX=n[49],t.originY=n[50],t.originZ=n[51],t.ARMS=n[54];var l=t,c=[l.xlen,0,0],u=[l.ylen*Math.cos(Math.PI/180*l.gamma),l.ylen*Math.sin(Math.PI/180*l.gamma),0],h=[l.zlen*Math.cos(Math.PI/180*l.beta),l.zlen*(Math.cos(Math.PI/180*l.alpha)-Math.cos(Math.PI/180*l.gamma)*Math.cos(Math.PI/180*l.beta))/Math.sin(Math.PI/180*l.gamma),0];h[2]=Math.sqrt(l.zlen*l.zlen*Math.sin(Math.PI/180*l.beta)*Math.sin(Math.PI/180*l.beta)-h[1]*h[1]);var d=[0,c,u,h],f=[0,l.MX,l.MY,l.MZ],p=[0,l.MAPC,l.MAPR,l.MAPS];this.matrix=new i.Matrix4,this.matrix.set(d[p[1]][0]/f[p[1]],d[p[2]][0]/f[p[2]],d[p[3]][0]/f[p[3]],0,d[p[1]][1]/f[p[1]],d[p[2]][1]/f[p[2]],d[p[3]][1]/f[p[3]],0,d[p[1]][2]/f[p[1]],d[p[2]][2]/f[p[2]],d[p[3]][2]/f[p[3]],0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new i.Matrix4).makeTranslation(l.NXSTART+l.originX,l.NYSTART+l.originY,l.NZSTART+l.originZ)),this.origin=new i.Vector3(0,0,0),this.unit=new i.Vector3(1,1,1),this.size={x:t.NX,y:t.NY,z:t.NZ},this.dimensionorder=[t.MAPC,t.MAPR,t.MAPS];var m=new Float32Array(e.buffer,1024+t.NSYMBT),g=t.NX,v=t.NY,b=t.NZ;this.data=new Float32Array(g*v*b);for(let i=0;i<g;i++)for(let e=0;e<v;e++)for(let t=0;t<b;t++)this.data[(i*v+e)*b+t]=m[(t*v+e)*g+i]}}},"./src/VolumetricRender.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{GLVolumetricRender:()=>l});var n=r("./src/WebGL/shapes/index.ts"),i=r("./src/WebGL/math/index.ts"),s=r("./src/WebGL/index.ts"),a=r("./src/colors.ts"),o=r("./src/GLShape.ts");class l{static interpolateArray(e,t){function r(e,t,r){return e+(t-e)*r}var n=[],i=(e.length-1)/(t-1);n[0]=e[0];for(var s=1;s<t-1;s++){var a=s*i,o=Math.floor(a),l=Math.ceil(a),c=a-o;n[s]=r(e[o],e[l],c)}return n[t-1]=e[e.length-1],n}constructor(e,t){this.hidden=!1,this.boundingSphere=new n.Sphere,this.renderedShapeObj=null,this.shapeObj=null,this.subsamples=5,this.data=null,this.transferfunctionbuffer=[],this.min=0,this.max=0,t=t||{};var r,s,c,u,h,d,f,p,m,g,v=Object.assign([],t.transferfn);this.subsamples=t.subsamples||5,v.forEach((function(e){e.value=parseFloat(e.value)})),v.sort((function(e,t){return e.value-t.value})),this.min=v[0].value,0==v.length&&v.push(v[0]),this.max=v[v.length-1].value;for(let n=0;n<v.length-1;n++)if(c=a.CC.color(v[n].color),u=a.CC.color(v[n+1].color),m=v[n].opacity,g=v[n+1].opacity,(r=Math.floor(256*(v[n].value-this.min)/(this.max-this.min)))!=(s=Math.floor(256*(v[n+1].value-this.min)/(this.max-this.min)))){h=l.interpolateArray([255*c.r,255*u.r],s-r),d=l.interpolateArray([255*c.g,255*u.g],s-r),f=l.interpolateArray([255*c.b,255*u.b],s-r),p=l.interpolateArray([255*m,255*g],s-r);for(let e=0;e<h.length;e++)this.transferfunctionbuffer.push(h[e]),this.transferfunctionbuffer.push(d[e]),this.transferfunctionbuffer.push(f[e]),this.transferfunctionbuffer.push(p[e])}if(this.transferfunctionbuffer=new Uint8ClampedArray(this.transferfunctionbuffer),e.matrix){let t=new i.Vector3(0,0,0),r=new i.Vector3(e.size.x,e.size.y,e.size.z),n=new i.Vector3(1,1,1);t.applyMatrix4(e.matrix),r.applyMatrix4(e.matrix),n.applyMatrix4(e.matrix).sub(t),this.extent=[[t.x,t.y,t.z],[r.x,r.y,r.z]];for(let i=1;i<7;i++)r.x=1&i?e.size.x:0,r.y=2&i?e.size.y:0,r.z=4&i?e.size.z:0,r.applyMatrix4(e.matrix),this.extent[0][0]=Math.min(this.extent[0][0],r.x),this.extent[0][1]=Math.min(this.extent[0][1],r.y),this.extent[0][2]=Math.min(this.extent[0][2],r.z),this.extent[1][0]=Math.max(this.extent[1][0],r.x),this.extent[1][1]=Math.max(this.extent[1][1],r.y),this.extent[1][2]=Math.max(this.extent[1][2],r.z);let s=r.x-t.x,a=r.y-t.y,o=r.z-t.z;this.maxdepth=Math.sqrt(s*s+a*a+o*o),this.minunit=Math.min(Math.min(n.x,n.y),n.z),this.texmatrix=(new i.Matrix4).identity().scale({x:e.size.x,y:e.size.y,z:e.size.z}),this.texmatrix=this.texmatrix.multiplyMatrices(e.matrix,this.texmatrix),this.texmatrix=this.texmatrix.getInverse(this.texmatrix)}else{this.texmatrix=(new i.Matrix4).identity();let t=e.unit.x*e.size.x,r=e.unit.y*e.size.y,n=e.unit.z*e.size.z;this.texmatrix.makeTranslation(-e.origin.x/t,-e.origin.y/r,-e.origin.z/n),this.texmatrix.scale({x:1/t,y:1/r,z:1/n}),this.minunit=Math.min(Math.min(e.unit.x,e.unit.y),e.unit.z),this.extent=[[e.origin.x,e.origin.y,e.origin.z],[e.origin.x+t,e.origin.y+r,e.origin.z+n]],this.maxdepth=Math.sqrt(t*t+r*r+n*n)}var b=new o.GLShape({});if(b.addBox({corner:{x:this.extent[0][0],y:this.extent[0][1],z:this.extent[0][2]},dimensions:{w:this.extent[1][0]-this.extent[0][0],h:this.extent[1][1]-this.extent[0][1],d:this.extent[1][2]-this.extent[0][2]}}),this.geo=b.finalize(),this.boundingSphere.center=new i.Vector3((this.extent[0][0]+this.extent[1][0])/2,(this.extent[0][1]+this.extent[1][1])/2,(this.extent[0][2]+this.extent[1][2])/2),this.boundingSphere.radius=this.maxdepth/2,void 0!==t.coords&&void 0!==t.seldist){let r=new Uint8Array(e.data.length),n=t.seldist,i=n*n;for(let s=0,a=t.coords.length;s<a;s++){let a=t.coords[s],o=a.x-n,l=a.y-n,c=a.z-n,u=a.x+n,h=a.y+n,d=a.z+n;if(e.getIndex(o,l,c)>=0||e.getIndex(u,h,d)>=0)for(let t=o;t<u;t+=this.minunit)for(let n=l;n<h;n+=this.minunit)for(let s=c;s<d;s+=this.minunit){let o=e.getIndex(t,n,s);o>=0&&!r[o]&&(t-a.x)*(t-a.x)+(n-a.y)*(n-a.y)+(s-a.z)*(s-a.z)<i&&(r[o]=1)}}for(let t=0,s=e.data.length;t<s;t++)0==r[t]&&(e.data[t]=1/0)}this.data=e}globj(e){if(this.renderedShapeObj&&(e.remove(this.renderedShapeObj),this.renderedShapeObj=null),!this.hidden){this.shapeObj=new s.Object3D;var t,r=new s.Texture(this.data,!0),n=new s.Texture(this.transferfunctionbuffer,!1);r.needsUpdate=!0,n.needsUpdate=!0,n.flipY=!1,t=new s.VolumetricMaterial({transferfn:n,transfermin:this.min,transfermax:this.max,map:r,extent:this.extent,maxdepth:this.maxdepth,texmatrix:this.texmatrix,unit:this.minunit,subsamples:this.subsamples});var i=new s.Mesh(this.geo,t);this.shapeObj.add(i),this.renderedShapeObj=this.shapeObj.clone(),e.add(this.renderedShapeObj)}}removegl(e){this.renderedShapeObj&&(void 0!==this.renderedShapeObj.geometry&&this.renderedShapeObj.geometry.dispose(),void 0!==this.renderedShapeObj.material&&this.renderedShapeObj.material.dispose(),e.remove(this.renderedShapeObj),this.renderedShapeObj=null),this.shapeObj=null}get position(){return this.boundingSphere.center}get x(){return this.boundingSphere.center.x}get y(){return this.boundingSphere.center.y}get z(){return this.boundingSphere.center.z}}},
2"./src/WebGL/Camera.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Camera:()=>s});var n=r("./src/WebGL/core/index.ts"),i=r("./src/WebGL/math/index.ts");class s extends n.Object3D{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super(),this.projectionMatrix=new i.Matrix4,this.projectionMatrixInverse=new i.Matrix4,this.matrixWorldInverse=new i.Matrix4,this.fov=e,this.aspect=t,this.near=r,this.far=n;var a=this.position.z;this.right=a*Math.tan(Math.PI/180*e),this.left=-this.right,this.top=this.right/this.aspect,this.bottom=-this.top,this.ortho=!!s,this.updateProjectionMatrix()}lookAt(e){this.matrix.lookAt(this.position,e,this.up),this.rotationAutoUpdate&&(!1===this.useQuaternion&&this.rotation instanceof i.Vector3?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):console.error("Unimplemented math operation."))}updateProjectionMatrix(){this.ortho?this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far):this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}},
2"./src/WebGL/Fog.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Fog:()=>i});var n=r("./src/colors.ts");class i{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.name="",this.color=new n.Color(e),this.near=t,this.far=r}clone(){return new i(this.color.getHex(),this.near,this.far)}}},
2"./src/WebGL/Renderer.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Renderer:()=>f});var n=r("./src/WebGL/Camera.ts"),i=r("./src/WebGL/constants/Sides.ts"),s=r("./src/WebGL/constants/TextureConstants.ts"),a=r("./src/WebGL/core/index.ts"),o=r("./src/colors.ts"),l=r("./src/WebGL/materials/index.ts"),c=r("./src/WebGL/math/index.ts"),u=r("./src/WebGL/objects/index.ts"),h=r("./src/WebGL/shaders/index.ts"),d=r("./src/WebGL/SpritePlugin.ts");class f{constructor(e){this.context=null,this.devicePixelRatio=1,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.autoUpdateObjects=!0,this.autoUpdateScene=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}},this._programs=[],this._programs_counter=0,this._webglversion=1,this._currentProgram=null,this._currentMaterialId=-1,this._currentGeometryGroupHash=null,this._currentCamera=null,this._geometryGroupCounter=0,this._oldDoubleSided=-1,this._oldFlipSided=-1,this._oldDepthTest=-1,this._oldDepthWrite=-1,this._oldPolygonOffset=null,this._oldLineWidth=null,this._viewportWidth=0,this._viewportHeight=0,this._currentWidth=0,this._currentHeight=0,this._enabledAttributes={},this._projScreenMatrix=new c.Matrix4,this._vector3=new c.Vector3,this._worldInverse=new c.Matrix4,this._projInverse=new c.Matrix4,this._textureMatrix=new c.Matrix4,this._direction=new c.Vector3,this._lightsNeedUpdate=!0,this._lights={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},this.sprites=new d.SpritePlugin,this._screenshader=null,this._vertexattribpos=null,this._screenQuadVBO=null,this._fb=null,this._targetTexture=null,this._depthTexture=null,e=e||{},this.row=e.row,this.col=e.col,this.rows=e.rows,this.cols=e.cols,this._canvas=void 0!==e.canvas?e.canvas:document.createElement("canvas"),this._precision=void 0!==e.precision?e.precision:"highp",this._alpha=void 0===e.alpha||e.alpha,this._premultipliedAlpha=void 0===e.premultipliedAlpha||e.premultipliedAlpha,this._antialias=void 0!==e.antialias&&e.antialias,this._stencil=void 0===e.stencil||e.stencil,this._preserveDrawingBuffer=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,this._clearColor=void 0!==e.clearColor?new o.Color(e.clearColor):new o.Color(0),this._clearAlpha=void 0!==e.clearAlpha?e.clearAlpha:0,this._outlineMaterial=new l.MeshOutlineMaterial(e.outline),this._outlineSphereImposterMaterial=new l.SphereImposterOutlineMaterial(e.outline),this._outlineStickImposterMaterial=new l.StickImposterOutlineMaterial(e.outline),this._outlineEnabled=!!e.outline,this.domElement=this._canvas,this._canvas.id=e.id,this.initGL(),this.setDefaultGLState(),this.context=this._gl,this.isWebGL1()?this._extInstanced=this._gl.getExtension("ANGLE_instanced_arrays"):this._extInstanced={vertexAttribDivisorANGLE:this._gl.vertexAttribDivisor.bind(this._gl),drawElementsInstancedANGLE:this._gl.drawElementsInstanced.bind(this._gl)},this._extFragDepth=this._gl.getExtension("EXT_frag_depth"),this._extFloatLinear=this._gl.getExtension("OES_texture_float_linear"),this._extColorBufferFloat=this._gl.getExtension("EXT_color_buffer_float"),this.sprites.init(this)}supportedExtensions(){return{supportsAIA:Boolean(this._extInstanced),supportsImposters:Boolean(this._extFragDepth)||!this.isWebGL1(),regen:!1}}getContext(){return this._gl}isLost(){return this._gl.isContextLost()}getPrecision(){return this._precision}setClearColorHex(e,t){this._clearColor.setHex(e),this._clearAlpha=t,this._gl.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearAlpha)}enableOutline(e){this._outlineMaterial=new l.MeshOutlineMaterial(e),this._outlineSphereImposterMaterial=new l.SphereImposterOutlineMaterial(e),this._outlineStickImposterMaterial=new l.StickImposterOutlineMaterial(e),this._outlineEnabled=!0}disableOutline(){this._outlineEnabled=!1}setViewport(){if(void 0!=this.rows&&void 0!=this.cols&&void 0!=this.row&&void 0!=this.col){var e=this._canvas.width/this.cols,t=this._canvas.height/this.rows;
2this._viewportWidth=e,this._viewportHeight=t,this._gl.enable(this._gl.SCISSOR_TEST),this._gl.scissor(e*this.col,t*this.row,e,t),this._gl.viewport(e*this.col,t*this.row,e,t)}}setSize(e,t){if(this.devicePixelRatio=void 0!==window.devicePixelRatio?window.devicePixelRatio:1,this._antialias&&this.devicePixelRatio<2&&(this.devicePixelRatio*=2),void 0!=this.rows&&void 0!=this.cols&&void 0!=this.row&&void 0!=this.col){var r=e/this.cols,n=t/this.rows;this._canvas.width=e*this.devicePixelRatio,this._canvas.height=t*this.devicePixelRatio,this._viewportWidth=r*this.devicePixelRatio,this._viewportHeight=n*this.devicePixelRatio,this._canvas.style.width=e+"px",this._canvas.style.height=t+"px",this.setViewport()}else this._viewportWidth=this._canvas.width=e*this.devicePixelRatio,this._viewportHeight=this._canvas.height=t*this.devicePixelRatio,this._canvas.style.width=e+"px",this._canvas.style.height=t+"px",this._gl.viewport(0,0,this._gl.drawingBufferWidth,this._gl.drawingBufferHeight);this.initFrameBuffer()}clear(e,t,r){var n=0;(void 0===e||e)&&(n|=this._gl.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=this._gl.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)}clearTarget(e,t,r){this.clear(e,t,r)}setMaterialFaces(e,t){var r=e.side===i.DoubleSide,n=e.side===i.BackSide;e.imposter||(n=t?!n:n),this._oldDoubleSided!==r&&(r?this._gl.disable(this._gl.CULL_FACE):this._gl.enable(this._gl.CULL_FACE),this._oldDoubleSided=r),this._oldFlipSided!==n&&(n?this._gl.frontFace(this._gl.CW):this._gl.frontFace(this._gl.CCW),this._oldFlipSided=n),this._gl.cullFace(this._gl.BACK)}setDepthTest(e){this._oldDepthTest!==e&&(e?this._gl.enable(this._gl.DEPTH_TEST):this._gl.disable(this._gl.DEPTH_TEST),this._oldDepthTest=e)}setDepthWrite(e){this._oldDepthWrite!==e&&(this._gl.depthMask(e),this._oldDepthWrite=e)}setBlending(e){e?(this._gl.enable(this._gl.BLEND),this._gl.blendEquationSeparate(this._gl.FUNC_ADD,this._gl.FUNC_ADD),this._gl.blendFuncSeparate(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA)):this._gl.disable(this._gl.BLEND)}initMaterial(e,t,r,n){var i,s;if(e.addEventListener("dispose",this.onMaterialDispose.bind(this)),s=e.shaderID){var a=h.ShaderLib[s];e.vertexShader=a.vertexShader,e.fragmentShader=a.fragmentShader,e.uniforms=h.ShaderUtils.clone(a.uniforms)}i={wireframe:e.wireframe,fragdepth:e.imposter,volumetric:e.volumetric},e.program=this.buildProgram(e.fragmentShader,e.vertexShader,e.uniforms,i)}renderBuffer(e,t,r,n,i,s){var a,o;if(n.visible&&(a=this.setProgram(e,t,r,n,s,this))){o=a.attributes;var l,c,h=!1,d=n.wireframe?1:0,f=16777215*i.id+2*a.id+d;if(f!==this._currentGeometryGroupHash&&(this._currentGeometryGroupHash=f,h=!0),h&&(this.disableAttributes(),o.position>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglVertexBuffer),this.enableAttribute(o.position),this._gl.vertexAttribPointer(o.position,3,this._gl.FLOAT,!1,0,0)),o.color>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglColorBuffer),this.enableAttribute(o.color),this._gl.vertexAttribPointer(o.color,3,this._gl.FLOAT,!1,0,0)),o.normal>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglNormalBuffer),this.enableAttribute(o.normal),this._gl.vertexAttribPointer(o.normal,3,this._gl.FLOAT,!1,0,0)),o.offset>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglOffsetBuffer),this.enableAttribute(o.offset),this._gl.vertexAttribPointer(o.offset,3,this._gl.FLOAT,!1,0,0)),o.radius>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglRadiusBuffer),this.enableAttribute(o.radius),this._gl.vertexAttribPointer(o.radius,1,this._gl.FLOAT,!1,0,0))),s instanceof u.Mesh){if("instanced"===n.shaderID){var p=n.sphere.geometryGroups[0];h&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglVertexBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,p.vertexArray,this._gl.STATIC_DRAW),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglNormalBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,p.normalArray,this._gl.STATIC_DRAW),this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,i.__webglFaceBuffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,p.faceArray,this._gl.STATIC_DRAW)),l=p.faceidx,this._extInstanced.vertexAttribDivisorANGLE(o.offset,1),this._extInstanced.vertexAttribDivisorANGLE(o.radius,1),this._extInstanced.vertexAttribDivisorANGLE(o.color,1),this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES,l,this._gl.UNSIGNED_SHORT,0,i.radiusArray.length),this._extInstanced.vertexAttribDivisorANGLE(o.offset,0),this._extInstanced.vertexAttribDivisorANGLE(o.radius,0),this._extInstanced.vertexAttribDivisorANGLE(o.color,0)}else n.wireframe?(c=i.lineidx,this.setLineWidth(n.wireframeLinewidth),h&&this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,i.__webglLineBuffer),this._gl.drawElements(this._gl.LINES,c,this._gl.UNSIGNED_SHORT,0)):(l=i.faceidx,h&&this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,i.__webglFaceBuffer),this._gl.drawElements(this._gl.TRIANGLES,l,this._gl.UNSIGNED_SHORT,0));this.info.render.calls++,this.info.render.vertices+=l,this.info.render.faces+=l/3}else s instanceof u.Line&&(c=i.vertices,this.setLineWidth(n.linewidth),this._gl.drawArrays(this._gl.LINES,0,c),this.info.render.calls++)}}render(e,t,r){if(t instanceof n.Camera!==!1){var i,s,a,o,l,c=e.__lights,u=e.fog;this._currentMaterialId=-1,this._lightsNeedUpdate=!0,this.autoUpdateScene&&e.updateMatrixWorld(),void 0===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),this._projScreenMatrix.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this.autoUpdateObjects&&this.initWebGLObjects(e),this.info.render.calls=0,this.info.render.vertices=0,this.info.render.faces=0,this.info.render.points=0,this._currentWidth=this._viewportWidth,this._currentHeight=this._viewportHe
2ight,this.setViewport(),this.setFrameBuffer(),(this.autoClear||r)&&(this._gl.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearAlpha),this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil));var h=!1;for(i=0,s=(l=e.__webglObjects).length;i<s;i++)o=(a=l[i]).object,a.render=!1,o.visible&&(this.setupMatrices(o,t),this.unrollBufferMaterial(a),a.render=!0,a.volumetric&&(h=!0));var d=null;this.setBlending(!1),this.renderObjects(e.__webglObjects,!0,"opaque",t,c,u,!1,d),this.renderSprites(e,t,!1),this.renderObjects(e.__webglObjects,!0,"blank",t,c,u,!0,d),this.renderObjects(e.__webglObjects,!1,"transparent",t,c,u,!0,d),h&&this._fb&&(this.reinitFrameBuffer(),this.renderObjects(e.__webglObjects,!1,"volumetric",t,c,u,!0,d)),this.renderFrameBuffertoScreen(),this.setDepthTest(!0),this.setDepthWrite(!0),this.renderSprites(e,t,!0)}else console.error("Renderer.render: camera is not an instance of Camera.")}reinitFrameBuffer(){this.isWebGL1()||(this._fb=this._gl.createFramebuffer(),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,this._fb),this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER,this._gl.COLOR_ATTACHMENT0,this._gl.TEXTURE_2D,this._targetTexture,0))}setFrameBuffer(){if(this.isWebGL1()||!this._fb)return;let e=this._viewportWidth,t=this._viewportHeight;this._gl.enable(this._gl.SCISSOR_TEST),this._gl.scissor(0,0,e,t),this._gl.viewport(0,0,e,t),this._gl.bindTexture(this._gl.TEXTURE_2D,this._targetTexture),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,e,t,0,this._gl.RGBA,this._gl.UNSIGNED_BYTE,null),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE),this._gl.bindTexture(this._gl.TEXTURE_2D,this._depthTexture),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.DEPTH_COMPONENT32F,e,t,0,this._gl.DEPTH_COMPONENT,this._gl.FLOAT,null),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.NEAREST),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.NEAREST),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,this._fb),this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER,this._gl.COLOR_ATTACHMENT0,this._gl.TEXTURE_2D,this._targetTexture,0),this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER,this._gl.DEPTH_ATTACHMENT,this._gl.TEXTURE_2D,this._depthTexture,0)}initFrameBuffer(){if(this.isWebGL1())return;let e=this._viewportWidth,t=this._viewportHeight;this._gl.enable(this._gl.SCISSOR_TEST),this._gl.scissor(0,0,e,t),this._gl.viewport(0,0,e,t),this._targetTexture=this._gl.createTexture(),this._depthTexture=this._gl.createTexture(),this._fb=this._gl.createFramebuffer();var r=h.ShaderLib.screen;this._screenshader=this.buildProgram(r.fragmentShader,r.vertexShader,r.uniforms,{}),this._vertexattribpos=this._gl.getAttribLocation(this._screenshader,"vertexPosition"),this._screenQuadVBO=this._gl.createBuffer(),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._screenQuadVBO),this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array([1,1,-1,1,-1,-1,-1,-1,1,-1,1,1]),this._gl.STATIC_DRAW)}renderFrameBuffertoScreen(){this.isWebGL1()||null===this._fb||(this.setViewport(),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,null),this._gl.clear(this._gl.COLOR_BUFFER_BIT|this._gl.DEPTH_BUFFER_BIT),this._gl.frontFace(this._gl.CCW),this._gl.cullFace(this._gl.BACK),this._gl.useProgram(this._screenshader),this._currentProgram=this._screenshader,this.setDepthTest(-1),this.setDepthWrite(-1),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._screenQuadVBO),this._gl.enableVertexAttribArray(this._vertexattribpos),this._gl.vertexAttribPointer(this._vertexattribpos,2,this._gl.FLOAT,!1,0,0),this._gl.activeTexture(this._gl.TEXTURE0),this._gl.bindTexture(this._gl.TEXTURE_2D,this._targetTexture),this._gl.drawArrays(this._gl.TRIANGLES,0,6))}initWebGLObjects(e){if(e.__webglObjects||(e.__webglObjects=[],e.__webglObjectsImmediate=[],e.__webglSprites=[],e.__webglFlares=[]),e.__objectsAdded.length){for(;e.__objectsAdded.length;)this.addObject(e.__objectsAdded[0],e),e.__objectsAdded.splice(0,1);this._currentGeometryGroupHash=-1}for(;e.__objectsRemoved.length;)this.removeObject(e.__objectsRemoved[0],e),e.__objectsRemoved.splice(0,1);for(var t=0,r=e.__webglObjects.length;t<r;t++)this.updateObject(e.__webglObjects[t].object)}getYRatio(){return void 0!==this.rows&&void 0!==this.row?this.rows:1}getXRatio(){return void 0!==this.cols&&void 0!==this.col?this.cols:1}getAspect(e,t){void 0!=e&&void 0!=t||(e=this._canvas.width,t=this._canvas.height);var r=e/t;return void 0!=this.rows&&void 0!=this.cols&&void 0!=this.row&&void 0!=this.col&&(r=e/this.cols/(t/this.rows)),r}setTexture(e,t,r){if(e.needsUpdate){e.__webglInit||(e.__webglInit=!0,e.addEventListener("dispose",this.onTextureDispose.bind(this)),e.__webglTexture=this._gl.createTexture(),this.info.memory.textures++),this._gl.activeTexture(this._gl.TEXTURE0+t);var n=r?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D;this._gl.bindTexture(n,e.__webglTexture),this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e.flipY),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,e.unpackAlignment),this._gl.pixelStorei(this._gl.PACK_ALIGNMENT,e.unpackAlignment);var i=this.paramToGL(e.format),s=this.paramToGL(e.type);if(r)this.setTextureParameters(this._gl.TEXTURE_3D,e),this._gl.texImage3D(this._gl.TEXTURE_3D,0,this._gl.R32F,e.image.size.z,e.image.size.y,e.image.size.x,0,this._gl.RED,this._gl.FLOAT,e.image.data);else{var a=e.image,o=a.width,l=a.height;"undefined"===typeof o&&(o=a.length,i==this._gl.RGBA&&(o/=4),l=1),this.setTextureParameters(this._gl.TEXTURE_2D,e),this.isWebG
vendor: 9,085 bytes, line 2
2L1()?this._gl.texImage2D(this._gl.TEXTURE_2D,0,i,i,s,e.image):this._gl.texImage2D(this._gl.TEXTURE_2D,0,i,o,l,0,i,s,e.image)}e.needsUpdate=!1,e.onUpdate&&e.onUpdate()}else this._gl.activeTexture(this._gl.TEXTURE0+t),r?this._gl.bindTexture(this._gl.TEXTURE_3D,e.__webglTexture):this._gl.bindTexture(this._gl.TEXTURE_2D,e.__webglTexture)}supportsVolumetric(){return!this.isWebGL1()}enableAttribute(e){this._enabledAttributes[e]||(this._gl.enableVertexAttribArray(e),this._enabledAttributes[e]=!0)}disableAttributes(){for(let e in this._enabledAttributes)this._enabledAttributes[e]&&(this._gl.disableVertexAttribArray(e),this._enabledAttributes[e]=!1)}setPolygonOffset(e,t,r){this._oldPolygonOffset!==e&&(e?this._gl.enable(this._gl.POLYGON_OFFSET_FILL):this._gl.disable(this._gl.POLYGON_OFFSET_FILL))}setLineWidth(e){e!==this._oldLineWidth&&(this._gl.lineWidth(e),this._oldLineWidth=e)}deallocateGeometry(e){if(e.__webglInit=void 0,void 0!==e.__webglVertexBuffer&&this._gl.deleteBuffer(e.__webglVertexBuffer),void 0!==e.__webglColorBuffer&&this._gl.deleteBuffer(e.__webglColorBuffer),void 0!==e.geometryGroups)for(var t=0,r=e.groups;t<r;t++){var n=e.geometryGroups[t];void 0!==n.__webglVertexBuffer&&this._gl.deleteBuffer(n.__webglVertexBuffer),void 0!==n.__webglColorBuffer&&this._gl.deleteBuffer(n.__webglColorBuffer),void 0!==n.__webglNormalBuffer&&this._gl.deleteBuffer(n.__webglNormalBuffer),void 0!==n.__webglFaceBuffer&&this._gl.deleteBuffer(n.__webglFaceBuffer),void 0!==n.__webglLineBuffer&&this._gl.deleteBuffer(n.__webglLineBuffer)}}deallocateMaterial(e){var t=e.program;if(void 0!==t){var r,n,i;e.program=void 0;var s=!1;for(r=0,n=this._programs.length;r<n;r++)if((i=this._programs[r]).program===t){i.usedTimes--,0===i.usedTimes&&(s=!0);break}if(!0===s){var a=[];for(r=0,n=this._programs.length;r<n;r++)(i=this._programs[r]).program!==t&&a.push(i);this._programs=a,this._gl.deleteProgram(t),this.info.memory.programs--}}}deallocateTexture(e){if(e.image&&e.image.__webglTextureCube)this._gl.deleteTexture(e.image.__webglTextureCube);else{if(!e.__webglInit)return;e.__webglInit=!1,this._gl.deleteTexture(e.__webglTexture)}}onGeometryDispose(e){var t=e.target;t.removeEventListener("dispose",this.onGeometryDispose),this.deallocateGeometry(t),this.info.memory.geometries--}onTextureDispose(e){var t=e.target;t.removeEventListener("dispose",this.onTextureDispose),this.deallocateTexture(t),this.info.memory.textures--}onMaterialDispose(e){var t=e.target;t.removeEventListener("dispose",this.onMaterialDispose),this.deallocateMaterial(t)}getShader(e,t){var r;return this.isWebGL1()||t.startsWith("#version")||(t=t.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),t="#version 300 es\n"+(t=(t=(t=(t=(t="fragment"==e?t.replace(/varying/g,"in"):t.replace(/varying/g,"out")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).replace(/\/\/DEFINEFRAGCOLOR/g,"out vec4 glFragColor;")).replace(/gl_FragColor/g,"glFragColor"))),"fragment"===e?r=this._gl.createShader(this._gl.FRAGMENT_SHADER):"vertex"===e&&(r=this._gl.createShader(this._gl.VERTEX_SHADER)),null==r?null:(this._gl.shaderSource(r,t),this._gl.compileShader(r),this._gl.getShaderParameter(r,this._gl.COMPILE_STATUS)?r:(console.error(this._gl.getShaderInfoLog(r)),console.error("could not initialize shader"),null))}buildProgram(e,t,r,n){var i,s,a,o,l=[];for(i in l.push(e),l.push(t),n)l.push(i),l.push(n[i]);for(o=l.join(),i=0,s=this._programs.length;i<s;i++){var c=this._programs[i];if(c.code===o)return c.usedTimes++,c.program}if(this.isWebGL1()&&n.volumetric)throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware.");if(null==(a=this._gl.createProgram()))return null;var u,h,d,f="precision "+this._precision+" float;",p=[n.volumetric?"#version 300 es":"",f].join("\n"),m=[n.volumetric?"#version 300 es":"",n.fragdepth&&this.isWebGL1()?"#extension GL_EXT_frag_depth: enable":"",n.wireframe?"#define WIREFRAME 1":"",f].join("\n"),g=this.getShader("fragment",m+e),v=this.getShader("vertex",p+t);for(h in null!=v&&this._gl.attachShader(a,v),null!=g&&this._gl.attachShader(a,g),this._gl.linkProgram(a),this._gl.getProgramParameter(a,this._gl.LINK_STATUS)||console.error("Could not initialize shader"),a.uniforms={},a.attributes={},u=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix"],r)u.push(h);for(d=0;d<u.length;d++){var b=u[d];a.uniforms[b]=this._gl.getUniformLocation(a,b)}for(u=["position","normal","color","lineDistance","offset","radius"],d=0;d<u.length;d++){var y=u[d];a.attributes[y]=this._gl.getAttribLocation(a,y)}return a.id=this._programs_counter++,this._programs.push({program:a,code:o,usedTimes:1}),this.info.memory.programs=this._programs.length,a}setProgram(e,t,r,n,i,s){if(n.needsUpdate&&(n.program&&this.deallocateMaterial(n),this.initMaterial(n,t,r,i),n.needsUpdate=!1),null==n.program)return null;var a=!1,o=n.program,l=o.uniforms,c=n.uniforms;if(o!=this._currentProgram&&(this._gl.useProgram(o),this._currentProgram=o,a=!0),n.id!=this._currentMaterialId&&(this._currentMaterialId=n.id,a=!0),e!=this._currentCamera&&(this._currentCamera=e,a=!0),this._gl.uniformMatrix4fv(l.projectionMatrix,!1,e.projectionMatrix.elements),this._gl.uniformMatrix4fv(l.modelViewMatrix,!1,i._modelViewMatrix.elements),this._gl.uniformMatrix3fv(l.normalMatrix,!1,i._normalMatrix.elements),a){if(c.fogColor.value=r.color,c.fogNear.value=r.near,c.fogFar.value=r.far,n.shaderID.startsWith("lambert")||"instanced"===n.shaderID||n.shaderID.endsWith("imposter"))this._gl.uniformMatrix4fv(l.viewMatrix,!1,e.matrixWorldInverse.elements),this._lightsNeedUpdate&&(this.setupLights(o,t),this._lightsNeedUpdate=!1),c.directionalLightColor.value=this._lights.directional.colors,c.directionalLightDirection.value=this._lights.directional.positions;else if(n.shaderID.endsWith("outline"))c.outlineColor.value=n.outlineColor,c.outlineWidth.value=n.outlineWidth,c.outlinePushback.value=n.outlinePushback;else if("volumetric"===n.shaderID){i._modelViewMatrix.getScale(this._direction),this._worldInverse.getInverse(i._modelViewMatrix),this._projInverse.getInverse(e.projectionMatrix),this._textureMatrix.multiplyMatrices(i.material.texmatrix,this._worldInverse),this._gl.uniformMatrix4fv(l.textmat,!1,this._textureMatrix.elements),this._gl.uniformMatrix4fv(l.projinv,!1,this._projInverse.elements);let t=Math.min(Math.min(this._direction.x,this._direction.y),this._direction.z);c.step.value=i.material.unit*t,c.maxdepth.value=i.material.maxdepth*t,c.transfermax.value=i.material.transfermax,c.transfermin.value=i.material.transfermin,c.subsamples.value=i.material.subsamples,s.setTexture(i.material.transferfn,4,!1),s.setTexture(i.material.map,3,!0),this._gl.activeTexture(this._gl.TEXTURE5),this._gl.bindTexture(this._gl.TEXTURE_2D,this._depthTexture)}c.opacity.value=n.opacity,this.loadMaterialUniforms(l,c)}return o}loadMaterialUniforms(e,t){var r,n,i,s;for(r in t)e[r]&&(n=t[r].type,i=t[r].value,s=e[r],"f"===n?this._gl.uniform1f(s,i):"i"===n?this._gl.uniform1i(s,i):"fv"===n?this._gl.uniform3fv(s,i):"c"===n?this._gl.uniform3f(s,i.r,i.g,i.b):"f4"===n&&this._gl.uniform4f(s,i[0],i[1],i[2],i[3]))}addObject(e,t){var r,n,i,s;if(!e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new c.Matrix4,e._normalMatrix=new c.Matrix3,void 0!==e.geometry&&void 0===e.geometry.__webglInit&&(e.geometry.__webglInit=!0,e.geometry.addEventListener("dispose",this.onGeometryDispose.bind(this))),e instanceof u.Mesh||e instanceof u.Line))for(r=0,n=(i=e.geometry).geometryGroups.length;r<n;r++)(s=i.geometryGroups[r]).id=this._geometryGroupCounter++,s.__webglVertexBuffer||(e instanceof u.Mesh?(this.createMeshBuffers(s),i.elementsNeedUpdate=!0,i.normalsNeedUpdate=!0):e instanceof u.Line&&this.createLineBuffers(s),i.verticesNeedUpdate=!0,i.colorsNeedUpdate=!0);if(!e.__webglActive){if(e instanceof u.Mesh||e instanceof u.Line)for(r=0,n=(i=e.geometry).geometryGroups.length;r<n;r++)s=i.geometryGroups[r],this.addBuffer(t.__webglObjects,s,e);else e instanceof u.Sprite&&t.__webglSprites.push(e);e.__webglActive=!0}}updateObject(e){var t,r=e.geometry;if(e instanceof u.Mesh||e instanceof u.Line){for(var n=0,i=r.geometryGroups.length;n<i;n++)t=r.geometryGroups[n],(r.verticesNeedUpdate||r.elementsNeedUpdate||r.colorsNeedUpdate||r.normalsNeedUpdate)&&this.setBuffers(t,this._gl.STATIC_DRAW);r.verticesNeedUpdate=!1,r.elementsNeedUpdate=!1,r.normalsNeedUpdate=!1,r.colorsNeedUpdate=!1,r.buffersNeedUpdate=!1}}removeObject(e,t){e instanceof u.Mesh||e instanceof u.Line?this.removeInstances(t.__webglObjects,e):e instanceof u.Sprite&&this.removeInstancesDirect(t.__webglSprites,e),e.__webglActive=!1}removeInstances(e,t){for(var r=e.length-1;r>=0;--r)e[r].object===t&&e.splice(r,1)}removeInstancesDirect(e,t){for(var r=e.length-1;r>=0;--r)e[r]===t&&e.splice(r,1)}unrollBufferMaterial(e){var t=e.object.material;if(t.volumetric)e.opaque=null,e.transparent=null,e.volumetric=t;else if(t.transparent){if(e.opaque=null,e.volumetric=null,e.transparent=t,!t.wireframe){var r=t.clone();r.opacity=0,e.blank=r}}else e.opaque=t,e.transparent=null,e.volumetric=null}setBuffers(e,t){var r=e.vertexArray,n=e.colorArray;
2if(void 0!==e.__webglOffsetBuffer?(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,e.__webglOffsetBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,r,t)):(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,e.__webglVertexBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,r,t)),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,e.__webglColorBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,n,t),e.normalArray&&void 0!==e.__webglNormalBuffer){var i=e.normalArray;this._gl.bindBuffer(this._gl.ARRAY_BUFFER,e.__webglNormalBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,i,t)}if(e.radiusArray&&void 0!==e.__webglRadiusBuffer&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,e.__webglRadiusBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,e.radiusArray,t)),e.faceArray&&void 0!==e.__webglFaceBuffer){var s=e.faceArray;this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,s,t)}if(e.lineArray&&void 0!==e.__webglLineBuffer){var a=e.lineArray;this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,a,t)}}createMeshBuffers(e){e.radiusArray&&(e.__webglRadiusBuffer=this._gl.createBuffer()),e.useOffset&&(e.__webglOffsetBuffer=this._gl.createBuffer()),e.__webglVertexBuffer=this._gl.createBuffer(),e.__webglNormalBuffer=this._gl.createBuffer(),e.__webglColorBuffer=this._gl.createBuffer(),e.__webglFaceBuffer=this._gl.createBuffer(),e.__webglLineBuffer=this._gl.createBuffer(),this.info.memory.geometries++}createLineBuffers(e){e.__webglVertexBuffer=this._gl.createBuffer(),e.__webglColorBuffer=this._gl.createBuffer(),this.info.memory.geometries++}addBuffer(e,t,r){e.push({buffer:t,object:r,opaque:null,transparent:null})}setupMatrices(e,t){e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),e._normalMatrix.getInverse(e._modelViewMatrix),e._normalMatrix.transpose()}filterFallback(e){return this._gl.LINEAR}setTextureParameters(e,t){e==this._gl.TEXTURE_2D?(this._gl.texParameteri(e,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(e,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(e,this._gl.TEXTURE_MAG_FILTER,this.filterFallback(t.magFilter)),this._gl.texParameteri(e,this._gl.TEXTURE_MIN_FILTER,this.filterFallback(t.minFilter))):(this._gl.texParameteri(e,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(e,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(e,this._gl.TEXTURE_WRAP_R,this._gl.CLAMP_TO_EDGE),this._extColorBufferFloat&&this._extFloatLinear?(this._gl.texParameteri(e,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(e,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR)):(this._gl.texParameteri(e,this._gl.TEXTURE_MAG_FILTER,this._gl.NEAREST),this._gl.texParameteri(e,this._gl.TEXTURE_MIN_FILTER,this._gl.NEAREST)))}paramToGL(e){return e===s.UnsignedByteType?this._gl.UNSIGNED_BYTE:e===s.RGBAFormat?this._gl.RGBA:e===s.NearestFilter?this._gl.NEAREST:0}setupLights(e,t){var r,n,i,s,o,l=this._lights,c=l.directional.colors,u=l.directional.positions,h=0,d=0;for(r=0,n=t.length;r<n;r++)if(s=(i=t[r]).color,o=i.intensity,i instanceof a.Light){if(this._direction.getPositionFromMatrix(i.matrixWorld),this._vector3.getPositionFromMatrix(i.target.matrixWorld),this._direction.sub(this._vector3),this._direction.normalize(),0===this._direction.x&&0===this._direction.y&&0===this._direction.z)continue;u[d]=this._direction.x,u[d+1]=this._direction.y,u[d+2]=this._direction.z,c[d]=s.r*o,c[d+1]=s.g*o,c[d+2]=s.b*o,d+=3,h++}l.ambient[0]=0,l.ambient[1]=0,l.ambient[2]=0,l.directional.length=h}initGL(){try{if(!(this._gl=this._canvas.getContext("webgl2",{alpha:this._alpha,premultipliedAlpha:this._premultipliedAlpha,antialias:this._antialias,stencil:this._stencil,preserveDrawingBuffer:this._preserveDrawingBuffer}))&&!(this._gl=this._canvas.getContext("experimental-webgl",{alpha:this._alpha,premultipliedAlpha:this._premultipliedAlpha,antialias:this._antialias,stencil:this._stencil,preserveDrawingBuffer:this._preserveDrawingBuffer}))&&!(this._gl=this._canvas.getContext("webgl",{alpha:this._alpha,premultipliedAlpha:this._premultipliedAlpha,antialias:this._antialias,stencil:this._stencil,preserveDrawingBuffer:this._preserveDrawingBuffer})))throw"Error creating WebGL context.";var e=this._gl.getParameter(this._gl.VERSION);this._webglversion=parseInt(e[6])}catch(t){console.error(t)}}isWebGL1(){return 1==this._webglversion}setDefaultGLState(){this._gl.clearColor(0,0,0,1),this._gl.clearDepth(1),this._gl.clearStencil(0),this._gl.enable(this._gl.DEPTH_TEST),this._gl.depthFunc(this._gl.LEQUAL),this._gl.frontFace(this._gl.CCW),this._gl.cullFace(this._gl.BACK),this._gl.enable(this._gl.CULL_FACE),this._gl.enable(this._gl.BLEND),this._gl.blendEquation(this._gl.FUNC_ADD),this._gl.blendFunc(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA),this._gl.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearAlpha)}renderObjects(e,t,r,n,i,s,a,o){var l,c,u,h,d,f;t?(h=e.length-1,d=-1,f=-1):(h=0,d=e.length,f=1);for(var p=h;p!==d;p+=f)if((l=e[p]).render){if(c=l.object,u=l.buffer,!(o=l[r]))continue;a&&this.setBlending(!0),this.setDepthTest(o.depthTest),this.setDepthWrite(o.depthWrite),this.setPolygonOffset(o.polygonOffset,o.polygonOffsetFactor,o.polygonOffsetUnits);var m=c._modelViewMatrix.isReflected();this.setMaterialFaces(o,m),this.renderBuffer(n,i,s,o,u,c),(this._outlineEnabled||o.outline)&&("sphereimposter"==o.shaderID?this.renderBuffer(n,i,s,this._outlineSphereImposterMaterial,u,c):"stickimposter"==o.shaderID?this.renderBuffer(n,i,s,this._outlineStickImposterMaterial,u,c):o.wireframe||"basic"===o.shaderID||0===o.opacity||this.renderBuffer(n,i,s,this._outlineMaterial,u,c))}}renderSprites(e,t,r){this._currentGeometryGroupHash=-1,this._currentProgram=null,this._currentCamera=null,this._oldDepthWrite=-1,this._oldDepthTest=-1,this._oldDoubleSided=-1,this._currentMaterialId=-1,this._oldFlipSided=-1,this._lightsNeedUpdate=!0,this.sprites.render(e,t,this._currentWidth,this._currentHeight,r),this._currentGeometryGroupHash=-1,this._currentProgram=null,this._currentCamera=null,this._oldDepthWrite=-1,this._oldDepthTest=-1,this._oldDoubleSided=-1,this._currentMaterialId=-1,this._oldFlipSided=-1}}},
2"./src/WebGL/SpritePlugin.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{SpritePlugin:()=>i});var n=r("./src/WebGL/shaders/index.ts");class i{constructor(){this.sprite={vertices:null,faces:null,vertexBuffer:null,elementBuffer:null,program:null,attributes:{},uniforms:null}}init(e){this.gl=e.context,this.renderer=e,this.precision=e.getPrecision(),this.sprite.vertices=new Float32Array(16),this.sprite.faces=new Uint16Array(6);var t=0;this.sprite.vertices[t++]=-1,this.sprite.vertices[t++]=-1,this.sprite.vertices[t++]=0,this.sprite.vertices[t++]=0,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=-1,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=0,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=-1,this.sprite.vertices[t++]=1,this.sprite.vertices[t++]=0,this.sprite.vertices[t++]=1,t=0,this.sprite.faces[t++]=0,this.sprite.faces[t++]=1,this.sprite.faces[t++]=2,this.sprite.faces[t++]=0,this.sprite.faces[t++]=2,this.sprite.faces[t++]=3,this.sprite.vertexBuffer=this.gl.createBuffer(),this.sprite.elementBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.sprite.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.sprite.vertices,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.sprite.elementBuffer),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,this.sprite.faces,this.gl.STATIC_DRAW),this.sprite.program=this.createProgram(n.ShaderLib.sprite,this.precision||1),this.sprite.attributes={};const r={};this.sprite.attributes.position=this.gl.getAttribLocation(this.sprite.program,"position"),this.sprite.attributes.uv=this.gl.getAttribLocation(this.sprite.program,"uv"),r.uvOffset=this.gl.getUniformLocation(this.sprite.program,"uvOffset"),r.uvScale=this.gl.getUniformLocation(this.sprite.program,"uvScale"),r.rotation=this.gl.getUniformLocation(this.sprite.program,"rotation"),r.scale=this.gl.getUniformLocation(this.sprite.program,"scale"),r.alignment=this.gl.getUniformLocation(this.sprite.program,"alignment"),r.color=this.gl.getUniformLocation(this.sprite.program,"color"),r.map=this.gl.getUniformLocation(this.sprite.program,"map"),r.opacity=this.gl.getUniformLocation(this.sprite.program,"opacity"),r.useScreenCoordinates=this.gl.getUniformLocation(this.sprite.program,"useScreenCoordinates"),r.screenPosition=this.gl.getUniformLocation(this.sprite.program,"screenPosition"),r.modelViewMatrix=this.gl.getUniformLocation(this.sprite.program,"modelViewMatrix"),r.projectionMatrix=this.gl.getUniformLocation(this.sprite.program,"projectionMatrix"),r.fogType=this.gl.getUniformLocation(this.sprite.program,"fogType"),r.fogDensity=this.gl.getUniformLocation(this.sprite.program,"fogDensity"),r.fogNear=this.gl.getUniformLocation(this.sprite.program,"fogNear"),r.fogFar=this.gl.getUniformLocation(this.sprite.program,"fogFar"),r.fogColor=this.gl.getUniformLocation(this.sprite.program,"fogColor"),r.alphaTest=this.gl.getUniformLocation(this.sprite.program,"alphaTest"),this.sprite.uniforms=r}render(e,t,r,n,i){var a,o,l,c,u,h,d,f,p,m;if(!this.gl)throw new Error("WebGLRenderer not initialized");let g=[];null===(a=null===e||void 0===e?void 0:e.__webglSprites)||void 0===a||a.forEach((e=>{(i&&0==e.material.depthTest||!i&&e.material.depthTest)&&g.push(e)}));let v=g.length;if(!v)return;const b=this.sprite.attributes,y=this.sprite.uniforms;if(!y)throw new Error("Uniforms not defined");var _=.5*r,w=.5*n;this.gl.useProgram(this.sprite.program),this.gl.enableVertexAttribArray(b.position),this.gl.enableVertexAttribArray(b.uv),this.gl.disable(this.gl.CULL_FACE),this.gl.enable(this.gl.BLEND),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.sprite.vertexBuffer),this.gl.vertexAttribPointer(b.position,2,this.gl.FLOAT,!1,16,0),this.gl.vertexAttribPointer(b.uv,2,this.gl.FLOAT,!1,16,8),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.sprite.elementBuffer),this.gl.uniformMatrix4fv(y.projectionMatrix,!1,t.projectionMatrix.elements),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.uniform1i(y.map,0);var x,S=0,C=0,k=e.fog;let E,A,L,M;
2k?(this.gl.uniform3f(y.fogColor,k.color.r,k.color.g,k.color.b),this.gl.uniform1f(y.fogNear,k.near),this.gl.uniform1f(y.fogFar,k.far),this.gl.uniform1i(y.fogType,1),S=1,C=1):(this.gl.uniform1i(y.fogType,0),S=0,C=0);let z=[];for(x=0;x<v;x++)E=g[x],A=E.material,A&&(0!=A.depthTest||i)&&E.visible&&0!==A.opacity&&(A.useScreenCoordinates?E.z=-E.position.z:(E._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,E.matrixWorld),E.z=-E._modelViewMatrix.elements[14]));for(g.sort(s),x=0;x<v;x++)if(E=g[x],A=E.material,A&&E.visible&&0!==A.opacity&&A.map&&A.map.image&&A.map.image.width){this.gl.uniform1f((null===y||void 0===y?void 0:y.alphaTest)||null,A.alphaTest);var T=A.map.image.width,O=A.map.image.height;z[0]=T*this.renderer.devicePixelRatio/r,z[1]=O*this.renderer.devicePixelRatio/n,!0===A.useScreenCoordinates?(this.gl.uniform1i(y.useScreenCoordinates,1),this.gl.uniform3f(y.screenPosition,(E.position.x*this.renderer.devicePixelRatio-_)/_,(w-E.position.y*this.renderer.devicePixelRatio)/w,Math.max(0,Math.min(1,E.position.z)))):(this.gl.uniform1i(y.useScreenCoordinates,0),this.gl.uniformMatrix4fv(y.modelViewMatrix,!1,E._modelViewMatrix.elements)),M=e.fog&&A.fog?C:0,S!==M&&(this.gl.uniform1i(y.fogType,M),S=M),L=1/(A.scaleByViewport?n:1),z[0]*=L*E.scale.x,z[1]*=L*E.scale.y;let t=null===(o=null===A||void 0===A?void 0:A.alignment)||void 0===o?void 0:o.x,i=null===(l=null===A||void 0===A?void 0:A.alignment)||void 0===l?void 0:l.y;A.screenOffset&&(t=(t||0)+2*A.screenOffset.x/T,i=(i||0)+2*A.screenOffset.y/O),this.gl.uniform2f(y.uvScale,(null===(c=null===A||void 0===A?void 0:A.uvScale)||void 0===c?void 0:c.x)||1,(null===(u=null===A||void 0===A?void 0:A.uvScale)||void 0===u?void 0:u.y)||1),this.gl.uniform2f(y.uvOffset,(null===(h=null===A||void 0===A?void 0:A.uvOffset)||void 0===h?void 0:h.x)||0,(null===(d=null===A||void 0===A?void 0:A.uvOffset)||void 0===d?void 0:d.y)||0),this.gl.uniform2f(y.alignment,t||0,i||0),this.gl.uniform1f(y.opacity,A.opacity),this.gl.uniform3f(y.color,(null===(f=null===A||void 0===A?void 0:A.color)||void 0===f?void 0:f.r)||0,(null===(p=null===A||void 0===A?void 0:A.color)||void 0===p?void 0:p.g)||0,(null===(m=null===A||void 0===A?void 0:A.color)||void 0===m?void 0:m.b)||0),this.gl.uniform1f(y.rotation,E.rotation),this.gl.uniform2fv(y.scale,z),this.renderer.setDepthTest(A.depthTest),this.renderer.setDepthWrite(A.depthWrite),this.renderer.setTexture(A.map,0),this.gl.drawElements(this.gl.TRIANGLES,6,this.gl.UNSIGNED_SHORT,0)}this.gl.enable(this.gl.CULL_FACE)}createProgram(e,t){if(!this.gl)throw new Error("WebGL Rendering context not found");var r=this.gl.createProgram();if(!r)throw new Error("Error creating webgl program");var n=this.gl.createShader(this.gl.FRAGMENT_SHADER),i=this.gl.createShader(this.gl.VERTEX_SHADER);if(!n)throw new Error("Unable to create fragment shader SpritePlugin.createProgram");if(!i)throw new Error("Unable to create vertex shader SpritePlugin.createProgram");var s="precision "+t+" float;\n";if(this.gl.shaderSource(n,s+e.fragmentShader),this.gl.shaderSource(i,s+e.vertexShader),this.gl.compileShader(n),this.gl.compileShader(i),!this.gl.getShaderParameter(n,this.gl.COMPILE_STATUS)||!this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS))throw new Error("Error compiling shader: \n      ".concat(this.gl.getShaderInfoLog(n)," \n      ").concat(this.gl.getShaderInfoLog(i)));return this.gl.attachShader(r,n),this.gl.attachShader(r,i),this.gl.linkProgram(r),this.gl.getProgramParameter(r,this.gl.LINK_STATUS)||console.error("Could not initialize shader"),r}}function s(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}},
2"./src/WebGL/constants/Coloring.ts":(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{Coloring:()=>n}),function(e){e[e.NoColors=0]="NoColors",e[e.FaceColors=1]="FaceColors",e[e.VertexColors=2]="VertexColors"}(n||(n={}))},
2"./src/WebGL/constants/Shading.ts":(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{Shading:()=>n}),function(e){e[e.NoShading=0]="NoShading",e[e.FlatShading=1]="FlatShading",e[e.SmoothShading=2]="SmoothShading"}(n||(n={}))},
2"./src/WebGL/constants/Sides.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{BackSide:()=>i,DoubleSide:()=>s,FrontSide:()=>n});const n=0,i=1,s=2},
2"./src/WebGL/constants/SpriteAlignment.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{SpriteAlignment:()=>i});var n=r("./src/WebGL/math/index.ts");const i={topLeft:new n.Vector2(1,-1),topCenter:new n.Vector2(0,-1),topRight:new n.Vector2(-1,-1),centerLeft:new n.Vector2(1,0),center:new n.Vector2(0,0),centerRight:new n.Vector2(-1,0),bottomLeft:new n.Vector2(1,1),bottomCenter:new n.Vector2(0,1),bottomRight:new n.Vector2(-1,1)}},
2"./src/WebGL/constants/TextureConstants.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClampToEdgeWrapping:()=>n,FloatType:()=>l,LinearFilter:()=>i,LinearMipMapLinearFilter:()=>a,NearestFilter:()=>s,R32Format:()=>h,RFormat:()=>u,RGBAFormat:()=>c,UnsignedByteType:()=>o});const n=1001,i=1006,s=1007,a=1008,o=1009,l=1010,c=1021,u=1022,h=1023},
2"./src/WebGL/constants/TextureOperations.ts":(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{TextureOperations:()=>n}),function(e){e[e.MultiplyOperation=0]="MultiplyOperation",e[e.MixOperation=1]="MixOperation",e[e.AddOperation=2]="AddOperation"}(n||(n={}))},
2"./src/WebGL/constants/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{BackSide:()=>i.BackSide,ClampToEdgeWrapping:()=>o.ClampToEdgeWrapping,Coloring:()=>n.Coloring,DoubleSide:()=>i.DoubleSide,FloatType:()=>o.FloatType,FrontSide:()=>i.FrontSide,LinearFilter:()=>o.LinearFilter,LinearMipMapLinearFilter:()=>o.LinearMipMapLinearFilter,NearestFilter:()=>o.NearestFilter,R32Format:()=>o.R32Format,RFormat:()=>o.RFormat,RGBAFormat:()=>o.RGBAFormat,Shading:()=>s.Shading,SpriteAlignment:()=>a.SpriteAlignment,TextureOperations:()=>l.TextureOperations,UnsignedByteType:()=>o.UnsignedByteType});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Sides.ts"),s=r("./src/WebGL/constants/Shading.ts"),a=r("./src/WebGL/constants/SpriteAlignment.ts"),o=r("./src/WebGL/constants/TextureConstants.ts"),l=r("./src/WebGL/constants/TextureOperations.ts")},
vendor: 13,026 bytes, line 2
2"./src/WebGL/core/EventDispatcher.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{EventDispatcher:()=>n});class n{constructor(){this.listeners={}}dispatchEvent(e){var t=this.listeners[e.type];if(void 0!==t){e.target=this;for(var r=0,n=t.length;r<n;r++)t[r].call(this,e)}}removeEventListener(e,t){if(t){var r=this.listeners[e].indexOf(t);-1!==r&&this.listeners[e].splice(r,1)}else this.listeners[e]=[]}addEventListener(e,t){void 0===this.listeners[e]&&(this.listeners[e]=[]),-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)}}},"./src/WebGL/core/Geometry.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Geometry:()=>c,GeometryGroup:()=>l,GeometryIDCount:()=>u});var n=r("./src/WebGL/materials/LineBasicMaterial.ts"),i=r("./src/WebGL/core/EventDispatcher.ts"),s=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts");const o=65535;class l{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.vertexArray=null,this.colorArray=null,this.normalArray=null,this.radiusArray=null,this.faceArray=null,this.lineArray=null,this.vertices=0,this.faceidx=0,this.lineidx=0,this.__inittedArrays=!1,this.id=e}setColors(e){var t=this.vertexArray,r=this.colorArray;if(!t)throw new Error("vertex array not initialized");if(!r)throw new Error("color array not initialized");if(t.length==r.length)for(var n=0;n<t.length;n+=3){var i=e(t[n],t[n+1],t[n+2]);i instanceof a.Color||(i=a.CC.color(i)),r[n]=i.r,r[n+1]=i.g,r[n+2]=i.b}else console.log("Cannot re-color geometry group due to mismatched lengths.")}getNumVertices(){return this.vertices}getVertices(){return this.vertexArray}getCentroid(){if(!this.vertexArray)throw new Error("vertex array not initialized");for(var e,t,r,n,i=new s.Vector3,a=0;a<this.vertices;++a)e=3*a,t=this.vertexArray[e],r=this.vertexArray[e+1],n=this.vertexArray[e+2],i.x+=t,i.y+=r,i.z+=n;return i.divideScalar(this.vertices),i}setNormals(){var e=this.faceArray,t=this.vertexArray,r=this.normalArray;if(this.vertices&&this.faceidx){if(!e)throw new Error("face array not initialized");if(!t)throw new Error("vertex array not initialized");if(!r)throw new Error("normal array not initialized");for(var n,i,a,o,l,c,u,h=0;h<e.length/3;++h)n=3*e[3*h],i=3*e[3*h+1],a=3*e[3*h+2],o=new s.Vector3(t[n],t[n+1],t[n+2]),l=new s.Vector3(t[i],t[i+1],t[i+2]),c=new s.Vector3(t[a],t[a+1],t[a+2]),o.subVectors(o,l),c.subVectors(c,l),c.cross(o),(u=c).normalize(),r[n]+=u.x,r[i]+=u.x,r[a]+=u.x,r[n+1]+=u.y,r[i+1]+=u.y,r[a+1]+=u.y,r[n+2]+=u.z,r[i+2]+=u.z,r[a+2]+=u.z}}setLineIndices(){if(this.faceidx&&(!this.lineArray||this.lineArray.length!=2*this.faceidx||this.lineidx!=2*this.faceidx)){var e=this.faceArray,t=this.lineArray=new Uint16Array(2*this.faceidx);if(this.lineidx=2*this.faceidx,!e)throw new Error("face array not initialized");for(var r=0;r<this.faceidx/3;++r){var n=3*r,i=2*n,s=e[n],a=e[n+1],o=e[n+2];t[i]=s,t[i+1]=a,t[i+2]=s,t[i+3]=o,t[i+4]=a,t[i+5]=o}}}vrml(e,t){var r,i,s,a,o,l,c,u,h,d,f,p,m,g,v,b="";b+=e+"Shape {\n"+e+" appearance Appearance {\n"+e+"  material Material {\n"+e+"   diffuseColor "+(null===(r=null===t||void 0===t?void 0:t.color)||void 0===r?void 0:r.r)+" "+(null===(i=null===t||void 0===t?void 0:t.color)||void 0===i?void 0:i.g)+" "+(null===(s=null===t||void 0===t?void 0:t.color)||void 0===s?void 0:s.b)+"\n",(null===t||void 0===t?void 0:t.transparent)&&(b+=e+"   transparency "+(1-t.opacity)+"\n"),b+=e+"  }\n",b+=e+" }\n";var y=e;if(e+=" ",t instanceof n.LineBasicMaterial){let t,r,n;b+=e+"geometry IndexedLineSet {\n"+e+" colorPerVertex TRUE\n"+e+" coord Coordinate {\n"+e+"  point [\n";for(let i=0;i<this.vertices;++i){let s=3*i;t=null===(a=this.vertexArray)||void 0===a?void 0:a[s],r=null===(o=this.vertexArray)||void 0===o?void 0:o[s+1],n=null===(l=this.vertexArray)||void 0===l?void 0:l[s+2],b+=e+"   "+t+" "+r+" "+n+",\n"}if(b+=e+"  ]\n",b+=e+" }\n",this.colorArray){b+=e+" color Color {\n"+e+"  color [\n";for(let i=0;i<this.vertices;++i){let s=3*i;t=this.colorArray[s],r=this.colorArray[s+1],n=this.colorArray[s+2],b+=e+"   "+t+" "+r+" "+n+",\n"}b+=e+"  ]\n",b+=e+" }\n"}b+=e+" coordIndex [\n";for(let i=0;i<this.vertices;i+=2)b+=e+"  "+i+", "+(i+1)+", -1,\n";b+=e+" ]\n",b+=e+"}\n"}else{let t,r,n;b+=e+"geometry IndexedFaceSet {\n"+e+" colorPerVertex TRUE\n"+e+" normalPerVertex TRUE\n"+e+" solid FALSE\n",b+=e+" coord Coordinate {\n"+e+"  point [\n";for(let i=0;i<this.vertices;++i){let s=3*i;t=null===(c=this.vertexArray)||void 0===c?void 0:c[s],r=null===(u=this.vertexArray)||void 0===u?void 0:u[s+1],n=null===(h=this.vertexArray)||void 0===h?void 0:h[s+2],b+=e+"   "+t+" "+r+" "+n+",\n"}b+=e+"  ]\n",b+=e+" }\n",b+=e+" normal Normal {\n"+e+"  vector [\n";for(let i=0;i<this.vertices;++i){let s=3*i;t=null===(d=this.normalArray)||void 0===d?void 0:d[s],r=null===(f=this.normalArray)||void 0===f?void 0:f[s+1],n=null===(p=this.normalArray)||void 0===p?void 0:p[s+2],b+=e+"   "+t+" "+r+" "+n+",\n"}if(b+=e+"  ]\n",b+=e+" }\n",this.colorArray){b+=e+" color Color {\n"+e+"  color [\n";for(let i=0;i<this.vertices;++i){let s=3*i;t=this.colorArray[s],r=this.colorArray[s+1],n=this.colorArray[s+2],b+=e+"   "+t+" "+r+" "+n+",\n"}b+=e+"  ]\n",b+=e+" }\n"}b+=e+" coordIndex [\n";for(var _=0;_<this.faceidx;_+=3)t=null===(m=this.faceArray)||void 0===m?void 0:m[_],r=null===(g=this.faceArray)||void 0===g?void 0:g[_+1],n=null===(v=this.faceArray)||void 0===v?void 0:v[_+2],b+=e+"  "+t+", "+r+", "+n+", -1,\n";b+=e+" ]\n",b+=e+"}\n"}return b+=y+"}"}truncateArrayBuffers(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var r=this.vertexArray,n=this.colorArray,i=this.normalArray,s=this.faceArray,a=this.lineArray,o=this.radiusArray;this.vertexArray=(null===r||void 0===r?void 0:r.subarray(0,3*this.vertices))||null,this.colorArray=(null===n||void 0===n?void 0:n.subarray(0,3*this.vertices))||null,e?(this.normalArray=(null===i||void 0===i?void 0:i.subarray(0,3*this.vertices))||null,this.faceArray=(null===s||void 0===s?void 0:s.subarray(0,this.faceidx))||null,this.lineidx>0?this.lineArray=(null===a||void 0===a?void 0:a.subarray(0,this.lineidx))||null:this.lineArray=new Uint16Array(0)):(this.normalArray=new Float32Array(0),this.faceArray=new Uint16Array(0),this.lineArray=new Uint16Array(0)),o&&(this.radiusArray=o.subarray(0,this.vertices)),t&&(this.normalArray&&(this.normalArray=new Float32Array(this.normalArray)),this.faceArray&&(this.faceArray=new Uint16Array(this.faceArray)),this.lineArray&&(this.lineArray=new Uint16Array(this.lineArray)),this.vertexArray&&(this.vertexArray=new Float32Array(this.vertexArray)),this.colorArray&&(this.colorArray=new Float32Array(this.colorArray)),this.radiusArray&&(this.radiusArray=new Float32Array(this.radiusArray))),this.__inittedArrays=!0}}class c extends i.EventDispatcher{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.name="",this.hasTangents=!1,this.dynamic=!0,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.buffersNeedUpdate=!1,this.imposter=!1,this.instanced=!1,this.geometryGroups=[],this.groups=0,this.id=u++,this.mesh=e,this.radii=t,this.offset=r}updateGeoGroup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;var t,r=this.groups>0?this.geometryGroups[this.groups-1]:null;return(!r||r.vertices+e>((null===(t=null===r||void 0===r?void 0:r.vertexArray)||void 0===t?void 0:t.length)||0)/3)&&(r=this.addGeoGroup()),r}vrml(e,t){for(var r="",n=this.geometryGroups.length,i=0;i<n;i++)r+=this.geometryGroups[i].vrml(e,t)+",\n";return r}addGeoGroup(){var e=new l(this.geometryGroups.length);return this.geometryGroups.push(e),this.groups=this.geometryGroups.length,e.vertexArray=new Float32Array(196605),e.colorArray=new Float32Array(196605),this.mesh&&(e.normalArray=new Float32Array(196605),e.faceArray=new Uint16Array(393210),e.lineArray=new Uint16Array(393210)),this.radii&&(e.radiusArray=new Float32Array(o)),e.useOffset=this.offset,e}setUpNormals(){for(var e=0;e<this.groups;e++)this.geometryGroups[e].setNormals(...arguments)}setColors(){for(var e=this.geometryGroups.length,t=0;t<e;t++)this.geometryGroups[t].setColors(...arguments)}setUpWireframe(){for(var e=0;e<this.groups;e++)this.geometryGroups[e].setLineIndices(...arguments)}initTypedArrays(){for(var e=0;e<this.groups;e++){var t=this.geometryGroups[e];!0!==t.__inittedArrays&&t.truncateArrayBuffers(this.mesh,!1)}}dispose(){this.dispatchEvent({type:"dispose"})}get vertices(){for(var e=0,t=0;t<this.groups;t++)e+=this.geometryGroups[t].vertices;return e}}let u=0},"./src/WebGL/core/Object3D.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Light:()=>l,Object3D:()=>a,Object3DIDCount:()=>s,Scene:()=>o});var n=r("./src/WebGL/math/index.ts"),i=r("./src/colors.ts");let s=0;class a{constructor(){this.id=s++,this.name="",this.children=[],this.position=new n.Vector3,this.rotation=new n.Vector3,this.matrix=new n.Matrix4,this.matrixWorld=new n.Matrix4,this.quaternion=new n.Quaternion,this.eulerOrder="XYZ",this.up=new n.Vector3(0,1,0),this.scale=new n.Vector3(1,1,1),this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!0,this.rotationAutoUpdate=!0,this.useQuaternion=!1,this.visible=!0}lookAt(e){this.matrix.lookAt(e,this.position,this.up),this.rotationAutoUpdate&&(!0===this.useQuaternion?console.error("Unimplemented math operation."):this.rotation instanceof n.Vector3&&this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder))}add(e){if(e!==this){e.parent=this,this.children.push(e);for(var t=this;void 0!==t.parent;)t=t.parent;void 0!==t&&t instanceof o&&t.__addObject(e)}else console.error("Can't add $3Dmol.Object3D to itself")}remove(e){var t=this.children.indexOf(e);if(-1!==t){e.parent=void 0,this.children.splice(t,1);for(var r=this;void 0!==r.parent;)r=r.parent;void 0!==r&&r instanceof o&&r.__removeObject(e)}}vrml(e){e||(e=" ");var t=2*Math.atan2(this.quaternion.lengthxyz(),this.quaternion.w),r=0,n=0,i=0;if(0!=t){let e=Math.sin(t/2);r=this.quaternion.x/e,n=this.quaternion.y/e,i=this.quaternion.z/e}var s=e+"Transform {\n"+e+" center "+this.position.x+" "+this.position.y+" "+this.position.z+"\n"+e+" rotation "+r+" "+n+" "+i+" "+t+"\n"+e+" children [\n";this.geometry&&(s+=this.geometry.vrml(e,this.material));for(var a=0;a<this.children.length;a++)s+=this.children[a].vrml(e+" ")+",\n";return s+=" ]\n",s+="}"}updateMatrix(){this.matrix.setPosition(this.position),!1===this.useQuaternion&&this.rotation instanceof n.Vector3?this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder):this.matrix.setRotationFromQuaternion(this.quaternion),1===this.scale.x&&1===this.scale.y&&1===this.scale.z||this.matrix.scale(this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==e||(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1;for(var t=0;t<this.children.length;t++)this.children[t].updateMatrixWorld(!0)}clone(e){void 0===e&&(e=new a),e.name=this.name,e.up.copy(this.up),e.position.copy(this.position),e.rotation instanceof n.Vector3&&this.rotation instanceof n.Vector3?e.rotation.copy(this.rotation):e.rotation=this.rotation,e.eulerOrder=this.eulerOrder,e.scale.copy(this.scale),e.rotationAutoUpdate=this.rotationAutoUpdate,e.matrix.copy(this.matrix),e.matrixWorld.copy(this.matrixWorld),e.quaternion.copy(this.quaternion),e.matrixAutoUpdate=this.matrixAutoUpdate,e.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,e.useQuaternion=this.useQuaternion,e.visible=this.visible;for(var t=0;t<this.children.length;t++){var r=this.children[t];e.add(r.clone())}return e}setVisible(e){this.visible=e;for(var t=0;t<this.children.length;t++)this.children[t].setVisible(e)}}class o extends a{constructor(){super(...arguments),this.fog=null,this.overrideMaterial=null,this.matrixAutoUpdate=!1,this.__objects=[],this.__lights=[],this.__objectsAdded=[],this.__objectsRemoved=[]}__addObject(e){if(e instanceof l)-1===this.__lights.indexOf(e)&&this.__lights.push(e),e.target&&void 0===e.target.parent&&this.add(e.target);else if(-1===this.__objects.indexOf(e)){this.__objects.push(e),this.__objectsAdded.push(e);var t=this.__objectsRemoved.indexOf(e);-1!==t&&this.__objectsRemoved.splice(t,1)}for(var r=0;r<e.children.length;r++)this.__addObject(e.children[r])}__removeObject(e){var t;e instanceof l?-1!==(t=this.__lights.indexOf(e))&&this.__lights.splice(t,1):-1!==(t=this.__objects.indexOf(e))&&(this.__objects.splice(t,1),this.__objectsRemoved.push(e),-1!==this.__objectsAdded.indexOf(e)&&this.__objectsAdded.splice(t,1));for(var r=0;r<e.children.length;r++)this.__removeObject(e.children[r])}}class l extends a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.position=new n.Vector3(0,1,0),this.target=new a,this.castShadow=!1,this.onlyShadow=!1,this.color=new i.Color(e),this.intensity=t}}},
2"./src/WebGL/core/Projector.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Projector:()=>i});const n=new(r("./src/WebGL/math/index.ts").Matrix4);class i{static unprojectVector(e,t){return t.projectionMatrixInverse.getInverse(t.projectionMatrix),n.multiplyMatrices(t.matrixWorld,t.projectionMatrixInverse),e.applyProjection(n)}static projectVector(e,t){return t.matrixWorldInverse.getInverse(t.matrixWorld),n.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),e.applyProjection(n)}projectVector(e,t){return i.projectVector(e,t)}unprojectVector(e,t){return i.unprojectVector(e,t)}}},
vendor: 3,557 bytes, line 2
2"./src/WebGL/core/Raycaster.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Raycaster:()=>o,intersectObject:()=>v});var n=r("./src/WebGL/math/index.ts"),i=r("./src/WebGL/shapes/index.ts");const s=(e,t)=>e.distance-t.distance,a=new n.Matrix4;class o{constructor(e,t,r,i){this.precision=1e-4,this.linePrecision=.2,this.ray=new n.Ray(e,t),this.ray.direction.lengthSq()>0&&this.ray.direction.normalize(),this.near=i||0,this.far=r||1/0}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.ortho?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,e.z),t.projectionMatrixInverse.getInverse(t.projectionMatrix),a.multiplyMatrices(t.matrixWorld,t.projectionMatrixInverse),this.ray.direction.applyProjection(a),this.ray.direction.sub(this.ray.origin).normalize())}intersectObjects(e,t){for(var r=[],n=0,i=t.length;n<i;n++)v(e,t[n],this,r);return r.sort(s),r}}const l=e=>Math.min(Math.max(e,-1),1);var c=new i.Sphere,u=new i.Cylinder,h=new i.Triangle,d=new n.Vector3,f=new n.Vector3,p=new n.Vector3,m=new n.Vector3,g=new n.Vector3;function v(e,t,r,n){if(g.getPositionFromMatrix(e.matrixWorld),void 0===t.intersectionShape)return n;var s,a,o,v,b,y,_,w,x,S,C,k,E,A,L=t.intersectionShape,M=r.linePrecision,z=(M*=e.matrixWorld.getMaxScaleOnAxis())*M;if(void 0!==t.boundingSphere&&t.boundingSphere instanceof i.Sphere&&(c.copy(t.boundingSphere),c.applyMatrix4(e.matrixWorld),!r.ray.isIntersectionSphere(c)))return n;for(s=0,a=L.triangle.length;s<a;s++)if(L.triangle[s]instanceof i.Triangle){if(h.copy(L.triangle[s]),h.applyMatrix4(e.matrixWorld),o=h.getNormal(),(v=r.ray.direction.dot(o))>=0)continue;if(d.subVectors(h.a,r.ray.origin),(_=o.dot(d)/v)<0)continue;f.copy(r.ray.direction).multiplyScalar(_).add(r.ray.origin),f.sub(h.a),p.copy(h.b).sub(h.a),m.copy(h.c).sub(h.a);var T=p.dot(m),O=p.lengthSq(),P=m.lengthSq();if((k=(O*f.dot(m)-T*f.dot(p))/(O*P-T*T))<0||k>1)continue;if((C=(f.dot(p)-k*T)/O)<0||C>1||C+k>1)continue;n.push({clickable:t,distance:_})}for(s=0,a=L.cylinder.length;s<a;s++)if(L.cylinder[s]instanceof i.Cylinder){if(u.copy(L.cylinder[s]),u.applyMatrix4(e.matrixWorld),d.subVectors(u.c1,r.ray.origin),b=d.dot(u.direction),y=d.dot(r.ray.direction),0===(x=1-(v=l(r.ray.direction.dot(u.direction)))*v))continue;E=(v*y-b)/x,A=(y-v*b)/x,f.copy(u.direction).multiplyScalar(E).add(u.c1),p.copy(r.ray.direction).multiplyScalar(A).add(r.ray.origin),w=m.subVectors(f,p).lengthSq();var D=u.radius*u.radius;if(w<=D){if((C=v*(k=_=(S=(v*b-y)*(v*b-y)-x*(d.lengthSq()-b*b-D))<=0?Math.sqrt(w):(y-v*b-Math.sqrt(S))/x)-b)<0||C*C>u.lengthSq()||k<0)continue;n.push({clickable:t,distance:_})}}for(s=0,a=L.line.length;s<a;s+=2){f.copy(L.line[s]),f.applyMatrix4(e.matrixWorld),p.copy(L.line[s+1]),p.applyMatrix4(e.matrixWorld),m.subVectors(p,f);var N=m.lengthSq();m.normalize(),d.subVectors(f,r.ray.origin);var F=d.dot(m);y=d.dot(r.ray.direction),0!==(x=1-(v=l(r.ray.direction.dot(m)))*v)&&(E=(v*y-F)/x,A=(y-v*F)/x,f.add(m.multiplyScalar(E)),p.copy(r.ray.direction).multiplyScalar(A).add(r.ray.origin),(w=m.subVectors(p,f).lengthSq())<z&&E*E<N&&n.push({clickable:t,distance:A}))}for(s=0,a=L.sphere.length;s<a;s++)if(L.sphere[s]instanceof i.Sphere&&(c.copy(L.sphere[s]),c.applyMatrix4(e.matrixWorld),r.ray.isIntersectionSphere(c))){f.subVectors(c.center,r.ray.origin);var R=f.dot(r.ray.direction);if(S=R*R-(f.lengthSq()-c.radius*c.radius),R<0)return n;_=S<=0?R:R-Math.sqrt(S),n.push({clickable:t,distance:_})}return n}},
2"./src/WebGL/core/Texture.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Texture:()=>o,TextureIdCount:()=>l});var n=r("./src/WebGL/constants/TextureConstants.ts"),i=r("./src/WebGL/math/index.ts"),s=r("./src/WebGL/core/EventDispatcher.ts"),a=r("./src/WebGL/core/UVMapping.ts");class o extends s.EventDispatcher{constructor(e,t){super(),this.id=l++,this.name="",this.image=e,this.mapping=new a.UVMapping,this.wrapS=n.ClampToEdgeWrapping,this.wrapT=n.ClampToEdgeWrapping,this.anisotropy=1,t?(this.format=n.RFormat,this.type=n.FloatType,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.magFilter=n.NearestFilter,this.minFilter=n.NearestFilter):(this.format=n.RGBAFormat,this.type=n.UnsignedByteType,this.offset=new i.Vector2(0,0),this.repeat=new i.Vector2(1,1),this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.magFilter=n.LinearFilter,this.minFilter=n.LinearMipMapLinearFilter),this.needsUpdate=!1,this.onUpdate=null}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o;return e.image=this.image,e.mapping=this.mapping,e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.format=this.format,e.type=this.type,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.premultiplyAlpha=this.premultiplyAlpha,e.flipY=this.flipY,e.unpackAlignment=this.unpackAlignment,e}dispose(){this.dispatchEvent({type:"dispose"})}}let l=0},
2"./src/WebGL/core/UVMapping.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{UVMapping:()=>n});class n{}},
2"./src/WebGL/core/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{EventDispatcher:()=>n.EventDispatcher,Geometry:()=>i.Geometry,GeometryGroup:()=>i.GeometryGroup,GeometryIDCount:()=>i.GeometryIDCount,Light:()=>s.Light,Object3D:()=>s.Object3D,Object3DIDCount:()=>s.Object3DIDCount,Projector:()=>a.Projector,Raycaster:()=>o.Raycaster,Scene:()=>s.Scene,Texture:()=>l.Texture,TextureIdCount:()=>l.TextureIdCount,UVMapping:()=>c.UVMapping,intersectObject:()=>o.intersectObject});var n=r("./src/WebGL/core/EventDispatcher.ts"),i=r("./src/WebGL/core/Geometry.ts"),s=r("./src/WebGL/core/Object3D.ts"),a=r("./src/WebGL/core/Projector.ts"),o=r("./src/WebGL/core/Raycaster.ts"),l=r("./src/WebGL/core/Texture.ts"),c=r("./src/WebGL/core/UVMapping.ts")},
2"./src/WebGL/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{BackSide:()=>n.BackSide,Camera:()=>u.Camera,ClampToEdgeWrapping:()=>n.ClampToEdgeWrapping,Coloring:()=>n.Coloring,Cylinder:()=>c.Cylinder,DoubleSide:()=>n.DoubleSide,EventDispatcher:()=>i.EventDispatcher,FloatType:()=>n.FloatType,Fog:()=>h.Fog,FrontSide:()=>n.FrontSide,Geometry:()=>i.Geometry,GeometryGroup:()=>i.GeometryGroup,GeometryIDCount:()=>i.GeometryIDCount,ImposterMaterial:()=>s.ImposterMaterial,InstancedMaterial:()=>s.InstancedMaterial,Light:()=>i.Light,Line:()=>o.Line,LineBasicMaterial:()=>s.LineBasicMaterial,LineStyle:()=>o.LineStyle,LinearFilter:()=>n.LinearFilter,LinearMipMapLinearFilter:()=>n.LinearMipMapLinearFilter,Material:()=>s.Material,MaterialIdCount:()=>s.MaterialIdCount,Matrix3:()=>a.Matrix3,Matrix4:()=>a.Matrix4,Mesh:()=>o.Mesh,MeshDoubleLambertMaterial:()=>s.MeshDoubleLambertMaterial,MeshLambertMaterial:()=>s.MeshLambertMaterial,MeshOutlineMaterial:()=>s.MeshOutlineMaterial,NearestFilter:()=>n.NearestFilter,Object3D:()=>i.Object3D,Object3DIDCount:()=>i.Object3DIDCount,Projector:()=>i.Projector,Quaternion:()=>a.Quaternion,R32Format:()=>n.R32Format,RFormat:()=>n.RFormat,RGBAFormat:()=>n.RGBAFormat,Ray:()=>a.Ray,Raycaster:()=>i.Raycaster,Renderer:()=>d.Renderer,Scene:()=>i.Scene,ShaderLib:()=>l.ShaderLib,ShaderUtils:()=>l.ShaderUtils,Shading:()=>n.Shading,Sphere:()=>c.Sphere,SphereImposterMaterial:()=>s.SphereImposterMaterial,SphereImposterOutlineMaterial:()=>s.SphereImposterOutlineMaterial,Sprite:()=>o.Sprite,SpriteAlignment:()=>n.SpriteAlignment,SpriteMaterial:()=>s.SpriteMaterial,SpritePlugin:()=>f.SpritePlugin,StickImposterMaterial:()=>s.StickImposterMaterial,StickImposterOutlineMaterial:()=>s.StickImposterOutlineMaterial,Texture:()=>i.Texture,TextureIdCount:()=>i.TextureIdCount,TextureOperations:()=>n.TextureOperations,Triangle:()=>c.Triangle,UVMapping:()=>i.UVMapping,UnsignedByteType:()=>n.UnsignedByteType,Vector2:()=>a.Vector2,Vector3:()=>a.Vector3,VolumetricMaterial:()=>s.VolumetricMaterial,basic:()=>l.basic,clamp:()=>a.clamp,clone:()=>l.clone,conversionMatrix3:()=>a.conversionMatrix3,degToRad:()=>a.degToRad,instanced:()=>l.instanced,intersectObject:()=>i.intersectObject,lambert:()=>l.lambert,lambertdouble:()=>l.lambertdouble,outline:()=>l.outline,screen:()=>l.screen,screenaa:()=>l.screenaa,sphereimposter:()=>l.sphereimposter,sphereimposteroutline:()=>l.sphereimposteroutline,sprite:()=>l.sprite,stickimposter:()=>l.stickimposter,stickimposteroutline:()=>l.stickimposteroutline,volumetric:()=>l.volumetric});var n=r("./src/WebGL/constants/index.ts"),i=r("./src/WebGL/core/index.ts"),s=r("./src/WebGL/materials/index.ts"),a=r("./src/WebGL/math/index.ts"),o=r("./src/WebGL/objects/index.ts"),l=r("./src/WebGL/shaders/index.ts"),c=r("./src/WebGL/shapes/index.ts"),u=r("./src/WebGL/Camera.ts"),h=r("./src/WebGL/Fog.ts"),d=r("./src/WebGL/Renderer.ts"),f=r("./src/WebGL/SpritePlugin.ts")},
2"./src/WebGL/materials/ImposterMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{ImposterMaterial:()=>l});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Shading.ts"),s=r("./src/colors.ts"),a=r("./src/WebGL/math/index.ts"),o=r("./src/WebGL/materials/Material.ts");class l extends o.Material{constructor(e){super(),this.color=new s.Color(16777215),this.ambient=new s.Color(1048575),this.emissive=new s.Color(0),this.imposter=!0,this.wrapAround=!1,this.wrapRGB=new a.Vector3(1,1,1),this.map=void 0,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=i.Shading.SmoothShading,this.shaderID=null,this.vertexColors=n.Coloring.NoColors,this.skinning=!1,this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new l;return super.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.shaderID=this.shaderID,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e}}},
2"./src/WebGL/materials/InstancedMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{InstancedMaterial:()=>l});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Shading.ts"),s=r("./src/colors.ts"),a=r("./src/WebGL/math/index.ts"),o=r("./src/WebGL/materials/Material.ts");class l extends o.Material{constructor(e){super(),this.color=new s.Color(16777215),this.ambient=new s.Color(1048575),this.emissive=new s.Color(0),this.wrapAround=!1,this.wrapRGB=new a.Vector3(1,1,1),this.map=void 0,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=i.Shading.SmoothShading,this.shaderID="instanced",this.vertexColors=n.Coloring.NoColors,this.skinning=!1,this.sphere=null,this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new l;return super.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.shaderID=this.shaderID,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e.sphere=this.sphere,e}}},
2"./src/WebGL/materials/LineBasicMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{LineBasicMaterial:()=>s});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/Material.ts");class s extends i.Material{constructor(e){super(),this.color=new n.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=!1,this.fog=!0,this.shaderID="basic",this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s;return super.clone.call(this,e),e.color.copy(this.color),e}}},
2"./src/WebGL/materials/Material.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Material:()=>o,MaterialIdCount:()=>l});var n=r("./src/WebGL/constants/Sides.ts"),i=r("./src/WebGL/core/index.ts"),s=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts");class o extends i.EventDispatcher{constructor(){super(...arguments),this.id=l++,this.name="",this.side=n.FrontSide,this.opacity=1,this.transparent=!1,this.depthTest=!0,this.depthWrite=!0,this.stencilTest=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.visible=!0,this.needsUpdate=!0,this.outline=!1}setValues(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0!==e)for(var t in e){var r=e[t];if(void 0!==r){if(t in this){var n=this[t];n instanceof a.Color&&r instanceof a.Color?n.copy(r):n instanceof a.Color?n.set(r):n instanceof s.Vector3&&r instanceof s.Vector3?n.copy(r):this[t]=r}}else console.warn("$3Dmol.Material: '"+t+"' parameter is undefined.")}}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o;return e.name=this.name,e.side=this.side,e.opacity=this.opacity,e.transparent=this.transparent,e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.stencilTest=this.stencilTest,e.polygonOffset=this.polygonOffset,e.polygonOffsetFactor=this.polygonOffsetFactor,e.polygonOffsetUnits=this.polygonOffsetUnits,e.alphaTest=this.alphaTest,e.overdraw=this.overdraw,e.visible=this.visible,e}dispose(){this.dispatchEvent({type:"dispose"})}}let l=0},
2"./src/WebGL/materials/MeshDoubleLambertMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{MeshDoubleLambertMaterial:()=>s});var n=r("./src/WebGL/constants/Sides.ts"),i=r("./src/WebGL/materials/MeshLambertMaterial.ts");class s extends i.MeshLambertMaterial{constructor(e){super(e),this.shaderID="lambertdouble",this.side=n.DoubleSide,this.outline=!1}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s;return super.clone.call(this,e),e}}},
2"./src/WebGL/materials/MeshLambertMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{MeshLambertMaterial:()=>l});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Shading.ts"),s=r("./src/WebGL/materials/Material.ts"),a=r("./src/colors.ts"),o=r("./src/WebGL/math/index.ts");class l extends s.Material{constructor(e){super(),this.color=new a.Color(16777215),this.ambient=new a.Color(1048575),this.emissive=new a.Color(0),this.wrapAround=!1,this.wrapRGB=new o.Vector3(1,1,1),this.map=void 0,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=i.Shading.SmoothShading,this.shaderID="lambert",this.vertexColors=n.Coloring.NoColors,this.skinning=!1,this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new l;return super.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.shaderID=this.shaderID,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e}}},
2"./src/WebGL/materials/MeshOutlineMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{MeshOutlineMaterial:()=>s});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/Material.ts");class s extends i.Material{constructor(e){super(),e=e||{},this.fog=!0,this.shaderID="outline",this.wireframe=!1,this.outlineColor=e.color||new n.Color(0,0,0),this.outlineWidth=e.width||.1,this.outlinePushback=e.pushback||1}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s;return super.clone.call(this,e),e.fog=this.fog,e.shaderID=this.shaderID,e.wireframe=this.wireframe,e}}},
2"./src/WebGL/materials/SphereImposterMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{SphereImposterMaterial:()=>i});var n=r("./src/WebGL/materials/ImposterMaterial.ts");class i extends n.ImposterMaterial{constructor(e){super(e),this.shaderID="sphereimposter",this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i;return super.clone.call(this,e),e}}},
2"./src/WebGL/materials/SphereImposterOutlineMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{SphereImposterOutlineMaterial:()=>s});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/ImposterMaterial.ts");class s extends i.ImposterMaterial{constructor(e){super(e),e=e||{},this.shaderID="sphereimposteroutline",this.outlineColor=e.color||new n.Color(0,0,0),this.outlineWidth=e.width||.1,this.outlinePushback=e.pushback||1,this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s;return super.clone.call(this,e),e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.outlinePushback=this.outlinePushback,e}}},
2"./src/WebGL/materials/SpriteMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{SpriteMaterial:()=>l});var n=r("./src/WebGL/constants/SpriteAlignment.ts"),i=r("./src/WebGL/core/Texture.ts"),s=r("./src/colors.ts"),a=r("./src/WebGL/math/index.ts"),o=r("./src/WebGL/materials/Material.ts");class l extends o.Material{constructor(e){super(),this.color=new s.Color(16777215),this.map=new i.Texture,this.useScreenCoordinates=!0,this.fog=!1,this.uvOffset=new a.Vector2(0,0),this.uvScale=new a.Vector2(1,1),this.depthTest=!this.useScreenCoordinates,this.sizeAttenuation=!this.useScreenCoordinates,this.screenOffset=this.screenOffset,this.scaleByViewPort=!this.sizeAttenuation,this.alignment=n.SpriteAlignment.center.clone(),this.setValues(e),void 0===(e=e||{}).depthTest&&(this.depthTest=!this.useScreenCoordinates),void 0===e.sizeAttenuation&&(this.sizeAttenuation=!this.useScreenCoordinates),void 0===e.scaleByViewPort&&(this.scaleByViewPort=!this.sizeAttenuation)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new l;return super.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.useScreenCoordinates=this.useScreenCoordinates,e.screenOffset=this.screenOffset,e.sizeAttenuation=this.sizeAttenuation,e.scaleByViewport=this.scaleByViewPort,e.alignment.copy(this.alignment),e.uvOffset.copy(this.uvOffset),e}}},
2"./src/WebGL/materials/StickImposterMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{StickImposterMaterial:()=>i});var n=r("./src/WebGL/materials/ImposterMaterial.ts");class i extends n.ImposterMaterial{constructor(e){super(e),this.shaderID="stickimposter",this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i;return super.clone.call(this,e),e}}},
2"./src/WebGL/materials/StickImposterOutlineMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{StickImposterOutlineMaterial:()=>s});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/ImposterMaterial.ts");class s extends i.ImposterMaterial{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e),this.shaderID="stickimposteroutline",this.outlineColor=new n.Color(0,0,0),this.outlineWidth=.1,this.outlinePushback=1,e.color&&(this.outlineColor=e.color),e.width&&(this.outlineWidth=e.width),e.pushback&&(this.outlinePushback=e.pushback),this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s;return super.clone.call(this,e),e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.outlinePushback=this.outlinePushback,e}}},
2"./src/WebGL/materials/VolumetricMaterial.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{VolumetricMaterial:()=>a});var n=r("./src/WebGL/constants/Sides.ts"),i=r("./src/colors.ts"),s=r("./src/WebGL/materials/Material.ts");class a extends s.Material{constructor(e){super(),this.transparent=!1,this.volumetric=!0,this.color=new i.Color(16777215),this.transferfn=null,this.map=void 0,this.extent=[],this.maxdepth=100,this.unit=0,this.texmatrix=null,this.transfermin=-1,this.transfermax=1,this.subsamples=5,this.shaderID="volumetric",this.side=n.FrontSide,this.setValues(e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a;return super.clone.call(this,e),e.transparent=this.transparent,e.volumetric=this.volumetric,e.color=this.color,e.transferfn=this.transferfn,e.map=this.map,e.extent=this.extent,e.maxdepth=this.maxdepth,e.unit=this.unit,e.texmatrix=this.texmatrix,e.transfermin=this.transfermin,e.transfermax=this.transfermax,e.subsamples=this.subsamples,e.shaderID=this.shaderID,e.side=this.side,e}}},
2"./src/WebGL/materials/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{ImposterMaterial:()=>n.ImposterMaterial,InstancedMaterial:()=>i.InstancedMaterial,LineBasicMaterial:()=>s.LineBasicMaterial,Material:()=>a.Material,MaterialIdCount:()=>a.MaterialIdCount,MeshDoubleLambertMaterial:()=>o.MeshDoubleLambertMaterial,MeshLambertMaterial:()=>l.MeshLambertMaterial,MeshOutlineMaterial:()=>c.MeshOutlineMaterial,SphereImposterMaterial:()=>u.SphereImposterMaterial,SphereImposterOutlineMaterial:()=>h.SphereImposterOutlineMaterial,SpriteMaterial:()=>d.SpriteMaterial,StickImposterMaterial:()=>f.StickImposterMaterial,StickImposterOutlineMaterial:()=>p.StickImposterOutlineMaterial,VolumetricMaterial:()=>m.VolumetricMaterial});var n=r("./src/WebGL/materials/ImposterMaterial.ts"),i=r("./src/WebGL/materials/InstancedMaterial.ts"),s=r("./src/WebGL/materials/LineBasicMaterial.ts"),a=r("./src/WebGL/materials/Material.ts"),o=r("./src/WebGL/materials/MeshDoubleLambertMaterial.ts"),l=r("./src/WebGL/materials/MeshLambertMaterial.ts"),c=r("./src/WebGL/materials/MeshOutlineMaterial.ts"),u=r("./src/WebGL/materials/SphereImposterMaterial.ts"),h=r("./src/WebGL/materials/SphereImposterOutlineMaterial.ts"),d=r("./src/WebGL/materials/SpriteMaterial.ts"),f=r("./src/WebGL/materials/StickImposterMaterial.ts"),p=r("./src/WebGL/materials/StickImposterOutlineMaterial.ts"),m=r("./src/WebGL/materials/VolumetricMaterial.ts")},
vendor: 1,338 bytes, line 2
2"./src/WebGL/math/Quaternion.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Quaternion:()=>n});class n{constructor(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1}set(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}conjugate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}inverse(){return this.conjugate().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}lengthxyz(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}normalize(){let e=this.length();return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}multiply(e){return this.multiplyQuaternions(this,e)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}multiplyQuaternions(e,t){const r=e.x,n=e.y,i=e.z,s=e.w,a=t.x,o=t.y,l=t.z,c=t.w;return this.x=r*c+s*a+n*l-i*o,this.y=n*c+s*o+i*a-r*l,this.z=i*c+s*l+r*o-n*a,this.w=s*c-r*a-n*o-i*l,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}clone(){return new n(this.x,this.y,this.z,this.w)}setFromEuler(e){const t=Math.cos(e.x/2),r=Math.cos(e.y/2),n=Math.cos(e.z/2),i=Math.sin(e.x/2),s=Math.sin(e.y/2),a=Math.sin(e.z/2);return this.x=i*r*n+t*s*a,this.y=t*s*n-i*r*a,this.z=t*r*a+i*s*n,this.w=t*r*n-i*s*a,this}}},
2"./src/WebGL/math/Vector2.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Vector2:()=>n});class n{constructor(e,t){this.x=e||0,this.y=t||0}set(e,t){return this.x=e,this.y=t,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}copy(e){return this.x=e.x,this.y=e.y,this}clone(){return new n(this.x,this.y)}}},
2"./src/WebGL/math/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Matrix3:()=>l.Matrix3,Matrix4:()=>l.Matrix4,Quaternion:()=>n.Quaternion,Ray:()=>l.Ray,Vector2:()=>i.Vector2,Vector3:()=>l.Vector3,clamp:()=>s.clamp,conversionMatrix3:()=>a.conversionMatrix3,degToRad:()=>o.degToRad});var n=r("./src/WebGL/math/Quaternion.ts"),i=r("./src/WebGL/math/Vector2.ts"),s=r("./src/WebGL/math/utils/clamp.ts"),a=r("./src/WebGL/math/utils/conversionMatrix3.ts"),o=r("./src/WebGL/math/utils/degToRad.ts"),l=r("./src/WebGL/math/math.ts")},
vendor: 14,976 bytes, line 2
2"./src/WebGL/math/math.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Matrix3:()=>d,Matrix4:()=>u,Ray:()=>f,Vector3:()=>h});var n,i,s,a,o,l=r("./src/WebGL/math/utils/degToRad.ts"),c=r("./src/WebGL/math/utils/clamp.ts");class u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,h=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,d=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,f=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,p=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,m=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;"undefined"!==typeof e&&"number"!==typeof e?this.elements=new Float32Array(e):(this.elements=new Float32Array(16),this.elements[0]=e,this.elements[4]=t,this.elements[8]=r,this.elements[12]=n,this.elements[1]=i,this.elements[5]=s,this.elements[9]=a,this.elements[13]=o,this.elements[2]=l,this.elements[6]=c,this.elements[10]=u,this.elements[14]=h,this.elements[3]=d,this.elements[7]=f,this.elements[11]=p,this.elements[15]=m)}makeScale(e,t,r){throw new Error("Method not implemented.")}set(e,t,r,n,i,s,a,o,l,c,u,h,d,f,p,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}copy(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]),this}matrix3FromTopLeft(){const e=this.elements;return new d(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])}setRotationFromEuler(e,t){const r=this.elements,{x:n,y:i,z:s}=e,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(void 0===t||"XYZ"===t){const e=a*u,t=a*h,n=o*u,i=o*h;r[0]=l*u,r[4]=-l*h,r[8]=c,r[1]=t+n*c,r[5]=e-i*c,r[9]=-o*l,r[2]=i-e*c,r[6]=n+t*c,r[10]=a*l}else console.error("Error with matrix4 setRotationFromEuler. Order: ".concat(t));return this}setRotationFromQuaternion(e){const t=this.elements,{x:r,y:n,z:i,w:s}=e,a=r+r,o=n+n,l=i+i,c=r*a,u=r*o,h=r*l,d=n*o,f=n*l,p=i*l,m=s*a,g=s*o,v=s*l;return t[0]=1-(d+p),t[4]=u-v,t[8]=h+g,t[1]=u+v,t[5]=1-(c+p),t[9]=f-m,t[2]=h-g,t[6]=f+m,t[10]=1-(c+d),this}multiplyMatrices(e,t){const r=e.elements,n=t.elements,i=this.elements,s=r[0],a=r[4],o=r[8],l=r[12],c=r[1],u=r[5],h=r[9],d=r[13],f=r[2],p=r[6],m=r[10],g=r[14],v=r[3],b=r[7],y=r[11],_=r[15],w=n[0],x=n[4],S=n[8],C=n[12],k=n[1],E=n[5],A=n[9],L=n[13],M=n[2],z=n[6],T=n[10],O=n[14],P=n[3],D=n[7],N=n[11],F=n[15];return i[0]=s*w+a*k+o*M+l*P,i[4]=s*x+a*E+o*z+l*D,i[8]=s*S+a*A+o*T+l*N,i[12]=s*C+a*L+o*O+l*F,i[1]=c*w+u*k+h*M+d*P,i[5]=c*x+u*E+h*z+d*D,i[9]=c*S+u*A+h*T+d*N,i[13]=c*C+u*L+h*O+d*F,i[2]=f*w+p*k+m*M+g*P,i[6]=f*x+p*E+m*z+g*D,i[10]=f*S+p*A+m*T+g*N,i[14]=f*C+p*L+m*O+g*F,i[3]=v*w+b*k+y*M+_*P,i[7]=v*x+b*E+y*z+_*D,i[11]=v*S+b*A+y*T+_*N,i[15]=v*C+b*L+y*O+_*F,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}snap(e){e||(e=4);const t=Math.pow(10,4),r=this.elements;for(let n=0;n<16;n++){const e=Math.round(r[n]);e===Math.round(r[n]*t)/t&&(r[n]=e)}return this}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e){const t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this}translate(e){const t=this.elements;return t[12]+=e.x,t[13]+=e.y,t[14]+=e.z,this}getInverse(e,t){const r=this.elements,n=e.elements,i=n[0],s=n[4],a=n[8],o=n[12],l=n[1],c=n[5],u=n[9],h=n[13],d=n[2],f=n[6],p=n[10],m=n[14],g=n[3],v=n[7],b=n[11],y=n[15];r[0]=u*m*v-h*p*v+h*f*b-c*m*b-u*f*y+c*p*y,r[4]=o*p*v-a*m*v-o*f*b+s*m*b+a*f*y-s*p*y,r[8]=a*h*v-o*u*v+o*c*b-s*h*b-a*c*y+s*u*y,r[12]=o*u*f-a*h*f-o*c*p+s*h*p+a*c*m-s*u*m,r[1]=h*p*g-u*m*g-h*d*b+l*m*b+u*d*y-l*p*y,r[5]=a*m*g-o*p*g+o*d*b-i*m*b-a*d*y+i*p*y,r[9]=o*u*g-a*h*g-o*l*b+i*h*b+a*l*y-i*u*y,r[13]=a*h*d-o*u*d+o*l*p-i*h*p-a*l*m+i*u*m,r[2]=c*m*g-h*f*g+h*d*v-l*m*v-c*d*y+l*f*y,r[6]=o*f*g-s*m*g-o*d*v+i*m*v+s*d*y-i*f*y,r[10]=s*h*g-o*c*g+o*l*v-i*h*v-s*l*y+i*c*y,r[14]=o*c*d-s*h*d-o*l*f+i*h*f+s*l*m-i*c*m,r[3]=u*f*g-c*p*g-u*d*v+l*p*v+c*d*b-l*f*b,r[7]=s*p*g-a*f*g+a*d*v-i*p*v-s*d*b+i*f*b,r[11]=a*c*g-s*u*g-a*l*v+i*u*v+s*l*b-i*c*b,r[15]=s*u*d-a*c*d+a*l*f-i*u*f-s*l*p+i*c*p;const _=i*r[0]+l*r[4]+d*r[8]+g*r[12];if(0===_){const e="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(e);return console.warn(e),this.identity(),this}return this.multiplyScalar(1/_),this}isReflected(){const e=this.elements,t=e[0],r=e[4],n=e[8],i=e[1],s=e[5],a=e[9],o=e[2],l=e[6],c=e[10];return t*s*c+i*l*n+o*r*a-o*s*n-i*r*c-t*l*a<0}scale(e){const t=this.elements,{x:r}=e,{y:n}=e,{z:i}=e;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,Math.max(r,n)))}makeFrustum(e,t,r,n,i,s){const a=this.elements,o=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(s+i)/(s-i),d=-2*s*i/(s-i);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makePerspective(e,t,r,n){const i=r*Math.tan((0,l.degToRad)(.5*e)),s=-i,a=s*t,o=i*t;return this.makeFrustum(a,o,s,i,r,n)}makeOrthographic(e,t,r,n,i,s){const a=this.elements,o=1/(t-e),l=1/(r-n),c=1/(s-i),u=(t+e)*o,h=(r+n)*l,d=(s+i)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}isEqual(e){const t=e.elements,r=this.elements;return r[0]===t[0]&&r[4]===t[4]&&r[8]===t[8]&&r[12]===t[12]&&r[1]===t[1]&&r[5]===t[5]&&r[9]===t[9]&&r[13]===t[13]&&r[2]===t[2]&&r[6]===t[6]&&r[10]===t[10]&&r[14]===t[14]&&r[3]===t[3]&&r[7]===t[7]&&r[11]===t[11]&&r[15]===t[15]}clone(){const e=this.elements;return new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])}isIdentity(){const e=this.elements;return 1===e[0]&&0===e[4]&&0===e[8]&&0===e[12]&&0===e[1]&&1===e[5]&&0===e[9]&&0===e[13]&&0===e[2]&&0===e[6]&&1===e[10]&&0===e[14]&&0===e[3]&&0===e[7]&&0===e[11]&&1===e[15]}isNearlyIdentity(e){return this.clone().snap(e).isIdentity()}getScale(e){const t=this.elements;return e=e||new h,s.set(t[0],t[1],t[2]),a.set(t[4],t[5],t[6]),o.set(t[8],t[9],t[10]),e.x=s.length(),e.y=a.length(),e.z=o.length(),e}lookAt(e,t,r){const n=this.elements;return o.subVectors(e,t).normalize(),0===o.length()&&(o.z=1),s.crossVectors(r,o).normalize(),0===s.length()&&(o.x+=1e-4,s.crossVectors(r,o).normalize()),a.crossVectors(o,s),n[0]=s.x,n[4]=a.x,n[8]=o.x,n[1]=s.y,n[5]=a.y,n[9]=o.y,n[2]=s.z,n[6]=a.z,n[10]=o.z,this}compose(e,t,r){const s=this.elements;return n.identity(),n.setRotationFromQuaternion(t),i.makeScale(r.x,r.y,r.z),this.multiplyMatrices(n,i),s[12]=e.x,s[13]=e.y,s[14]=e.z,this}}n=new u,i=new u;class h{constructor(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0,this.atomid=void 0}set(e,t,r){return this.x=e,this.y=t,this.z=r,this}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}divideScalar(e){return 0!==e?(this.x/=e,this.y/=e,this.z/=e):(this.x=0,this.y=0,this.z=0),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n}applyMatrix3(e){const{x:t}=this,{y:r}=this,{z:n}=this,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this}applyMatrix4(e){const{x:t}=this,{y:r}=this,{z:n}=this,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n+i[12],this.y=i[1]*t+i[5]*r+i[9]*n+i[13],this.z=i[2]*t+i[6]*r+i[10]*n+i[14],this}applyProjection(e){const{x:t}=this,{y:r}=this,{z:n}=this,i=e.elements,s=i[3]*t+i[7]*r+i[11]*n+i[15];return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])/s,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])/s,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])/s,this}applyQuaternion(e){const{x:t}=this,{y:r}=this,{z:n}=this,i=e.x,s=e.y,a=e.z,o=e.w,l={};l.x=2*(r*a-n*s),l.y=2*(n*i-t*a),l.z=2*(t*s-r*i);const c={};return c.x=l.y*a-l.z*s,c.y=l.z*i-l.x*a,c.z=l.x*s-l.y*i,this.x=t+o*l.x+c.x,this.y=r+o*l.y+c.y,this.z=n+o*l.z+c.z,this}negate(){return this.multiplyScalar(-1)}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){return this.divideScalar(this.length())}cross(e){const{x:t}=this,{y:r}=this,{z:n}=this;return this.x=r*e.z-n*e.y,this.y=n*e.x-t*e.z,this.z=t*e.y-r*e.x,this}crossVectors(e,t){return this.x=e.y*t.z-e.z*t.y,this.y=e.z*t.x-e.x*t.z,this.z=e.x*t.y-e.y*t.x,this}equals(e){return this.x==e.x&&this.y==e.y&&this.z==e.z}getPositionFromMatrix(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this}setEulerFromRotationMatrix(e,t){const r=e.elements,n=r[0],i=r[4],s=r[8],a=r[5],o=r[9],l=r[6],u=r[10];return void 0===t||"XYZ"===t?(this.y=Math.asin((0,c.clamp)(s,-1,1)),Math.abs(s)<.99999?(this.x=Math.atan2(-o,u),this.z=Math.atan2(-i,n)):(this.x=Math.atan2(l,a),this.z=0)):console.error("Error with vector's setEulerFromRotationMatrix: Unknown order: ".concat(t)),this}rotateAboutVector(e,t){e.normalize();const r=Math.cos(t),n=Math.sin(t),i=this.clone().multiplyScalar(r),s=e.clone().cross(this).multiplyScalar(n),a=e.clone().multiplyScalar(e.clone().dot(this)).multiplyScalar(1-r),o=i.add(s).add(a);return this.x=o.x,this.y=o.y,this.z=o.z,this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}transformDirection(e){const{x:t}=this,{y:r}=this,{z:n}=this,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()}clone(){return new h(this.x,this.y,this.z)}unproject(e){const t=n;return t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}s=new h,a=new h,o=new h;class d{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;this.elements=new Float32Array(9),this.set(e,t,r,n,i,s,a,o,l)}set(e,t,r,n,i,s,a,o,l){const c=this.elements;return c[0]=e,c[3]=t,c[6]=r,c[1]=n,c[4]=i,c[7]=s,c[2]=a,c[5]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=e.elements;this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}getInverse3(e){const t=e.elements,r=this.elements;r[0]=t[4]*t[8]-t[5]*t[7],r[3]=t[6]*t[5]-t[3]*t[8],r[6]=t[3]*t[7]-t[6]*t[4],r[1]=t[7]*t[2]-t[1]*t[8],r[4]=t[0]*t[8]-t[6]*t[2],r[7]=t[1]*t[6]-t[0]*t[7],r[2]=t[1]*t[5]-t[2]*t[4],r[5]=t[2]*t[3]-t[0]*t[5],r[8]=t[0]*t[4]-t[1]*t[3];const n=t[0]*r[0]+t[3]*r[1]+t[6]*r[2];return this.multiplyScalar(1/n),this}getInverse(e,t){const r=e.elements,n=this.elements;n[0]=r[10]*r[5]-r[6]*r[9],n[1]=-r[10]*r[1]+r[2]*r[9],n[2]=r[6]*r[1]-r[2]*r[5],n[3]=-r[10]*r[4]+r[6]*r[8],n[4]=r[10]*r[0]-r[2]*r[8],n[5]=-r[6]*r[0]+r[2]*r[4],n[6]=r[9]*r[4]-r[5]*r[8],n[7]=-r[9]*r[0]+r[1]*r[8],n[8]=r[5]*r[0]-r[1]*r[4];const i=r[0]*n[0]+r[1]*n[3]+r[2]*n[6];if(0===i){const e="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(e);return console.warn(e),this.identity(),this}return this.multiplyScalar(1/i),this}getDeterminant(){const e=this.elements;return e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7]}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}clone(){const e=this.elements;return new d(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])}getMatrix4(){const e=this.elements;return new u(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0)}}class f{constructor(e,t){this.origin=void 0!==e?e:new h,this.direction=void 0!==t?t:new h}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return(t||new h).copy(this.direction).multiplyScalar(e).add(this.origin)}recast(e){const t=s;return this.origin.copy(this.at(e,t)),this}closestPointToPoint(e,t){const r=t||new h;r.subVectors(e,this.origin);const n=r.dot(this.direction);return r.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){const t=s,r=t.subVectors(e,this.origin).dot(this.direction);return t.copy(this.direction).multiplyScalar(r).add(this.origin),t.distanceTo(e)}isIntersectionCylinder(){}isIntersectionSphere(e){return this.distanceToPoint(e.center)<=e.radius}isIntersectionPlane(e){return 0!==e.normal.dot(this.direction)||0===e.distanceToPoint(this.origin)}distanceToPlane(e){const t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:void 0:-(this.origin.dot(e.normal)+e.constant)/t}intersectPlane(e,t){const r=this.distanceToPlane(e);if(void 0!==r)return this.at(r,t)}applyMatrix4(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this}clone(){return(new f).copy(this)}}},
2"./src/WebGL/math/utils/clamp.ts":(e,t,r)=>{"use strict";function n(e,t,r){return Math.min(Math.max(e,t),r)}r.r(t),r.d(t,{clamp:()=>n})},
2"./src/WebGL/math/utils/conversionMatrix3.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{conversionMatrix3:()=>i});var n=r("./src/WebGL/math/math.ts");function i(e,t,r,i,s,a){i=i*Math.PI/180,s=s*Math.PI/180,a=a*Math.PI/180;const o=e=>e*e,l=Math.cos(i),c=Math.cos(s),u=Math.cos(a),h=Math.sin(a);return new n.Matrix3(e,t*u,r*c,0,t*h,r*(l-c*u)/h,0,0,r*Math.sqrt(1-o(l)-o(c)-o(u)+2*l*c*u)/h)}},
2"./src/WebGL/math/utils/degToRad.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{degToRad:()=>i});const n=Math.PI/180;function i(e){return e*n}},
2"./src/WebGL/objects/Line.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Line:()=>a,LineStyle:()=>n});var n,i=r("./src/WebGL/materials/index.ts"),s=r("./src/WebGL/core/index.ts");!function(e){e[e.LineStrip=0]="LineStrip",e[e.LinePieces=1]="LinePieces"}(n||(n={}));class a extends s.Object3D{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.LineBasicMaterial({color:16777215*Math.random()}),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.LineStrip;super(),this.geometry=e,this.material=t,this.type=r}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a(this.geometry,this.material,this.type);return super.clone.call(this,e),e}}},
2"./src/WebGL/objects/Mesh.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Mesh:()=>i});var n=r("./src/WebGL/core/index.ts");class i extends n.Object3D{constructor(e,t){super(),this.geometry=e,this.material=t}clone(e){return void 0===e&&(e=new i(this.geometry,this.material)),super.clone.call(this,e),e}}},
2"./src/WebGL/objects/Sprite.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Sprite:()=>s});var n=r("./src/WebGL/materials/index.ts"),i=r("./src/WebGL/core/index.ts");class s extends i.Object3D{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.SpriteMaterial;super(),this.material=e,this.rotation3d=this.rotation,this.rotation=0}updateMatrix(){this.matrix.setPosition(this.position),this.rotation3d.set(0,0,this.rotation),this.matrix.setRotationFromEuler(this.rotation3d),1===this.scale.x&&1===this.scale.y||this.matrix.scale(this.scale),this.matrixWorldNeedsUpdate=!0}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new s(this.material);return i.Object3D.prototype.clone.call(this,e),e}}},
2"./src/WebGL/objects/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Line:()=>n.Line,LineStyle:()=>n.LineStyle,Mesh:()=>i.Mesh,Sprite:()=>s.Sprite});var n=r("./src/WebGL/objects/Line.ts"),i=r("./src/WebGL/objects/Mesh.ts"),s=r("./src/WebGL/objects/Sprite.ts")},
2"./src/WebGL/shaders/ShaderType.ts":(e,t,r)=>{"use strict";r.r(t)},
2"./src/WebGL/shaders/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShaderLib:()=>n.ShaderLib,ShaderUtils:()=>i.ShaderUtils,basic:()=>n.basic,clone:()=>i.clone,instanced:()=>n.instanced,lambert:()=>n.lambert,lambertdouble:()=>n.lambertdouble,outline:()=>n.outline,screen:()=>n.screen,screenaa:()=>n.screenaa,sphereimposter:()=>n.sphereimposter,sphereimposteroutline:()=>n.sphereimposteroutline,sprite:()=>n.sprite,stickimposter:()=>n.stickimposter,stickimposteroutline:()=>n.stickimposteroutline,volumetric:()=>n.volumetric});var n=r("./src/WebGL/shaders/lib/index.ts"),i=r("./src/WebGL/shaders/utils/index.ts");r("./src/WebGL/shaders/ShaderType.ts")},
2"./src/WebGL/shaders/lib/basic/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{basic:()=>s});var n=r("./src/WebGL/shaders/lib/basic/uniforms.ts"),i=r("./src/WebGL/shaders/lib/basic/basic.frag");const s={vertexShader:r("./src/WebGL/shaders/lib/basic/basic.vert").default.replace("#define GLSLIFY 1",""),fragmentShader:i.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/basic/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3}}},
2"./src/WebGL/shaders/lib/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShaderLib:()=>g,basic:()=>n.basic,instanced:()=>i.instanced,lambert:()=>s.lambert,lambertdouble:()=>a.lambertdouble,outline:()=>o.outline,screen:()=>l.screen,screenaa:()=>c.screenaa,sphereimposter:()=>u.sphereimposter,sphereimposteroutline:()=>h.sphereimposteroutline,sprite:()=>d.sprite,stickimposter:()=>f.stickimposter,stickimposteroutline:()=>p.stickimposteroutline,volumetric:()=>m.volumetric});var n=r("./src/WebGL/shaders/lib/basic/index.ts"),i=r("./src/WebGL/shaders/lib/instanced/index.ts"),s=r("./src/WebGL/shaders/lib/lambert/index.ts"),a=r("./src/WebGL/shaders/lib/lambertdouble/index.ts"),o=r("./src/WebGL/shaders/lib/outline/index.ts"),l=r("./src/WebGL/shaders/lib/screen/index.ts"),c=r("./src/WebGL/shaders/lib/screenaa/index.ts"),u=r("./src/WebGL/shaders/lib/sphereimposter/index.ts"),h=r("./src/WebGL/shaders/lib/sphereimposteroutline/index.ts"),d=r("./src/WebGL/shaders/lib/sprite/index.ts"),f=r("./src/WebGL/shaders/lib/stickimposter/index.ts"),p=r("./src/WebGL/shaders/lib/stickimposteroutline/index.ts"),m=r("./src/WebGL/shaders/lib/volumetric/index.ts");const g={basic:n.basic,instanced:i.instanced,lambert:s.lambert,lambertdouble:a.lambertdouble,outline:o.outline,screen:l.screen,screenaa:c.screenaa,sphereimposter:u.sphereimposter,sphereimposteroutline:h.sphereimposteroutline,sprite:d.sprite,stickimposter:f.stickimposter,stickimposteroutline:p.stickimposteroutline,volumetric:m.volumetric}},
2"./src/WebGL/shaders/lib/instanced/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{instanced:()=>a});var n=r("./src/WebGL/shaders/lib/instanced/uniforms.ts"),i=r("./src/WebGL/shaders/lib/instanced/instanced.frag"),s=r("./src/WebGL/shaders/lib/instanced/instanced.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/instanced/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},
2"./src/WebGL/shaders/lib/lambert/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{lambert:()=>a});var n=r("./src/WebGL/shaders/lib/lambert/uniforms.ts"),i=r("./src/WebGL/shaders/lib/lambert/lambert.frag"),s=r("./src/WebGL/shaders/lib/lambert/lambert.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/lambert/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},
2"./src/WebGL/shaders/lib/lambertdouble/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{lambertdouble:()=>a});var n=r("./src/WebGL/shaders/lib/lambertdouble/uniforms.ts"),i=r("./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag"),s=r("./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/lambertdouble/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},
2"./src/WebGL/shaders/lib/outline/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{outline:()=>a});var n=r("./src/WebGL/shaders/lib/outline/uniforms.ts"),i=r("./src/WebGL/shaders/lib/outline/outline.frag"),s=r("./src/WebGL/shaders/lib/outline/outline.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/outline/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>i});var n=r("./src/colors.ts");const i={opacity:{type:"f",value:1},outlineColor:{type:"c",value:new n.Color(0,0,0)},fogColor:{type:"c",value:new n.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},
2"./src/WebGL/shaders/lib/screen/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{screen:()=>a});var n=r("./src/WebGL/shaders/lib/screen/uniforms.ts"),i=r("./src/WebGL/shaders/lib/screen/screen.frag"),s=r("./src/WebGL/shaders/lib/screen/screen.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/screen/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={}},
2"./src/WebGL/shaders/lib/screenaa/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{screenaa:()=>a});var n=r("./src/WebGL/shaders/lib/screenaa/uniforms.ts"),i=r("./src/WebGL/shaders/lib/screenaa/screenaa.frag"),s=r("./src/WebGL/shaders/lib/screenaa/screenaa.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/screenaa/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={}},
2"./src/WebGL/shaders/lib/sphereimposter/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{sphereimposter:()=>s});var n=r("./src/WebGL/shaders/lib/sphereimposter/uniforms.ts"),i=r("./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag");const s={vertexShader:r("./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert").default.replace("#define GLSLIFY 1",""),fragmentShader:i.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/sphereimposter/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},
2"./src/WebGL/shaders/lib/sphereimposteroutline/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{sphereimposteroutline:()=>a});var n=r("./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts"),i=r("./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag"),s=r("./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>i});var n=r("./src/colors.ts");const i={opacity:{type:"f",value:1},outlineColor:{type:"c",value:new n.Color(0,0,0)},fogColor:{type:"c",value:new n.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},
2"./src/WebGL/shaders/lib/sprite/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{sprite:()=>a});var n=r("./src/WebGL/shaders/lib/sprite/uniforms.ts"),i=r("./src/WebGL/shaders/lib/sprite/sprite.frag"),s=r("./src/WebGL/shaders/lib/sprite/sprite.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/sprite/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={}},
2"./src/WebGL/shaders/lib/stickimposter/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{stickimposter:()=>o});var n=r("./src/WebGL/shaders/lib/stickimposter/uniforms.ts"),i=r("./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag"),s=r("./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag"),a=r("./src/WebGL/shaders/lib/stickimposter/stickimposter.vert");const o={fragmentShader:[i.default,s.default].join("\n").replace("#define GLSLIFY 1",""),vertexShader:a.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/stickimposter/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},
2"./src/WebGL/shaders/lib/stickimposteroutline/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{stickimposteroutline:()=>a});var n=r("./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts"),i=r("./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag"),s=r("./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert");const a={fragmentShader:(i.default+"gl_FragColor = vec4(color,1.0);}").replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>i});var n=r("./src/colors.ts");const i={opacity:{type:"f",value:1},fogColor:{type:"c",value:new n.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineColor:{type:"c",value:new n.Color(0,0,0)},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},
2"./src/WebGL/shaders/lib/volumetric/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{volumetric:()=>a});var n=r("./src/WebGL/shaders/lib/volumetric/uniforms.ts"),i=r("./src/WebGL/shaders/lib/volumetric/volumetric.frag"),s=r("./src/WebGL/shaders/lib/volumetric/volumetric.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:s.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},
2"./src/WebGL/shaders/lib/volumetric/uniforms.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},data:{type:"i",value:3},colormap:{type:"i",value:4},depthmap:{type:"i",value:5},step:{type:"f",value:1},maxdepth:{type:"f",value:100},subsamples:{type:"f",value:5},textmat:{type:"mat4",value:[]},projinv:{type:"mat4",value:[]},transfermin:{type:"f",value:-.2},transfermax:{type:"f",value:.2}}},
2"./src/WebGL/shaders/utils/clone.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{clone:()=>i});var n=r("./src/colors.ts");function i(e){let t={};for(const i in e){t[i]={},t[i].type=e[i].type;var r=e[i].value;r instanceof n.Color?t[i].value=r.clone():"number"===typeof r?t[i].value=r:r instanceof Array?t[i].value=[]:console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform")}return t}},
2"./src/WebGL/shaders/utils/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShaderUtils:()=>s,clone:()=>n.clone});var n=r("./src/WebGL/shaders/utils/clone.ts"),i=r("./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag");const s={clone:n.clone,stickimposterFragmentShader:i.default}},
2"./src/WebGL/shapes/Cylinder.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Cylinder:()=>s});var n=r("./src/WebGL/math/index.ts");let i=new n.Vector3;class s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.c1=e,this.c2=t,this.radius=r,this.direction=(new n.Vector3).subVectors(this.c2,this.c1).normalize()}copy(e){return this.c1.copy(e.c1),this.c2.copy(e.c2),this.direction.copy(e.direction),this.radius=e.radius,this}lengthSq(){return i.subVectors(this.c2,this.c1).lengthSq()}applyMatrix4(e){return this.direction.add(this.c1).applyMatrix4(e),this.c1.applyMatrix4(e),this.c2.applyMatrix4(e),this.direction.sub(this.c1).normalize(),this.radius=this.radius*e.getMaxScaleOnAxis(),this}}},
2"./src/WebGL/shapes/Sphere.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Sphere:()=>i});var n=r("./src/WebGL/math/index.ts");class i{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,z:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center=new n.Vector3(e.x,e.y,e.z),this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new i).copy(this)}}},
2"./src/WebGL/shapes/Triangle.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Triangle:()=>s});var n=r("./src/WebGL/math/index.ts");const i=new n.Vector3;class s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new n.Vector3;this.a=e,this.b=t,this.c=r}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}applyMatrix4(e){return this.a.applyMatrix4(e),this.b.applyMatrix4(e),this.c.applyMatrix4(e),this}getNormal(){var e=this.a.clone();return e.sub(this.b),i.subVectors(this.c,this.b),e.cross(i),e.normalize(),e}}},
2"./src/WebGL/shapes/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Cylinder:()=>i.Cylinder,Sphere:()=>n.Sphere,Triangle:()=>s.Triangle});var n=r("./src/WebGL/shapes/Sphere.ts"),i=r("./src/WebGL/shapes/Cylinder.ts"),s=r("./src/WebGL/shapes/Triangle.ts")},
2"./src/autoload.ts":(__unused_webpack_module,__nested_webpack_exports__,__nested_webpack_require_950556__)=>{"use strict";__nested_webpack_require_950556__.r(__nested_webpack_exports__),__nested_webpack_require_950556__.d(__nested_webpack_exports__,{autoinit:()=>autoinit,autoload:()=>autoload,processing_autoinit:()=>processing_autoinit,viewers:()=>viewers});var _GLViewer__WEBPACK_IMPORTED_MODULE_0__=__nested_webpack_require_950556__("./src/GLViewer.ts"),_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__=__nested_webpack_require_950556__("./src/ProteinSurface4.ts"),_utilities__WEBPACK_IMPORTED_MODULE_2__=__nested_webpack_require_950556__("./src/utilities.ts"),_colors__WEBPACK_IMPORTED_MODULE_3__=__nested_webpack_require_950556__("./src/colors.ts"),autoinit=!1,processing_autoinit=!1,viewers={};function autoload(viewer,callback){var i,dataname,type;if(null!=document.querySelector(".viewer_3Dmoljs")&&(autoinit=!0),autoinit){processing_autoinit=!0,viewer=void 0!=viewer?viewer:null;var nviewers=0;document.querySelectorAll(".viewer_3Dmoljs").forEach((viewerdiv=>{var datauri=[],datatypes=[],uri="";"static"==viewerdiv.style.position&&(viewerdiv.style.position="relative");var UI=null;if(type=null,viewerdiv.dataset.pdb)datauri.push("https://files.rcsb.org/view/"+viewerdiv.dataset.pdb+".pdb"),datatypes.push("pdb");else if(viewerdiv.dataset.cid)datatypes.push("sdf"),datauri.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+viewerdiv.dataset.cid+"/SDF?record_type=3d");else if(viewerdiv.dataset.href||viewerdiv.dataset.url){uri=viewerdiv.dataset.href?viewerdiv.dataset.href:viewerdiv.dataset.url,datauri.push(uri),type=uri.substring(uri.lastIndexOf(".")+1),datatypes.push(type);var molName=uri.substring(uri.lastIndexOf("/")+1,uri.lastIndexOf("."));"/"==molName&&(molName=uri.substring(uri.lastIndexOf("/")+1)),viewerdiv.dataset[datatypes[datatypes.length-1]]=molName}var divdata=viewerdiv.dataset;for(i in divdata)"pdb"===i.substring(0,3)&&"pdb"!==i?(datauri.push("https://files.rcsb.org/view/"+divdata[i]+".pdb"),datatypes.push("pdb")):"href"===i.substring(0,4)&&"href"!==i?(uri=divdata[i],datauri.push(uri),datatypes.push(uri.substring(uri.lastIndexOf(".")+1))):"cid"===i.substring(0,3)&&"cid"!==i&&(datauri.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+divdata[i]+"/SDF?record_type=3d"),datatypes.push("sdf"));var options={};viewerdiv.dataset.options&&(options=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.options));var bgcolor=_colors__WEBPACK_IMPORTED_MODULE_3__.CC.color(viewerdiv.dataset.backgroundcolor),bgalpha=viewerdiv.dataset.backgroundalpha;bgalpha=void 0==bgalpha?1:parseFloat(bgalpha);var style={line:{}};viewerdiv.dataset.style&&(style=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.style));var select={};viewerdiv.dataset.select&&(select=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.select));var selectstylelist=[],surfaces=[],labels=[],zoomto={},spin=null,d=viewerdiv.dataset,stylere=/style(.+)/,surfre=/surface(.*)/,reslabre=/labelres(.*)/,keys=[];for(dataname in d)Object.prototype.hasOwnProperty.call(d,dataname)&&keys.push(dataname);for(keys.sort(),i=0;i<keys.length;i++){dataname=keys[i];var m=stylere.exec(dataname),selname,newsel,styleobj;m&&(selname="select"+m[1],newsel=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[selname]),styleobj=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]),selectstylelist.push([newsel,styleobj])),m=surfre.exec(dataname),m&&(selname="select"+m[1],newsel=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[selname]),styleobj=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]),surfaces.push([newsel,styleobj])),m=reslabre.exec(dataname),m&&(selname="select"+m[1],newsel=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[selname]),styleobj=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]),labels.push([newsel,styleobj])),"zoomto"==dataname&&(zoomto=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname])),"spin"==dataname&&(spin=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(d[dataname]))}var applyStyles=function(e){for(e.setStyle(select,style),UI&&UI.createSelectionAndStyle(select,style),i=0;i<selectstylelist.length;i++){let t=selectstylelist[i][0]||{},r=selectstylelist[i][1]||{line:{}};e.setStyle(t,r),UI&&UI.createSelectionAndStyle(select,style)}for(i=0;i<surfaces.length;i++){let t=surfaces[i][0]||{},r=surfaces[i][1]||{};UI?e.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW,r,t,t).then((e=>{UI.loadSurface("VDW",t,r,e)})):e.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW,r,t,t)}for(i=0;i<labels.length;i++){let t=labels[i][0]||{},r=labels[i][1]||{};e.addResLabels(t,r)}e.render(),e.zoomTo(zoomto),spin&&e.spin(spin.axis,spin.speed)},glviewer=viewer;try{var config=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.config)||{};void 0===config.backgroundColor&&(config.backgroundColor=bgcolor),void 0===config.backgroundAlpha&&(config.backgroundAlpha=bgalpha),null==glviewer?glviewer=viewers[viewerdiv.id||nviewers++]=(0,_GLViewer__WEBPACK_IMPORTED_MODULE_0__.createViewer)(viewerdiv,config):(glviewer.setBackgroun
2dColor(bgcolor,bgalpha),glviewer.setConfig(config),UI&&UI.initiateUI()),viewerdiv.dataset.ui&&$3Dmol.StateManager&&(UI=new $3Dmol.StateManager(glviewer))}catch(error){console.log(error),viewerdiv.textContent="WebGL appears to be disabled."}if(0!=datauri.length){let i=0;var process=function(moldata){uri=datauri[i];var type=viewerdiv.dataset.type||viewerdiv.dataset.datatype||datatypes[i];if(glviewer.addModel(moldata,type,options),UI){var modelName=viewerdiv.dataset[datatypes[i]];UI.setModelTitle(modelName)}if(i+=1,i<datauri.length)(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.get)(datauri[i]).then(process);else{if(applyStyles(glviewer),viewerdiv.dataset.callback){var runres=eval(viewerdiv.dataset.callback);"function"==typeof runres&&runres(glviewer)}processing_autoinit=!1,callback&&callback(glviewer)}};(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.get)(datauri[0]).then(process)}else{if(viewerdiv.dataset.element){var moldataid="#"+viewerdiv.dataset.element,molelem=document.querySelector(moldataid),moldata=molelem?molelem.textContent:"";type=viewerdiv.dataset.type||viewerdiv.dataset.datatype,glviewer.addModel(moldata,type,options)}if(applyStyles(glviewer),viewerdiv.dataset.callback){var runres=eval(viewerdiv.dataset.callback);"function"==typeof runres&&runres(glviewer)}processing_autoinit=!1,callback&&callback(glviewer)}}))}}document.onreadystatechange=()=>{"complete"===document.readyState&&autoload()}},
2"./src/colors.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{CC:()=>i,Color:()=>n,builtinColorSchemes:()=>h,chains:()=>u,elementColors:()=>l,htmlColors:()=>s,residues:()=>c,ssColors:()=>a});class n{constructor(e,t,r){return this.r=0,this.g=0,this.b=0,arguments.length>1&&"number"===typeof e?(this.r=e||0,this.g=t||0,this.b=r||0,this):this.set(e||0)}set(e){return e instanceof n?e.clone():("number"===typeof e?this.setHex(e):"object"===typeof e&&(this.r=(null===e||void 0===e?void 0:e.r)||0,this.g=(null===e||void 0===e?void 0:e.g)||0,this.b=(null===e||void 0===e?void 0:e.b)||0),this)}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}getHex(){return Math.round(255*this.r)<<16|Math.round(255*this.g)<<8|Math.round(255*this.b)}clone(){return new n(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}scaled(){var e={};return e.r=Math.round(255*this.r),e.g=Math.round(255*this.g),e.b=Math.round(255*this.b),e.a=1,e}}class i{static color(e){if(!e)return i.cache[0];if(e instanceof n)return e;if("number"===typeof e&&"undefined"!==typeof i.cache[e])return i.cache[e];if(e&&Array.isArray(e))return e.map(i.color);let t=i.getHex(e),r=new n(t);return i.cache[t]=r,r}static getHex(e){var t;if(Array.isArray(e))return e.map(i.getHex);if("string"===typeof e){let r=e;if(!isNaN(parseInt(r)))return parseInt(r);if(r=r.trim(),4==r.length&&"#"==r[0]&&(r="#"+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),7==r.length&&"#"==r[0])return parseInt(r.substring(1),16);let n=i.rgbRegEx.exec(r);if(n){""!=n[1]&&console.log("WARNING: Opacity value in rgba ignored.  Specify separately as opacity attribute.");let e=0;for(let t=2;t<5;t++){e*=256;let r=n[t].endsWith("%")?255*parseFloat(n[t])/100:parseFloat(n[t]);e+=Math.round(r)}return e}return(null===(t=null===window||void 0===window?void 0:window.$3Dmol)||void 0===t?void 0:t.htmlColors[e.toLowerCase()])||0}return e}}i.rgbRegEx=/rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i,i.cache={0:new n(0)};const s={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgrey:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,grey:8421504,green:32768,greenyellow:11403055,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgrey:13882323,lightgreen:9498256,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},a={pyMol:{h:16711680,s:16776960,c:65280},Jmol:{h:16711808,s:16762880,c:16777215}},o={H:16777215,He:16761035,HE:16761035,Li:11674146,LI:11674146,B:65280,C:13158600,N:9408511,O:15728640,F:14329120,Na:255,NA:255,Mg:2263842,MG:2263842,Al:8421520,AL:8421520,Si:14329120,SI:14329120,P:16753920,S:16762930,Cl:65280,CL:65280,Ca:8421520,CA:8421520,Ti:8421520,TI:8421520,Cr:8421520,CR:8421520,Mn:8421520,MN:8421520,Fe:16753920,FE:16753920,Ni:10824234,NI:10824234,Cu:10824234,CU:10824234,Zn:10824234,ZN:10824234,Br:10824234,BR:10824234,Ag:8421520,AG:8421520,I:10494192,Ba:16753920,BA:16753920,Au:14329120,AU:14329120}
2,l={defaultColor:16716947,Jmol:{H:16777215,He:14286847,HE:14286847,Li:13402367,LI:13402367,Be:12779264,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,Ne:11789301,NE:11789301,Na:11230450,NA:11230450,Mg:9109248,MG:9109248,Al:12560038,AL:12560038,Si:1578e4,SI:1578e4,P:16744448,S:16777008,Cl:2093087,CL:2093087,Ar:8442339,AR:8442339,K:9388244,Ca:4062976,CA:4062976,Sc:15132390,SC:15132390,Ti:12567239,TI:12567239,V:10921643,Cr:9083335,CR:9083335,Mn:10255047,MN:10255047,Fe:14706227,FE:14706227,Co:15765664,CO:15765664,Ni:5296208,NI:5296208,Cu:13140019,CU:13140019,Zn:8224944,ZN:8224944,Ga:12750735,GA:12750735,Ge:6721423,GE:6721423,As:12419299,AS:12419299,Se:16752896,SE:16752896,Br:10889513,BR:10889513,Kr:6076625,KR:6076625,Rb:7351984,RB:7351984,Sr:65280,SR:65280,Y:9764863,Zr:9756896,ZR:9756896,Nb:7586505,NB:7586505,Mo:5551541,MO:5551541,Tc:3907230,TC:3907230,Ru:2396047,RU:2396047,Rh:687500,RH:687500,Pd:27013,PD:27013,Ag:12632256,AG:12632256,Cd:16767375,CD:16767375,In:10909043,IN:10909043,Sn:6717568,SN:6717568,Sb:10380213,SB:10380213,Te:13924864,TE:13924864,I:9699476,Xe:4366e3,XE:4366e3,Cs:5707663,CS:5707663,Ba:51456,BA:51456,La:7394559,LA:7394559,Ce:16777159,CE:16777159,Pr:14286791,PR:14286791,Nd:13107143,ND:13107143,Pm:10747847,PM:10747847,Sm:9437127,SM:9437127,Eu:6422471,EU:6422471,Gd:4587463,GD:4587463,Tb:3211207,TB:3211207,Dy:2097095,DY:2097095,Ho:65436,HO:65436,Er:58997,ER:58997,Tm:54354,TM:54354,Yb:48952,YB:48952,Lu:43812,LU:43812,Hf:5096191,HF:5096191,Ta:5089023,TA:5089023,W:2200790,Re:2522539,RE:2522539,Os:2516630,OS:2516630,Ir:1528967,IR:1528967,Pt:13684960,PT:13684960,Au:16765219,AU:16765219,Hg:12105936,HG:12105936,Tl:10900557,TL:10900557,Pb:5724513,PB:5724513,Bi:10375093,BI:10375093,Po:11230208,PO:11230208,At:7688005,AT:7688005,Rn:4358806,RN:4358806,Fr:4325478,FR:4325478,Ra:32e3,RA:32e3,Ac:7384058,AC:7384058,Th:47871,TH:47871,Pa:41471,PA:41471,U:36863,Np:33023,NP:33023,Pu:27647,PU:27647,Am:5528818,AM:5528818,Cm:7888099,CM:7888099,Bk:9064419,BK:9064419,Cf:10565332,CF:10565332,Es:11739092,ES:11739092,Fm:11739066,FM:11739066,Md:11734438,MD:11734438,No:12389767,NO:12389767,Lr:13041766,LR:13041766,Rf:13369433,RF:13369433,Db:13697103,DB:13697103,Sg:14221381,SG:14221381,Bh:14680120,BH:14680120,Hs:15073326,HS:15073326,Mt:15400998,MT:15400998},rasmol:o,defaultColors:Object.assign({},o),greenCarbon:Object.assign(Object.assign({},o),{C:65280}),cyanCarbon:Object.assign(Object.assign({},o),{C:65535}),magentaCarbon:Object.assign(Object.assign({},o),{C:16711935}),yellowCarbon:Object.assign(Object.assign({},o),{C:16776960}),whiteCarbon:Object.assign(Object.assign({},o),{C:16777215}),orangeCarbon:Object.assign(Object.assign({},o),{C:16753920}),purpleCarbon:Object.assign(Object.assign({},o),{C:8388736}),blueCarbon:Object.assign(Object.assign({},o),{C:255})},c={amino:{ALA:13158600,ARG:1334015,ASN:56540,ASP:15075850,CYS:15132160,GLN:56540,GLU:15075850,GLY:15461355,HIS:8553170,ILE:1016335,LEU:1016335,LYS:1334015,MET:15132160,PHE:3289770,PRO:14456450,SER:16422400,THR:16422400,TRP:11819700,TYR:3289770,VAL:1016335,ASX:16738740,GLX:16738740},shapely:{ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:16777215,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,ASX:16711935,GLX:16711935},nucleic:{A:10526975,G:16740464,I:8454143,C:16747595,T:10551200,U:16744576}},u={atom:{A:12636415,B:11599792,C:16761032,D:16777088,E:16761087,F:11596016,G:16765040,H:15761536,I:16113331,J:49151,K:13458524,L:6737322,M:10145074,N:15631086,O:52945,P:65407,Q:3978097,R:139,S:12433259,T:25600,U:8388608,V:8421376,W:8388736,X:32896,Y:12092939,Z:11674146},hetatm:{A:9478351,B:8441752,C:13602992,D:13619056,E:13603023,F:8437952,G:13607008,H:12603504,I:12955267,J:42959,K:11881548,L:5682578,M:9090346,N:12481214,O:46753,P:53103,Q:3447649,R:187,S:10854235,T:37888,U:11534336,V:11579392,W:11534512,X:45232,Y:15250963,Z:12726834}},h={ssPyMol:{prop:"ss",map:a.pyMol},ssJmol:{prop:"ss",map:a.Jmol},Jmol:{prop:"elem",map:l.Jmol},amino:{prop:"resn",map:c.amino},shapely:{prop:"resn",map:c.shapely},nucleic:{prop:"resn",map:c.nucleic},chain:{prop:"chain",map:u.atom},rasmol:{prop:"elem",map:l.rasmol},default:{prop:"elem",map:l.defaultColors},greenCarbon:{prop:"elem",map:l.greenCarbon},chainHetatm:{prop:"chain",map:u.hetatm},cyanCarbon:{prop:"elem",map:l.cyanCarbon},magentaCarbon:{prop:"elem",map:l.magentaCarbon},purpleCarbon:{prop:"elem",map:l.purpleCarbon},whiteCarbon:{prop:"elem",map:l.whiteCarbon},orangeCarbon:{prop:"elem",map:l.orangeCarbon},yellowCarbon:{prop:"elem",map:l.yellowCarbon},blueCarbon:{prop:"elem",map:l.blueCarbon}}},
vendor: 4,382 bytes, line 2
2"./src/glcartoon.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{drawCartoon:()=>E,subdivide_spline:()=>u});var n=r("./src/WebGL/math/index.ts"),i=r("./src/WebGL/shapes/index.ts"),s=r("./src/WebGL/index.ts"),a=r("./src/Gradient.ts"),o=r("./src/colors.ts"),l=r("./src/GLDraw.ts"),c=r("./src/utilities.ts");function u(e,t){var r,i,s,a,o,l,c,u,h,d=[],f=e;for((f=[]).push(e[0]),r=1,i=e.length-1;r<i;r++)if(o=e[r],l=e[r+1],o.smoothen){var p=new n.Vector3((o.x+l.x)/2,(o.y+l.y)/2,(o.z+l.z)/2);p.atom=o.atom,f.push(p)}else f.push(o);for(f.push(e[e.length-1]),r=-1,s=f.length;r<=s-3;r++)if(a=f[-1===r?0:r],o=f[r+1],l=f[r+2],c=f[r===s-3?s-1:r+3],u=(new n.Vector3).subVectors(l,a).multiplyScalar(.5),h=(new n.Vector3).subVectors(c,o).multiplyScalar(.5),!l.skip)for(var m=0;m<t;m++){var g=1/t*m,v=o.x+g*u.x+g*g*(-3*o.x+3*l.x-2*u.x-h.x)+g*g*g*(2*o.x-2*l.x+u.x+h.x),b=o.y+g*u.y+g*g*(-3*o.y+3*l.y-2*u.y-h.y)+g*g*g*(2*o.y-2*l.y+u.y+h.y),y=o.z+g*u.z+g*g*(-3*o.z+3*l.z-2*u.z-h.z)+g*g*g*(2*o.z-2*l.z+u.z+h.z),_=new n.Vector3(v,b,y);_.atom=m<t/2?o.atom:l.atom,d.push(_)}return d.push(f[f.length-1]),d}const h=.5,d=1.3,f=.8,p=.4,m=.4;function g(e,t,r,n){for(var i,s,a,l,c=0,u=t.length;c<u;c++){l=Math.round(c*(n.length-1)/u),a=o.CC.color(n[l]);var h=e.updateGeoGroup(2),d=h.vertexArray,f=h.colorArray,p=h.faceArray;d[s=3*(i=h.vertices)]=t[c].x,d[s+1]=t[c].y,d[s+2]=t[c].z,d[s+3]=r[c].x,d[s+4]=r[c].y,d[s+5]=r[c].z;for(var m=0;m<6;++m)f[s+3*m]=a.r,f[s+1+3*m]=a.g,f[s+2+3*m]=a.b;if(c>0){var g=[i,i+1,i-1,i-2],v=h.faceidx;p[v]=g[0],p[v+1]=g[1],p[v+2]=g[3],p[v+3]=g[1],p[v+4]=g[2],p[v+5]=g[3],h.faceidx+=6}h.vertices+=2}}function v(e,t,r,n,s,a,l){l&&"default"!==l||(l="rectangle"),"edged"===l?function(e,t,r,n,s,a){if(!(t.length<2)){var l,c;if(l=t[0],c=t[t.length-1],l=u(l,n),c=u(c,n),!s)return g(e,l,c,r);var h,d,f,p,m,v,b,y,_,w,x,S,C,k,E,A,L,M,z,T,O,P,D=[],N=[[0,2,-6,-8],[-4,-2,6,4],[7,-1,-5,3],[-3,5,1,-7]];for(C=0,k=l.length;C<k;C++){if(w=Math.round(C*(r.length-1)/k),_=o.CC.color(r[w]),D.push(d=l[C]),D.push(d),D.push(f=c[C]),D.push(f),C<k-1){var F=l[C+1].clone().sub(l[C]);h=c[C].clone().sub(l[C]).cross(F).normalize().multiplyScalar(s)}for(D.push(p=l[C].clone().add(h)),D.push(p),D.push(m=c[C].clone().add(h)),D.push(m),void 0!==d.atom&&(x=d.atom),T=(z=e.updateGeoGroup(8)).vertexArray,O=z.colorArray,P=z.faceArray,T[b=3*(v=z.vertices)]=d.x,T[b+1]=d.y,T[b+2]=d.z,T[b+3]=d.x,T[b+4]=d.y,T[b+5]=d.z,T[b+6]=f.x,T[b+7]=f.y,T[b+8]=f.z,T[b+9]=f.x,T[b+10]=f.y,T[b+11]=f.z,T[b+12]=p.x,T[b+13]=p.y,T[b+14]=p.z,T[b+15]=p.x,T[b+16]=p.y,T[b+17]=p.z,T[b+18]=m.x,T[b+19]=m.y,T[b+20]=m.z,T[b+21]=m.x,T[b+22]=m.y,T[b+23]=m.z,E=0;E<8;++E)O[b+3*E]=_.r,O[b+1+3*E]=_.g,O[b+2+3*E]=_.b;if(C>0){var R=void 0!==S&&void 0!==x&&S.serial!==x.serial;for(E=0;E<4;E++){var I=[v+N[E][0],v+N[E][1],v+N[E][2],v+N[E][3]];if(P[y=z.faceidx]=I[0],P[y+1]=I[1],P[y+2]=I[3],P[y+3]=I[1],P[y+4]=I[2],P[y+5]=I[3],z.faceidx+=6,x.clickable||S.clickable||x.hoverable||S.hoverable){var j=D[I[3]].clone(),G=D[I[0]].clone(),B=D[I[2]].clone(),U=D[I[1]].clone();if(j.atom=D[I[3]].atom||null,B.atom=D[I[2]].atom||null,G.atom=D[I[0]].atom||null,U.atom=D[I[1]].atom||null,R){var W=j.clone().add(G).multiplyScalar(.5),V=B.clone().add(U).multiplyScalar(.5),H=j.clone().add(U).multiplyScalar(.5);E%2===0?((S.clickable||S.hoverable)&&(A=new i.Triangle(W,H,j),L=new i.Triangle(V,B,H),M=new i.Triangle(H,B,j),S.intersectionShape.triangle.push(A),S.intersectionShape.triangle.push(L),S.intersectionShape.triangle.push(M)),(x.clickable||x.hoverable)&&(A=new i.Triangle(G,U,H),L=new i.Triangle(U,V,H),M=new i.Triangle(G,H,W),x.intersectionShape.triangle.push(A),x.intersectionShape.triangle.push(L),x.intersectionShape.triangle.push(M))):((x.clickable||x.hoverable)&&(A=new i.Triangle(W,H,j),L=new i.Triangle(V,B,H),M=new i.Triangle(H,B,j),x.intersectionShape.triangle.push(A),x.intersectionShape.triangle.push(L),x.intersectionShape.triangle.push(M)),(S.clickable||S.hoverable)&&(A=new i.Triangle(G,U,H),L=new i.Triangle(U,V,H),M=new i.Triangle(G,H,W),S.intersectionShape.triangle.push(A),S.intersectionShape.triangle.push(L),S.intersectionShape.triangle.push(M)))}else(x.clickable||x.hoverable)&&(A=new i.Triangle(G,U,j),L=new i.Triangle(U,B,j),x.intersectionShape.triangle.push(A),x.intersectionShape.triangle.push(L))}}}z.vertices+=8,S=x}var q=D.length-8;for(T=(z=e.updateGeoGroup(8)).vertexArray,O=z.colorArray,P=z.faceArray,b=3*(v=z.vertices),y=z.faceidx,C=0;C<4;
vendor: 8,981 bytes, line 2
2C++){D.push(D[2*C]),D.push(D[q+2*C]);var Y=D[2*C],Z=D[q+2*C];T[b+6*C]=Y.x,T[b+1+6*C]=Y.y,T[b+2+6*C]=Y.z,T[b+3+6*C]=Z.x,T[b+4+6*C]=Z.y,T[b+5+6*C]=Z.z,O[b+6*C]=_.r,O[b+1+6*C]=_.g,O[b+2+6*C]=_.b,O[b+3+6*C]=_.r,O[b+4+6*C]=_.g,O[b+5+6*C]=_.b}q+=8,A=[v,v+2,v+6,v+4],L=[v+1,v+5,v+7,v+3],P[y]=A[0],P[y+1]=A[1],P[y+2]=A[3],P[y+3]=A[1],P[y+4]=A[2],P[y+5]=A[3],P[y+6]=L[0],P[y+7]=L[1],P[y+8]=L[3],P[y+9]=L[1],P[y+10]=L[2],P[y+11]=L[3],z.faceidx+=12,z.vertices+=8}}(e,t,r,n,s):"rectangle"!==l&&"oval"!==l&&"parabola"!==l||function(e,t,r,n,s,a,l){var c,h,d,f,p,m,v,b,y,_;if((d=t.length)<2||t[0].length<2)return;for(c=0;c<d;c++)t[c]=u(t[c],n);if(f=t[0].length,!s)return g(e,t[0],t[d-1],r);var w=[],x=[],S=[];for(h=0;h<d;h++)w.push(.25+1.5*Math.sqrt((d-1)*h-Math.pow(h,2))/(d-1)),x.push(.5),S.push(2*(Math.pow(h/d,2)-h/d)+.6);var C,k,E,A,L,M,z,T,O,P,D=[];for(h=0;h<2*d-1;h++)D[h]=[h,h+1,h+1-2*d,h-2*d];D[2*d-1]=[h,h+1-2*d,h+1-4*d,h-2*d];let N=e.updateGeoGroup();for(c=0;c<f;c++){let n=e.groups,a=!1;var F,R;for(N=e.updateGeoGroup(2*d),n!=e.groups&&c>0&&(c-=1,a=!0),M=Math.round(c*(r.length-1)/f),L=o.CC.color(r[M]),y=v,_=b,v=[],b=[],p=[],void 0!==t[0][c].atom&&(A=t[0][c].atom,"oval"===l?m=w:"rectangle"===l?m=x:"parabola"===l&&(m=S)),m||(m=x),h=0;h<d;h++)F=c<f-1?t[h][c+1].clone().sub(t[h][c]):t[h][c-1].clone().sub(t[h][c]).negate(),R=h<d-1?t[h+1][c].clone().sub(t[h][c]):t[h-1][c].clone().sub(t[h][c]).negate(),p[h]=R.cross(F).normalize().multiplyScalar(s*m[h]);for(h=0;h<d;h++)v[h]=t[h][c].clone().add(p[h].clone().negate());for(h=0;h<d;h++)b[h]=t[h][c].clone().add(p[h]);for(z=N.vertexArray,T=N.colorArray,O=N.faceArray,k=3*(C=N.vertices),h=0;h<d;h++)z[k+3*h+0]=v[h].x,z[k+3*h+1]=v[h].y,z[k+3*h+2]=v[h].z;for(h=0;h<d;h++)z[k+3*h+0+3*d]=b[d-1-h].x,z[k+3*h+1+3*d]=b[d-1-h].y,z[k+3*h+2+3*d]=b[d-1-h].z;for(h=0;h<2*d;++h)T[k+3*h+0]=L.r,T[k+3*h+1]=L.g,T[k+3*h+2]=L.b;if(c>0&&!a){for(h=0;h<2*d;h++)P=[C+D[h][0],C+D[h][1],C+D[h][2],C+D[h][3]],O[E=N.faceidx]=P[0],O[E+1]=P[1],O[E+2]=P[3],O[E+3]=P[1],O[E+4]=P[2],O[E+5]=P[3],N.faceidx+=6;if(A.clickable||A.hoverable){var I=[];for(h in I.push(new i.Triangle(y[0],v[0],v[d-1])),I.push(new i.Triangle(y[0],v[d-1],y[d-1])),I.push(new i.Triangle(y[d-1],v[d-1],b[d-1])),I.push(new i.Triangle(y[d-1],b[d-1],_[d-1])),I.push(new i.Triangle(b[0],_[0],_[d-1])),I.push(new i.Triangle(b[d-1],b[0],_[d-1])),I.push(new i.Triangle(v[0],y[0],_[0])),I.push(new i.Triangle(b[0],v[0],_[0])),I)A.intersectionShape.triangle.push(I[h])}}N.vertices+=2*d}for(z=N.vertexArray,T=N.colorArray,O=N.faceArray,k=3*(C=N.vertices),E=N.faceidx,c=0;c<d-1;c++)P=[c,c+1,2*d-2-c,2*d-1-c],O[E=N.faceidx]=P[0],O[E+1]=P[1],O[E+2]=P[3],O[E+3]=P[1],O[E+4]=P[2],O[E+5]=P[3],N.faceidx+=6;for(c=0;c<d-1;c++)P=[C-1-c,C-2-c,C-2*d+c+1,C-2*d+c],O[E=N.faceidx]=P[0],O[E+1]=P[1],O[E+2]=P[3],O[E+3]=P[1],O[E+4]=P[2],O[E+5]=P[3],N.faceidx+=6}(e,t,r,n,s,0,l)}function b(e){return e&&"C"===e.elem&&"CA"===e.atom}function y(e,t){if(e&&t&&e.chain===t.chain){if(!e.hetflag&&!t.hetflag&&e.reschain===t.reschain&&(e.resi===t.resi||e.resi===t.resi-1))return!0;if(e.resi<t.resi){var r=e.x-t.x,n=e.y-t.y,i=e.z-t.z,s=r*r+n*n+i*i;if("CA"==e.atom&&"CA"==t.atom&&s<16)return!0;if(("P"==e.atom||"P"==t.atom)&&s<64)return!0}}return!1}function _(e,t,r,n,i){if(null!=t&&0!=t.vertices){i&&(t.initTypedArrays(),t.setUpNormals());var a=new s.MeshDoubleLambertMaterial;a.vertexColors=s.Coloring.FaceColors,"number"===typeof r&&r>=0&&r<1&&(a.transparent=!0,a.opacity=r),a.outline=n;var o=new s.Mesh(t,a);e.add(o)}}function w(e,t,r,i,s,a,o,l,c){var u,m,g,v,b,y;if(i&&s&&o){var _=s.sub(i);_.normalize();var w=l[c];for(m=c+1;m<l.length&&(w=l[m]).atom!=o.atom;m++);if((w=w?new n.Vector3(w.x,w.y,w.z):new n.Vector3(0,0,0)).sub(i),"arrow start"===o.ss){var x=w.clone().multiplyScalar(.3).cross(s);i.add(x);var S=w.clone().cross(_).normalize();_.rotateAboutVector(S,.43)}for(o.style.cartoon.ribbon?u=o.style.cartoon.thickness||p:o.style.cartoon.width?u=o.style.cartoon.width:"c"===o.ss?u="P"===o.atom?f:h:"arrow start"===o.ss?(u=d,b=!0):u="arrow end"===o.ss||"h"===o.ss&&o.style.cartoon.tubes||"tube start"===o.ss?h:d,null!=a&&_.dot(a)<0&&_.negate(),_.multiplyScalar(u),m=0;m<t;m++)g=2*m/(t-1)-1,(v=new n.Vector3(i.x+g*_.x,i.y+g*_.y,i.z+g*_.z)).atom=o,r&&"s"===o.ss&&(v.smoothen=!0),e[m].push(v);if(b)for(_.multiplyScalar(2),m=0;m<t;m++)g=2*m/(t-1)-1,(v=new n.Vector3(i.x+g*_.x,i.y+g*_.y,i.z+g*_.z)).atom=o,v.smoothen=!1,v.skip=!0,e[m].push(v);return y=o.style.cartoon.style||"default",e.style?e.style!=y&&(console.log("Warning: a cartoon chain's strand-style is ambiguous"),e.style="default"):e.style=y,"arrow start"!==o.ss&&"arrow end"!==o.ss||(o.ss="s"),b}}const x={C:!0,CA:!0,O:!0,P:!0,OP2:!0,O2P:!0,"O5'":!0,"O3'":!0,"C5'":!0,"C2'":!0,"O5*":!0,"O3*":!0,"C5*":!0,"C2*":!0,N1:!0,N3:!0},S={DA:!0,DG:!0,A:!0,G:!0},C={DT:!0,DC:!0,U:!0,C:!0,T:!0},k={DA:!0,DG:!0,A:!0,G:!0,DT:!0,DC:!0,U:!0,C:!0,T:!0};function E(e,t,r){let u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,h=u,d=u;var f,g,E,A,L,M,z,T,O,P,D,N,F,R,I,j,G,B,U=new s.Geometry(!0),W=new s.Geometry(!0),V=[],H=[],q=1,Y=!1,Z={};for(var X in a.Gradient.builtinGradients)a.Gradient.builtinGradients.hasOwnProperty(X)&&(Z[X]=new a.Gradient.builtinGradients[X](r[1],r[0]));var K=function(e,t){return r&&"spectrum"===t.color?t.colorscheme in Z?Z[t.colorscheme].valueToHex(e.resi):Z.sinebow.valueToHex(e.resi):(0,c.getColorFromStyle)(e,t).getHex()};for(T=0;T<h;T++)H[T]=[];var $=!1,Q=!1,J=[];for(T in t){if("C"===(A=t[T]).elem&&"CA"===A.atom){var ee=y(E,A);ee&&"s"===A.ss?$=!0:$&&(E&&g&&E.style.cartoon.arrows&&g.style.cartoon.arrows&&(E.ss="arrow end",g.ss="arrow start"),$=!1),ee&&("h"===E.ss||"tube start"==E.ss)&&E.style.cartoon.tubes?!Q&&"tube start"!=E.ss&&A.style.cartoon.tubes&&(A.ss="tube start",Q=!0):Q&&("tube start"===E.ss?E.ss="tube end":g&&g.style.cartoon.tubes&&(g.ss="tube end"),Q=!1),g=E,E=A}A&&A.atom in x&&J.push(A)}Q&&E.style.cartoon.tubes&&(E.ss="tube end",Q=!1);var te=function(t){H[0].length>0&&v(W,H,V,d,z,0,H.style);var r=[],n=null;if(t){for(T=0;T<h;T++)r[T]=H[T][H[T].length-1];n=V[V.length-1]}for(H=[],T=0;T<h;T++)H[T]=[];if(V=[],t){for(T=0;T<h;T++)H[T].push(r[T]);V.push(n)}_(e,W,q,Y,!0),_(e,U,q,Y,!1),W=new s.Geometry(!0),U=new s.Geometry(!0)};E=void 0;for(var re=0;re<J.length;re++){var ne=(A=J[re]).resn.trim(),ie=ne in k;if(q=1,f=A.style.cartoon,E&&E.style.cartoon&&(q=E.style.cartoon.opacity),E&&E.style.cartoon&&E.style.cartoon.outline&&(Y=E.style.cartoon.outline),!E||!E.style.cartoon||A.style.cartoon&&E.style.cartoon.opacity==A.style.cartoon.opacity||te(E.chain==A.chain),"trace"===f.style){if(A.hetflag);else if("C"===A.elem&&"CA"===A.atom||ie&&"P"===A.atom||"BB"===A.atom){if(M=K(A,f),z=(0,c.isNumeric)(f.thickness)?f.thickness:p,y(E,A))if(M==L){var se=o.CC.color(M);l.GLDraw.drawCylinder(U,E,A,z,se,2,2)}else{var ae=(new n.Vector3).addVectors(E,A).multiplyScalar(.5),oe=o.CC.color(L),le=o.CC.color(M);l.GLDraw.drawCylinder(U,E,ae,z,oe,2,0),l.GLDraw.drawCylinder(U,ae,A,z,le,0,2)}if((!0===A.clickable||A.hoverable)&&void 0!==A.intersectionShape){var ce=new n.Vector3(A.x,A.y,A.z);A.intersectionShape.sphere.push(new i.Sphere(ce,z))}E=A,L=M}}else{if(b(A)||ie&&("P"===A.atom||0==A.atom.indexOf("O5"))){if(B)if("tube end"===A.ss)B=!1,G=new n.Vector3(A.x,A.y,A.z),l.GLDraw.drawCylinder(U,j,G,2,o.CC.color(L),1,1),A.ss="h";else{if(E.chain==A.chain&&"tube end"!==E.ss)continue;B=!1,E.ss="h",G=new n.Vector3(E.x,E.y,E.z),l.GLDraw.drawCylinder(U,j,G,2,o.CC.color(L),1,1)}if(E&&(!y(E,A)||"tube start"===E.ss)){for("tube start"===E.ss&&(B=!0,j=new n.Vector3(E.x,E.y,E.z),E.ss="h"),I&&(R=N?(new n.Vector3).addVectors(E,N).multiplyScalar(.5):new n.Vector3(E.x,E.y,E.z),l.GLDraw.drawCylinder(U,R,I,m,o.CC.color(I.color),0,2),w(H,h,!0,N,F,D,E,J,re),V.push(M),R=null,I=null),H[0].length>0&&v(W,H,V,d,z,0,H.style),H=[],T=0;T<h;T++)H[T]=[];V=[]}if(void 0===E||E.rescode!=A.rescode||E.resi!=A.resi){if(I){var ue=(R=(new n.Vector3).addVectors(E,A).multiplyScalar(.5)).clone().sub(I).multiplyScalar(.02);R.add(ue),l.GLDraw.drawCylinder(U,R,I,m,o.CC.color(I.color),0,2),R=null,I=null}M=K(A,f),V.push(M),z=(0,c.isNumeric)(f.thickness)?f.thickness:p,E=A,(O=new n.Vector3(E.x,E.y,E.z)).resi=E.resi,L=M}!0!==A.clickable&&!0!==A.hoverable||void 0!==A.intersectionShape&&void 0!==A.intersectionShape.triangle||(A.intersectionShape={sphere:null,cylinder:[],line:[],triangle:[]})}else b(E)&&"O"===A.atom||ie&&"P"===E.atom&&("OP2"===A.atom||"O2P"===A.atom)||ie&&0==E.atom.indexOf("O5")&&0==A.atom.indexOf("C5")?((P=new n.Vector3(A.x,A.y,A.z)).resi=A.resi,"OP2"!==A.atom&&"O2P"!==A.atom||(F=new n.Vector3(A.x,A.y,A.z))):ie&&0==A.atom.indexOf("O3")?N=new n.Vector3(A.x,A.y,A.z):("N1"===A.atom&&ne in S||"N3"===A.atom&&ne in C)&&((I=new n.Vector3(A.x,A.y,A.z)).color=(0,c.getColorFromStyle)(A,f).getHex());P&&O&&P.resi===O.resi&&(w(H,h,!0,O,P,D,E,J,re),D=P,O=null,P=null,V.push(M))}}I&&(R=N?(new n.Vector3).addVectors(E,N).multiplyScalar(.5):new n.Vector3(E.x,E.y,E.z),l.GLDraw.drawCylinder(U,R,I,m,o.CC.color(I.color),0,2),w(H,h,!0,N,F,D,E,J,re),V.push(M)),te(!1)}},
2"./src/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{CAP:()=>m.CAP,CC:()=>i.CC,Color:()=>i.Color,CustomLinear:()=>n.CustomLinear,Cylinder:()=>c.Cylinder,GLDraw:()=>m.GLDraw,GLModel:()=>v.GLModel,GLShape:()=>p.GLShape,GLViewer:()=>b.GLViewer,GLVolumetricRender:()=>f.GLVolumetricRender,Gradient:()=>n.Gradient,GradientType:()=>n.GradientType,Label:()=>s.Label,LabelCount:()=>s.LabelCount,MarchingCube:()=>h.MarchingCube,MarchingCubeInitializer:()=>h.MarchingCubeInitializer,Matrix3:()=>l.Matrix3,Matrix4:()=>l.Matrix4,Parsers:()=>o.Parsers,PausableTimer:()=>u.PausableTimer,PointGrid:()=>h.PointGrid,ProteinSurface:()=>h.ProteinSurface,Quaternion:()=>l.Quaternion,ROYGB:()=>n.ROYGB,RWB:()=>n.RWB,Ray:()=>l.Ray,Sinebow:()=>n.Sinebow,Sphere:()=>c.Sphere,SurfaceType:()=>h.SurfaceType,Triangle:()=>c.Triangle,Vector2:()=>l.Vector2,Vector3:()=>l.Vector3,VolumeData:()=>d.VolumeData,adjustVolumeStyle:()=>u.adjustVolumeStyle,applyPartialCharges:()=>a.applyPartialCharges,autoinit:()=>y.autoinit,autoload:()=>y.autoload,base64ToArray:()=>u.base64ToArray,bondLength:()=>o.bondLength,builtinColorSchemes:()=>i.builtinColorSchemes,builtinGradients:()=>n.builtinGradients,chains:()=>i.chains,clamp:()=>l.clamp,conversionMatrix3:()=>l.conversionMatrix3,createStereoViewer:()=>b.createStereoViewer,createViewer:()=>b.createViewer,createViewerGrid:()=>b.createViewerGrid,deepCopy:()=>u.deepCopy,degToRad:()=>l.degToRad,download:()=>u.download,drawCartoon:()=>g.drawCartoon,elementColors:()=>i.elementColors,extend:()=>u.extend,get:()=>u.get,getAtomProperty:()=>u.getAtomProperty,getColorFromStyle:()=>u.getColorFromStyle,getElement:()=>u.getElement,getExtent:()=>u.getExtent,getGradient:()=>n.getGradient,getPropertyRange:()=>u.getPropertyRange,getbin:()=>u.getbin,htmlColors:()=>i.htmlColors,isEmptyObject:()=>u.isEmptyObject,isNumeric:()=>u.isNumeric,makeFunction:()=>u.makeFunction,mergeGeos:()=>u.mergeGeos,normalizeValue:()=>n.normalizeValue,partialCharges:()=>a.partialCharges,processing_autoinit:()=>y.processing_autoinit,residues:()=>i.residues,setBondLength:()=>o.setBondLength,setSyncSurface:()=>h.setSyncSurface,specStringToObject:()=>u.specStringToObject,splitMesh:()=>p.splitMesh,ssColors:()=>i.ssColors,subdivide_spline:()=>g.subdivide_spline,syncSurface:()=>h.syncSurface,viewers:()=>y.viewers});var n=r("./src/Gradient.ts"),i=r("./src/colors.ts"),s=r("./src/Label.ts"),a=r("./src/partialCharges.ts"),o=r("./src/parsers/index.ts"),l=r("./src/WebGL/math/index.ts"),c=r("./src/WebGL/shapes/index.ts"),u=r("./src/utilities.ts"),h=r("./src/ProteinSurface4.ts"),d=r("./src/VolumeData.ts"),f=r("./src/VolumetricRender.ts"),p=r("./src/GLShape.ts"),m=r("./src/GLDraw.ts"),g=r("./src/glcartoon.ts"),v=r("./src/GLModel.ts"),b=r("./src/GLViewer.ts"),y=r("./src/autoload.ts");r("./src/specs.ts"),window&&(window.$3Dmol=t)},
2"./src/parsers/CDJSON.ts":(e,t,r)=>{"use strict";function n(e,t){var r=[[]];"string"===typeof e&&(e=JSON.parse(e));for(var n=e.m,i=n[0].a,s=n[0].b,a=n[0].s,o=void 0!==t&&void 0!==t.parseStyle?t.parseStyle:void 0!==a,l=r[r.length-1].length,c=0;c<i.length;c++){var u=i[c],h={};h.id=u.i,h.x=u.x,h.y=u.y,h.z=u.z||0,h.bonds=[],h.bondOrder=[];var d=u.l||"C";h.elem=d[0].toUpperCase()+d.substring(1).toLowerCase(),h.serial=r[r.length-1].length,o&&(h.style=a[u.s||0]),r[r.length-1].push(h)}for(let f=0;f<s.length;f++){let e=s[f],t=e.b+l,n=e.e+l,i=e.o||1,a=r[r.length-1][t],o=r[r.length-1][n];a.bonds.push(n),a.bondOrder.push(i),o.bonds.push(t),o.bondOrder.push(i)}return r}r.r(t),r.d(t,{CDJSON:()=>n})},
2"./src/parsers/CIF.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{CIF:()=>o});var n=r("./src/parsers/utils/assignBonds.ts"),i=r("./src/parsers/utils/computeSecondaryStructure.ts"),s=r("./src/parsers/utils/processSymmetries.ts"),a=r("./src/WebGL/index.ts");function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r=[],o=!t.doAssembly,l=r.modelData=[],c=void 0===t.assignBonds||t.assignBonds;function u(e,t){for(var r=[],n=0,i=0;i<e.length;){for(;e.substring(i,i+t.length)!==t&&i<e.length;){if("'"===e[i])for(i++;i<e.length&&"'"!==e[i];)i++;else if('"'===e[i])for(i++;i<e.length&&'"'!==e[i];)i++;i++}r.push(e.substring(n,i)),n=i+=t.length}return r}var h=e.split(/\r?\n|\r/),d=[],f=!1;for(let n=0;n<h.length;n++){var p=h[n].split("#")[0];if(f?";"===p[0]&&(f=!1):";"===p[0]&&(f=!0),f||""!==p){if(!f&&"_"===(p=p.trim())[0]){var m=p.split(/\s/)[0].indexOf(".");if(m>-1){let e=p.split("");e[m]="_",p=(p=e.join("")).substring(0,m)+"_"+p.substring(m+1)}}d.push(p)}}for(var g,v,b,y,_=0;_<d.length;){for(;!d[_].startsWith("data_")||"data_global"===d[_];)_++;_++;for(var w={};_<d.length&&!d[_].startsWith("data_");)if(void 0===d[_][0])_++;else if("_"===d[_][0]){var x=d[_].split(/\s/)[0].toLowerCase(),S=w[x]=w[x]||[],C=d[_].substring(d[_].indexOf(x)+x.length);if(""===C)if(";"===d[++_][0]){var k=d[_].substring(1);for(_++;";"!==d[_];)k=k+"\n"+d[_],_++;S.push(k)}else S.push(d[_]);else S.push(C.trim());_++}else if("loop_"===d[_].substring(0,5)){_++;for(var E=[];""===d[_]||"_"===d[_][0];){if(""!==d[_]){let e=d[_].split(/\s/)[0].toLowerCase(),t=w[e]=w[e]||[];E.push(t)}_++}for(var A=0;_<d.length&&"_"!==d[_][0]&&!d[_].startsWith("loop_")&&!d[_].startsWith("data_");){let e=u(d[_]," ");for(var L=0;L<e.length;L++)""!==e[L]&&(E[A].push(e[L]),A=(A+1)%E.length);_++}}else _++;l.push({symmetries:[]}),r.push([]);var M,z=void 0!==w._atom_site_id?w._atom_site_id.length:w._atom_site_label.length;if(void 0!==w._cell_length_a){var T=parseFloat(w._cell_length_a),O=parseFloat(w._cell_length_b),P=parseFloat(w._cell_length_c),D=parseFloat(w._cell_angle_alpha)||90,N=parseFloat(w._cell_angle_beta)||90,F=parseFloat(w._cell_angle_gamma)||90;M=(0,a.conversionMatrix3)(T,O,P,D,N,F),l[l.length-1].cryst={a:T,b:O,c:P,alpha:D,beta:N,gamma:F}}for(var R=0;R<z;R++)if(void 0===w._atom_site_group_pdb||"TER"!==w._atom_site_group_pdb[R]){var I={};if(void 0!==w._atom_site_cartn_x)I.x=parseFloat(w._atom_site_cartn_x[R]),I.y=parseFloat(w._atom_site_cartn_y[R]),I.z=parseFloat(w._atom_site_cartn_z[R]);else{var j=(g=M,v=parseFloat(w._atom_site_fract_x[R]),b=parseFloat(w._atom_site_fract_y[R]),y=parseFloat(w._atom_site_fract_z[R]),new a.Vector3(v,b,y).applyMatrix3(g));I.x=j.x,I.y=j.y,I.z=j.z}I.chain=w._atom_site_auth_asym_id?w._atom_site_auth_asym_id[R]:void 0,I.resi=w._atom_site_auth_seq_id?parseInt(w._atom_site_auth_seq_id[R]):void 0,I.resn=w._atom_site_auth_comp_id?w._atom_site_auth_comp_id[R].trim():void 0,I.atom=w._atom_site_auth_atom_id?w._atom_site_auth_atom_id[R].replace(/"/gm,""):void 0,I.hetflag=!w._atom_site_group_pdb||"HETA"===w._atom_site_group_pdb[R]||"HETATM"===w._atom_site_group_pdb[R];var G="X";w._atom_site_type_symbol?G=w._atom_site_type_symbol[R].replace(/\(?\+?\d+.*/,""):w._atom_site_label&&(G=w._atom_site_label[R].split("_")[0].replace(/\(?\d+.*/,"")),I.elem=G[0].toUpperCase()+G.substring(1,2).toLowerCase(),I.bonds=[],I.ss="c",I.serial=R,I.bondOrder=[],I.properties={},r[r.length-1].push(I)}if(void 0!==w._pdbx_struct_oper_list_id&&!o)for(let e=0;e<w._pdbx_struct_oper_list_id.length;e++){var B=parseFloat(w["_pdbx_struct_oper_list_matrix[1][1]"][e]),U=parseFloat(w["_pdbx_struct_oper_list_matrix[1][2]"][e]),W=parseFloat(w["_pdbx_struct_oper_list_matrix[1][3]"][e]),V=parseFloat(w["_pdbx_struct_oper_list_vector[1]"][e]),H=parseFloat(w["_pdbx_struct_oper_list_matrix[2][1]"][e]),q=parseFloat(w["_pdbx_struct_oper_list_matrix[2][2]"][e]),Y=parseFloat(w["_pdbx_struct_oper_list_matrix[2][3]"][e]),Z=
2parseFloat(w["_pdbx_struct_oper_list_vector[2]"][e]),X=parseFloat(w["_pdbx_struct_oper_list_matrix[3][1]"][e]),K=parseFloat(w["_pdbx_struct_oper_list_matrix[3][2]"][e]),$=parseFloat(w["_pdbx_struct_oper_list_matrix[3][3]"][e]),Q=parseFloat(w["_pdbx_struct_oper_list_vector[3]"][e]),J=new a.Matrix4(B,U,W,V,H,q,Y,Z,X,K,$,Q);l[l.length-1].symmetries.push(J)}var ee=function(e){var t,r=e.match("-"),n=(e=e.replace(/[-xyz]/g,"")).split("/");return t=void 0===n[1]?1:parseInt(n[1]),(""===n[0]?1:parseInt(n[0]))/t*(r?-1:1)};if(void 0!==w._symmetry_equiv_pos_as_xyz&&!o)for(var te=0;te<w._symmetry_equiv_pos_as_xyz.length;te++){var re=w._symmetry_equiv_pos_as_xyz[te].replace(/["' ]/g,"").split(",").map((function(e){return e.replace(/-/g,"+-")}));let e=new a.Matrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);for(let t=0;t<3;t++){var ne=re[t].split("+");for(let r=0;r<ne.length;r++){var ie=ne[r];if(""!==ie){var se=ee(ie);ie.match("x")?e.elements[t+0]=se:ie.match("y")?e.elements[t+4]=se:ie.match("z")?e.elements[t+8]=se:e.elements[t+12]=se}}}var ae=M.getMatrix4(),oe=(new a.Matrix4).getInverse(ae,!0);e=(new a.Matrix4).multiplyMatrices(e,oe),e=(new a.Matrix4).multiplyMatrices(ae,e),l[l.length-1].symmetries.push(e)}}for(let a=0;a<r.length;a++)c&&(0,n.assignBonds)(r[a]),(0,i.computeSecondaryStructure)(r[a],t.hbondCutoff),(0,s.processSymmetries)(l[a].symmetries,r[a],t,l[a].cryst),t.duplicateAssemblyAtoms&&!t.dontConnectDuplicatedAtoms&&c&&(0,n.assignBonds)(r[a]);return r}},
2"./src/parsers/CUBE.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{CUBE:()=>a});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/assignBonds.ts"),s=r("./src/parsers/utils/anumToSymbol.ts");function a(e,t){t=t||{};var r=[[]],a=e.split(/\r?\n/),o=void 0===t.assignBonds||t.assignBonds;if(a.length<6)return r;var l=a[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),c=Math.abs(parseFloat(l[0]));let u={};var h=u.origin=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));l=a[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var d=(l=a[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" "))[0]>0?.529177:1;h.multiplyScalar(d);var f=Math.abs(l[0]),p=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])).multiplyScalar(d);l=a[4].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var m=Math.abs(l[0]),g=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])).multiplyScalar(d);l=a[5].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var v=Math.abs(l[0]),b=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])).multiplyScalar(d);if(u.size={x:f,y:m,z:v},u.unit=new n.Vector3(p.x,g.y,b.z),0!=p.y||0!=p.z||0!=g.x||0!=g.z||0!=b.x||0!=b.y){u.matrix4=new n.Matrix4(p.x,g.x,b.x,0,p.y,g.y,b.y,0,p.z,g.z,b.z,0,0,0,0,1);let e=(new n.Matrix4).makeTranslation(h.x,h.y,h.z);u.matrix4=u.matrix4.multiplyMatrices(e,u.matrix4),u.matrix=u.matrix4.matrix3FromTopLeft(),u.origin=new n.Vector3(0,0,0),u.unit=new n.Vector3(1,1,1)}r.modelData=[{cryst:u}],a=a.splice(6,c);for(var y=r[r.length-1].length,_=y+a.length,w=y;w<_;++w){var x={};x.serial=w;var S=a[w-y].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");x.elem=s.anumToSymbol[S[0]],x.x=parseFloat(S[2])*d,x.y=parseFloat(S[3])*d,x.z=parseFloat(S[4])*d,x.hetflag=!0,x.bonds=[],x.bondOrder=[],x.properties={},r[r.length-1].push(x)}if(o)for(let n=0;n<r.length;n++)(0,i.assignBonds)(r[n]);return r}},
2"./src/parsers/GRO.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{GRO:()=>s});var n=r("./src/parsers/utils/assignPDBBonds.ts"),i=r("./src/parsers/utils/atomNameToElem.ts");function s(e){for(var t=[],r=e.split(/\r?\n|\r/);r.length>0&&!(r.length<3);){var s=parseInt(r[1]);if(isNaN(s)||s<=0)break;if(r.length<s+3)break;var a=[];t.push(a);for(var o=2,l=a.length,c=l+s,u=l;u<c;u++){var h=r[o++],d={};d.serial=u,d.atom=h.slice(10,15).trim(),d.elem=(0,i.atomNameToElem)(d.atom,!0),d.x=10*parseFloat(h.slice(20,28)),d.y=10*parseFloat(h.slice(28,36)),d.z=10*parseFloat(h.slice(36,44)),d.resi=parseInt(h.slice(0,5)),d.resn=h.slice(5,10).trim(),d.bonds=[],d.bondOrder=[],d.properties={},h.length>44&&(d.dx=10*parseFloat(h.slice(44,52)),d.dy=10*parseFloat(h.slice(52,60)),d.dz=10*parseFloat(h.slice(60,68))),a[u]=d}if(r.length<=o+3){var f=r[o++].trim().split(/\s+/);if(3==f.length){for(var p=0;p<3;p++)f[p]=10*parseFloat(f[p]);t.box=f}}r.splice(0,++o)}for(let i=0;i<t.length;i++)(0,n.assignPDBBonds)(t[i]);return t}},
2"./src/parsers/LAMMPSTRJ.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{LAMMPSTRJ:()=>i});var n=r("./src/parsers/utils/assignBonds.ts");function i(e,t){for(var r=[],i={id:"serial",type:"atom",element:"elem",q:"charge",radius:"radius",x:"x",xu:"x",xs:"x",xsu:"x",y:"y",yu:"y",ys:"y",ysu:"y",z:"z",zu:"z",zs:"z",zsu:"z"},s=e.split(/\r?\n|\r/),a=0,o=0,l=0;l<s.length-9;){for(var c=l;c<s.length;c++)if(s[c].match(/ITEM: NUMBER OF ATOMS/)&&(o=parseInt(s[c+1])),s[c].match(/ITEM: ATOMS/)){a=c+1;break}var u=s[a-1].replace("ITEM: ATOMS ","").split(" ");r.push([]);for(let e=a;e<a+o;e++){for(var h={},d={},f=s[e].split(" "),p=0;p<f.length;p++){var m=i[u[p]];void 0!=m&&("serial"==m?h[m]=parseInt(f[p]):"x"==m||"y"==m||"z"===m?h[m]=parseFloat(f[p]):"charge"==m||"radius"==m?d[m]=parseFloat(f[p]):h[m]=f[p]),h.properties=d,h.bonds=[],h.bondOrder=[]}r[r.length-1][e-a]=h}l=a+o-1}if(t.assignBonds)for(var g=0;g<r.length;g++)(0,n.assignBonds)(r[g]);return r}},
vendor: 7,129 bytes, line 2
2"./src/parsers/MMTF.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{MMTFparser:()=>h});var n=r("./src/utilities.ts"),i=r("./src/WebGL/index.ts"),s=r("./src/parsers/utils/computeSecondaryStructure.ts"),a=r("./src/parsers/utils/processSymmetries.ts"),o=r("./src/vendor/mmtf.js"),l=function(e){return String.fromCharCode.apply(null,e).replace(/\0/g,"")},c=function(e){return 0==e||2==e||4==e?"h":3==e?"s":"c"};let u=new Set(["D-SACCHARIDE","D-SACCHARIDE 1,4 AND 1,4 LINKING","D-SACCHARIDE 1,4 AND 1,6 LINKING","L-SACCHARIDE","L-SACCHARIDE 1,4 AND 1,4 LINKING","L-SACCHARIDE 1,4 AND 1,6 LINKING","NON-POLYMER","OTHER","PEPTIDE-LIKE","SACCHARIDE"]);function h(e,t){var r=!t.keepH,h=t.altLoc?t.altLoc:"A",d=!!t.noSecondaryStructure,f=!t.noComputeSecondaryStructure,p=!t.doAssembly,m=t.assemblyIndex?t.assemblyIndex:0;e="string"==typeof e?(0,n.base64ToArray)(e):new Uint8Array(e);var g,v,b,y,_,w,x=o.decode(e),S=[[]],C=S.modelData=[],k=0,E=0,A=0,L=x.secStructList,M=x.bFactorList,z=x.altLocList,T=x.occupancyList,O=x.bondAtomList,P=x.bondOrderList,D=x.numModels;if(0==D)return S;t.multimodel||(D=1);var N=[];if(!p&&x.bioAssemblyList&&x.bioAssemblyList.length>0){var F=x.bioAssemblyList[m].transformList;for(g=0,w=F.length;g<w;g++){var R=new i.Matrix4(F[g].matrix);R.transpose(),N.push(R)}}var I=null;if(x.unitCell){var j=x.unitCell;I={a:j[0],b:j[1],c:j[2],alpha:j[3],beta:j[4],gamma:j[5]}}let G=[];x.entityList.forEach((e=>{e.chainIndexList.forEach((t=>{G[t]="polymer"==e.type}))}));var B=0;for(_=0;_<D;_++){var U=x.chainsPerModel[_],W=S[S.length-1],V=[];for(C.push({symmetries:N,cryst:I}),g=0;g<U;++g){var H=x.groupsPerChain[k],q=l(x.chainIdList.subarray(4*k,4*k+4));x.chainNameList&&(q=l(x.chainNameList.subarray(4*k,4*k+4)));var Y=E,Z="";for(v=0;v<H;++v){var X=x.groupList[x.groupTypeList[E]],K=X.atomNameList.length,$=0,Q=!1,J=!1;if(L){$=L[E];var ee=c($);0!=E&&ee==Z||(Q=!0),Z=ee;var te=E+1;(te>=L.length||c(L[te]!=ee))&&(J=!0)}var re=x.groupIdList[E],ne=X.groupName;let e=X.chemCompType;var ie=A;let t=u.has(e)||!G[k];for(b=0;b<K;++b){var se=X.elementList[b];if(r&&"H"==se)A+=1;else{var ae="";M&&(ae=M[A]);var oe="";z&&z[A]&&(oe=String.fromCharCode(z[A]));var le="";if(T&&(le=T[A]),""==oe||oe==h||"*"==h){var ce=x.atomIdList[A],ue=X.atomNameList[b],he=0;X.atomChargeList&&(he=X.atomChargeList[b]);var de=x.xCoordList[A],fe=x.yCoordList[A],pe=x.zCoordList[A];V[A]=W.length,W.push({resn:ne,x:de,y:fe,z:pe,elem:se,hetflag:t,chain:q,resi:re,icode:oe,rescode:re+(" "!=oe?"^"+oe:""),serial:ce,altLoc:oe,index:A,atom:ue,bonds:[],ss:c($),ssbegin:Q,ssend:J,bondOrder:[],properties:{charge:he,occupancy:le},b:ae}),A+=1}else A+=1}}var me=X.bondAtomList;for(b=0,y=X.bondOrderList.length;b<y;++b){var ge=ie+me[2*b],ve=ie+me[2*b+1],be=X.bondOrderList[b],ye=V[ge],_e=V[ve],we=W[ye],xe=W[_e];we&&xe&&(we.bonds.push(_e),we.bondOrder.push(be),xe.bonds.push(ye),xe.bondOrder.push(be))}E+=1}for(E=Y,v=0;v<H;++v)E+=1;k+=1}if(O)for(let e=B,t=O.length;e<t;e+=2){let t=O[e],r=O[e+1],n=P?P[e/2]:1;if(t>=A){B=e;break}let i=V[t],s=V[r],a=W[i],o=W[s];a&&o&&(a.bonds.push(s),a.bondOrder.push(n),o.bonds.push(i),o.bondOrder.push(n))}t.multimodel&&(t.onemol||S.push([]))}if(!p)for(let n=0;n<S.length;n++)(0,a.processSymmetries)(C[n].symmetries,S[n],t,C[n].cryst);return f&&!d&&(0,s.computeSecondaryStructure)(S,t.hbondCutoff),S}},"./src/parsers/MOL2.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{MOL2:()=>i});let n={"C.1":"C",C1:"C","C.2":"C",C2:"C","C.3":"C",C3:"C","C.ar":"C",Car:"C","C.cat":"C",Ccat:"C","H.spc":"H",Hspc:"H","H.t3p":"H",Ht3p:"H","N.1":"N",N1:"N","N.2":"N",N2:"N","N.3":"N",N3:"N","N.4":"N",N4:"N","N.am":"N",Nam:"N","N.ar":"N",Nar:"N","N.p13":"N",Np13:"N","O.2":"O",O2:"O","O.3":"O",O3:"O","O.co2":"O",Oco2:"O","O.spc":"O",Ospc:"O","O.t3p":"O",Ot3p:"O","P.3":"P",P3:"P","S.2":"S",S2:"S","S.3":"S",S3:"S","S.o":"S",So:"S","S.o2":"S",So2:"S"};function i(e,t){var r=[[]],i=!1;"undefined"!==typeof t.keepH&&(i=!t.keepH);var s=e.search(/@<TRIPOS>MOLECULE/),a=e.search(/@<TRIPOS>ATOM/);if(-1==s||-1==a)return r;for(var o=e.substring(s).split(/\r?\n|\r/);o.length>0;){var l=[],c=o[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),u=parseInt(c[0]),h=0;c.length>1&&(h=parseInt(c[1]));var d,f=4;for(d=3;d<o.length;d++)if("@<TRIPOS>ATOM"==o[d]){f=d+1;break}var p=r[r.length-1].length,m=p+u;for(d=p;d<m;d++){var g={},v=(c=o[f++].replace(/^\s+/,"").replace(/\s+/g," ").split(" "))[5];if(v=void 0!==n[v]?n[v]:(v=v.split(".")[0])[0].toUpperCase()+v.substring(1).toLowerCase(),g.atom=c[1],g.elem=v,"H"==g.elem&&i);else{var b=r[r.length-1].length,y=parseInt(c[0]);g.serial=y,g.x=parseFloat(c[2]),g.y=parseFloat(c[3]),g.z=parseFloat(c[4]),g.atom=c[5];var _=parseFloat(c[8]);g.index=b,g.bonds=[],g.bondOrder=[],g.properties={charge:_,partialCharge:_},l[y]=b,r[r.length-1].push(g)}}for(var w=!1;f<o.length;)if("@<TRIPOS>BOND"==o[f++]){w=!0;break}if(w&&h)for(d=0;d<h;d++){c=o[f++].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var x=parseInt(c[1]),S=r[r.length-1][l[x]],C=parseInt(c[2]),k=r[r.length-1][l[C]],E=parseInt(c[3]);isNaN(E)&&(E=1),void 0!==S&&void 0!==k&&(S.bonds.push(l[C]),S.bondOrder.push(E),k.bonds.push(l[x]),k.bondOrder.push(E))}if(!t.multimodel)break;t.onemol||r.push([]),o.splice(0,f),e=o.join("\n")}return r}},"./src/parsers/PDB.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{PDB:()=>i});var n=r("./src/parsers/utils/getSinglePDB.ts");function i(e,t){t=t||{};var r=[],i={};r.modelData=[];for(var s=e.split(/\r?\n|\r/);s.length>0;){var a=(0,n.getSinglePDB)(s,t,i),o=a[0],l=a[1];if(s=a[2],0!=o.length){if(t.multimodel&&t.onemol&&r.length>0)for(var c=r[0].length,u=0;u<o.length;u++){var h=o[u];h.index=u;for(var d=0;d<h.bonds.length;d++)h.bonds[d]+=c;r[0].push(h)}else r.modelData.push(l),r.push(o);if(!t.multimodel)break}}return r}},"./src/parsers/PQR.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{PQR:()=>s});var n=r("./src/parsers/utils/assignPDBBonds.ts"),i=r("./src/parsers/utils/computeSecondaryStructure.ts");function s(e,t){var r=[[]],s=!t.noSecondaryStructure;r.modelData=[{symmetries:[]}];var a,o=[],l=e.split(/\r?\n|\r/);for(let n=0;n<l.length;n++){var c=(a=l[n].replace(/^\s*/,"")).substring(0,6);if(0==c.indexOf("END")){if(t.multimodel){t.onemol||r.push([]);continue}break}if("ATOM  "==c||"HETATM"==c){var u;let e=parseInt(a.substring(6,11)),t=a.substring(12,16).replace(/ /g,""),n=a.substring(17,20).trim(),i=a.substring(21,22),s=parseInt(a.substring(22,26));var h=a.substring(30).trim().split(/\s+/),d=parseFloat(h[0]),f=parseFloat(h[1]),p=parseFloat(h[2]),m=parseFloat(h[3]),g=parseFloat(h[4]),v=t[0];t.length>1&&t[1].toUpperCase()!=t[1]&&(v=t.substring(0,2)),u="H"==a[0],o[e]=r[r.length-1].length,r[r.length-1].push({resn:n,x:d,y:f,z:p,elem:v,hetflag:u,chain:i,resi:s,serial:e,atom:t,bonds:[],ss:"c",bondOrder:[],properties:{charge:m,partialCharge:m,radius:g},pdbline:a})}else if("CONECT"==c){var b=parseInt(a.substring(6,11)),y=r[r.length-1][o[b]];for(let e=0;e<4;e++){var _=parseInt(a.substring([11,16,21,26][e],[11,16,21,26][e]+5)),w=r[r.length-1][o[_]];void 0!==y&&void 0!==w&&(y.bonds.push(o[_]),y.bondOrder.push(1))}}}for(let x=0;x<r.length;x++)(0,n.assignPDBBonds)(r[x]),s&&(0,i.computeSecondaryStructure)(r[x],t.hbondCutoff);return r}},
2"./src/parsers/PRMTOP.ts":(e,t,r)=>{"use strict";function n(e){var t,r=[],n=0,i=e.split(/\r?\n|\r/);if(!(i.length>0&&i[0].includes("VERSION")))return[];var s=i.filter((function(e){return e.includes("POINTERS")||e.includes("ATOM_NAME")||e.includes("CHARGE")||e.includes("RADII")||e.includes("BONDS_INC_HYDROGEN")||e.includes("BONDS_WITHOUT_HYDROGEN")})),a=u("POINTERS");if(-1==a)return[];var o=h(a),l=parseInt(i[a+1].slice(0,o[1]));if(isNaN(l)||l<=0)return[];if(-1==(a=u("ATOM_NAME")))return[];var c=(o=h(a))[0];for(let d=0;d<l/o[0];d++){d==parseInt(l/o[0])&&(c=l%o[0]);for(let e=0;e<c;e++){let t={},s={charge:"",radii:""};t.serial=n,t.x=0,t.y=0,t.z=0,t.atom=i[a+1].slice(o[1]*e,o[1]*(e+1)),t.elem=i[a+1].slice(o[1]*e,o[1]*e+1),t.properties=s,t.bonds=[],t.bondOrder=[],r.push(t),n++}a++}if(-1!=(a=u("CHARGE"))){n=0,c=(o=h(a))[0];for(let e=0;e<l/o[0];e++){e==parseInt(l/o[0])&&(c=l%o[0]);for(let e=0;e<c;e++)r[n].properties.charge=parseFloat(i[a+1].slice(o[1]*e,o[1]*(e+1))),n++;a++}}if(-1!=(a=u("RADII"))){n=0,c=(o=h(a))[0];for(let e=0;e<l/o[0];e++){e==parseInt(l/o[0])&&(c=l%o[0]);for(let e=0;e<c;e++)r[n].properties.radii=parseFloat(i[a+1].slice(o[1]*e,o[1]*(e+1))),n++;a++}}if(-1!=(a=u("BONDS_WITHOUT_HYDROGEN")))for(n=0,c=(o=h(a))[0],a+=1;!i[a].match(/^%FLAG/);){i[a+1].match(/^%FLAG/)&&(c=l%o[0]);for(let e=0;e<c;e++)n%3==0?t=parseInt(i[a].slice(o[1]*e,o[1]*(e+1))/3):n%3==1&&r[t].bonds.push(parseInt(i[a].slice(o[1]*e,o[1]*(e+1))/3)),n++;a++}if(-1!=(a=u("BONDS_INC_HYDROGEN")))for(n=0,c=(o=h(a))[0],a+=1;!i[a].match(/^%FLAG/);){i[a+1].match(/^%FLAG/)&&(c=l%o[0]);for(let e=0;e<c;e++)n%3==0?t=parseInt(i[a].slice(o[1]*e,o[1]*(e+1))/3):n%3==1&&r[t].bonds.push(parseInt(i[a].slice(o[1]*e,o[1]*(e+1))/3)),n++;a++}function u(e){var t=i.indexOf(s.filter((function(t){return t.includes(e)}))[0]);if(Number.isInteger(t)&&t>0){for(;!i[t].includes("FORMAT");)t++;return t}return-1}function h(e){var t=i[e].match(/\((\d*)\S*/),r=i[e].match(/[a-zA-Z](\d*)\)\s*/);return null==r&&(r=i[e].match(/[a-zA-Z](\d*)\.\d*\)\s*/)),[t[1],r[1]]}return[r]}r.r(t),r.d(t,{PRMTOP:()=>n})},
2"./src/parsers/SDF.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{SDF:()=>s});var n=function(e,t){var r=[[]],n=!1;for("undefined"!==typeof t.keepH&&(n=!t.keepH);e.length>0&&!(e.length<4);){var i=parseInt(e[3].substring(0,3));if(isNaN(i)||i<=0)break;var s=parseInt(e[3].substring(3,6)),a=4;if(e.length<4+i+s)break;var o,l,c=[],u=r[r.length-1].length,h=u+i;for(o=u;o<h;o++,a++){var d={},f=(l=e[a]).substring(31,34).replace(/ /g,"");d.atom=d.elem=f[0].toUpperCase()+f.substring(1).toLowerCase(),"H"===d.elem&&n||(d.serial=o,c[o]=r[r.length-1].length,d.x=parseFloat(l.substring(0,10)),d.y=parseFloat(l.substring(10,20)),d.z=parseFloat(l.substring(20,30)),d.hetflag=!0,d.bonds=[],d.bondOrder=[],d.properties={},d.index=r[r.length-1].length,r[r.length-1].push(d))}for(o=0;o<s;o++,a++){l=e[a];var p=c[parseInt(l.substring(0,3))-1+u],m=c[parseInt(l.substring(3,6))-1+u],g=parseFloat(l.substring(6));"undefined"!=typeof p&&"undefined"!=typeof m&&(r[r.length-1][p].bonds.push(m),r[r.length-1][p].bondOrder.push(g),r[r.length-1][m].bonds.push(p),r[r.length-1][m].bondOrder.push(g))}if(!t.multimodel)break;for(t.onemol||r.push([]);"$$$$"!==e[a]&&a<e.length;)a++;e.splice(0,++a)}return r},i=function(e,t){var r=[[]],n=!1;for("undefined"!==typeof t.keepH&&(n=!t.keepH);e.length>0&&!(e.length<8)&&e[4].startsWith("M  V30 BEGIN CTAB")&&e[5].startsWith("M  V30 COUNTS")&&!(e[5].length<14);){var i=e[5].substring(13).match(/\S+/g);if(i.length<2)break;var s=parseInt(i[0]);if(isNaN(s)||s<=0)break;var a=parseInt(i[1]),o=7;if(e.length<8+s+a)break;var l,c=[],u=r[r.length-1].length,h=u+s;for(l=u;l<h;l++,o++){var d=e[o].substring(6).match(/\S+/g);if(d.length>4){var f={},p=d[1].replace(/ /g,"");f.atom=f.elem=p[0].toUpperCase()+p.substring(1).toLowerCase(),"H"===f.elem&&n||(f.serial=l,c[l]=r[r.length-1].length,f.x=parseFloat(d[2]),f.y=parseFloat(d[3]),f.z=parseFloat(d[4]),f.hetflag=!0,f.bonds=[],f.bondOrder=[],f.properties={},f.index=r[r.length-1].length,r[r.length-1].push(f))}}if("M  V30 END ATOM"!==e[o])break;if(o++,0===a||"M  V30 BEGIN BOND"!==e[o])break;for(o++,l=0;l<a;l++,o++){var m=e[o].substring(6).match(/\S+/g);if(m.length>3){var g=c[parseInt(m[2])-1+u],v=c[parseInt(m[3])-1+u],b=parseFloat(m[1]);"undefined"!=typeof g&&"undefined"!=typeof v&&(r[r.length-1][g].bonds.push(v),r[r.length-1][g].bondOrder.push(b),r[r.length-1][v].bonds.push(g),r[r.length-1][v].bondOrder.push(b))}}if(!t.multimodel)break;for(t.onemol||r.push([]);"$$$$"!==e[o]&&o<e.length;)o++;e.splice(0,++o)}return r};function s(e,t){var r="V2000",s=e.split(/\r?\n|\r/);return s.length>3&&s[3].length>38&&(r=s[3].substring(34,39)),"V2000"===r?n(s,t):"V3000"===r?i(s,t):[[""]]}},
2"./src/parsers/VASP.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{VASP:()=>i});var n=r("./src/WebGL/index.ts");function i(e){var t=[[]],r={},i=e.replace(/^\s+/,"").split(/\r?\n/);if(i.length<3)return t;if(!i[1].match(/\d+/))return console.log("Warning: second line of the vasp structure file must be a number"),t;if(r.length=parseFloat(i[1]),r.length<0)return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"),t;r.xVec=new Float32Array(i[2].replace(/^\s+/,"").split(/\s+/)),r.yVec=new Float32Array(i[3].replace(/^\s+/,"").split(/\s+/)),r.zVec=new Float32Array(i[4].replace(/^\s+/,"").split(/\s+/));var s=new n.Matrix3(r.xVec[0],r.xVec[1],r.xVec[2],r.yVec[0],r.yVec[1],r.yVec[2],r.zVec[0],r.zVec[1],r.zVec[2]);s.multiplyScalar(r.length),t.modelData=[{symmetries:[],cryst:{matrix:s}}];var a=i[5].replace(/\s+/,"").replace(/\s+$/,"").split(/\s+/),o=new Int16Array(i[6].replace(/^\s+/,"").split(/\s+/)),l=i[7].replace(/\s+/,"");if(l.match(/C/))l="cartesian";else{if(!l.match(/D/))return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"),t;l="direct"}if(a.length!=o.length)return console.log("Warning: declaration of atomary species wrong:"),console.log(a),console.log(o),t;i.splice(0,8);for(var c=0,u=0,h=a.length;u<h;u++){for(var d=a[u],f=0,p=o[u];f<p;f++){var m=new Float32Array(i[c+f].replace(/^\s+/,"").split(/\s+/)),g={};g.elem=d,"cartesian"==l?(g.x=r.length*m[0],g.y=r.length*m[1],g.z=r.length*m[2]):(g.x=r.length*(m[0]*r.xVec[0]+m[1]*r.yVec[0]+m[2]*r.zVec[0]),g.y=r.length*(m[0]*r.xVec[1]+m[1]*r.yVec[1]+m[2]*r.zVec[1]),g.z=r.length*(m[0]*r.xVec[2]+m[1]*r.yVec[2]+m[2]*r.zVec[2])),g.bonds=[],t[0].push(g)}c+=o[u]}return t}},
vendor: 1,351 bytes, line 2
2"./src/parsers/XYZ.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{XYZ:()=>s});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/assignBonds.ts");function s(e,t){for(var r=[[]],s=void 0===(t=t||{}).assignBonds||t.assignBonds,a=e.split(/\r?\n|\r/);a.length>0&&!(a.length<3);){var o=parseInt(a[0]);if(isNaN(o)||o<=0)break;if(a.length<o+2)break;var l=/Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi.exec(a[1]);if(null!=l&&l.length>1){var c=new Float32Array(l[1].split(/\s+/)),u=new n.Matrix3(c[0],c[3],c[6],c[1],c[4],c[7],c[2],c[5],c[8]);r.modelData=[{cryst:{matrix:u}}]}for(var h=2,d=r[r.length-1].length,f=d+o,p=d;p<f;p++){var m=a[h++].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),g={};g.serial=p;var v=m[0];g.atom=g.elem=v[0].toUpperCase()+v.substring(1,2).toLowerCase(),g.x=parseFloat(m[1]),g.y=parseFloat(m[2]),g.z=parseFloat(m[3]),g.hetflag=!0,g.bonds=[],g.bondOrder=[],g.properties={},r[r.length-1][p]=g,m.length>=7&&(g.dx=parseFloat(m[4]),g.dy=parseFloat(m[5]),g.dz=parseFloat(m[6]))}if(!t.multimodel)break;r.push([]),a.splice(0,h)}if(s)for(let n=0;n<r.length;n++)(0,i.assignBonds)(r[n]);if(t.onemol){var b=r;(r=[]).push(b[0]);for(let e=1;e<b.length;e++){let t=r[0].length;for(let n=0;n<b[e].length;n++){let i=b[e][n];for(let e=0;e<i.bonds.length;e++)i.bonds[e]=i.bonds[e]+t;i.index=r[0].length,i.serial=r[0].length,r[0].push(i)}}}return r}},
2"./src/parsers/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Parsers:()=>v,bondLength:()=>g.bondLength,setBondLength:()=>g.setBondLength});var n=r("./src/parsers/VASP.ts"),i=r("./src/parsers/CUBE.ts"),s=r("./src/parsers/XYZ.ts"),a=r("./src/parsers/SDF.ts"),o=r("./src/parsers/CDJSON.ts"),l=r("./src/parsers/CIF.ts"),c=r("./src/parsers/MOL2.ts"),u=r("./src/parsers/PDB.ts"),h=r("./src/parsers/PQR.ts"),d=r("./src/parsers/MMTF.ts"),f=r("./src/parsers/PRMTOP.ts"),p=r("./src/parsers/GRO.ts"),m=r("./src/parsers/LAMMPSTRJ.ts"),g=r("./src/parsers/utils/bondLength.ts");const v={vasp:n.VASP,VASP:n.VASP,cube:i.CUBE,CUBE:i.CUBE,xyz:s.XYZ,XYZ:s.XYZ,sdf:a.SDF,SDF:a.SDF,json:o.CDJSON,cdjson:o.CDJSON,CDJSON:o.CDJSON,mcif:l.CIF,cif:l.CIF,CIF:l.CIF,mol2:c.MOL2,MOL2:c.MOL2,pdb:u.PDB,PDB:u.PDB,pdbqt:u.PDB,PDBQT:u.PDB,pqr:h.PQR,PQR:h.PQR,mmtf:d.MMTFparser,MMTF:d.MMTFparser,prmtop:f.PRMTOP,PRMTOP:f.PRMTOP,gro:p.GRO,GRO:p.GRO,lammpstrj:m.LAMMPSTRJ,LAMMPSTRJ:m.LAMMPSTRJ}},
2"./src/parsers/utils/anumToSymbol.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{anumToSymbol:()=>n});const n={1:"H",2:"He",3:"Li",4:"Be",5:"B",6:"C",7:"N",8:"O",9:"F",10:"Ne",11:"Na",12:"Mg",13:"Al",14:"Si",15:"P",16:"S",17:"Cl",18:"Ar",19:"K",20:"Ca",21:"Sc",22:"Ti",23:"V",24:"Cr",25:"Mn",26:"Fe",27:"Co",28:"Ni",29:"Cu",30:"Zn",31:"Ga",32:"Ge",33:"As",34:"Se",35:"Br",36:"Kr",37:"Rb",38:"Sr",39:"Y",40:"Zr",41:"Nb",42:"Mo",43:"Tc",44:"Ru",45:"Rh",46:"Pd",47:"Ag",48:"Cd",49:"In",50:"Sn",51:"Sb",52:"Te",53:"I",54:"Xe",55:"Cs",56:"Ba",71:"Lu",72:"Hf",73:"Ta",74:"W",75:"Re",76:"Os",77:"Ir",78:"Pt",79:"Au",80:"Hg",81:"Tl",82:"Pb",83:"Bi",84:"Po",85:"At",86:"Rn",87:"Fr",88:"Ra",104:"Rf",105:"Db",106:"Sg",107:"Bh",108:"Hs",109:"Mt",110:"Ds",111:"Rg",112:"Cn",113:"Nh",114:"Fl",115:"Mc",116:"Lv",117:"Ts",118:"Og",57:"La",58:"Ce",59:"Pr",60:"Nd",61:"Pm",62:"Sm",63:"Eu",64:"Gd",65:"Tb",66:"Dy",67:"Ho",68:"Er",69:"Tm",70:"Yb",89:"Ac",90:"Th",91:"Pa",92:"U",93:"Np",94:"Pu",95:"Am",96:"Cm",97:"Bk",98:"Cf",99:"Es",100:"Fm",101:"Md",102:"No"}},
2"./src/parsers/utils/areConnected.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{areConnected:()=>i});var n=r("./src/parsers/utils/bondLength.ts");function i(e,t){var r=(0,n.bondLength)(e.elem)+(0,n.bondLength)(t.elem);r+=.25,r*=r;var i=e.x-t.x;if((i*=i)>r)return!1;var s=e.y-t.y;if((s*=s)>r)return!1;var a=e.z-t.z;if((a*=a)>r)return!1;var o=i+s+a;return!isNaN(o)&&!(o<.5)&&!(o>r)&&(e.altLoc==t.altLoc||" "==e.altLoc||" "==t.altLoc)}},
2"./src/parsers/utils/assignBackboneHBonds.ts":(e,t,r)=>{"use strict";function n(e,t){let r=t||3.2,n=r*r,i=[];for(let d=0,f=e.length;d<f;d++){e[d].index=d;var s=e[d];s.hetflag||"N"!==s.atom&&"O"!==s.atom||(i.push(s),s.hbondOther=null,s.hbondDistanceSq=Number.POSITIVE_INFINITY)}i.sort((function(e,t){return e.z-t.z}));for(let d=0,f=i.length;d<f;d++){var a=i[d];for(let e=d+1;e<f;e++){var o=i[e],l=o.z-a.z;if(l>r)break;if(o.atom!=a.atom){var c=Math.abs(o.y-a.y);if(!(c>r)){var u=Math.abs(o.x-a.x);if(!(u>r)){var h=u*u+c*c+l*l;h>n||o.chain==a.chain&&Math.abs(o.resi-a.resi)<4||(h<a.hbondDistanceSq&&(a.hbondOther=o,a.hbondDistanceSq=h),h<o.hbondDistanceSq&&(o.hbondOther=a,o.hbondDistanceSq=h))}}}}}}r.r(t),r.d(t,{assignBackboneHBonds:()=>n})},
2"./src/parsers/utils/assignBonds.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{assignBonds:()=>i});var n=r("./src/parsers/utils/areConnected.ts");function i(e){for(var t=0,r=e.length;t<r;t++)e[t].index||(e[t].index=t);for(var i={},s=4.95,a=0;a<e.length;a++){var o=e[a],l=Math.floor(o.x/s),c=Math.floor(o.y/s),u=Math.floor(o.z/s);i[l]||(i[l]={}),i[l][c]||(i[l][c]={}),i[l][c][u]||(i[l][c][u]=[]),i[l][c][u].push(o)}var h=function(e,t){for(var r=0;r<e.length;r++)for(var i=e[r],s=0;s<t.length;s++){var a=t[s];if((0,n.areConnected)(i,a)){var o=i.bonds.indexOf(a.index),l=a.bonds.indexOf(i.index);-1==o&&-1==l?(i.bonds.push(a.index),i.bondOrder.push(1),a.bonds.push(i.index),a.bondOrder.push(1)):-1==o?(i.bonds.push(a.index),i.bondOrder.push(a.bondOrder[l])):-1==l&&(a.bonds.push(i.index),a.bondOrder.push(i.bondOrder[o]))}}},d=[{x:0,y:0,z:1},{x:0,y:1,z:-1},{x:0,y:1,z:0},{x:0,y:1,z:1},{x:1,y:-1,z:-1},{x:1,y:-1,z:0},{x:1,y:-1,z:1},{x:1,y:0,z:-1},{x:1,y:0,z:0},{x:1,y:0,z:1},{x:1,y:1,z:-1},{x:1,y:1,z:0},{x:1,y:1,z:1}];for(let f in i){let e=parseInt(f);for(let t in i[e]){let r=parseInt(t);for(let t in i[e][r]){let s=parseInt(t),a=i[e][r][s];for(let e=0;e<a.length;e++){let t=a[e];for(let r=e+1;r<a.length;r++){let e=a[r];(0,n.areConnected)(t,e)&&-1==t.bonds.indexOf(e.index)&&(t.bonds.push(e.index),t.bondOrder.push(1),e.bonds.push(t.index),e.bondOrder.push(1))}}for(let t=0;t<d.length;t++){let n=d[t];i[e+n.x]&&i[e+n.x][r+n.y]&&i[e+n.x][r+n.y][s+n.z]&&h(a,i[e+n.x][r+n.y][s+n.z])}}}}}},
2"./src/parsers/utils/assignPDBBonds.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{assignPDBBonds:()=>a});var n=r("./src/parsers/utils/areConnected.ts"),i=r("./src/parsers/utils/assignBonds.ts"),s=r("./src/parsers/utils/standardResidues.ts");function a(e){var t,r,a=[],o=[];for(t=0,r=e.length;t<r;t++){var l=e[t];l.index=t,l.hetflag||!s.standardResidues.has(l.resn)?o.push(l):a.push(l)}(0,i.assignBonds)(o),a.sort((function(e,t){return e.chain!=t.chain?e.chain<t.chain?-1:1:e.resi-t.resi}));var c,u=-1,h=-1;for(t=0,r=a.length;t<r;t++){var d=a[t];d.resi!==u&&(u=d.resi,c||h++,c=!1),d.reschain=h;for(var f=t+1;f<a.length;f++){var p=a[f];if(p.chain!=d.chain)break;if(p.resi-d.resi>1)break;(0,n.areConnected)(d,p)&&(-1===d.bonds.indexOf(p.index)&&(d.bonds.push(p.index),d.bondOrder.push(1),p.bonds.push(d.index),p.bondOrder.push(1)),d.resi!==p.resi&&(c=!0))}}}},
2"./src/parsers/utils/atomNameToElem.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{atomNameToElem:()=>i});var n=r("./src/parsers/utils/bondLength.ts");function i(e,t){var r=e.replace(/ /g,"");return r.length>0&&"H"==r[0]&&"Hg"!=r&&"He"!=r&&"Hf"!=r&&"Hs"!=r&&"Ho"!=r&&(r="H"),r.length>1&&(r=r[0].toUpperCase()+r.substring(1).toLowerCase(),"undefined"===typeof n.bondTable[r]?r=r[0]:t&&("Ca"==r||"Cd"==r)&&(r="C")),r}},
2"./src/parsers/utils/bondLength.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{bondLength:()=>i,bondTable:()=>n,setBondLength:()=>s});let n={H:.37,He:.32,Li:1.34,Be:.9,B:.82,C:.77,N:.75,O:.73,F:.71,Ne:.69,Na:1.54,Mg:1.3,Al:1.18,Si:1.11,P:1.06,S:1.02,Cl:.99,Ar:.97,K:1.96,Ca:1.74,Sc:1.44,Ti:1.56,V:1.25,Mn:1.39,Fe:1.25,Co:1.26,Ni:1.21,Cu:1.38,Zn:1.31,Ga:1.26,Ge:1.22,Se:1.16,Br:1.14,Kr:1.1,Rb:2.11,Sr:1.92,Y:1.62,Zr:1.48,Nb:1.37,Mo:1.45,Tc:1.56,Ru:1.26,Rh:1.35,Pd:1.31,Ag:1.53,Cd:1.48,In:1.44,Sn:1.41,Sb:1.38,Te:1.35,I:1.33,Xe:1.3,Cs:2.25,Ba:1.98,Lu:1.6,Hf:1.5,Ta:1.38,W:1.46,Re:1.59,Os:1.44,Ir:1.37,Pt:1.28,Au:1.44,Hg:1.49,Tl:1.48,Pb:1.47,Bi:1.46,Rn:1.45};function i(e){return n[e]||1.6}function s(e,t){t<0&&(t=0),n[e]=t}},
2"./src/parsers/utils/computeSecondaryStructure.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{computeSecondaryStructure:()=>i});var n=r("./src/parsers/utils/assignBackboneHBonds.ts");function i(e,t){(0,n.assignBackboneHBonds)(e,t);var r,i,s,a,o,l,c={};for(r=0,i=e.length;r<i;r++)if("undefined"===typeof c[(o=e[r]).chain]&&(c[o.chain]=[]),isFinite(o.hbondDistanceSq)){var u=o.hbondOther;"undefined"===typeof c[u.chain]&&(c[u.chain]=[]),4===Math.abs(u.resi-o.resi)&&(c[o.chain][o.resi]="h")}for(s in c)for(a=1;a<c[s].length-1;a++){var h=c[s][a-1],d=c[s][a+1];l=c[s][a],"h"==h&&h==d&&l!=h&&(c[s][a]=h)}for(r=0,i=e.length;r<i;r++)o=e[r],isFinite(o.hbondDistanceSq)&&"h"!=c[o.chain][o.resi]&&"h"!=o.ss&&(c[o.chain][o.resi]="maybesheet");for(let n=0,f=e.length;n<f;n++)if(o=e[n],isFinite(o.hbondDistanceSq)&&"maybesheet"==c[o.chain][o.resi]){let e=o.hbondOther,t=c[e.chain][e.resi];"maybesheet"!=t&&"s"!=t||(c[o.chain][o.resi]="s",c[e.chain][e.resi]="s")}for(let n in c){for(let e=1;e<c[n].length-1;e++){let t=c[n][e-1],r=c[n][e+1];l=c[n][e],"s"==t&&t==r&&l!=t&&(c[n][e]=t)}for(let e=0;e<c[n].length;e++){let t=c[n][e];"h"!=t&&"s"!=t||c[n][e-1]!=t&&c[n][e+1]!=t&&delete c[n][e]}}for(r=0,i=e.length;r<i;r++)l=c[(o=e[r]).chain][o.resi],delete o.hbondOther,delete o.hbondDistanceSq,"undefined"!=typeof l&&"maybesheet"!=l&&(o.ss=l,c[o.chain][o.resi-1]!=l&&(o.ssbegin=!0),c[o.chain][o.resi+1]!=l&&(o.ssend=!0))}},
2"./src/parsers/utils/getSinglePDB.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{getSinglePDB:()=>h});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/atomNameToElem.ts"),s=r("./src/parsers/utils/bondLength.ts"),a=r("./src/parsers/utils/computeSecondaryStructure.ts"),o=r("./src/parsers/utils/isEmpty.ts"),l=r("./src/parsers/utils/processSymmetries.ts"),c=r("./src/parsers/utils/assignPDBBonds.ts"),u=r("./src/parsers/utils/validateBonds.ts");function h(e,t,r){var h,d,f=[],p=void 0===t.assignBonds||t.assignBonds,m=!t.keepH,g=!!t.noSecondaryStructure,v=!t.noComputeSecondaryStructure,b=!t.doAssembly,y=t.altLoc?t.altLoc:"A",_={symmetries:[]},w=[],x=[],S={};for(let a=0;a<e.length;a++){var C,k,E,A=(d=e[a].replace(/^\s*/,"")).substring(0,6);if(0==A.indexOf("END")){if(w=e.slice(a+1),"END"==A)for(var L in r)r.hasOwnProperty(L)&&delete r[L];break}if("ATOM  "==A||"HETATM"==A){var M,z,T,O,P,D,N,F,R,I,j,G;if(" "!=(j=d.substring(16,17))&&j!=y&&"*"!=y)continue;if(I=parseInt(d.substring(6,11)),h=d.substring(12,16).replace(/ /g,""),M=d.substring(17,20).replace(/ /g,""),z=d.substring(21,22),T=parseInt(d.substring(22,26)),O=d.substring(26,27),P=parseFloat(d.substring(30,38)),D=parseFloat(d.substring(38,46)),N=parseFloat(d.substring(46,54)),G=parseFloat(d.substring(60,68)),"H"==(R=""===(R=d.substring(76,78).replace(/ /g,""))||"undefined"===typeof s.bondTable[R]?(0,i.atomNameToElem)(d.substring(12,14),"A"==d[0]):R[0].toUpperCase()+R.substring(1).toLowerCase())&&m)continue;F="H"==A[0],x[I]=f.length,f.push({resn:M,x:P,y:D,z:N,elem:R,hetflag:F,altLoc:j,chain:z,resi:T,icode:O,rescode:T+(" "!=O?"^"+O:""),serial:I,atom:h,bonds:[],ss:"c",bondOrder:[],properties:{},b:G,pdbline:d})}else if("SHEET "==A){C=d.substring(21,22),k=parseInt(d.substring(22,26)),E=parseInt(d.substring(33,37)),C in r||(r[C]={}),r[C][k]="s1";for(var B=k+1;B<E;B++)r[C][B]="s";r[C][E]="s2"}else if("CONECT"==A){var U=x[parseInt(d.substring(6,11))],W=f[U],V=[11,16,21,26];for(let e=0;e<4;e++){var H=x[parseInt(d.substring(V[e],V[e]+5))];let t=U+":"+H;var q=f[H];if(void 0!==W&&void 0!==q)if(S[t]){S[t]+=1;for(let e=0;e<W.bonds.length;e++)if(W.bonds[e]==H){var Y=S[t];W.bondOrder[e]=Y>=4?1:Y}}else S[t]=1,0!=W.bonds.length&&W.bonds[W.bonds.length-1]==H||(W.bonds.push(H),W.bondOrder.push(1))}}else if("HELIX "==A){C=d.substring(19,20),k=parseInt(d.substring(21,25)),E=parseInt(d.substring(33,37)),C in r||(r[C]={}),r[C][k]="h1";for(let e=k+1;e<E;e++)r[C][e]="h";r[C][E]="h2"}else if(b||"REMARK"!=A||"BIOMT"!=d.substring(13,18)){if("CRYST1"==A){let e,t,r,n,i,s;e=parseFloat(d.substring(7,15)),t=parseFloat(d.substring(16,24)),r=parseFloat(d.substring(25,33)),n=parseFloat(d.substring(34,40)),i=parseFloat(d.substring(41,47)),s=parseFloat(d.substring(48,54)),_.cryst={a:e,b:t,c:r,alpha:n,beta:i,gamma:s}}else if("ANISOU"==A){var Z=f[x[parseInt(d.substring(6,11))]];if(Z){var X=d.substring(30).trim().split(/\s+/),K={u11:parseInt(X[0]),u22:parseInt(X[1]),u33:parseInt(X[2]),u12:parseInt(X[3]),u13:parseInt(X[4]),u23:parseInt(X[5])};Z.uMat=K}}}else{var $,Q=new n.Matrix4;for($=1;$<=3;$++)if(d=e[a].replace(/^\s*/,""),parseInt(d.substring(18,19))==$)Q.elements[$-1]=parseFloat(d.substring(23,33)),Q.elements[$-1+4]=parseFloat(d.substring(33,43)),Q.elements[$-1+8]=parseFloat(d.substring(43,53)),Q.elements[$-1+12]=parseFloat(d.substring(53)),a++;else for(;"BIOMT"==d.substring(13,18);)a++,d=e[a].replace(/^\s*/,"");Q.elements[3]=0,Q.elements[7]=0,Q.elements[11]=0,Q.elements[15]=1,_.symmetries.push(Q),a--}}if((0,u.validateBonds)(f,x),p&&(0,c.assignPDBBonds)(f),b||(0,l.processSymmetries)(_.symmetries,f,t,_.cryst),v&&!g&&(0,a.computeSecondaryStructure)(f,t.hbondCutoff),!(0,o.isEmpty)(r))for(let n=0;n<f.length;n++)if(void 0!==(h=f[n])&&h.chain in r&&h.resi in r[h.chain]){var J=r[h.chain][h.resi];h.ss=J[0],J.length>1&&("1"==J[1]?h.ssbegin=!0:"2"==J[1]&&(h.ssend=!0))}return[f,_,w]}},
2"./src/parsers/utils/isEmpty.ts":(e,t,r)=>{"use strict";function n(e){var t;for(t in e)return!1;return!0}r.r(t),r.d(t,{isEmpty:()=>n})},
2"./src/parsers/utils/processSymmetries.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{processSymmetries:()=>i});var n=r("./src/WebGL/index.ts");function i(e,t,r,i){var s,a,o,l=!r.duplicateAssemblyAtoms,c=t.length,u=c;let h=-1;if(r.normalizeAssembly&&i){let r=(0,n.conversionMatrix3)(i.a,i.b,i.c,i.alpha,i.beta,i.gamma),a=new n.Matrix3;for(a.getInverse3(r),s=0;s<e.length;s++){let i=new n.Vector3(0,0,0);for(o=0;o<c;o++){let r=new n.Vector3(t[o].x,t[o].y,t[o].z);r.applyMatrix4(e[s]),r.applyMatrix3(a),i.add(r)}i.divideScalar(c);const l=[i.x,i.y,i.z];let u=[0,0,0];for(let e=0;e<3;e++){for(;l[e]<-.001;)l[e]+=1,u[e]+=1;for(;l[e]>1.001;)l[e]-=1,u[e]-=1}const d=new n.Vector3(u[0],u[1],u[2]);d.applyMatrix3(r),e[s].isNearlyIdentity()&&d.lengthSq()>.001&&(h=s),e[s].translate(d)}}if(l){if(e.length>1)for(s=0;s<t.length;s++){var d=[];for(a=0;a<e.length;a++)if(!e[a].isNearlyIdentity()){var f=new n.Vector3;f.set(t[s].x,t[s].y,t[s].z),f.applyMatrix4(e[a]),d.push(f)}t[s].symmetries=d}}else{for(o=0;o<c;o++)t[o].sym=-1;for(s=0;s<e.length;s++)if(e[s].isNearlyIdentity()||h==s)for(o=0;o<c;o++)t[o].sym=s;else{let r=new n.Vector3;for(o=0;o<c;o++){var p=[];for(a=0;a<t[o].bonds.length;a++)p.push(t[o].bonds[a]+u);r.set(t[o].x,t[o].y,t[o].z),r.applyMatrix4(e[s]);var m={};for(var g in t[o])m[g]=t[o][g];m.x=r.x,m.y=r.y,m.z=r.z,m.bonds=p,m.sym=s,m.index=t.length,t.push(m)}u=t.length}if(h>=0){let r=new n.Vector3;for(o=0;o<c;o++)r.set(t[o].x,t[o].y,t[o].z),r.applyMatrix4(e[h]),t[o].x=r.x,t[o].y=r.y,t[o].z=r.z}e.length=0}}},
2"./src/parsers/utils/standardResidues.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{standardResidues:()=>n});const n=new Set(["ABU","ACD","ALA","ALB","ALI","ARG","AR0","ASN","ASP","ASX","BAS","CYS","CYH","CYX","CSS","CSH","GLN","GLU","GLX","GLY","HIS","HIE","HID","HIP","HYP","ILE","ILU","LEU","LYS","MET","PCA","PGA","PHE","PR0","PRO","PRZ","SER","THR","TRP","TYR","VAL","A","1MA","C","5MC","OMC","G","1MG","2MG","M2G","7MG","OMG","YG","I","T","U","+U","H2U","5MU","PSU","ACE","F0R","H2O","HOH","WAT"])},
2"./src/parsers/utils/validateBonds.ts":(e,t,r)=>{"use strict";function n(e,t){for(var r=0,n=e.length;r<n;r++)for(var i=e[r],s=0;s<i.bonds.length;s++){var a=e[i.bonds[s]],o=t[i.serial];a&&o&&a.bonds.indexOf(o)<0&&(a.bonds.push(o),a.bondOrder.push(i.bondOrder[s]))}}r.r(t),r.d(t,{validateBonds:()=>n})},
2"./src/partialCharges.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{applyPartialCharges:()=>i,partialCharges:()=>n});const n={"ALA:N":-.15,"ALA:CA":.1,"ALA:CB":0,"ALA:C":.6,"ALA:O":-.55,"ARG:N":-.15,"ARG:CA":.1,"ARG:CB":0,"ARG:CG":0,"ARG:CD":.1,"ARG:NE":-.1,"ARG:CZ":.5,"ARG:NH1":.25,"ARG:NH2":.25,"ARG:C":.6,"ARG:O":-.55,"ASN:N":-.15,"ASN:CA":.1,"ASN:CB":0,"ASN:CG":.55,"ASN:OD1":-.55,"ASN:ND2":0,"ASN:C":.6,"ASN:O":-.55,"ASP:N":-.15,"ASP:CA":.1,"ASP:CB":0,"ASP:CG":.14,"ASP:OD1":-.57,"ASP:OD2":-.57,"ASP:C":.6,"ASP:O":-.55,"CYS:N":-.15,"CYS:CA":.1,"CYS:CB":.19,"CYS:SG":-.19,"CYS:C":.6,"CYS:O":-.55,"GLN:N":-.15,"GLN:CA":.1,"GLN:CB":0,"GLN:CG":0,"GLN:CD":.55,"GLN:OE1":-.55,"GLN:NE2":0,"GLN:C":.6,"GLN:O":-.55,"GLU:N":-.15,"GLU:CA":.1,"GLU:CB":0,"GLU:CG":0,"GLU:CD":.14,"GLU:OE1":-.57,"GLU:OE2":-.57,"GLU:C":.6,"GLU:O":-.55,"GLY:N":-.15,"GLY:CA":.1,"GLY:C":.6,"GLY:O":-.55,"HIS:N":-.15,"HIS:CA":.1,"HIS:CB":0,"HIS:CG":.1,"HIS:ND1":-.1,"HIS:CD2":.1,"HIS:NE2":-.4,"HIS:CE1":.3,"HIS:C":.6,"HIS:O":-.55,"ILE:N":-.15,"ILE:CA":.1,"ILE:CB":0,"ILE:CG2":0,"ILE:CG1":0,"ILE:CD":0,"ILE:C":.6,"ILE:O":-.55,"LEU:N":-.15,"LEU:CA":.1,"LEU:CB":0,"LEU:CG":0,"LEU:CD1":0,"LEU:CD2":0,"LEU:C":.6,"LEU:O":-.55,"LYS:N":-.15,"LYS:CA":.1,"LYS:CB":0,"LYS:CG":0,"LYS:CD":0,"LYS:CE":.25,"LYS:NZ":.75,"LYS:C":.6,"LYS:O":-.55,"MET:N":-.15,"MET:CA":.1,"MET:CB":0,"MET:CG":.06,"MET:SD":-.12,"MET:CE":.06,"MET:C":.6,"MET:O":-.55,"PHE:N":-.15,"PHE:CA":.1,"PHE:CB":0,"PHE:CG":0,"PHE:CD1":0,"PHE:CD2":0,"PHE:CE1":0,"PHE:CE2":0,"PHE:CZ":0,"PHE:C":.6,"PHE:O":-.55,"PRO:N":-.25,"PRO:CD":.1,"PRO:CA":.1,"PRO:CB":0,"PRO:CG":0,"PRO:C":.6,"PRO:O":-.55,"SER:N":-.15,"SER:CA":.1,"SER:CB":.25,"SER:OG":-.25,"SER:C":.6,"SER:O":-.55,"THR:N":-.15,"THR:CA":.1,"THR:CB":.25,"THR:OG1":-.25,"THR:CG2":0,"THR:C":.6,"THR:O":-.55,"TRP:N":-.15,"TRP:CA":.1,"TRP:CB":0,"TRP:CG":-.03,"TRP:CD2":.1,"TRP:CE2":-.04,"TRP:CE3":-.03,"TRP:CD1":.06,"TRP:NE1":-.06,"TRP:CZ2":0,"TRP:CZ3":0,"TRP:CH2":0,"TRP:C":.6,"TRP:O":-.55,"TYR:N":-.15,"TYR:CA":.1,"TYR:CB":0,"TYR:CG":0,"TYR:CD1":0,"TYR:CE1":0,"TYR:CD2":0,"TYR:CE2":0,"TYR:CZ":.25,"TYR:OH":-.25,"TYR:C":.6,"TYR:O":-.55,"VAL:N":-.15,"VAL:CA":.1,"VAL:CB":0,"VAL:CG1":0,"VAL:CG2":0,"VAL:C":.6,"VAL:O":-.55};function i(e,t){if((!t||"undefined"===typeof e.partialCharge)&&e.resn&&e.atom){var r=e.resn+":"+e.atom;e.properties.partialCharge=n[r]}}},
2"./src/specs.ts":(e,t,r)=>{"use strict";r.r(t)},
2"./src/utilities.ts":(__unused_webpack_module,__nested_webpack_exports__,__nested_webpack_require_1191961__)=>{"use strict";__nested_webpack_require_1191961__.r(__nested_webpack_exports__),__nested_webpack_require_1191961__.d(__nested_webpack_exports__,{PausableTimer:()=>PausableTimer,adjustVolumeStyle:()=>adjustVolumeStyle,base64ToArray:()=>base64ToArray,deepCopy:()=>deepCopy,download:()=>download,extend:()=>extend,get:()=>get,getAtomProperty:()=>getAtomProperty,getColorFromStyle:()=>getColorFromStyle,getElement:()=>getElement,getExtent:()=>getExtent,getPropertyRange:()=>getPropertyRange,getbin:()=>getbin,isEmptyObject:()=>isEmptyObject,isNumeric:()=>isNumeric,makeFunction:()=>makeFunction,mergeGeos:()=>mergeGeos,specStringToObject:()=>specStringToObject});var _Gradient__WEBPACK_IMPORTED_MODULE_0__=__nested_webpack_require_1191961__("./src/Gradient.ts"),_VolumeData__WEBPACK_IMPORTED_MODULE_1__=__nested_webpack_require_1191961__("./src/VolumeData.ts"),_colors__WEBPACK_IMPORTED_MODULE_2__=__nested_webpack_require_1191961__("./src/colors.ts");function extend(e,t){for(var r in t)t.hasOwnProperty(r)&&void 0!==t[r]&&(e[r]=t[r]);return e}function deepCopy(e){let t,r,n;if(void 0==e)return{};if("object"!==typeof e||null===e)return e;for(n in t=Array.isArray(e)?[]:{},e)r=e[n],t[n]=deepCopy(r);return t}function isNumeric(e){var t=typeof e;return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))}function isEmptyObject(e){var t;for(t in e)return!1;return!0}function makeFunction(callback){return callback&&"string"===typeof callback&&(callback=eval("("+callback+")")),callback&&"function"!=typeof callback?null:callback}function adjustVolumeStyle(e){e&&(!e.volformat||e.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData||(e.voldata=new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(e.voldata,e.volformat)),e.volscheme&&(e.volscheme=_Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(e.volscheme)))}function getExtent(e,t){var r,n,i,s,a,o,l,c,u,h,d=!t;if(r=n=i=9999,s=a=o=-9999,l=c=u=h=0,0===e.length)return[[0,0,0],[0,0,0],[0,0,0]];for(var f=0;f<e.length;f++){var p=e[f];if("undefined"!==typeof p&&isFinite(p.x)&&isFinite(p.y)&&isFinite(p.z)&&(h++,l+=p.x,c+=p.y,u+=p.z,r=r<p.x?r:p.x,n=n<p.y?n:p.y,i=i<p.z?i:p.z,s=s>p.x?s:p.x,a=a>p.y?a:p.y,o=o>p.z?o:p.z,p.symmetries&&d))for(var m=0;m<p.symmetries.length;m++)h++,l+=p.symmetries[m].x,c+=p.symmetries[m].y,u+=p.symmetries[m].z,r=r<p.symmetries[m].x?r:p.symmetries[m].x,n=n<p.symmetries[m].y?n:p.symmetries[m].y,i=i<p.symmetries[m].z?i:p.symmetries[m].z,s=s>p.symmetries[m].x?s:p.symmetries[m].x,a=a>p.symmetries[m].y?a:p.symmetries[m].y,o=o>p.symmetries[m].z?o:p.symmetries[m].z}return[[r,n,i],[s,a,o],[l/h,c/h,u/h]]}function getPropertyRange(e,t){for(var r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=0,s=e.length;i<s;i++){var a=getAtomProperty(e[i],t);null!=a&&(a<r&&(r=a),a>n&&(n=a))}return isFinite(r)||isFinite(n)?isFinite(r)?isFinite(n)||(n=r):r=n:r=n=0,[r,n]}class PausableTimer{constructor(e,t,r){this.total_time_run=0,this.fn=e,this.arg=r,this.countdown=t,this.start_time=(new Date).getTime(),this.ident=setTimeout(e,t,r)}cancel(){clearTimeout(this.ident)}pause(){clearTimeout(this.ident),this.total_time_run=(new Date).getTime()-this.start_time}resume(){this.ident=setTimeout(this.fn,Math.max(0,this.countdown-this.total_time_run),this.arg)}}function base64ToArray(e){for(var t=window.atob(e),r=t.length,n=new Uint8Array(r),i=0;i<r;i++)n[i]=t.charCodeAt(i);return n}function getAtomProperty(e,t){var r=null;return e.properties&&"undefined"!=typeof e.properties[t]?r=e.properties[t]:"undefined"!=typeof e[t]&&(r=e[t]),r}function mergeGeos(e,t){var r=t.geometry;void 0!==r&&e.geometryGroups.push(r.geometryGroups[0])}function specStringToObject(e){if("object"===typeof e)return e;if("undefined"===typeof e||null==e)return e;try{return JSON.parse(e)}catch(d){}var t=function(e){return isNumeric(e)?Math.floor(parseFloat(e))==parseInt(e)||e.indexOf(".")>=0?parseFloat(e):parseInt(e):"true"===e||"false"!==e&&e},r={};if("all"===(e=e.replace(/%7E/g,"~")))return r;for(var n=e.split(";"),i=0;i<n.length;i++){var s=n[i].split(":"),a=s[0],o={},l=s[1];if(l)if(-1!==(l=l.replace(/~/g,"=")).indexOf("="))for(var c=l.split(","),u=0;u<c.length;u++){var h=c[u].split("=",2);o[h[0]]=t(h[1])}else o=-1!==l.indexOf(",")?l.split(","):t(l);r[a]=o}return r}function checkStatus(e){if(!e.ok)throw new Error("HTTP ".concat(e.status," - ").concat(e.statusText));return e}function get(e,t){var r=fetch(e).then(checkStatus).then((e=>e.text()));return t?r.then(t):r}function getbin(e,t,r,n){var i;return i="POST"==r?fetch(e,{method:"POST",body:n}).then((e=>checkStatus(e))).then((e=>e.arrayBuffer())):fetch(e).then((e=>checkStatus(e))).then((e=>e.arrayBuffer())),t?i.then(t):i}function download(e,t,r,n){var i="",s="",a="",o="",l=null,c=t.addModel();if(e.indexOf(":")<0&&(e=4==e.length?"pdb:"+e:isNaN(e)?"url:"+e:"cid:"+e),"mmtf:"===e.substring(0,5))s=r&&r.pdbUri?r.pdbUri:"https://mmtf.rcsb.org/v1.0/full/",e=e.substring(5).toUpperCase(),o=s+e,r&&"undefined"===typeof r.noComputeSecondaryStructure&&(r.noComputeSecondaryStructure=!0),l=new Promise((function(e){getbin(o).then((function(n){c.addMolData(n,"mmtf",r),t.zoomTo(),t.render(),e(c)}),(function(){console.log("fetch of "+o+" failed.")}))}));else{if("pdb:"===e.substring(0,4)){if(i="mmtf",r&&r.format&&(i=r.format),r&&"undefined"===typeof r.noComputeSecondaryStructure&&(r.noComputeSecondaryStructure=!0),!(e=e.substring(4).toUpperCase()).match(/^[1-9][A-Za-z0-9]{3}$/))return void alert("Wrong PDB ID");"mmtf"==i?(a=r&&r.mmtfUri?r.mmtfUri:"https://mmtf.rcsb.org/v1.0/full/",o=a+e.toUpperCase()):(s=r&&r.pdbUri?r.pdbUri:"https://files.rcsb.org/view/",o=s+e+"."+i)}else if("cid:"==e.substring(0,4)){if(i="sdf",!(e=e.substring(4)).match(/^[0-9]+$/))return void alert("Wrong Compound ID");o="https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+e+"/SDF?record_type=3d"}else"url:"==e.substring(0,4)&&(o=e.substring(4),i=o);var u=function(e){c.addMolData(e,i,r),t.zoomTo(),t.render()};l=new Promise((function(t){"mmtf"==i?getbin(o).then((function(e){u(e),t(c)})).catch((function(){s=r&&r.pdbUri?r.pdbUri:"https://files.rcsb.org/view/",o=s+e+".pdb",i="pdb",console.log("falling back to pdb format"),get(o).then((function(e){u(e),t(c)})).catch((function(e){u(""),t(c),console.log("fetch of "+o+" failed: "+e.statusText)}))})):get(o).then((function(e){u(e),t(c)})).catch((function(e){u(""),t(c),console.log("fetch of "+o+" failed: "+e.statusText)}))}))}return n?(l.then((function(e){n(e)})),c):l}function getColorFromStyle(e,t){let r=t.colorscheme;if("undefined"!=typeof _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r])r=_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r];else if("string"==typeof r&&r.endsWith("Carbon")){let e=r.substring(0,r.lastIndexOf("Carbon")).toLowerCase();if("undefined"!=typeof _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[e]){let t=Object.assign({},_colors__WEBPACK_IMPORTED_MODULE_2__.elementColors.defaultColors);t.C=_colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[e],_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r]={prop:"elem",map:t},r=_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r]}}let n=e.color;if("undefined"!=typeof t.color&&"spectrum"!=t.color&&(n=t.color),"undefined"!=typeof r){let s,a;if("undefined"!=typeof _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[r])r=_colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[r],"undefined"!=typeof r[e[r.prop]]&&(n=r.map[e[r.prop]]);else if("undefined"!=typeof r[e[r.prop]])n=r.map[e[r.prop]];else if("undefined"!=typeof r.prop&&"undefined"!=typeof r.gradient){s=r.prop;var i=r.gradient;"undefined"!=typeof _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[i]&&(i=new _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[i](r.min,r.max,r.mid?r.mid:r.colors));let t=i.range()||[-1,1];a=getAtomProperty(e,s),null!=a&&(n=i.valueToHex(a,t))}else"undefined"!=typeof r.prop&&"undefined"!=typeof r.map?(s=r.prop,a=getAtomProperty(e,s),"undefined"!=typeof r.map[a]&&(n=r.map[a])):"undefined"!=typeof t.colorscheme[e.elem]?n=t.colorscheme[e.elem]:console.log("Could not interpret colorscheme "+r)}else"undefined"!=typeof t.colorfunc&&(n=t.colorfunc(e));return _colors__WEBPACK_IMPORTED_MODULE_2__.CC.color(n)}function getElement(e){let t=e;return"string"===typeof e?t=document.querySelector("#"+e):"object"===typeof e&&e.get&&(t=e.get(0)),t}},
vendor: 17,500 bytes, line 2
2"./node_modules/upng-js/UPNG.js":(e,t,r)=>{!function(){var t={};e.exports=t,function(e,t){e.toRGBA8=function(t){var r=t.width,n=t.height;if(null==t.tabs.acTL)return[e.toRGBA8.decodeImage(t.data,r,n,t).buffer];var i=[];null==t.frames[0].data&&(t.frames[0].data=t.data);for(var s,a=new Uint8Array(r*n*4),o=0;o<t.frames.length;o++){var l=t.frames[o],c=l.rect.x,u=l.rect.y,h=l.rect.width,d=l.rect.height,f=e.toRGBA8.decodeImage(l.data,h,d,t);if(0==o?s=f:0==l.blend?e._copyTile(f,h,d,s,r,n,c,u,0):1==l.blend&&e._copyTile(f,h,d,s,r,n,c,u,1),i.push(s.buffer),s=s.slice(0),0==l.dispose);else if(1==l.dispose)e._copyTile(a,h,d,s,r,n,c,u,0);else if(2==l.dispose){for(var p=o-1;2==t.frames[p].dispose;)p--;s=new Uint8Array(i[p]).slice(0)}}return i},e.toRGBA8.decodeImage=function(t,r,n,i){var s=r*n,a=e.decode._getBPP(i),o=Math.ceil(r*a/8),l=new Uint8Array(4*s),c=new Uint32Array(l.buffer),u=i.ctype,h=i.depth,d=e._bin.readUshort;if(6==u){var f=s<<2;if(8==h)for(var p=0;p<f;p++)l[p]=t[p];if(16==h)for(p=0;p<f;p++)l[p]=t[p<<1]}else if(2==u){var m=i.tabs.tRNS,g=-1,v=-1,b=-1;if(m&&(g=m[0],v=m[1],b=m[2]),8==h)for(p=0;p<s;p++){var y=3*p;l[E=p<<2]=t[y],l[E+1]=t[y+1],l[E+2]=t[y+2],l[E+3]=255,-1!=g&&t[y]==g&&t[y+1]==v&&t[y+2]==b&&(l[E+3]=0)}if(16==h)for(p=0;p<s;p++)y=6*p,l[E=p<<2]=t[y],l[E+1]=t[y+2],l[E+2]=t[y+4],l[E+3]=255,-1!=g&&d(t,y)==g&&d(t,y+2)==v&&d(t,y+4)==b&&(l[E+3]=0)}else if(3==u){var _=i.tabs.PLTE,w=i.tabs.tRNS,x=w?w.length:0;if(1==h)for(var S=0;S<n;S++){var C=S*o,k=S*r;for(p=0;p<r;p++){var E=k+p<<2,A=3*(L=t[C+(p>>3)]>>7-((7&p)<<0)&1);l[E]=_[A],l[E+1]=_[A+1],l[E+2]=_[A+2],l[E+3]=L<x?w[L]:255}}if(2==h)for(S=0;S<n;S++)for(C=S*o,k=S*r,p=0;p<r;p++)E=k+p<<2,A=3*(L=t[C+(p>>2)]>>6-((3&p)<<1)&3),l[E]=_[A],l[E+1]=_[A+1],l[E+2]=_[A+2],l[E+3]=L<x?w[L]:255;if(4==h)for(S=0;S<n;S++)for(C=S*o,k=S*r,p=0;p<r;p++)E=k+p<<2,A=3*(L=t[C+(p>>1)]>>4-((1&p)<<2)&15),l[E]=_[A],l[E+1]=_[A+1],l[E+2]=_[A+2],l[E+3]=L<x?w[L]:255;if(8==h)for(p=0;p<s;p++){var L;E=p<<2,A=3*(L=t[p]),l[E]=_[A],l[E+1]=_[A+1],l[E+2]=_[A+2],l[E+3]=L<x?w[L]:255}}else if(4==u){if(8==h)for(p=0;p<s;p++){E=p<<2;var M=t[z=p<<1];l[E]=M,l[E+1]=M,l[E+2]=M,l[E+3]=t[z+1]}if(16==h)for(p=0;p<s;p++){var z;E=p<<2,M=t[z=p<<2],l[E]=M,l[E+1]=M,l[E+2]=M,l[E+3]=t[z+2]}}else if(0==u){if(g=i.tabs.tRNS?i.tabs.tRNS:-1,1==h)for(p=0;p<s;p++){var T=(M=255*(t[p>>3]>>7-(7&p)&1))==255*g?0:255;c[p]=T<<24|M<<16|M<<8|M}if(2==h)for(p=0;p<s;p++)T=(M=85*(t[p>>2]>>6-((3&p)<<1)&3))==85*g?0:255,c[p]=T<<24|M<<16|M<<8|M;if(4==h)for(p=0;p<s;p++)T=(M=17*(t[p>>1]>>4-((1&p)<<2)&15))==17*g?0:255,c[p]=T<<24|M<<16|M<<8|M;if(8==h)for(p=0;p<s;p++)T=(M=t[p])==g?0:255,c[p]=T<<24|M<<16|M<<8|M;if(16==h)for(p=0;p<s;p++)M=t[p<<1],T=d(t,p<<1)==g?0:255,c[p]=T<<24|M<<16|M<<8|M}return l},e.decode=function(t){for(var r,n=new Uint8Array(t),i=8,s=e._bin,a=s.readUshort,o=s.readUint,l={tabs:{},frames:[]},c=new Uint8Array(n.length),u=0,h=0,d=[137,80,78,71,13,10,26,10],f=0;f<8;f++)if(n[f]!=d[f])throw"The input is not a PNG file!";for(;i<n.length;){var p=s.readUint(n,i);i+=4;var m=s.readASCII(n,i,4);if(i+=4,"IHDR"==m)e.decode._IHDR(n,i,l);else if("IDAT"==m){for(f=0;f<p;f++)c[u+f]=n[i+f];u+=p}else if("acTL"==m)l.tabs[m]={num_frames:o(n,i),num_plays:o(n,i+4)},r=new Uint8Array(n.length);else if("fcTL"==m){0!=h&&((C=l.frames[l.frames.length-1]).data=e.decode._decompress(l,r.slice(0,h),C.rect.width,C.rect.height),h=0);var g={x:o(n,i+12),y:o(n,i+16),width:o(n,i+4),height:o(n,i+8)},v=a(n,i+22);v=a(n,i+20)/(0==v?100:v);var b={rect:g,delay:Math.round(1e3*v),dispose:n[i+24],blend:n[i+25]};l.frames.push(b)}else if("fdAT"==m){for(f=0;f<p-4;f++)r[h+f]=n[i+f+4];h+=p-4}else if("pHYs"==m)l.tabs[m]=[s.readUint(n,i),s.readUint(n,i+4),n[i+8]];else if("cHRM"==m)for(l.tabs[m]=[],f=0;f<8;f++)l.tabs[m].push(s.readUint(n,i+4*f));else if("tEXt"==m){null==l.tabs[m]&&(l.tabs[m]={});var y=s.nextZero(n,i),_=s.readASCII(n,i,y-i),w=s.readASCII(n,y+1,i+p-y-1);l.tabs[m][_]=w}else if("iTXt"==m){null==l.tabs[m]&&(l.tabs[m]={}),y=0;var x=i;y=s.nextZero(n,x),_=s.readASCII(n,x,y-x),n[x=y+1],n[x+1],x+=2,y=s.nextZero(n,x),s.readASCII(n,x,y-x),x=y+1,y=s.nextZero(n,x),s.readUTF8(n,x,y-x),x=y+1,w=s.readUTF8(n,x,p-(x-i)),l.tabs[m][_]=w}else if("PLTE"==m)l.tabs[m]=s.readBytes(n,i,p);else if("hIST"==m){var S=l.tabs.PLTE.length/3;for(l.tabs[m]=[],f=0;f<S;f++)l.tabs[m].push(a(n,i+2*f))}else if("tRNS"==m)3==l.ctype?l.tabs[m]=s.readBytes(n,i,p):0==l.ctype?l.tabs[m]=a(n,i):2==l.ctype&&(l.tabs[m]=[a(n,i),a(n,i+2),a(n,i+4)]);else if("gAMA"==m)l.tabs[m]=s.readUint(n,i)/1e5;else if("sRGB"==m)l.tabs[m]=n[i];else if("bKGD"==m)0==l.ctype||4==l.ctype?l.tabs[m]=[a(n,i)]:2==l.ctype||6==l.ctype?l.tabs[m]=[a(n,i),a(n,i+2),a(n,i+4)]:3==l.ctype&&(l.tabs[m]=n[i]);else if("IEND"==m){var C;0!=h&&((C=l.frames[l.frames.length-1]).data=e.decode._decompress(l,r.slice(0,h),C.rect.width,C.rect.height),h=0),l.data=e.decode._decompress(l,c,l.width,l.height);break}i+=p,s.readUint(n,i),i+=4}return delete l.compress,delete l.interlace,delete l.filter,l},e.decode._decompress=function(t,r,n,i){return 0==t.compress&&(r=e.decode._inflate(r)),0==t.interlace?r=e.decode._filterZero(r,t,0,n,i):1==t.interlace&&(r=e.decode._readInterlace(r,t)),r},e.decode._inflate=function(e){return t.inflate(e)},e.decode._readInterlace=function(t,r){for(var n=r.width,i=r.height,s=e.decode._getBPP(r),a=s>>3,o=Math.ceil(n*s/8),l=new Uint8Array(i*o),c=0,u=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],f=[8,8,4,4,2,2,1],p=0;p<7;){for(var m=d[p],g=f[p],v=0,b=0,y=u[p];y<i;)y+=m,b++;for(var _=h[p];_<n;)_+=g,v++;var w=Math.ceil(v*s/8);e.decode._filterZero(t,r,c,v,b);for(var x=0,S=u[p];S<i;){for(var C=h[p],k=c+x*w<<3;C<n;){var E;if(1==s&&(E=(E=t[k>>3])>>7-(7&k)&1,l[S*o+(C>>3)]|=E<<7-((3&C)<<0)),2==s&&(E=(E=t[k>>3])>>6-(7&k)&3,l[S*o+(C>>2)]|=E<<6-((3&C)<<1)),4==s&&(E=(E=t[k>>3])>>4-(7&k)&15,l[S*o+(C>>1)]|=E<<4-((1&C)<<2)),s>=8)for(var A=S*o+C*a,L=0;L<a;L++)l[A+L]=t[(k>>3)+L];k+=s,C+=g}x++,S+=m}v*b!=0&&(c+=b*(1+w)),p+=1}return l},e.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},e.decode._filterZero=function(t,r,n,i,s){var a=e.decode._getBPP(r),o=Math.ceil(i*a/8),l=e.decode._paeth;a=Math.ceil(a/8);for(var c=0;c<s;c++){var u=n+c*o,h=u+c+1,d=t[h-1];if(0==d)for(var f=0;f<o;f++)t[u+f]=t[h+f];else if(1==d){for(f=0;f<a;f++)t[u+f]=t[h+f];for(f=a;f<o;f++)t[u+f]=t[h+f]+t[u+f-a]&255}else if(0==c){for(f=0;f<a;f++)t[u+f]=t[h+f];if(2==d)for(f=a;f<o;f++)t[u+f]=255&t[h+f];if(3==d)for(f=a;f<o;f++)t[u+f]=t[h+f]+(t[u+f-a]>>1)&255;if(4==d)for(f=a;f<o;f++)t[u+f]=t[h+f]+l(t[u+f-a],0,0)&255}else{if(2==d)for(f=0;f<o;f++)t[u+f]=t[h+f]+t[u+f-o]&255;if(3==d){for(f=0;f<a;f++)t[u+f]=t[h+f]+(t[u+f-o]>>1)&255;for(f=a;f<o;f++)t[u+f]=t[h+f]+(t[u+f-o]+t[u+f-a]>>1)&255}if(4==d){for(f=0;f<a;f++)t[u+f]=t[h+f]+l(0,t[u+f-o],0)&255;for(f=a;f<o;f++)t[u+f]=t[h+f]+l(t[u+f-a],t[u+f-o],t[u+f-a-o])&255}}}return t},e.decode._paeth=function(e,t,r){var n=e+t-r,i=Math.abs(n-e),s=Math.abs(n-t),a=Math.abs(n-r);return i<=s&&i<=a?e:s<=a?t:r},e.decode._IHDR=function(t,r,n){var i=e._bin;n.width=i.readUint(t,r),r+=4,n.height=i.readUint(t,r),r+=4,n.depth=t[r],r++,n.ctype=t[r],r++,n.compress=t[r],r++,n.filter=t[r],r++,n.interlace=t[r],r++},e._bin={nextZero:function(e,t){for(;0!=e[t];)t++;return t},readUshort:function(e,t){return e[t]<<8|e[t+1]},writeUshort:function(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},readUint:function(e,t){return 16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII:function(e,t,r){for(var n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},readBytes:function(e,t,r){for(var n=[],i=0;i<r;i++)n.push(e[t+i]);return n},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(t,r,n){for(var i,s="",a=0;a<n;a++)s+="%"+e._bin.pad(t[r+a].toString(16));try{i=decodeURIComponent(s)}catch(o){return e._bin.readASCII(t,r,n)}return i}},e._copyTile=function(e,t,r,n,i,s,a,o,l){for(var c=Math.min(t,i),u=Math.min(r,s),h=0,d=0,f=0;f<u;f++)for(var p=0;p<c;p++)if(a>=0&&o>=0?(h=f*t+p<<2,d=(o+f)*i+a+p<<2):(h=(-o+f)*t-a+p<<2,d=f*i+p<<2),0==l)n[d]=e[h],n[d+1]=e[h+1],n[d+2]=e[h+2],n[d+3]=e[h+3];else if(1==l){var m=e[h+3]*(1/255),g=e[h]*m,v=e[h+1]*m,b=e[h+2]*m,y=n[d+3]*(1/255),_=n[d]*y,w=n[d+1]*y,x=n[d+2]*y,S=1-m,C=m+y*S,k=0==C?0:1/C;n[d+3]=255*C,n[d+0]=(g+_*S)*k,n[d+1]=(v+w*S)*k,n[d+2]=(b+x*S)*k}else if(2==l)m=e[h+3],g=e[h],v=e[h+1],b=e[h+2],y=n[d+3],_=n[d],w=n[d+1],x=n[d+2],m==y&&g==_&&v==w&&b==x?(n[d]=0,n[d+1]=0,n[d+2]=0,n[d+3]=0):(n[d]=g,n[d+1]=v,n[d+2]=b,n[d+3]=m);else if(3==l){if(m=e[h+3],g=e[h],v=e[h+1],b=e[h+2],y=n[d+3],_=n[d],w=n[d+1],x=n[d+2],m==y&&g==_&&v==w&&b==x)continue;if(m<220&&y>20)return!1}return!0},e.encode=function(t,r,n,i,s,a){null==i&&(i=0),null==a&&(a=!1);for(var o=new Uint8Array(t[0].byteLength*t.length+100),l=[137,80,78,71,13,10,26,10],c=0;c<8;c++)o[c]=l[c];var u=8,h=e._bin,d=e.crc.crc,f=h.writeUint,p=h.writeUshort,m=h.writeASCII,g=e.encode.compressPNG(t,r,n,i,a);f(o,u,13),m(o,u+=4,"IHDR"),f(o,u+=4,r),f(o,u+=4,n),o[u+=4]=g.depth,o[++u]=g.ctype,o[++u]=0,o[++u]=0,o[++u]=0,f(o,++u,d(o,u-17,17)),f(o,u+=4,1),m(o,u+=4,"sRGB"),o[u+=4]=1,f(o,++u,d(o,u-5,5)),u+=4;var v=t.length>1;if(v&&(f(o,u,8),m(o,u+=4,"acTL"),f(o,u+=4,t.length),f(o,u+=4,0),f(o,u+=4,d(o,u-12,12)),u+=4),3==g.ctype){for(f(o,u,3*(E=g.plte.length)),m(o,u+=4,"PLTE"),u+=4,c=0;c<E;c++){var b=3*c,y=g.plte[c],_=255&y,w=y>>8&255,x=y>>16&255;o[u+b+0]=_,o[u+b+1]=w,o[u+b+2]=x}if(f(o,u+=3*E,d(o,u-3*E-4,3*E+4)),u+=4,g.gotAlpha){for(f(o,u,E),m(o,u+=4,"tRNS"),u+=4,c=0;c<E;c++)o[u+c]=g.plte[c]>>24&255;f(o,u+=E,d(o,u-E-4,E+4)),u+=4}}for(var S=0,C=0;C<g.frames.length;C++){var k=g.frames[C];v&&(f(o,u,26),m(o,u+=4,"fcTL"),f(o,u+=4,S++),f(o,u+=4,k.rect.width),f(o,u+=4,k.rect.height),f(o,u+=4,k.rect.x),f(o,u+=4,k.rect.y),p(o,u+=4,s[C]),p(o,u+=2,1e3),o[u+=2]=k.dispose,o[++u]=k.blend,f(o,++u,d(o,u-30,30)),u+=4);var E,A=k.cimg;f(o,u,(E=A.length)+(0==C?0:4));var L=u+=4;for(m(o,u,0==C?"IDAT":"fdAT"),u+=4,0!=C&&(f(o,u,S++),u+=4),c=0;c<E;c++)o[u+c]=A[c];f(o,u+=E,d(o,L,u-L)),u+=4}return f(o,u,0),m(o,u+=4,"IEND"),f(o,u+=4,d(o,u-4,4)),u+=4,o.buffer.slice(0,u)},e.encode.compressPNG=function(t,r,n,i,s){for(var a=e.encode.compress(t,r,n,i,!1,s),o=0;o<t.length;o++){var l=a.frames[o],c=(l.rect.width,l.rect.height),u=l.bpl,h=l.bpp,d=new Uint8Array(c*u+c);l.cimg=e.encode._filterZero(l.img,c,h,u,d)}return a},e.encode.compress=function(t,r,n,i,s,a){null==a&&(a=!1);for(var o=6,l=8,c=4,u=255,h=0;h<t.length;h++)for(var d=new Uint8Array(t[h]),f=d.length,p=0;p<f;p+=4)u&=d[p+3];var m=255!=u,g={},v=[];if(0!=t.length&&(g[0]=0,v.push(0),0!=i&&i--),0!=i){var b=e.quantize(t,i,s);for(t=b.bufs,p=0;p<b.plte.length;p++)null==g[_=b.plte[p].est.rgba]&&(g[_]=v.length,v.push(_))}else for(h=0;h<t.length;h++){var y=new Uint32Array(t[h]);for(f=y.length,p=0;p<f;p++){var _=y[p];if((p<r||_!=y[p-1]&&_!=y[p-r])&&null==g[_]&&(g[_]=v.length,v.push(_),v.length>=300))break}}var w=!!m&&s,x=v.length;x<=256&&0==a&&(l=x<=2?1:x<=4?2:x<=16?4:8,s&&(l=8),m=!0);var S=[];for(h=0;h<t.length;h++){var C=new Uint8Array(t[h]),k=new Uint32Array(C.buffer),E=0,A=0,L=r,M=n,z=0;if(0!=h&&!w){for(var T=s||1==h||2==S[S.length-2].dispose?1:2,O=0,P=1e9,D=0;D<T;D++){for(var N=new Uint8Array(t[h-1-D]),F=new Uint32Array(t[h-1-D]),R=r,I=n,j=-1,G=-1,B=0;B<n;B++)for(var U=0;U<r;U++)k[p=B*r+U]!=F[p]&&(U<R&&(R=U),U>j&&(j=U),B<I&&(I=B),B>G&&(G=B));var W=-1==j?1:(j-R+1)*(G-I+1);W<P&&(P=W,O=D,-1==j?(E=A=0,L=M=1):(E=R,A=I,L=j-R+1,M=G-I+1))}N=new Uint8Array(t[h-1-O]),1==O&&(S[S.length-1].dispose=2);var V=new Uint8Array(L*M*4);new Uint32Array(V.buffer),e._copyTile(N,r,n,V,L,M,-E,-A,0),e._copyTile(C,r,n,V,L,M,-E,-A,3)?(e._copyTile(C,r,n,V,L,M,-E,-A,2),z=1):(e._copyTile(C,r,n,V,L,M,-E,-A,0),z=0),C=V,k=new Uint32Array(C.buffer)}var H=4*L;if(x<=256&&0==a){for(H=Math.ceil(l*L/8),V=new Uint8Array(H*M),B=0;B<M;B++){p=B*H;var q=B*L;if(8==l)for(U=0;U<L;U++)V[p+U]=g[k[q+U]];else if(4==l)for(U=0;U<L;U++)V[p+(U>>1)]|=g[k[q+U]]<<4-4*(1&U);else if(2==l)for(U=0;U<L;U++)V[p+(U>>2)]|=g[k[q+U]]<<6-2*(3&U);else if(1==l)for(U=0;U<L;U++)V[p+(U>>3)]|=g[k[q+U]]<<7-1*(7&U)}C=V,o=3,c=1}else if(0==m&&1==t.length){V=new Uint8Array(L*M*3);var Y=L*M;for(p=0;p<Y;p++){var Z=3*p,X=4*p;V[Z]=C[X],V[Z+1]=C[X+1],V[Z+2]=C[X+2]}C=V,o=2,c=3,H=3*L}S.push({rect:{x:E,y:A,width:L,height:M},img:C,bpl:H,bpp:c,blend:z,dispose:w?1:0})}return{ctype:o,depth:l,plte:v,gotAlpha:m,frames:S}},e.encode._filterZero=function(r,n,i,s,a){for(var o=[],l=0;l<5;l++)if(!(n*s>5e5)||2!=l&&3!=l&&4!=l){for(var c=0;c<n;c++)e.encode._filterLine(a,r,c,s,i,l);if(o.push(t.deflate(a)),1==i)break}for(var u,h=1e9,d=0;d<o.length;d++)o[d].length<h&&(u=d,h=o[d].length);return o[u]},e.encode._filterLine=function(t,r,n,i,s,a){var o=n*i,l=o+n,c=e.decode._paeth;if(t[l]=a,l++,0==a)for(var u=0;u<i;u++)t[l+u]=r[o+u];else if(1==a){for(u=0;u<s;u++)t[l+u]=r[o+u];for(u=s;u<i;u++)t[l+u]=r[o+u]-r[o+u-s]+256&255}else if(0==n){for(u=0;u<s;u++)t[l+u]=r[o+u];if(2==a)for(u=s;u<i;u++)t[l+u]=r[o+u];if(3==a)for(u=s;u<i;u++)t[l+u]=r[o+u]-(r[o+u-s]>>1)+256&255;if(4==a)for(u=s;u<i;u++)t[l+u]=r[o+u]-c(r[o+u-s],0,0)+256&255}else{if(2==a)for(u=0;u<i;u++)t[l+u]=r[o+u]+256-r[o+u-i]&255;if(3==a){for(u=0;u<s;u++)t[l+u]=r[o+u]+256-(r[o+u-i]>>1)&255;for(u=s;u<i;u++)t[l+u]=r[o+u]+256-(r[o+u-i]+r[o+u-s]>>1)&255}if(4==a){for(u=0;u<s;u++)t[l+u]=r[o+u]+256-c(0,r[o+u-i],0)&255;for(u=s;u<i;u++)t[l+u]=r[o+u]+256-c(r[o+u-s],r[o+u-i],r[o+u-s-i])&255}}},e.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var r=t,n=0;n<8;n++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update:function(t,r,n,i){for(var s=0;s<i;s++)t=e.crc.table[255&(t^r[n+s])]^t>>>8;return t},crc:function(t,r,n){return 4294967295^e.crc.update(4294967295,t,r,n)}},e.quantize=function(t,r,n){for(var i=[],s=0,a=0;a<t.length;a++)i.push(e.encode.alphaMul(new Uint8Array(t[a]),n)),s+=t[a].byteLength;var o=new Uint8Array(s),l=new Uint32Array(o.buffer),c=0;for(a=0;a<i.length;a++){for(var u=i[a],h=u.length,d=0;d<h;d++)o[c+d]=u[d];c+=h}var f={i0:0,i1:o.length,bst:null,est:null,tdst:0,left:null,right:null};f.bst=e.quantize.stats(o,f.i0,f.i1),f.est=e.quantize.estats(f.bst);for(var p=[f];p.length<r;){var m=0,g=0;for(a=0;a<p.length;a++)p[a].est.L>m&&(m=p[a].est.L,g=a);if(m<.001)break;var v=p[g],b=e.quantize.splitPixels(o,l,v.i0,v.i1,v.est.e,v.est.eMq255),y={i0:v.i0,i1:b,bst:null,est:null,tdst:0,left:null,right:null};y.bst=e.quantize.stats(o,y.i0,y.i1),y.est=e.quantize.estats(y.bst);var _={i0:b,i1:v.i1,bst:null,est:null,tdst:0,left:null,right:null};for(_.bst={R:[],m:[],N:v.bst.N-y.bst.N},a=0;a<16;a++)_.bst.R[a]=v.bst.R[a]-y.bst.R[a];for(a=0;a<4;a++)_.bst.m[a]=v.bst.m[a]-y.bst.m[a];_.est=e.quantize.estats(_.bst),v.left=y,v.right=_,p[g]=y,p.push(_)}p.sort((function(e,t){return t.bst.N-e.bst.N}));for(var w=0;w<i.length;w++){var x=e.quantize.planeDst,S=new Uint8Array(i[w].buffer),C=new Uint32Array(i[w].buffer),k=S.length;for(a=0;a<k;a+=4){for(var E=S[a]*(1/255),A=S[a+1]*(1/255),L=S[a+2]*(1/255),M=S[a+3]*(1/255),z=f;z.left;)z=x(z.est,E,A,L,M)<=0?z.left:z.right;C[a>>2]=z.est.rgba}i[w]=C.buffer}return{bufs:i,plte:p}},e.quantize.getNearest=function(t,r,n,i,s){if(null==t.left)return t.tdst=e.quantize.dist(t.est.q,r,n,i,s),t;var a=e.quantize.planeDst(t.est,r,n,i,s),o=t.left,l=t.right;a>0&&(o=t.right,l=t.left);var c=e.quantize.getNearest(o,r,n,i,s);if(c.tdst<=a*a)return c;var u=e.quantize.getNearest(l,r,n,i,s);return u.tdst<c.tdst?u:c},e.quantize.planeDst=function(e,t,r,n,i){var s=e.e;return s[0]*t+s[1]*r+s[2]*n+s[3]*i-e.eMq},e.quantize.dist=function(e,t,r,n,i){var s=t-e[0],a=r-e[1],o=n-e[2],l=i-e[3];return s*s+a*a+o*o+l*l},e.quantize.splitPixels=function(t,r,n,i,s,a){var o=e.quantize.vecDot;for(i-=4;n<i;){for(;o(t,n,s)<=a;)n+=4;for(;o(t,i,s)>a;)i-=4;if(n>=i)break;var l=r[n>>2];r[n>>2]=r[i>>2],r[i>>2]=l,n+=4,i-=4}for(;o(t,n,s)>a;)n-=4;return n+4},e.quantize.vecDot=function(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]},e.quantize.stats=function(e,t,r){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],s=r-t>>2,a=t;a<r;a+=4){var o=e[a]*(1/255),l=e[a+1]*(1/255),c=e[a+2]*(1/255),u=e[a+3]*(1/255);i[0]+=o,i[1]+=l,i[2]+=c,i[3]+=u,n[0]+=o*o,n[1]+=o*l,n[2]+=o*c,n[3]+=o*u,n[5]+=l*l,n[6]+=l*c,n[7]+=l*u,n[10]+=c*c,n[11]+=c*u,n[15]+=u*u}return n[4]=n[1],n[8]=n[2],n[12]=n[3],n[9]=n[6],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:s}},e.quantize.estats=function(t){var r=t.R,n=t.m,i=t.N,s=n[0],a=n[1],o=n[2],l=n[3],c=0==i?0:1/i,u=[r[0]-s*s*c,r[1]-s*a*c,r[2]-s*o*c,r[3]-s*l*c,r[4]-a*s*c,r[5]-a*a*c,r[6]-a*o*c,r[7]-a*l*c,r[8]-o*s*c,r[9]-o*a*c,r[10]-o*o*c,r[11]-o*l*c,r[12]-l*s*c,r[13]-l*a*c,r[14]-l*o*c,r[15]-l*l*c],h=u,d=e.M4,f=[.5,.5,.5,.5],p=0,m=0;if(0!=i)for(var g=0;g<10&&(f=d.multVec(h,f),m=Math.sqrt(d.dot(f,f)),f=d.sml(1/m,f),!(Math.abs(m-p)<1e-9));g++)p=m;var v=[s*c,a*c,o*c,l*c],b=d.dot(d.sml(255,v),f),y=v[3]<.001?0:1/v[3];return{Cov:u,q:v,e:f,L:p,eMq255:b,eMq:d.dot(f,v),rgba:(Math.round(255*v[3])<<24|Math.round(255*v[2]*y)<<16|Math.round(255*v[1]*y)<<8|Math.round(255*v[0]*y)<<0)>>>0}},e.M4={multVec:function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]]},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sml:function(e,t){return[e*t[0],e*t[1],e*t[2],e*t[3]]}},e.encode.alphaMul=function(e,t){for(var r=new Uint8Array(e.length),n=e.length>>2,i=0;i<n;i++){var s=i<<2,a=e[s+3];t&&(a=a<128?0:255);var o=a*(1/255);r[s+0]=e[s+0]*o,r[s+1]=e[s+1]*o,r[s+2]=e[s+2]*o,r[s+3]=a}return r}}(t,r("./node_modules/upng-js/node_modules/pako/index.js"))}()},
vendor: 367 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/index.js":(e,t,r)=>{"use strict";var n={};(0,r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js").assign)(n,r("./node_modules/upng-js/node_modules/pako/lib/deflate.js"),r("./node_modules/upng-js/node_modules/pako/lib/inflate.js"),r("./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js")),e.exports=n},
vendor: 2,509 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/deflate.js":(e,t,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js"),i=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/utils/strings.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js"),l=Object.prototype.toString,c=0,u=-1,h=0,d=8;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({level:u,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==c)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"===typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==c)throw new Error(a[r]);this._dict_set=!0}}function p(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(e,t){var r,a,o=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"===typeof e?o.input=s.string2buf(e):"[object ArrayBuffer]"===l.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new i.Buf8(u),o.next_out=0,o.avail_out=u),1!==(r=n.deflate(o,a))&&r!==c)return this.onEnd(r),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(s.buf2binstring(i.shrinkBuf(o.output,o.next_out))):this.onData(i.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===c):2!==a||(this.onEnd(c),o.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=f,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},
vendor: 3,159 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/inflate.js":(e,t,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js"),i=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/utils/strings.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"),l=r("./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js"),c=r("./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js"),u=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(o[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"===typeof t.dictionary?t.dictionary=s.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(o[r])}function d(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,o,l,c,h,d=this.strm,f=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"===typeof e?d.input=s.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(f),d.next_out=0,d.avail_out=f),(r=n.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===m&&(r=a.Z_OK,m=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==a.Z_STREAM_END&&(0!==d.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=s.utf8border(d.output,d.next_out),c=d.next_out-l,h=s.buf2string(d.output,l),d.next_out=c,d.avail_out=f-c,c&&i.arraySet(d.output,d.output,l,c,0),this.onData(h)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=h,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},
vendor: 1,165 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/utils/common.js":(e,t)=>{"use strict";var r="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!==typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){var t,r,n,i,s,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)s=e[t],a.set(s,i),i+=s.length;return a}},s={arraySet:function(e,t,r,n,i){for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(r)},
vendor: 1,797 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/utils/strings.js":(e,t,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(c){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(c){s=!1}for(var a=new n.Buf8(256),o=0;o<256;o++)a[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&s||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,t.string2buf=function(e){var t,r,i,s,a,o=e.length,l=0;for(s=0;s<o;s++)55296===(64512&(r=e.charCodeAt(s)))&&s+1<o&&56320===(64512&(i=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),a=0,s=0;a<l;s++)55296===(64512&(r=e.charCodeAt(s)))&&s+1<o&&56320===(64512&(i=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,s,o=t||e.length,c=new Array(2*o);for(n=0,r=0;r<o;)if((i=e[r++])<128)c[n++]=i;else if((s=a[i])>4)c[n++]=65533,r+=s-1;else{for(i&=2===s?31:3===s?15:7;s>1&&r<o;)i=i<<6|63&e[r++],s--;s>1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return l(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128===(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},
vendor: 246 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js":e=>{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{s=s+(i=i+t[n++]|0)|0}while(--a);i%=65521,s%=65521}return i|s<<16|0}},
vendor: 477 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js":e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},
vendor: 302 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js":e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var s=t,a=i+n;e^=-1;for(var o=i;o<a;o++)e=e>>>8^s[255&(e^r[o])];return-1^e}},
vendor: 14,472 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js":(e,t,r)=>{"use strict";var n,i=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js"),l=r("./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"),c=0,u=4,h=0,d=-2,f=-1,p=4,m=2,g=8,v=9,b=286,y=30,_=19,w=2*b+1,x=15,S=3,C=258,k=C+S+1,E=42,A=103,L=113,M=666,z=1,T=2,O=3,P=4;function D(e,t){return e.msg=l[t],t}function N(e){return(e<<1)-(e>4?9:0)}function F(e){for(var t=e.length;--t>=0;)e[t]=0}function R(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function I(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function G(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function B(e,t,r,n){var s=e.avail_in;return s>n&&(s=n),0===s?0:(e.avail_in-=s,i.arraySet(t,e.input,e.next_in,s,r),1===e.state.wrap?e.adler=a(e.adler,t,s,r):2===e.state.wrap&&(e.adler=o(e.adler,t,s,r)),e.next_in+=s,e.total_in+=s,s)}function U(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-k?e.strstart-(e.w_size-k):0,c=e.window,u=e.w_mask,h=e.prev,d=e.strstart+C,f=c[s+a-1],p=c[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(c[(r=t)+a]===p&&c[r+a-1]===f&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<d);if(n=C-(d-s),s=d-C,n>a){if(e.match_start=t,a=n,n>=o)break;f=c[s+a-1],p=c[s+a]}}}while((t=h[t&u])>l&&0!==--i);return a<=e.lookahead?a:e.lookahead}function W(e){var t,r,n,s,a,o=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-k)){i.arraySet(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=o?n-o:0}while(--r);t=r=o;do{n=e.prev[--t],e.prev[t]=n>=o?n-o:0}while(--r);s+=o}if(0===e.strm.avail_in)break;if(r=B(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=r,e.lookahead+e.insert>=S)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+S-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<S)););}while(e.lookahead<k&&0!==e.strm.avail_in)}function V(e,t){for(var r,n;;){if(e.lookahead<k){if(W(e),e.lookahead<k&&t===c)return z;if(0===e.lookahead)break}if(r=0,e.lookahead>=S&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-k&&(e.match_length=U(e,r)),e.match_length>=S)if(n=s._tr_tally(e,e.strstart-e.match_start,e.match_length-S),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=S){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(I(e,!1),0===e.strm.avail_out))return z}return e.insert=e.strstart<S-1?e.strstart:S-1,t===u?(I(e,!0),0===e.strm.avail_out?O:P):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?z:T}function H(e,t){for(var r,n,i;;){if(e.lookahead<k){if(W(e),e.lookahead<k&&t===c)return z;if(0===e.lookahead)break}if(r=0,e.lookahead>=S&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=S-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-k&&(e.match_length=U(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===S&&e.strstart-e.match_start>4096)&&(e.match_length=S-1)),e.prev_length>=S&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-S,n=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-S),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=S-1,e.strstart++,n&&(I(e,!1),0===e.strm.avail_out))return z}else if(e.match_available){if((n=s._tr_tally(e,0,e.window[e.strstart-1]))&&I(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return z}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<S-1?e.strstart:S-1,t===u?(I(e,!0),0===e.strm.avail_out?O:P):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?z:T}function q(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function Y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*w),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*_+1)),F(this.dyn_ltree),F(this.dyn_dtree),F(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(x+1),this.heap=new i.Buf16(2*b+1),F(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*b+1),F(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Z(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:L,e.adler=2===t.wrap?0:1,t.last_flush=c,s._tr_init(t),h):D(e,d)}function X(e){var t,r=Z(e);return r===h&&((t=e.state).window_size=2*t.w_size,F(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=S-1,t.match_available=0,t.ins_h=0),r}function K(e,t,r,n,s,a){if(!e)return d;var o=1;if(t===f&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),s<1||s>v||r!==g||n<8||n>15||t<0||t>9||a<0||a>p)return D(e,d);8===n&&(n=9);var l=new Y;return e.state=l,l.strm=e,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+S-1)/S),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=r,X(e)}n=[new q(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(W(e),0===e.lookahead&&t===c)return z;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,I(e,!1),0===e.strm.avail_out))return z;if(e.strstart-e.block_start>=e.w_size-k&&(I(e,!1),0===e.strm.avail_out))return z}return e.insert=0,t===u?(I(e,!0),0===e.strm.avail_out?O:P):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),z)})),new q(4,4,8,4,V),new q(4,5,16,8,V),new q(4,6,32,32,V),new q(4,4,16,16,H),new q(8,16,32,32,H),new q(8,16,128,128,H),new q(8,32,128,256,H),new q(32,128,258,1024,H),new q(32,258,258,4096,H)],t.deflateInit=function(e,t){return K(e,t,g,15,8,0)},t.deflateInit2=K,t.deflateReset=X,t.deflateResetKeep=Z,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,h):d},t.deflate=function(e,t){var r,i,a,l;if(!e||!e.state||t>5||t<0)return e?D(e,d):d;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===M&&t!==u)return D(e,0===e.avail_out?-5:d);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,j(i,31),j(i,139),j(i,8),i.gzhead?(j(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),j(i,255&i.gzhead.time),j(i,i.gzhead.time>>8&255),j(i,i.gzhead.time>>16&255),j(i,i.gzhead.time>>24&255),j(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),j(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(j(i,255&i.gzhead.extra.length),j(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=o(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(j(i,0),j(i,0),j(i,0),j(i,0),j(i,0),j(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),j(i,3),i.status=L);else{var f=g+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=L,G(i,f),0!==i.strstart&&(G(i,e.adler>>>16),G(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=o(e.adler,i.pending_buf,i.pending-a,a)),R(e),a=i.pending,i.pending!==i.pending_buf_size));)j(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=o(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=o(e.adler,i.pending_buf,i.pending-a,a)),R(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,j(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=o(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=o(e.adler,i.pending_buf,i.pending-a,a)),R(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,j(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=o(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=A)}else i.status=A;if(i.status===A&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(j(i,255&e.adler),j(i,e.adler>>8&255),e.adler=0,i.status=L)):i.status=L),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,h}else if(0===e.avail_in&&N(t)<=N(r)&&t!==u)return D(e,-5);if(i.status===M&&0!==e.avail_in)return D(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&i.status!==M){var p=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(W(e),0===e.lookahead)){if(t===c)return z;break}if(e.match_length=0,r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(I(e,!1),0===e.strm.avail_out))return z}return e.insert=0,t===u?(I(e,!0),0===e.strm.avail_out?O:P):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?z:T}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=C){if(W(e),e.lookahead<=C&&t===c)return z;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=S&&e.strstart>0&&(n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){a=e.strstart+C;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=C-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=S?(r=s._tr_tally(e,1,e.match_length-S),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(I(e,!1),0===e.strm.avail_out))return z}return e.insert=0,t===u?(I(e,!0),0===e.strm.avail_out?O:P):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?z:T}(i,t):n[i.level].func(i,t);if(p!==O&&p!==P||(i.status=M),p===z||p===O)return 0===e.avail_out&&(i.last_flush=-1),h;if(p===T&&(1===t?s._tr_align(i):5!==t&&(s._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,h}return t!==u?h:i.wrap<=0?1:(2===i.wrap?(j(i,255&e.adler),j(i,e.adler>>8&255),j(i,e.adler>>16&255),j(i,e.adler>>24&255),j(i,255&e.total_in),j(i,e.total_in>>8&255),j(i,e.total_in>>16&255),j(i,e.total_in>>24&255)):(G(i,e.adler>>>16),G(i,65535&e.adler)),R(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?h:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&t!==A&&t!==L&&t!==M?D(e,d):(e.state=null,t===L?D(e,-3):h):d},t.deflateSetDictionary=function(e,t){var r,n,s,o,l,c,u,f,p=t.length;if(!e||!e.state)return d;if(2===(o=(r=e.state).wrap)||1===o&&r.status!==E||r.lookahead)return d;for(1===o&&(e.adler=a(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===o&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,t,p-r.w_size,r.w_size,0),t=f,p=r.w_size),l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,W(r);r.lookahead>=S;){n=r.strstart,s=r.lookahead-(S-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+S-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--s);r.strstart=n,r.lookahead=S-1,W(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=S-1,r.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,r.wrap=o,h},t.deflateInfo="pako deflate (from Nodeca project)"},
vendor: 239 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js":e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},
vendor: 1,856 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js":e=>{"use strict";e.exports=function(e,t){var r,n,i,s,a,o,l,c,u,h,d,f,p,m,g,v,b,y,_,w,x,S,C,k,E;r=e.state,n=e.next_in,k=e.input,i=n+(e.avail_in-5),s=e.next_out,E=e.output,a=s-(t-e.avail_out),o=s+(e.avail_out-257),l=r.dmax,c=r.wsize,u=r.whave,h=r.wnext,d=r.window,f=r.hold,p=r.bits,m=r.lencode,g=r.distcode,v=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(f+=k[n++]<<p,p+=8,f+=k[n++]<<p,p+=8),y=m[f&v];t:for(;;){if(f>>>=_=y>>>24,p-=_,0===(_=y>>>16&255))E[s++]=65535&y;else{if(!(16&_)){if(0===(64&_)){y=m[(65535&y)+(f&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(p<_&&(f+=k[n++]<<p,p+=8),w+=f&(1<<_)-1,f>>>=_,p-=_),p<15&&(f+=k[n++]<<p,p+=8,f+=k[n++]<<p,p+=8),y=g[f&b];r:for(;;){if(f>>>=_=y>>>24,p-=_,!(16&(_=y>>>16&255))){if(0===(64&_)){y=g[(65535&y)+(f&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(x=65535&y,p<(_&=15)&&(f+=k[n++]<<p,(p+=8)<_&&(f+=k[n++]<<p,p+=8)),(x+=f&(1<<_)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(f>>>=_,p-=_,x>(_=s-a)){if((_=x-_)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,C=d,0===h){if(S+=c-_,_<w){w-=_;do{E[s++]=d[S++]}while(--_);S=s-x,C=E}}else if(h<_){if(S+=c+h-_,(_-=h)<w){w-=_;do{E[s++]=d[S++]}while(--_);if(S=0,h<w){w-=_=h;do{E[s++]=d[S++]}while(--_);S=s-x,C=E}}}else if(S+=h-_,_<w){w-=_;do{E[s++]=d[S++]}while(--_);S=s-x,C=E}for(;w>2;)E[s++]=C[S++],E[s++]=C[S++],E[s++]=C[S++],w-=3;w&&(E[s++]=C[S++],w>1&&(E[s++]=C[S++]))}else{S=s-x;do{E[s++]=E[S++],E[s++]=E[S++],E[s++]=E[S++],w-=3}while(w>2);w&&(E[s++]=E[S++],w>1&&(E[s++]=E[S++]))}break}}break}}while(n<i&&s<o);n-=w=p>>3,f&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=s<o?o-s+257:257-(s-o),r.hold=f,r.bits=p}},
vendor: 11,528 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js":(e,t,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=r("./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js"),l=1,c=2,u=0,h=-2,d=1,f=12,p=30,m=852,g=592;function v(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=d,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(m),t.distcode=t.distdyn=new n.Buf32(g),t.sane=1,t.back=-1,u):h}function _(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,y(e)):h}function w(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,_(e))):h}function x(e,t){var r,n;return e?(n=new b,e.state=n,n.window=null,(r=w(e,t))!==u&&(e.state=null),r):h}var S,C,k=!0;function E(e){if(k){var t;for(S=new n.Buf32(512),C=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(l,e.lens,0,288,S,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(c,e.lens,0,32,C,0,e.work,{bits:5}),k=!1}e.lencode=S,e.lenbits=9,e.distcode=C,e.distbits=5}function A(e,t,r,i){var s,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((s=a.wsize-a.wnext)>i&&(s=i),n.arraySet(a.window,t,r-i,s,a.wnext),(i-=s)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=s))),0}t.inflateReset=_,t.inflateReset2=w,t.inflateResetKeep=y,t.inflateInit=function(e){return x(e,15)},t.inflateInit2=x,t.inflate=function(e,t){var r,m,g,b,y,_,w,x,S,C,k,L,M,z,T,O,P,D,N,F,R,I,j,G,B=0,U=new n.Buf8(4),W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return h;(r=e.state).mode===f&&(r.mode=13),y=e.next_out,g=e.output,w=e.avail_out,b=e.next_in,m=e.input,_=e.avail_in,x=r.hold,S=r.bits,C=_,k=w,I=u;e:for(;;)switch(r.mode){case d:if(0===r.wrap){r.mode=13;break}for(;S<16;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(2&r.wrap&&35615===x){r.check=0,U[0]=255&x,U[1]=x>>>8&255,r.check=s(r.check,U,2,0),x=0,S=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&x)<<8)+(x>>8))%31){e.msg="incorrect header check",r.mode=p;break}if(8!==(15&x)){e.msg="unknown compression method",r.mode=p;break}if(S-=4,R=8+(15&(x>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=p;break}r.dmax=1<<R,e.adler=r.check=1,r.mode=512&x?10:f,x=0,S=0;break;case 2:for(;S<16;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(r.flags=x,8!==(255&r.flags)){e.msg="unknown compression method",r.mode=p;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=p;break}r.head&&(r.head.text=x>>8&1),512&r.flags&&(U[0]=255&x,U[1]=x>>>8&255,r.check=s(r.check,U,2,0)),x=0,S=0,r.mode=3;case 3:for(;S<32;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}r.head&&(r.head.time=x),512&r.flags&&(U[0]=255&x,U[1]=x>>>8&255,U[2]=x>>>16&255,U[3]=x>>>24&255,r.check=s(r.check,U,4,0)),x=0,S=0,r.mode=4;case 4:for(;S<16;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}r.head&&(r.head.xflags=255&x,r.head.os=x>>8),512&r.flags&&(U[0]=255&x,U[1]=x>>>8&255,r.check=s(r.check,U,2,0)),x=0,S=0,r.mode=5;case 5:if(1024&r.flags){for(;S<16;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}r.length=x,r.head&&(r.head.extra_len=x),512&r.flags&&(U[0]=255&x,U[1]=x>>>8&255,r.check=s(r.check,U,2,0)),x=0,S=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((L=r.length)>_&&(L=_),L&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,m,b,L,R)),512&r.flags&&(r.check=s(r.check,m,L,b)),_-=L,b+=L,r.length-=L),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===_)break e;L=0;do{R=m[b+L++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&L<_);if(512&r.flags&&(r.check=s(r.check,m,L,b)),_-=L,b+=L,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===_)break e;L=0;do{R=m[b+L++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R))}while(R&&L<_);if(512&r.flags&&(r.check=s(r.check,m,L,b)),_-=L,b+=L,R)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;S<16;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(x!==(65535&r.check)){e.msg="header crc mismatch",r.mode=p;break}x=0,S=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=f;break;case 10:for(;S<32;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}e.adler=r.check=v(x),x=0,S=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=y,e.avail_out=w,e.next_in=b,e.avail_in=_,r.hold=x,r.bits=S,2;e.adler=r.check=1,r.mode=f;case f:if(5===t||6===t)break e;case 13:if(r.last){x>>>=7&S,S-=7&S,r.mode=27;break}for(;S<3;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}switch(r.last=1&x,S-=1,3&(x>>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6===t){x>>>=2,S-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=p}x>>>=2,S-=2;break;case 14:for(x>>>=7&S,S-=7&S;S<32;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if((65535&x)!==(x>>>16^65535)){e.msg="invalid stored block lengths",r.mode=p;break}if(r.length=65535&x,x=0,S=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(L=r.length){if(L>_&&(L=_),L>w&&(L=w),0===L)break e;n.arraySet(g,m,b,L,y),_-=L,b+=L,w-=L,y+=L,r.length-=L;break}r.mode=f;break;case 17:for(;S<14;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(r.nlen=257+(31&x),x>>>=5,S-=5,r.ndist=1+(31&x),x>>>=5,S-=5,r.ncode=4+(15&x),x>>>=4,S-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=p;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;S<3;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}r.lens[W[r.have++]]=7&x,x>>>=3,S-=3}for(;r.have<19;)r.lens[W[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},I=o(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,I){e.msg="invalid code lengths set",r.mode=p;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;O=(B=r.lencode[x&(1<<r.lenbits)-1])>>>16&255,P=65535&B,!((T=B>>>24)<=S);){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(P<16)x>>>=T,S-=T,r.lens[r.have++]=P;else{if(16===P){for(G=T+2;S<G;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(x>>>=T,S-=T,0===r.have){e.msg="invalid bit length repeat",r.mode=p;break}R=r.lens[r.have-1],L=3+(3&x),x>>>=2,S-=2}else if(17===P){for(G=T+3;S<G;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}S-=T,R=0,L=3+(7&(x>>>=T)),x>>>=3,S-=3}else{for(G=T+7;S<G;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}S-=T,R=0,L=11+(127&(x>>>=T)),x>>>=7,S-=7}if(r.have+L>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=p;break}for(;L--;)r.lens[r.have++]=R}}if(r.mode===p)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=p;break}if(r.lenbits=9,j={bits:r.lenbits},I=o(l,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,I){e.msg="invalid literal/lengths set",r.mode=p;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},I=o(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,I){e.msg="invalid distances set",r.mode=p;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(_>=6&&w>=258){e.next_out=y,e.avail_out=w,e.next_in=b,e.avail_in=_,r.hold=x,r.bits=S,a(e,k),y=e.next_out,g=e.output,w=e.avail_out,b=e.next_in,m=e.input,_=e.avail_in,x=r.hold,S=r.bits,r.mode===f&&(r.back=-1);break}for(r.back=0;O=(B=r.lencode[x&(1<<r.lenbits)-1])>>>16&255,P=65535&B,!((T=B>>>24)<=S);){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(O&&0===(240&O)){for(D=T,N=O,F=P;O=(B=r.lencode[F+((x&(1<<D+N)-1)>>D)])>>>16&255,P=65535&B,!(D+(T=B>>>24)<=S);){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}x>>>=D,S-=D,r.back+=D}if(x>>>=T,S-=T,r.back+=T,r.length=P,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=f;break}if(64&O){e.msg="invalid literal/length code",r.mode=p;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(G=r.extra;S<G;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}r.length+=x&(1<<r.extra)-1,x>>>=r.extra,S-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(B=r.distcode[x&(1<<r.distbits)-1])>>>16&255,P=65535&B,!((T=B>>>24)<=S);){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(0===(240&O)){for(D=T,N=O,F=P;O=(B=r.distcode[F+((x&(1<<D+N)-1)>>D)])>>>16&255,P=65535&B,!(D+(T=B>>>24)<=S);){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}x>>>=D,S-=D,r.back+=D}if(x>>>=T,S-=T,r.back+=T,64&O){e.msg="invalid distance code",r.mode=p;break}r.offset=P,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(G=r.extra;S<G;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}r.offset+=x&(1<<r.extra)-1,x>>>=r.extra,S-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=p;break}r.mode=25;case 25:if(0===w)break e;if(L=k-w,r.offset>L){if((L=r.offset-L)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=p;break}L>r.wnext?(L-=r.wnext,M=r.wsize-L):M=r.wnext-L,L>r.length&&(L=r.length),z=r.window}else z=g,M=y-r.offset,L=r.length;L>w&&(L=w),w-=L,r.length-=L;do{g[y++]=z[M++]}while(--L);0===r.length&&(r.mode=21);break;case 26:if(0===w)break e;g[y++]=r.length,w--,r.mode=21;break;case 27:if(r.wrap){for(;S<32;){if(0===_)break e;_--,x|=m[b++]<<S,S+=8}if(k-=w,e.total_out+=k,r.total+=k,k&&(e.adler=r.check=r.flags?s(r.check,g,k,y-k):i(r.check,g,k,y-k)),k=w,(r.flags?x:v(x))!==r.check){e.msg="incorrect data check",r.mode=p;break}x=0,S=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;S<32;){if(0===_)break e;_--,x+=m[b++]<<S,S+=8}if(x!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=p;break}x=0,S=0}r.mode=29;case 29:I=1;break e;case p:I=-3;break e;case 31:return-4;default:return h}return e.next_out=y,e.avail_out=w,e.next_in=b,e.avail_in=_,r.hold=x,r.bits=S,(r.wsize||k!==e.avail_out&&r.mode<p&&(r.mode<27||4!==t))&&A(e,e.output,e.next_out,k-e.avail_out)?(r.mode=31,-4):(C-=e.avail_in,k-=e.avail_out,e.total_in+=C,e.total_out+=k,r.total+=k,r.wrap&&k&&(e.adler=r.check=r.flags?s(r.check,g,k,e.next_out-k):i(r.check,g,k,e.next_out-k)),e.data_type=r.bits+(r.last?64:0)+(r.mode===f?128:0)+(20===r.mode||15===r.mode?256:0),(0===C&&0===k||4===t)&&I===u&&(I=-5),I)},t.inflateEnd=function(e){if(!e||!e.state)return h;var t=e.state;return t.window&&(t.window=null),e.state=null,u},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0===(2&(r=e.state).wrap)?h:(r.head=t,t.done=!1,u):h},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?h:11===r.mode&&i(1,t,n,0)!==r.check?-3:A(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,u):h},t.inflateInfo="pako inflate (from Nodeca project)"},
vendor: 1,712 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js":(e,t,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=15,s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,c,u,h,d,f){var p,m,g,v,b,y,_,w,x,S=f.bits,C=0,k=0,E=0,A=0,L=0,M=0,z=0,T=0,O=0,P=0,D=null,N=0,F=new n.Buf16(16),R=new n.Buf16(16),I=null,j=0;for(C=0;C<=i;C++)F[C]=0;for(k=0;k<c;k++)F[t[r+k]]++;for(L=S,A=i;A>=1&&0===F[A];A--);if(L>A&&(L=A),0===A)return u[h++]=20971520,u[h++]=20971520,f.bits=1,0;for(E=1;E<A&&0===F[E];E++);for(L<E&&(L=E),T=1,C=1;C<=i;C++)if(T<<=1,(T-=F[C])<0)return-1;if(T>0&&(0===e||1!==A))return-1;for(R[1]=0,C=1;C<i;C++)R[C+1]=R[C]+F[C];for(k=0;k<c;k++)0!==t[r+k]&&(d[R[t[r+k]]++]=k);if(0===e?(D=I=d,y=19):1===e?(D=s,N-=257,I=a,j-=257,y=256):(D=o,I=l,y=-1),P=0,k=0,C=E,b=h,M=L,z=0,g=-1,v=(O=1<<L)-1,1===e&&O>852||2===e&&O>592)return 1;for(;;){_=C-z,d[k]<y?(w=0,x=d[k]):d[k]>y?(w=I[j+d[k]],x=D[N+d[k]]):(w=96,x=0),p=1<<C-z,E=m=1<<M;do{u[b+(P>>z)+(m-=p)]=_<<24|w<<16|x|0}while(0!==m);for(p=1<<C-1;P&p;)p>>=1;if(0!==p?(P&=p-1,P+=p):P=0,k++,0===--F[C]){if(C===A)break;C=t[r+d[k]]}if(C>L&&(P&v)!==g){for(0===z&&(z=L),b+=E,T=1<<(M=C-z);M+z<A&&!((T-=F[M+z])<=0);)M++,T<<=1;if(O+=1<<M,1===e&&O>852||2===e&&O>592)return 1;u[g=P&v]=L<<24|M<<16|b-h|0}}return 0!==P&&(u[b+P]=C-z<<24|64<<16|0),f.bits=L,0}},
vendor: 265 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js":e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},
vendor: 6,639 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js":(e,t,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=0,s=1;function a(e){for(var t=e.length;--t>=0;)e[t]=0}var o=0,l=29,c=256,u=c+1+l,h=30,d=19,f=2*u+1,p=15,m=16,g=7,v=256,b=16,y=17,_=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=new Array(2*(u+2));a(k);var E=new Array(2*h);a(E);var A=new Array(512);a(A);var L=new Array(256);a(L);var M=new Array(l);a(M);var z,T,O,P=new Array(h);function D(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function N(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function F(e){return e<256?A[e]:A[256+(e>>>7)]}function R(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,r){e.bi_valid>m-r?(e.bi_buf|=t<<e.bi_valid&65535,R(e,e.bi_buf),e.bi_buf=t>>m-e.bi_valid,e.bi_valid+=r-m):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function j(e,t,r){I(e,r[2*t],r[2*t+1])}function G(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function B(e,t,r){var n,i,s=new Array(p+1),a=0;for(n=1;n<=p;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=G(s[o]++,o))}}function U(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<h;t++)e.dyn_dtree[2*t]=0;for(t=0;t<d;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*v]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function W(e){e.bi_valid>8?R(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function V(e,t,r,n){var i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]}function H(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&V(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!V(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function q(e,t,r){var n,i,s,a,o=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===n?j(e,i,t):(j(e,(s=L[i])+c+1,t),0!==(a=w[s])&&I(e,i-=M[s],a),j(e,s=F(--n),r),0!==(a=x[s])&&I(e,n-=P[s],a))}while(o<e.last_lit);j(e,v,t)}function Y(e,t){var r,n,i,s=t.dyn_tree,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=f,r=0;r<l;r++)0!==s[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)H(e,s,r);i=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],H(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,H(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,v=0;for(s=0;s<=p;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<f;r++)(s=l[2*l[2*(n=e.heap[r])+1]+1]+1)>g&&(s=g,v++),l[2*n+1]=s,n>c||(e.bl_count[s]++,a=0,n>=m&&(a=d[n-m]),o=l[2*n],e.opt_len+=o*(s+a),h&&(e.static_len+=o*(u[2*n+1]+a)));if(0!==v){do{for(s=g-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[g]--,v-=2}while(v>0);for(s=g;0!==s;s--)for(n=e.bl_count[s];0!==n;)(i=e.heap[--r])>c||(l[2*i+1]!==s&&(e.opt_len+=(s-l[2*i+1])*l[2*i],l[2*i+1]=s),n--)}}(e,t),B(s,c,e.bl_count)}function Z(e,t,r){var n,i,s=-1,a=t[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++o<l&&i===a||(o<c?e.bl_tree[2*i]+=o:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[2*b]++):o<=10?e.bl_tree[2*y]++:e.bl_tree[2*_]++,o=0,s=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function X(e,t,r){var n,i,s=-1,a=t[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++o<l&&i===a)){if(o<c)do{j(e,i,e.bl_tree)}while(0!==--o);else 0!==i?(i!==s&&(j(e,i,e.bl_tree),o--),j(e,b,e.bl_tree),I(e,o-3,2)):o<=10?(j(e,y,e.bl_tree),I(e,o-3,3)):(j(e,_,e.bl_tree),I(e,o-11,7));o=0,s=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}a(P);var K=!1;function $(e,t,r,i){I(e,(o<<1)+(i?1:0),3),function(e,t,r,i){W(e),i&&(R(e,r),R(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}t._tr_init=function(e){K||(function(){var e,t,r,n,i,s=new Array(p+1);for(r=0,n=0;n<l-1;n++)for(M[n]=r,e=0;e<1<<w[n];e++)L[r++]=n;for(L[r-1]=n,i=0,n=0;n<16;n++)for(P[n]=i,e=0;e<1<<x[n];e++)A[i++]=n;for(i>>=7;n<h;n++)for(P[n]=i<<7,e=0;e<1<<x[n]-7;e++)A[256+i++]=n;for(t=0;t<=p;t++)s[t]=0;for(e=0;e<=143;)k[2*e+1]=8,e++,s[8]++;for(;e<=255;)k[2*e+1]=9,e++,s[9]++;for(;e<=279;)k[2*e+1]=7,e++,s[7]++;for(;e<=287;)k[2*e+1]=8,e++,s[8]++;for(B(k,u+1,s),e=0;e<h;e++)E[2*e+1]=5,E[2*e]=G(e,5);z=new D(k,w,c+1,u,p),T=new D(E,x,0,h,p),O=new D(new Array(0),S,0,d,g)}(),K=!0),e.l_desc=new N(e.dyn_ltree,z),e.d_desc=new N(e.dyn_dtree,T),e.bl_desc=new N(e.bl_tree,O),e.bi_buf=0,e.bi_valid=0,U(e)},t._tr_stored_block=$,t._tr_flush_block=function(e,t,r,n){var a,o,l=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return s;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return s;return i}(e)),Y(e,e.l_desc),Y(e,e.d_desc),l=function(e){var t;for(Z(e,e.dyn_ltree,e.l_desc.max_code),Z(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=d-1;t>=3&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=a&&(a=o)):a=o=r+5,r+4<=a&&-1!==t?$(e,t,r,n):4===e.strategy||o===a?(I(e,2+(n?1:0),3),q(e,k,E)):(I(e,4+(n?1:0),3),function(e,t,r,n){var i;for(I(e,t-257,5),I(e,r-1,5),I(e,n-4,4),i=0;i<n;i++)I(e,e.bl_tree[2*C[i]+1],3);X(e,e.dyn_ltree,t-1),X(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),q(e,e.dyn_ltree,e.dyn_dtree)),U(e),n&&W(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(L[r]+c+1)]++,e.dyn_dtree[2*F(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){I(e,2,3),j(e,v,k),function(e){16===e.bi_valid?(R(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},
vendor: 291 bytes, line 2
2"./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js":e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},
vendor: 1,001 bytes, line 2
2"./src/SurfaceWorker.js":()=>{$3Dmol.workerString=function(){self.onmessage=function(e){var t=e.data,r=t.type;if(r<0)self.atomData=t.atoms,self.volume=t.volume,self.ps=new ProteinSurface;else{var n=self.ps;n.initparm(t.expandedExtent,1!=r,self.volume),n.fillvoxels(self.atomData,t.extendedAtoms),n.buildboundary(),4!==r&&2!==r||(n.fastdistancemap(),n.boundingatom(!1),n.fillvoxelswaals(self.atomData,t.extendedAtoms)),n.marchingcube(r);var i=n.getFacesAndVertices(t.atomsToShow);self.postMessage(i)}}}.toString().replace(/(^.*?\{|\}$)/g,""),$3Dmol.workerString+=";\nfunction _classCallCheck() {};",$3Dmol.workerString+=";\n"+$3Dmol.Vector3.toString(),$3Dmol.workerString+=";\n"+$3Dmol.MarchingCubeInitializer.toString()+";\n\n",$3Dmol.workerString+=";\n"+$3Dmol.PointGrid.toString()+";\n",$3Dmol.workerString+=";\nvar ProteinSurface = "+$3Dmol.ProteinSurface.toString()+";\n",$3Dmol.SurfaceWorker=window.URL?window.URL.createObjectURL(new Blob([$3Dmol.workerString],{type:"text/javascript"})):void 0},
2"./src/exporter.js":e=>{"object"===typeof e.exports&&(e.exports=window.$3Dmol)},
vendor: 13,035 bytes, line 2
2"./src/vendor/mmtf.js":function(e,t){!function(e){"use strict";function t(e,t,r){for(var n=(e.byteLength,0),i=r.length;i>n;n++){var s=r.charCodeAt(n);if(128>s)e.setUint8(t++,s>>>0&127|0);else if(2048>s)e.setUint8(t++,s>>>6&31|192),e.setUint8(t++,s>>>0&63|128);else if(65536>s)e.setUint8(t++,s>>>12&15|224),e.setUint8(t++,s>>>6&63|128),e.setUint8(t++,s>>>0&63|128);else{if(!(1114112>s))throw new Error("bad codepoint "+s);e.setUint8(t++,s>>>18&7|240),e.setUint8(t++,s>>>12&63|128),e.setUint8(t++,s>>>6&63|128),e.setUint8(t++,s>>>0&63|128)}}}function r(e){for(var t=0,r=0,n=e.length;n>r;r++){var i=e.charCodeAt(r);if(128>i)t+=1;else if(2048>i)t+=2;else if(65536>i)t+=3;else{if(!(1114112>i))throw new Error("bad codepoint "+i);t+=4}}return t}function n(e,i,s){var a=typeof e;if("string"===a){if(32>(o=r(e)))return i.setUint8(s,160|o),t(i,s+1,e),1+o;if(256>o)return i.setUint8(s,217),i.setUint8(s+1,o),t(i,s+2,e),2+o;if(65536>o)return i.setUint8(s,218),i.setUint16(s+1,o),t(i,s+3,e),3+o;if(4294967296>o)return i.setUint8(s,219),i.setUint32(s+1,o),t(i,s+5,e),5+o}if(e instanceof Uint8Array){var o=e.byteLength,l=new Uint8Array(i.buffer);if(256>o)return i.setUint8(s,196),i.setUint8(s+1,o),l.set(e,s+2),2+o;if(65536>o)return i.setUint8(s,197),i.setUint16(s+1,o),l.set(e,s+3),3+o;if(4294967296>o)return i.setUint8(s,198),i.setUint32(s+1,o),l.set(e,s+5),5+o}if("number"===a){if(!isFinite(e))throw new Error("Number not finite: "+e);if(Math.floor(e)!==e)return i.setUint8(s,203),i.setFloat64(s+1,e),9;if(e>=0){if(128>e)return i.setUint8(s,e),1;if(256>e)return i.setUint8(s,204),i.setUint8(s+1,e),2;if(65536>e)return i.setUint8(s,205),i.setUint16(s+1,e),3;if(4294967296>e)return i.setUint8(s,206),i.setUint32(s+1,e),5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return i.setInt8(s,e),1;if(e>=-128)return i.setUint8(s,208),i.setInt8(s+1,e),2;if(e>=-32768)return i.setUint8(s,209),i.setInt16(s+1,e),3;if(e>=-2147483648)return i.setUint8(s,210),i.setInt32(s+1,e),5;throw new Error("Number too small -0x"+(-e).toString(16).substr(1))}if(null===e)return i.setUint8(s,192),1;if("boolean"===a)return i.setUint8(s,e?195:194),1;if("object"===a){var c=0,u=Array.isArray(e);if(u)o=e.length;else{var h=Object.keys(e);o=h.length}if(16>o?(i.setUint8(s,o|(u?144:128)),c=1):65536>o?(i.setUint8(s,u?220:222),i.setUint16(s+1,o),c=3):4294967296>o&&(i.setUint8(s,u?221:223),i.setUint32(s+1,o),c=5),u)for(var d=0;o>d;d++)c+=n(e[d],i,s+c);else for(d=0;o>d;d++){var f=h[d];c+=n(f,i,s+c),c+=n(e[f],i,s+c)}return c}throw new Error("Unknown type "+a)}function i(e){var t=typeof e;if("string"===t){if(32>(n=r(e)))return 1+n;if(256>n)return 2+n;if(65536>n)return 3+n;if(4294967296>n)return 5+n}if(e instanceof Uint8Array){if(256>(n=e.byteLength))return 2+n;if(65536>n)return 3+n;if(4294967296>n)return 5+n}if("number"===t){if(Math.floor(e)!==e)return 9;if(e>=0){if(128>e)return 1;if(256>e)return 2;if(65536>e)return 3;if(4294967296>e)return 5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return 1;if(e>=-128)return 2;if(e>=-32768)return 3;if(e>=-2147483648)return 5;throw new Error("Number too small -0x"+e.toString(16).substr(1))}if("boolean"===t||null===e)return 1;if("object"===t){var n,s=0;if(Array.isArray(e)){n=e.length;for(var a=0;n>a;a++)s+=i(e[a])}else{var o=Object.keys(e);for(n=o.length,a=0;n>a;a++){var l=o[a];s+=i(l)+i(e[l])}}if(16>n)return 1+s;if(65536>n)return 3+s;if(4294967296>n)return 5+s;throw new Error("Array or object too long 0x"+n.toString(16))}throw new Error("Unknown type "+t)}function s(e){var t=new ArrayBuffer(i(e));return n(e,new DataView(t),0),new Uint8Array(t)}function a(e,t,r){return t?new e(t.buffer,t.byteOffset,t.byteLength/(r||1)):void 0}function o(e){return a(DataView,e)}function l(e){return a(Uint8Array,e)}function c(e){return a(Int8Array,e)}function u(e){return a(Int32Array,e,4)}function h(e){return a(Float32Array,e,4)}function d(e,t){var r=e.length/2;t||(t=new Int16Array(r));for(var n=0,i=0;r>n;++n,i+=2)t[n]=e[i]<<8^e[i+1]<<0;return t}function f(e,t){var r=e.length;t||(t=new Uint8Array(2*r));for(var n=o(t),i=0;r>i;++i)n.setInt16(2*i,e[i]);return l(t)}function p(e,t){var r=e.length/4;t||(t=new Int32Array(r));for(var n=0,i=0;r>n;++n,i+=4)t[n]=e[i]<<24^e[i+1]<<16^e[i+2]<<8^e[i+3]<<0;return t}function m(e,t){var r=e.length;t||(t=new Uint8Array(4*r));for(var n=o(t),i=0;r>i;++i)n.setInt32(4*i,e[i]);return l(t)}function g(e,t){var r=e.length;t||(t=new Float32Array(r/4));for(var n=o(t),i=o(e),s=0,a=0,l=r/4;l>s;++s,a+=4)n.setFloat32(a,i.getFloat32(a),!0);return t}function v(e,t,r){var n=e.length,i=1/t;r||(r=new Float32Array(n));for(var s=0;n>s;++s)r[s]=e[s]*i;return r}function b(e,t,r){var n=e.length;r||(r=new Int32Array(n));for(var i=0;n>i;++i)r[i]=Math.round(e[i]*t);return r}function y(e,t){var r,n;if(!t){var i=0;for(r=0,n=e.length;n>r;r+=2)i+=e[r+1];t=new e.constructor(i)}var s=0;for(r=0,n=e.length;n>r;r+=2)for(var a=e[r],o=e[r+1],l=0;o>l;++l)t[s]=a,++s;return t}function _(e){if(0===e.length)return new Int32Array;var t,r,n=2;for(t=1,r=e.length;r>t;++t)e[t-1]!==e[t]&&(n+=2);var i=new Int32Array(n),s=0,a=1;for(t=1,r=e.length;r>t;++t)e[t-1]!==e[t]?(i[s]=e[t-1],i[s+1]=a,a=1,s+=2):++a;return i[s]=e[e.length-1],i[s+1]=a,i}function w(e,t){var r=e.length;t||(t=new e.constructor(r)),r&&(t[0]=e[0]);for(var n=1;r>n;++n)t[n]=e[n]+t[n-1];return t}function x(e,t){var r=e.length;t||(t=new e.constructor(r)),t[0]=e[0];for(var n=1;r>n;++n)t[n]=e[n]-e[n-1];return t}function S(e,t){var r,n,i=e instanceof Int8Array?127:32767,s=-i-1,a=e.length;if(!t){var o=0;for(r=0;a>r;++r)e[r]<i&&e[r]>s&&++o;t=new Int32Array(o)}for(r=0,n=0;a>r;){for(var l=0;e[r]===i||e[r]===s;)l+=e[r],++r;l+=e[r],++r,t[n]=l,++n}return t}function C(e,t){var r,n=t?127:32767,i=-n-1,s=e.length,a=0;for(r=0;s>r;++r)0===(c=e[r])?++a:c>0?(a+=Math.ceil(c/n),c%n===0&&(a+=1)):(a+=Math.ceil(c/i),c%i===0&&(a+=1));var o=t?new Int8Array(a):new Int16Array(a),l=0;for(r=0;s>r;++r){var c;if((c=e[r])>=0)for(;c>=n;)o[l]=n,++l,c-=n;else for(;i>=c;)o[l]=i,++l,c-=i;o[l]=c,++l}return o}function k(e,t){return w(y(e),t)}function E(e){return _(x(e))}function A(e,t,r){return v(y(e,u(r)),t,r)}function L(e,t){return _(b(e,t))}function M(e,t,r){return v(w(e,u(r)),t,r)}function z(e,t,r){return x(b(e,t),r)}function T(e,t,r){return v(S(e,u(r)),t,r)}function O(e,t,r){var n=S(e,u(r));return M(n,t,h(n))}function P(e,t,r){return C(z(e,t),r)}function D(e){var t=o(e),r=t.getInt32(0),n=t.getInt32(4),i=e.subarray(8,12);return[r,e=e.subarray(12),n,i]}function N(e,t,r,n){var i=new ArrayBuffer(12+n.byteLength),s=new Uint8Array(i),a=new DataView(i);return a.setInt32(0,e),a.setInt32(4,t),r&&s.set(r,8),s.set(n,12),s}function F(e){return N(2,e.length,void 0,l(e))}function R(e){return N(4,e.length,void 0,m(e))}function I(e,t){return N(5,e.length/t,m([t]),l(e))}function j(e){return N(6,e.length,void 0,m(_(e)))}function G(e){return N(8,e.length,void 0,m(E(e)))}function B(e,t){return N(9,e.length,m([t]),m(L(e,t)))}function U(e,t){return N(10,e.length,m([t]),f(P(e,t)))}function W(e){var t={};return ee.forEach((function(r){void 0!==e[r]&&(t[r]=e[r])})),e.bondAtomList&&(t.bondAtomList=R(e.bondAtomList)),e.bondOrderList&&(t.bondOrderList=F(e.bondOrderList)),t.xCoordList=U(e.xCoordList,1e3),t.yCoordList=U(e.yCoordList,1e3),t.zCoordList=U(e.zCoordList,1e3),e.bFactorList&&(t.bFactorList=U(e.bFactorList,100)),e.atomIdList&&(t.atomIdList=G(e.atomIdList)),e.altLocList&&(t.altLocList=j(e.altLocList)),e.occupancyList&&(t.occupancyList=B(e.occupancyList,100)),t.groupIdList=G(e.groupIdList),t.groupTypeList=R(e.groupTypeList),e.secStructList&&(t.secStructList=F(e.secStructList)),e.insCodeList&&(t.insCodeList=j(e.insCodeList)),e.sequenceIndexList&&(t.sequenceIndexList=G(e.sequenceIndexList)),t.chainIdList=I(e.chainIdList,4),e.chainNameList&&(t.chainNameList=I(e.chainNameList,4)),t}function V(e){function t(e){for(var t={},r=0;e>r;r++)t[s()]=s();return t}function r(t){var r=e.subarray(a,a+t);return a+=t,r}function n(t){var r=e.subarray(a,a+t);a+=t;var n=65535;if(t>n){for(var i=[],s=0;s<r.length;s+=n)i.push(String.fromCharCode.apply(null,r.subarray(s,s+n)));return i.join("")}return String.fromCharCode.apply(null,r)}function i(e){for(var t=new Array(e),r=0;e>r;r++)t[r]=s();return t}function s(){var s,l,c=e[a];if(0===(128&c))return a++,c;if(128===(240&c))return a++,t(l=15&c);if(144===(240&c))return a++,i(l=15&c);if(160===(224&c))return a++,n(l=31&c);if(224===(224&c))return s=o.getInt8(a),a++,s;switch(c){case 192:return a++,null;case 194:return a++,!1;case 195:return a++,!0;case 196:return l=o.getUint8(a+1),a+=2,r(l);case 197:return l=o.getUint16(a+1),a+=3,r(l);case 198:return l=o.getUint32(a+1),a+=5,r(l);case 202:return s=o.getFloat32(a+1),a+=5,s;case 203:return s=o.getFloat64(a+1),a+=9,s;case 204:return s=e[a+1],a+=2,s;case 205:return s=o.getUint16(a+1),a+=3,s;case 206:return s=o.getUint32(a+1),a+=5,s;case 208:return s=o.getInt8(a+1),a+=2,s;case 209:return s=o.getInt16(a+1),a+=3,s;case 210:return s=o.getInt32(a+1),a+=5,s;case 217:return l=o.getUint8(a+1),a+=2,n(l);case 218:return l=o.getUint16(a+1),a+=3,n(l);case 219:return l=o.getUint32(a+1),a+=5,n(l);case 220:return l=o.getUint16(a+1),a+=3,i(l);case 221:return l=o.getUint32(a+1),a+=5,i(l);case 222:return l=o.getUint16(a+1),a+=3,t(l);case 223:return l=o.getUint32(a+1),a+=5,t(l)}throw new Error("Unknown type 0x"+c.toString(16))}var a=0,o=new DataView(e.buffer);return s()}function H(e,t,r,n){switch(e){case 1:return g(t);case 2:return c(t);case 3:return d(t);case 4:return p(t);case 5:return l(t);case 6:return y(p(t),new Uint8Array(r));case 7:return y(p(t));case 8:return k(p(t));case 9:return A(p(t),p(n)[0]);case 10:return O(d(t),p(n)[0]);case 11:return v(d(t),p(n)[0]);case 12:return T(d(t),p(n)[0]);case 13:return T(c(t),p(n)[0]);case 14:return S(d(t));case 15:return S(c(t))}}function q(e,t){var r=(t=t||{}).ignoreFields,n={};return re.forEach((function(t){var i=!!r&&-1!==r.indexOf(t),s=e[t];i||void 0===s||(s instanceof Uint8Array?n[t]=H.apply(null,D(s)):n[t]=s)})),n}function Y(e){return String.fromCharCode.apply(null,e).replace(/\0/g,"")}function Z(e,t,r){var n,i,s,a,o,l,c=(r=r||{}).firstModelOnly,u=t.onModel,h=t.onChain,d=t.onGroup,f=t.onAtom,p=t.onBond,m=0,g=0,v=0,b=0,y=0,_=-1,w=e.chainNameList,x=e.secStructList,S=e.insCodeList,C=e.sequenceIndexList,k=e.atomIdList,E=e.bFactorList,A=e.altLocList,L=e.occupancyList,M=e.bondAtomList,z=e.bondOrderList;for(n=0,i=e.chainsPerModel.length;i>n&&!(c&&m>0);++n){var T=e.chainsPerModel[m];for(u&&u({chainCount:T,modelIndex:m}),s=0;T>s;++s){var O=e.groupsPerChain[g];if(h){var P=Y(e.chainIdList.subarray(4*g,4*g+4)),D=null;w&&(D=Y(w.subarray(4*g,4*g+4))),h({groupCount:O,chainIndex:g,modelIndex:m,chainId:P,chainName:D})}for(a=0;O>a;++a){var N=e.groupList[e.groupTypeList[v]],F=N.atomNameList.length;if(d){var R=null;x&&(R=x[v]);var I=null;e.insCodeList&&(I=String.fromCharCode(S[v]));var j=null;C&&(j=C[v]),d({atomCount:F,groupIndex:v,chainIndex:g,modelIndex:m,groupId:e.groupIdList[v],groupType:e.groupTypeList[v],groupName:N.groupName,singleLetterCode:N.singleLetterCode,chemCompType:N.chemCompType,secStruct:R,insCode:I,sequenceIndex:j})}for(o=0;F>o;++o){if(f){var G=null;k&&(G=k[b]);var B=null;E&&(B=E[b]);var U=null;A&&(U=String.fromCharCode(A[b]));var W=null;L&&(W=L[b]),f({atomIndex:b,groupIndex:v,chainIndex:g,modelIndex:m,atomId:G,element:N.elementList[o],atomName:N.atomNameList[o],formalCharge:N.formalChargeList[o],xCoord:e.xCoordList[b],yCoord:e.yCoordList[b],zCoord:e.zCoordList[b],bFactor:B,altLoc:U,occupancy:W})}b+=1}if(p){var V=N.bondAtomList;for(o=0,l=N.bondOrderList.length;l>o;++o)p({atomIndex1:b-F+V[2*o],atomIndex2:b-F+V[2*o+1],bondOrder:N.bondOrderList[o]})}v+=1}g+=1}if(y=_+1,_=b-1,p&&M)for(o=0,l=M.length;l>o;o+=2){var H=M[o],q=M[o+1];(H>=y&&_>=H||q>=y&&_>=q)&&p({atomIndex1:H,atomIndex2:q,bondOrder:z?z[o/2]:null})}m+=1}}function X(e){return s(W(e))}function K(e,t){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),q(e instanceof Uint8Array?V(e):e,t)}function $(e,t,r,n){function i(){try{var e=K(s.response);r(e)}catch(t){n(t)}}var s=new XMLHttpRequest;s.addEventListener("load",i,!0),s.addEventListener("error",n,!0),s.responseType="arraybuffer",s.open("GET",t+e.toUpperCase()),s.send()}function Q(e,t,r){$(e,se,t,r)}function J(e,t,r){$(e,ae,t,r)}var ee=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"],te=["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"],re=ee.concat(te),ne="v1.0.1",ie="//mmtf.rcsb.org/v1.0/",se=ie+"full/",ae=ie+"reduced/";e.encode=X,e.decode=K,e.traverse=Z,e.fetch=Q,e.fetchReduced=J,e.version=ne,e.fetchUrl=se,e.fetchReducedUrl=ae,e.encodeMsgpack=s,e.encodeMmtf=W,e.decodeMsgpack=V,e.decodeMmtf=q}(t)},
vendor: 46,778 bytes, line 2
2"./node_modules/pako/dist/pako.esm.mjs":(e,t,r)=>{"use strict";function n(e){let t=e.length;for(;--t>=0;)e[t]=0}r.r(t),r.d(t,{Deflate:()=>gr,Inflate:()=>_r,constants:()=>Cr,default:()=>kr,deflate:()=>vr,deflateRaw:()=>br,gzip:()=>yr,inflate:()=>wr,inflateRaw:()=>xr,ungzip:()=>Sr});const i=256,s=286,a=30,o=15,l=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),c=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);n(d);const f=new Array(60);n(f);const p=new Array(512);n(p);const m=new Array(256);n(m);const g=new Array(29);n(g);const v=new Array(a);function b(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let y,_,w;function x(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}n(v);const S=e=>e<256?p[e]:p[256+(e>>>7)],C=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},k=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,C(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},E=(e,t,r)=>{k(e,r[2*t],r[2*t+1])},A=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},L=(e,t,r)=>{const n=new Array(16);let i,s,a=0;for(i=1;i<=o;i++)a=a+r[i-1]<<1,n[i]=a;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=A(n[t]++,t))}},M=e=>{let t;for(t=0;t<s;t++)e.dyn_ltree[2*t]=0;for(t=0;t<a;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},z=e=>{e.bi_valid>8?C(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},T=(e,t,r,n)=>{const i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]},O=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&T(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!T(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},P=(e,t,r)=>{let n,s,a,o,u=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+u++],n+=(255&e.pending_buf[e.sym_buf+u++])<<8,s=e.pending_buf[e.sym_buf+u++],0===n?E(e,s,t):(a=m[s],E(e,a+i+1,t),o=l[a],0!==o&&(s-=g[a],k(e,s,o)),n--,a=S(n),E(e,a,r),o=c[a],0!==o&&(n-=v[a],k(e,n,o)))}while(u<e.sym_next);E(e,256,t)},D=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,l,c,u=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<s;a++)0!==r[2*a]?(e.heap[++e.heap_len]=u=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[2*c]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=n[2*c+1]);for(t.max_code=u,a=e.heap_len>>1;a>=1;a--)O(e,r,a);c=s;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(e,r,1),l=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=l,r[2*c]=r[2*a]+r[2*l],e.depth[c]=(e.depth[a]>=e.depth[l]?e.depth[a]:e.depth[l])+1,r[2*a+1]=r[2*l+1]=c,e.heap[1]=c++,O(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,h,d,f,p,m,g=0;for(f=0;f<=o;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;u<573;u++)h=e.heap[u],f=r[2*r[2*h+1]+1]+1,f>c&&(f=c,g++),r[2*h+1]=f,h>n||(e.bl_count[f]++,p=0,h>=l&&(p=a[h-l]),m=r[2*h],e.opt_len+=m*(f+p),s&&(e.static_len+=m*(i[2*h+1]+p)));if(0!==g){do{for(f=c-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(f=c;0!==f;f--)for(h=e.bl_count[f];0!==h;)d=e.heap[--u],d>n||(r[2*d+1]!==f&&(e.opt_len+=(f-r[2*d+1])*r[2*d],r[2*d+1]=f),h--)}})(e,t),L(r,u,e.bl_count)},N=(e,t,r)=>{let n,i,s=-1,a=t[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++o<l&&i===a||(o<c?e.bl_tree[2*i]+=o:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,s=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))},F=(e,t,r)=>{let n,i,s=-1,a=t[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++o<l&&i===a)){if(o<c)do{E(e,i,e.bl_tree)}while(0!==--o);else 0!==i?(i!==s&&(E(e,i,e.bl_tree),o--),E(e,16,e.bl_tree),k(e,o-3,2)):o<=10?(E(e,17,e.bl_tree),k(e,o-3,3)):(E(e,18,e.bl_tree),k(e,o-11,7));o=0,s=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}};let R=!1;const I=(e,t,r,n)=>{k(e,0+(n?1:0),3),z(e),C(e,r),C(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var j=(e,t,r,n)=>{let s,a,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<i;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),D(e,e.l_desc),D(e,e.d_desc),o=(e=>{let t;for(N(e,e.dyn_ltree,e.l_desc.max_code),N(e,e.dyn_dtree,e.d_desc.max_code),D(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),s=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=s&&(s=a)):s=a=r+5,r+4<=s&&-1!==t?I(e,t,r,n):4===e.strategy||a===s?(k(e,2+(n?1:0),3),P(e,d,f)):(k(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(k(e,t-257,5),k(e,r-1,5),k(e,n-4,4),i=0;i<n;i++)k(e,e.bl_tree[2*h[i]+1],3);F(e,e.dyn_ltree,t-1),F(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),P(e,e.dyn_ltree,e.dyn_dtree)),M(e),n&&z(e)},G={_tr_init:e=>{R||((()=>{let e,t,r,n,i;const h=new Array(16);for(r=0,n=0;n<28;n++)for(g[n]=r,e=0;e<1<<l[n];e++)m[r++]=n;for(m[r-1]=n,i=0,n=0;n<16;n++)for(v[n]=i,e=0;e<1<<c[n];e++)p[i++]=n;for(i>>=7;n<a;n++)for(v[n]=i<<7,e=0;e<1<<c[n]-7;e++)p[256+i++]=n;for(t=0;t<=o;t++)h[t]=0;for(e=0;e<=143;)d[2*e+1]=8,e++,h[8]++;for(;e<=255;)d[2*e+1]=9,e++,h[9]++;for(;e<=279;)d[2*e+1]=7,e++,h[7]++;for(;e<=287;)d[2*e+1]=8,e++,h[8]++;for(L(d,287,h),e=0;e<a;e++)f[2*e+1]=5,f[2*e]=A(e,5);y=new b(d,l,257,s,o),_=new b(f,c,0,a,o),w=new b(new Array(0),u,0,19,7)})(),R=!0),e.l_desc=new x(e.dyn_ltree,y),e.d_desc=new x(e.dyn_dtree,_),e.bl_desc=new x(e.bl_tree,w),e.bi_buf=0,e.bi_valid=0,M(e)},_tr_stored_block:I,_tr_flush_block:j,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(m[r]+i+1)]++,e.dyn_dtree[2*S(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{k(e,2,3),E(e,256,d),(e=>{16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},B=(e,t,r,n)=>{let i=65535&e|0,s=e>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,s=s+i|0}while(--a);i%=65521,s%=65521}return i|s<<16|0};const U=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var W=(e,t,r,n)=>{const i=U,s=n+r;e^=-1;for(let a=n;a<s;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},V={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:q,_tr_stored_block:Y,_tr_flush_block:Z,_tr_tally:X,_tr_align:K}=G,{Z_NO_FLUSH:$,Z_PARTIAL_FLUSH:Q,Z_FULL_FLUSH:J,Z_FINISH:ee,Z_BLOCK:te,Z_OK:re,Z_STREAM_END:ne,Z_STREAM_ERROR:ie,Z_DATA_ERROR:se,Z_BUF_ERROR:ae,Z_DEFAULT_COMPRESSION:oe,Z_FILTERED:le,Z_HUFFMAN_ONLY:ce,Z_RLE:ue,Z_FIXED:he,Z_DEFAULT_STRATEGY:de,Z_UNKNOWN:fe,Z_DEFLATED:pe}=H,me=258,ge=262,ve=42,be=113,ye=666,_e=(e,t)=>(e.msg=V[t],t),we=e=>2*e-(e>4?9:0),xe=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Se=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let Ce=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const ke=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Ee=(e,t)=>{Z(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ke(e.strm)},Ae=(e,t)=>{e.pending_buf[e.pending++]=t},Le=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Me=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=B(e.adler,t,i,r):2===e.state.wrap&&(e.adler=W(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},ze=(e,t)=>{let r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-ge?e.strstart-(e.w_size-ge):0,c=e.window,u=e.w_mask,h=e.prev,d=e.strstart+me;let f=c[s+a-1],p=c[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,c[r+a]===p&&c[r+a-1]===f&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<d);if(n=me-(d-s),s=d-me,n>a){if(e.match_start=t,a=n,n>=o)break;f=c[s+a-1],p=c[s+a]}}}while((t=h[t&u])>l&&0!==--i);return a<=e.lookahead?a:e.lookahead},Te=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ge)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Se(e),n+=t),0===e.strm.avail_in)break;if(r=Me(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Ce(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Ce(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<ge&&0!==e.strm.avail_in)},Oe=(e,t)=>{let r,n,i,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,o=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<s&&(0===r&&t!==ee||t===$||r!==n+e.strm.avail_in))break;a=t===ee&&r===n+e.strm.avail_in?1:0,Y(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,ke(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(Me(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===a);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==$&&t!==ee&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(Me(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,s=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=s||(n||t===ee)&&t!==$&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,a=t===ee&&0===e.strm.avail_in&&r===n?1:0,Y(e,e.block_start,r,a),e.block_start+=r,ke(e.strm)),a?3:1)},Pe=(e,t)=>{let r,n;for(;;){if(e.lookahead<ge){if(Te(e),e.lookahead<ge&&t===$)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Ce(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-ge&&(e.match_length=ze(e,r)),e.match_length>=3)if(n=X(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Ce(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Ce(e,e.ins_h,e.window[e.strstart+1]);else n=X(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Ee(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===ee?(Ee(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ee(e,!1),0===e.strm.avail_out)?1:2},De=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<ge){if(Te(e),e.lookahead<ge&&t===$)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Ce(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-ge&&(e.match_length=ze(e,r),e.match_length<=5&&(e.strategy===le||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=X(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Ce(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Ee(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=X(e,0,e.window[e.strstart-1]),n&&Ee(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=X(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===ee?(Ee(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ee(e,!1),0===e.strm.avail_out)?1:2};function Ne(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const Fe=[new Ne(0,0,0,0,Oe),new Ne(4,4,8,4,Pe),new Ne(4,5,16,8,Pe),new Ne(4,6,32,32,Pe),new Ne(4,4,16,16,De),new Ne(8,16,32,32,De),new Ne(8,16,128,128,De),new Ne(8,32,128,256,De),new Ne(32,128,258,1024,De),new Ne(32,258,258,4096,De)];function Re(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=pe,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),xe(this.dyn_ltree),xe(this.dyn_dtree),xe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),xe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),xe(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ie=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==ve&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==be&&t.status!==ye?1:0},je=e=>{if(Ie(e))return _e(e,ie);e.total_in=e.total_out=0,e.data_type=fe;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?ve:be,e.adler=2===t.wrap?0:1,t.last_flush=-2,q(t),re},Ge=e=>{const t=je(e);var r;return t===re&&((r=e.state).window_size=2*r.w_size,xe(r.head),r.max_lazy_match=Fe[r.level].max_lazy,r.good_match=Fe[r.level].good_length,r.nice_match=Fe[r.level].nice_length,r.max_chain_length=Fe[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},Be=(e,t,r,n,i,s)=>{if(!e)return ie;let a=1;if(t===oe&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==pe||n<8||n>15||t<0||t>9||s<0||s>he||8===n&&1!==a)return _e(e,ie);8===n&&(n=9);const o=new Re;return e.state=o,o.strm=e,o.status=ve,o.wrap=a,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=s,o.method=r,Ge(e)};var Ue={deflateInit:(e,t)=>Be(e,t,pe,15,8,de),deflateInit2:Be,deflateReset:Ge,deflateResetKeep:je,deflateSetHeader:(e,t)=>Ie(e)||2!==e.state.wrap?ie:(e.state.gzhead=t,re),deflate:(e,t)=>{if(Ie(e)||t>te||t<0)return e?_e(e,ie):ie;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===ye&&t!==ee)return _e(e,0===e.avail_out?ae:ie);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(ke(e),0===e.avail_out)return r.last_flush=-1,re}else if(0===e.avail_in&&we(t)<=we(n)&&t!==ee)return _e(e,ae);if(r.status===ye&&0!==e.avail_in)return _e(e,ae);if(r.status===ve&&0===r.wrap&&(r.status=be),r.status===ve){let t=pe+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=ce||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Le(r,t),0!==r.strstart&&(Le(r,e.adler>>>16),Le(r,65535&e.adler)),e.adler=1,r.status=be,ke(e),0!==r.pending)return r.last_flush=-1,re}if(57===r.status)if(e.adler=0,Ae(r,31),Ae(r,139),Ae(r,8),r.gzhead)Ae(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Ae(r,255&r.gzhead.time),Ae(r,r.gzhead.time>>8&255),Ae(r,r.gzhead.time>>16&255),Ae(r,r.gzhead.time>>24&255),Ae(r,9===r.level?2:r.strategy>=ce||r.level<2?4:0),Ae(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Ae(r,255&r.gzhead.extra.length),Ae(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=W(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Ae(r,0),Ae(r,0),Ae(r,0),Ae(r,0),Ae(r,0),Ae(r,9===r.level?2:r.strategy>=ce||r.level<2?4:0),Ae(r,3),r.status=be,ke(e),0!==r.pending)return r.last_flush=-1,re;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=W(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,ke(e),0!==r.pending)return r.last_flush=-1,re;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=W(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=W(e.adler,r.pending_buf,r.pending-n,n)),ke(e),0!==r.pending)return r.last_flush=-1,re;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Ae(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=W(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=W(e.adler,r.pending_buf,r.pending-n,n)),ke(e),0!==r.pending)return r.last_flush=-1,re;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Ae(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=W(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(ke(e),0!==r.pending))return r.last_flush=-1,re;Ae(r,255&e.adler),Ae(r,e.adler>>8&255),e.adler=0}if(r.status=be,ke(e),0!==r.pending)return r.last_flush=-1,re}if(0!==e.avail_in||0!==r.lookahead||t!==$&&r.status!==ye){let n=0===r.level?Oe(r,t):r.strategy===ce?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Te(e),0===e.lookahead)){if(t===$)return 1;break}if(e.match_length=0,r=X(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Ee(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===ee?(Ee(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ee(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===ue?((e,t)=>{let r,n,i,s;const a=e.window;for(;;){if(e.lookahead<=me){if(Te(e),e.lookahead<=me&&t===$)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){s=e.strstart+me;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);e.match_length=me-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=X(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=X(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Ee(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===ee?(Ee(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ee(e,!1),0===e.strm.avail_out)?1:2})(r,t):Fe[r.level].func(r,t);if(3!==n&&4!==n||(r.status=ye),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),re;if(2===n&&(t===Q?K(r):t!==te&&(Y(r,0,0,!1),t===J&&(xe(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),ke(e),0===e.avail_out))return r.last_flush=-1,re}return t!==ee?re:r.wrap<=0?ne:(2===r.wrap?(Ae(r,255&e.adler),Ae(r,e.adler>>8&255),Ae(r,e.adler>>16&255),Ae(r,e.adler>>24&255),Ae(r,255&e.total_in),Ae(r,e.total_in>>8&255),Ae(r,e.total_in>>16&255),Ae(r,e.total_in>>24&255)):(Le(r,e.adler>>>16),Le(r,65535&e.adler)),ke(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?re:ne)},deflateEnd:e=>{if(Ie(e))return ie;const t=e.state.status;return e.state=null,t===be?_e(e,se):re},deflateSetDictionary:(e,t)=>{let r=t.length;if(Ie(e))return ie;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==ve||n.lookahead)return ie;if(1===i&&(e.adler=B(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(xe(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const s=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Te(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Ce(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Te(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=a,e.input=o,e.avail_in=s,n.wrap=i,re},deflateInfo:"pako deflate (from Nodeca project)"};const We=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ve={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!==typeof r)throw new TypeError(r+"must be non-object");for(const t in r)We(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;const r=new Uint8Array(t);for(let n=0,i=0,s=e.length;n<s;n++){let t=e[n];r.set(t,i),i+=t.length}return r}};let He=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Er){He=!1}const qe=new Uint8Array(256);for(let Ar=0;Ar<256;Ar++)qe[Ar]=Ar>=252?6:Ar>=248?5:Ar>=240?4:Ar>=224?3:Ar>=192?2:1;qe[254]=qe[254]=1;var Ye={string2buf:e=>{if("function"===typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,s,a=e.length,o=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296===(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(o),s=0,i=0;s<o;i++)r=e.charCodeAt(i),55296===(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"===typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const s=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){s[i++]=t;continue}let a=qe[t];if(a>4)s[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],a--;a>1?s[i++]=65533:t<65536?s[i++]=t:(t-=65536,s[i++]=55296|t>>10&1023,s[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&He)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(s,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128===(192&e[r]);)r--;return r<0||0===r?t:r+qe[e[r]]>t?r:t}},Ze=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Xe=Object.prototype.toString,{Z_NO_FLUSH:Ke,Z_SYNC_FLUSH:$e,Z_FULL_FLUSH:Qe,Z_FINISH:Je,Z_OK:et,Z_STREAM_END:tt,Z_DEFAULT_COMPRESSION:rt,Z_DEFAULT_STRATEGY:nt,Z_DEFLATED:it}=H;function st(e){this.options=Ve.assign({level:rt,method:it,chunkSize:16384,windowBits:15,memLevel:8,strategy:nt},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ze,this.strm.avail_out=0;let r=Ue.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==et)throw new Error(V[r]);if(t.header&&Ue.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"===typeof t.dictionary?Ye.string2buf(t.dictionary):"[object ArrayBuffer]"===Xe.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Ue.deflateSetDictionary(this.strm,e),r!==et)throw new Error(V[r]);this._dict_set=!0}}function at(e,t){const r=new st(t);if(r.push(e,!0),r.err)throw r.msg||V[r.err];return r.result}st.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?Je:Ke,"string"===typeof e?r.input=Ye.string2buf(e):"[object ArrayBuffer]"===Xe.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===$e||s===Qe)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Ue.deflate(r,s),i===tt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ue.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===et;if(0!==r.avail_out){if(s>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},st.prototype.onData=function(e){this.chunks.push(e)},st.prototype.onEnd=function(e){e===et&&(this.result=Ve.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ot={Deflate:st,deflate:at,deflateRaw:function(e,t){return(t=t||{}).raw=!0,at(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,at(e,t)},constants:H};const lt=16209;var ct=function(e,t){let r,n,i,s,a,o,l,c,u,h,d,f,p,m,g,v,b,y,_,w,x,S,C,k;const E=e.state;r=e.next_in,C=e.input,n=r+(e.avail_in-5),i=e.next_out,k=e.output,s=i-(t-e.avail_out),a=i+(e.avail_out-257),o=E.dmax,l=E.wsize,c=E.whave,u=E.wnext,h=E.window,d=E.hold,f=E.bits,p=E.lencode,m=E.distcode,g=(1<<E.lenbits)-1,v=(1<<E.distbits)-1;e:do{f<15&&(d+=C[r++]<<f,f+=8,d+=C[r++]<<f,f+=8),b=p[d&g];t:for(;;){if(y=b>>>24,d>>>=y,f-=y,y=b>>>16&255,0===y)k[i++]=65535&b;else{if(!(16&y)){if(0===(64&y)){b=p[(65535&b)+(d&(1<<y)-1)];continue t}if(32&y){E.mode=16191;break e}e.msg="invalid literal/length code",E.mode=lt;break e}_=65535&b,y&=15,y&&(f<y&&(d+=C[r++]<<f,f+=8),_+=d&(1<<y)-1,d>>>=y,f-=y),f<15&&(d+=C[r++]<<f,f+=8,d+=C[r++]<<f,f+=8),b=m[d&v];r:for(;;){if(y=b>>>24,d>>>=y,f-=y,y=b>>>16&255,!(16&y)){if(0===(64&y)){b=m[(65535&b)+(d&(1<<y)-1)];continue r}e.msg="invalid distance code",E.mode=lt;break e}if(w=65535&b,y&=15,f<y&&(d+=C[r++]<<f,f+=8,f<y&&(d+=C[r++]<<f,f+=8)),w+=d&(1<<y)-1,w>o){e.msg="invalid distance too far back",E.mode=lt;break e}if(d>>>=y,f-=y,y=i-s,w>y){if(y=w-y,y>c&&E.sane){e.msg="invalid distance too far back",E.mode=lt;break e}if(x=0,S=h,0===u){if(x+=l-y,y<_){_-=y;do{k[i++]=h[x++]}while(--y);x=i-w,S=k}}else if(u<y){if(x+=l+u-y,y-=u,y<_){_-=y;do{k[i++]=h[x++]}while(--y);if(x=0,u<_){y=u,_-=y;do{k[i++]=h[x++]}while(--y);x=i-w,S=k}}}else if(x+=u-y,y<_){_-=y;do{k[i++]=h[x++]}while(--y);x=i-w,S=k}for(;_>2;)k[i++]=S[x++],k[i++]=S[x++],k[i++]=S[x++],_-=3;_&&(k[i++]=S[x++],_>1&&(k[i++]=S[x++]))}else{x=i-w;do{k[i++]=k[x++],k[i++]=k[x++],k[i++]=k[x++],_-=3}while(_>2);_&&(k[i++]=k[x++],_>1&&(k[i++]=k[x++]))}break}}break}}while(r<n&&i<a);_=f>>3,r-=_,f-=_<<3,d&=(1<<f)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<a?a-i+257:257-(i-a),E.hold=d,E.bits=f};const ut=15,ht=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),dt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ft=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),pt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var mt=(e,t,r,n,i,s,a,o)=>{const l=o.bits;let c,u,h,d,f,p,m=0,g=0,v=0,b=0,y=0,_=0,w=0,x=0,S=0,C=0,k=null;const E=new Uint16Array(16),A=new Uint16Array(16);let L,M,z,T=null;for(m=0;m<=ut;m++)E[m]=0;for(g=0;g<n;g++)E[t[r+g]]++;for(y=l,b=ut;b>=1&&0===E[b];b--);if(y>b&&(y=b),0===b)return i[s++]=20971520,i[s++]=20971520,o.bits=1,0;for(v=1;v<b&&0===E[v];v++);for(y<v&&(y=v),x=1,m=1;m<=ut;m++)if(x<<=1,x-=E[m],x<0)return-1;if(x>0&&(0===e||1!==b))return-1;for(A[1]=0,m=1;m<ut;m++)A[m+1]=A[m]+E[m];for(g=0;g<n;g++)0!==t[r+g]&&(a[A[t[r+g]]++]=g);if(0===e?(k=T=a,p=20):1===e?(k=ht,T=dt,p=257):(k=ft,T=pt,p=0),C=0,g=0,m=v,f=s,_=y,w=0,h=-1,S=1<<y,d=S-1,1===e&&S>852||2===e&&S>592)return 1;for(;;){L=m-w,a[g]+1<p?(M=0,z=a[g]):a[g]>=p?(M=T[a[g]-p],z=k[a[g]-p]):(M=96,z=0),c=1<<m-w,u=1<<_,v=u;do{u-=c,i[f+(C>>w)+u]=L<<24|M<<16|z|0}while(0!==u);for(c=1<<m-1;C&c;)c>>=1;if(0!==c?(C&=c-1,C+=c):C=0,g++,0===--E[m]){if(m===b)break;m=t[r+a[g]]}if(m>y&&(C&d)!==h){for(0===w&&(w=y),f+=v,_=m-w,x=1<<_;_+w<b&&(x-=E[_+w],!(x<=0));)_++,x<<=1;if(S+=1<<_,1===e&&S>852||2===e&&S>592)return 1;h=C&d,i[h]=y<<24|_<<16|f-s|0}}return 0!==C&&(i[f+C]=m-w<<24|64<<16|0),o.bits=y,0};const{Z_FINISH:gt,Z_BLOCK:vt,Z_TREES:bt,Z_OK:yt,Z_STREAM_END:_t,Z_NEED_DICT:wt,Z_STREAM_ERROR:xt,Z_DATA_ERROR:St,Z_MEM_ERROR:Ct,Z_BUF_ERROR:kt,Z_DEFLATED:Et}=H,At=16180,Lt=16190,Mt=16191,zt=16192,Tt=16194,Ot=16199,Pt=16200,Dt=16206,Nt=16209,Ft=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Rt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const It=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<At||t.mode>16211?1:0},jt=e=>{if(It(e))return xt;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=At,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,yt},Gt=e=>{if(It(e))return xt;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,jt(e)},Bt=(e,t)=>{let r;if(It(e))return xt;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?xt:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Gt(e))},Ut=(e,t)=>{if(!e)return xt;const r=new Rt;e.state=r,r.strm=e,r.window=null,r.mode=At;const n=Bt(e,t);return n!==yt&&(e.state=null),n};let Wt,Vt,Ht=!0;const qt=e=>{if(Ht){Wt=new Int32Array(512),Vt=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(mt(1,e.lens,0,288,Wt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;mt(2,e.lens,0,32,Vt,0,e.work,{bits:5}),Ht=!1}e.lencode=Wt,e.lenbits=9,e.distcode=Vt,e.distbits=5},Yt=(e,t,r,n)=>{let i;const s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(t.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(t.subarray(r-n,r-n+i),s.wnext),(n-=i)?(s.window.set(t.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0};var Zt={inflateReset:Gt,inflateReset2:Bt,inflateResetKeep:jt,inflateInit:e=>Ut(e,15),inflateInit2:Ut,inflate:(e,t)=>{let r,n,i,s,a,o,l,c,u,h,d,f,p,m,g,v,b,y,_,w,x,S,C=0;const k=new Uint8Array(4);let E,A;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(It(e)||!e.output||!e.input&&0!==e.avail_in)return xt;r=e.state,r.mode===Mt&&(r.mode=zt),a=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,c=r.hold,u=r.bits,h=o,d=l,S=yt;e:for(;;)switch(r.mode){case At:if(0===r.wrap){r.mode=zt;break}for(;u<16;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(2&r.wrap&&35615===c){0===r.wbits&&(r.wbits=15),r.check=0,k[0]=255&c,k[1]=c>>>8&255,r.check=W(r.check,k,2,0),c=0,u=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Nt;break}if((15&c)!==Et){e.msg="unknown compression method",r.mode=Nt;break}if(c>>>=4,u-=4,x=8+(15&c),0===r.wbits&&(r.wbits=x),x>15||x>r.wbits){e.msg="invalid window size",r.mode=Nt;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&c?16189:Mt,c=0,u=0;break;case 16181:for(;u<16;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(r.flags=c,(255&r.flags)!==Et){e.msg="unknown compression method",r.mode=Nt;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Nt;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&4&r.wrap&&(k[0]=255&c,k[1]=c>>>8&255,r.check=W(r.check,k,2,0)),c=0,u=0,r.mode=16182;case 16182:for(;u<32;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}r.head&&(r.head.time=c),512&r.flags&&4&r.wrap&&(k[0]=255&c,k[1]=c>>>8&255,k[2]=c>>>16&255,k[3]=c>>>24&255,r.check=W(r.check,k,4,0)),c=0,u=0,r.mode=16183;case 16183:for(;u<16;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&4&r.wrap&&(k[0]=255&c,k[1]=c>>>8&255,r.check=W(r.check,k,2,0)),c=0,u=0,r.mode=16184;case 16184:if(1024&r.flags){for(;u<16;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&4&r.wrap&&(k[0]=255&c,k[1]=c>>>8&255,r.check=W(r.check,k,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>o&&(f=o),f&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+f),x)),512&r.flags&&4&r.wrap&&(r.check=W(r.check,n,f,s)),o-=f,s+=f,r.length-=f),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===o)break e;f=0;do{x=n[s+f++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&f<o);if(512&r.flags&&4&r.wrap&&(r.check=W(r.check,n,f,s)),o-=f,s+=f,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===o)break e;f=0;do{x=n[s+f++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&f<o);if(512&r.flags&&4&r.wrap&&(r.check=W(r.check,n,f,s)),o-=f,s+=f,x)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;u<16;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(4&r.wrap&&c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Nt;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Mt;break;case 16189:for(;u<32;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}e.adler=r.check=Ft(c),c=0,u=0,r.mode=Lt;case Lt:if(0===r.havedict)return e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=o,r.hold=c,r.bits=u,wt;e.adler=r.check=1,r.mode=Mt;case Mt:if(t===vt||t===bt)break e;case zt:if(r.last){c>>>=7&u,u-=7&u,r.mode=Dt;break}for(;u<3;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}switch(r.last=1&c,c>>>=1,u-=1,3&c){case 0:r.mode=16193;break;case 1:if(qt(r),r.mode=Ot,t===bt){c>>>=2,u-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=Nt}c>>>=2,u-=2;break;case 16193:for(c>>>=7&u,u-=7&u;u<32;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if((65535&c)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Nt;break}if(r.length=65535&c,c=0,u=0,r.mode=Tt,t===bt)break e;case Tt:r.mode=16195;case 16195:if(f=r.length,f){if(f>o&&(f=o),f>l&&(f=l),0===f)break e;i.set(n.subarray(s,s+f),a),o-=f,s+=f,l-=f,a+=f,r.length-=f;break}r.mode=Mt;break;case 16196:for(;u<14;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(r.nlen=257+(31&c),c>>>=5,u-=5,r.ndist=1+(31&c),c>>>=5,u-=5,r.ncode=4+(15&c),c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Nt;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;u<3;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}r.lens[L[r.have++]]=7&c,c>>>=3,u-=3}for(;r.have<19;)r.lens[L[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},S=mt(0,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,S){e.msg="invalid code lengths set",r.mode=Nt;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;C=r.lencode[c&(1<<r.lenbits)-1],g=C>>>24,v=C>>>16&255,b=65535&C,!(g<=u);){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(b<16)c>>>=g,u-=g,r.lens[r.have++]=b;else{if(16===b){for(A=g+2;u<A;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(c>>>=g,u-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Nt;break}x=r.lens[r.have-1],f=3+(3&c),c>>>=2,u-=2}else if(17===b){for(A=g+3;u<A;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}c>>>=g,u-=g,x=0,f=3+(7&c),c>>>=3,u-=3}else{for(A=g+7;u<A;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}c>>>=g,u-=g,x=0,f=11+(127&c),c>>>=7,u-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Nt;break}for(;f--;)r.lens[r.have++]=x}}if(r.mode===Nt)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Nt;break}if(r.lenbits=9,E={bits:r.lenbits},S=mt(1,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,S){e.msg="invalid literal/lengths set",r.mode=Nt;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},S=mt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,S){e.msg="invalid distances set",r.mode=Nt;break}if(r.mode=Ot,t===bt)break e;case Ot:r.mode=Pt;case Pt:if(o>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=o,r.hold=c,r.bits=u,ct(e,d),a=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,c=r.hold,u=r.bits,r.mode===Mt&&(r.back=-1);break}for(r.back=0;C=r.lencode[c&(1<<r.lenbits)-1],g=C>>>24,v=C>>>16&255,b=65535&C,!(g<=u);){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(v&&0===(240&v)){for(y=g,_=v,w=b;C=r.lencode[w+((c&(1<<y+_)-1)>>y)],g=C>>>24,v=C>>>16&255,b=65535&C,!(y+g<=u);){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}c>>>=y,u-=y,r.back+=y}if(c>>>=g,u-=g,r.back+=g,r.length=b,0===v){r.mode=16205;break}if(32&v){r.back=-1,r.mode=Mt;break}if(64&v){e.msg="invalid literal/length code",r.mode=Nt;break}r.extra=15&v,r.mode=16201;case 16201:if(r.extra){for(A=r.extra;u<A;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;C=r.distcode[c&(1<<r.distbits)-1],g=C>>>24,v=C>>>16&255,b=65535&C,!(g<=u);){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(0===(240&v)){for(y=g,_=v,w=b;C=r.distcode[w+((c&(1<<y+_)-1)>>y)],g=C>>>24,v=C>>>16&255,b=65535&C,!(y+g<=u);){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}c>>>=y,u-=y,r.back+=y}if(c>>>=g,u-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=Nt;break}r.offset=b,r.extra=15&v,r.mode=16203;case 16203:if(r.extra){for(A=r.extra;u<A;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Nt;break}r.mode=16204;case 16204:if(0===l)break e;if(f=d-l,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Nt;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),m=r.window}else m=i,p=a-r.offset,f=r.length;f>l&&(f=l),l-=f,r.length-=f;do{i[a++]=m[p++]}while(--f);0===r.length&&(r.mode=Pt);break;case 16205:if(0===l)break e;i[a++]=r.length,l--,r.mode=Pt;break;case Dt:if(r.wrap){for(;u<32;){if(0===o)break e;o--,c|=n[s++]<<u,u+=8}if(d-=l,e.total_out+=d,r.total+=d,4&r.wrap&&d&&(e.adler=r.check=r.flags?W(r.check,i,d,a-d):B(r.check,i,d,a-d)),d=l,4&r.wrap&&(r.flags?c:Ft(c))!==r.check){e.msg="incorrect data check",r.mode=Nt;break}c=0,u=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;u<32;){if(0===o)break e;o--,c+=n[s++]<<u,u+=8}if(4&r.wrap&&c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Nt;break}c=0,u=0}r.mode=16208;case 16208:S=_t;break e;case Nt:S=St;break e;case 16210:return Ct;default:return xt}return e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=o,r.hold=c,r.bits=u,(r.wsize||d!==e.avail_out&&r.mode<Nt&&(r.mode<Dt||t!==gt))&&Yt(e,e.output,e.next_out,d-e.avail_out),h-=e.avail_in,d-=e.avail_out,e.total_in+=h,e.total_out+=d,r.total+=d,4&r.wrap&&d&&(e.adler=r.check=r.flags?W(r.check,i,d,e.next_out-d):B(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Mt?128:0)+(r.mode===Ot||r.mode===Tt?256:0),(0===h&&0===d||t===gt)&&S===yt&&(S=kt),S},inflateEnd:e=>{if(It(e))return xt;let t=e.state;return t.window&&(t.window=null),e.state=null,yt},inflateGetHeader:(e,t)=>{if(It(e))return xt;const r=e.state;return 0===(2&r.wrap)?xt:(r.head=t,t.done=!1,yt)},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,s;return It(e)?xt:(n=e.state,0!==n.wrap&&n.mode!==Lt?xt:n.mode===Lt&&(i=1,i=B(i,t,r,0),i!==n.check)?St:(s=Yt(e,t,r,r),s?(n.mode=16210,Ct):(n.havedict=1,yt)))},inflateInfo:"pako inflate (from Nodeca project)"},Xt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Kt=Object.prototype.toString,{Z_NO_FLUSH:$t,Z_FINISH:Qt,Z_OK:Jt,Z_STREAM_END:er,Z_NEED_DICT:tr,Z_STREAM_ERROR:rr,Z_DATA_ERROR:nr,Z_MEM_ERROR:ir}=H;function sr(e){this.options=Ve.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ze,this.strm.avail_out=0;let r=Zt.inflateInit2(this.strm,t.windowBits);if(r!==Jt)throw new Error(V[r]);if(this.header=new Xt,Zt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"===typeof t.dictionary?t.dictionary=Ye.string2buf(t.dictionary):"[object ArrayBuffer]"===Kt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Zt.inflateSetDictionary(this.strm,t.dictionary),r!==Jt)))throw new Error(V[r])}function ar(e,t){const r=new sr(t);if(r.push(e),r.err)throw r.msg||V[r.err];return r.result}sr.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Qt:$t,"[object ArrayBuffer]"===Kt.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=Zt.inflate(r,a),s===tr&&i&&(s=Zt.inflateSetDictionary(r,i),s===Jt?s=Zt.inflate(r,a):s===nr&&(s=tr));r.avail_in>0&&s===er&&r.state.wrap>0&&0!==e[r.next_in];)Zt.inflateReset(r),s=Zt.inflate(r,a);switch(s){case rr:case nr:case tr:case ir:return this.onEnd(s),this.ended=!0,!1}if(o=r.avail_out,r.next_out&&(0===r.avail_out||s===er))if("string"===this.options.to){let e=Ye.utf8border(r.output,r.next_out),t=r.next_out-e,i=Ye.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(s!==Jt||0!==o){if(s===er)return s=Zt.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},sr.prototype.onData=function(e){this.chunks.push(e)},sr.prototype.onEnd=function(e){e===Jt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ve.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var or={Inflate:sr,inflate:ar,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ar(e,t)},ungzip:ar,constants:H};const{Deflate:lr,deflate:cr,deflateRaw:ur,gzip:hr}=ot,{Inflate:dr,inflate:fr,inflateRaw:pr,ungzip:mr}=or;var gr=lr,vr=cr,br=ur,yr=hr,_r=dr,wr=fr,xr=pr,Sr=mr,Cr=H,kr={Deflate:lr,deflate:cr,deflateRaw:ur,gzip:hr,Inflate:dr,inflate:fr,inflateRaw:pr,ungzip:mr,constants:H}}
2},__webpack_module_cache__={};function __nested_webpack_require_1844235__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__nested_webpack_require_1844235__),r.exports}__nested_webpack_require_1844235__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_webpack_require_1844235__.d(t,{a:t}),t},__nested_webpack_require_1844235__.d=(e,t)=>{for(var r in t)__nested_webpack_require_1844235__.o(t,r)&&!__nested_webpack_require_1844235__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__nested_webpack_require_1844235__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__nested_webpack_require_1844235__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__nested_webpack_require_1844235__("./src/index.ts"),__nested_webpack_require_1844235__("./src/SurfaceWorker.js");var __nested_webpack_exports__=__nested_webpack_require_1844235__("./src/exporter.js");return __nested_webpack_exports__})(),module.exports=factory()},160:(e,t,r)=>{"use strict";function n(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=" "),i+=r);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function i(){for(var e,t,r=0,i="";r<arguments.length;)(e=arguments[r++])&&(t=n(e))&&(i&&(i+=" "),i+=t);return i}r.r(t),r.d(t,{clsx:()=>i,default:()=>s});const s=i},992:e=>{"use strict";e.exports=function(e,t,r,n,i,s,a,o){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,s,a,o],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},304:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.default)((function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=null;return t.forEach((function(e){if(null==i){var t=e.apply(void 0,r);null!=t&&(i=t)}})),i}))};var n,i=r(488),s=(n=i)&&n.__esModule?n:{default:n};e.exports=t.default},488:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,r,n,i,s,a){var o=i||"<<anonymous>>",l=a||n;if(null==r[n])return t?new Error("Required "+s+" `"+l+"` was not specified in `"+o+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),h=6;h<c;h++)u[h-6]=arguments[h];return e.apply(void 0,[r,n,o,s,l].concat(u))}var r=t.bind(null,!1);return r.isRequired=t.bind(null,!0),r},e.exports=t.default},532:(e,t,r)=>{"use strict";var n=r(552);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,s,a){if(a!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i}
vendor: 4,605 bytes, line 2
2;return r.PropTypes=r,r}},460:(e,t,r)=>{e.exports=r(532)()},552:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},144:(e,t,r)=>{"use strict";var n=r(60),i=r(724);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,o={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(o[e]=t,e=0;e<t.length;e++)a.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function m(e,t,r,n,i,s,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function y(e,t,r,n){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,r,n){if(null===t||"undefined"===typeof t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!h.call(p,e)||!h.call(f,e)&&(d.test(e)?p[e]=!0:(f[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
2-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,b);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,b);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,b);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var _=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),A=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var P=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var D=Symbol.iterator;function N(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=D&&e[D]||e["@@iterator"])?e:null}var F,R=Object.assign;function I(e){if(void 0===F)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return"\n"+F+e}var j=!1;function G(e,t){if(!e||j)return"";j=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&"string"===typeof c.stack){for(var i=c.stack.split("\n"),s=n.stack.split("\n"),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||i[a]!==s[o]){var l="\n"+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=o);break}}}finally{j=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?I(e):""}function B(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 1:return e=G(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case S:return"Fragment";case x:return"Portal";case k:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case z:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case E:return(e._context.displayName||"Context")+".Provider";case L:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return U(e(t))}catch(r){}}return null}function W(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function H(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=H(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Y(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=H(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function Z(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function X(e,t){var r=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function K(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=V(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function $(e,t){null!=(t=t.checked)&&y(e,"checked",t,!1)}function Q(e,t){$(e,t);var r=V(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,r):t.hasOwnProperty("defaultValue")&&ee(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}
vendor: 24,780 bytes, line 2
2""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ee(e,t,r){"number"===t&&Z(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var te=Array.isArray;function re(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+V(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ne(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(s(91));return R({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(s(92));if(te(r)){if(1<r.length)throw Error(s(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:V(r)}}function se(e,t){var r=V(t.value),n=V(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,he=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function de(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function me(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=me(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(fe).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]}))}));var ve=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(s(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(s(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(s(62))}}function ye(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _e=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var xe=null,Se=null,Ce=null;function ke(e){if(e=yi(e)){if("function"!==typeof xe)throw Error(s(280));var t=e.stateNode;t&&(t=wi(t),xe(e.stateNode,e.type,t))}}function Ee(e){Se?Ce?Ce.push(e):Ce=[e]:Se=e}function Ae(){if(Se){var e=Se,t=Ce;if(Ce=Se=null,ke(e),t)for(e=0;e<t.length;e++)ke(t[e])}}function Le(e,t){return e(t)}function Me(){}var ze=!1;function Te(e,t,r){if(ze)return e(t,r);ze=!0;try{return Le(e,t,r)}finally{ze=!1,(null!==Se||null!==Ce)&&(Me(),Ae())}}function Oe(e,t){var r=e.stateNode;if(null===r)return null;var n=wi(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!==typeof r)throw Error(s(231,t,typeof r));return r}var Pe=!1;if(u)try{var De={};Object.defineProperty(De,"passive",{get:function(){Pe=!0}}),window.addEventListener("test",De,De),window.removeEventListener("test",De,De)}catch(ue){Pe=!1}function Ne(e,t,r,n,i,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(u){this.onError(u)}}var Fe=!1,Re=null,Ie=!1,je=null,Ge={onError:function(e){Fe=!0,Re=e}};function Be(e,t,r,n,i,s,a,o,l){Fe=!1,Re=null,Ne.apply(Ge,arguments)}function Ue(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function We(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ve(e){if(Ue(e)!==e)throw Error(s(188))}function He(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ue(e)))throw Error(s(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Ve(i),e;if(a===n)return Ve(i),t;a=a.sibling}throw Error(s(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(s(189))}}if(r.alternate!==n)throw Error(s(190))}if(3!==r.tag)throw Error(s(188));return r.stateNode.current===r?e:t}(e))?qe(e):null}function qe(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=qe(e);if(null!==t)return t;e=e.sibling}return null}var Ye=i.unstable_scheduleCallback,Ze=i.unstable_cancelCallback,Xe=i.unstable_shouldYield,Ke=i.unstable_requestPaint,$e=i.unstable_now,Qe=i.unstable_getCurrentPriorityLevel,Je=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,rt=i.unstable_LowPriority,nt=i.unstable_IdlePriority,it=null,st=null;var at=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/lt|0)|0},ot=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function ht(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,a=268435455&r;if(0!==a){var o=a&~i;0!==o?n=ht(o):0!==(s&=a)&&(n=ht(s))}else 0!==(a=r&~i)?n=ht(a):0!==s&&(n=ht(s));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(s=t&-t)||16===i&&0!==(4194240&s)))return t;if(0!==(4&n)&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-at(t)),n|=e[r],t&=~i;return n}function ft(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function vt(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=r}function bt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-at(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var yt=0;function _t(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,xt,St,Ct,kt,Et=!1,At=[],Lt=null,Mt=null,zt=null,Tt=new Map,Ot=new Map,Pt=[],Dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Nt(e,t){switch(e){case"focusin":case"focusout":Lt=null;break;case"dragenter":case"dragleave":Mt=null;break;case"mouseover":case"mouseout":zt=null;break;case"pointerover":case"pointerout":Tt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ot.delete(t.pointerId)}}function Ft(e,t,r,n,i,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},null!==t&&(null!==(t=yi(t))&&xt(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Rt(e){var t=bi(e.target);if(null!==t){var r=Ue(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=We(r)))return e.blockedOn=t,void kt(e.priority,(function(){St(r)}))}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function It(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=yi(r))&&xt(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);_e=n,r.target.dispatchEvent(n),_e=null,t.shift()}return!0}function jt(e,t,r){It(e)&&r.delete(t)}function Gt(){Et=!1,null!==Lt&&It(Lt)&&(Lt=null),null!==Mt&&It(Mt)&&(Mt=null),null!==zt&&It(zt)&&(zt=null),Tt.forEach(jt),Ot.forEach(jt)}function Bt(e,t){e.blockedOn===t&&(e.blockedOn=null,Et||(Et=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Gt)))}function Ut(e){function t(t){return Bt(t,e)}if(0<At.length){Bt(At[0],e);for(var r=1;r<At.length;r++){var n=At[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Lt&&Bt(Lt,e),null!==Mt&&Bt(Mt,e),null!==zt&&Bt(zt,e),Tt.forEach(t),Ot.forEach(t),r=0;r<Pt.length;r++)(n=Pt[r]).blockedOn===e&&(n.blockedOn=null);for(;0<Pt.length&&null===(r=Pt[0]).blockedOn;)Rt(r),null===r.blockedOn&&Pt.shift()}var Wt=_.ReactCurrentBatchConfig,Vt=!0;function Ht(e,t,r,n){var i=yt,s=Wt.transition;Wt.transition=null;try{yt=1,Yt(e,t,r,n)}finally{yt=i,Wt.transition=s}}function qt(e,t,r,n){var i=yt,s=Wt.transition;Wt.transition=null;try{yt=4,Yt(e,t,r,n)}finally{yt=i,Wt.transition=s}}function Yt(e,t,r,n){if(Vt){var i=Xt(e,t,r,n);if(null===i)Vn(e,t,n,Zt,r),Nt(e,n);else if(function(e,t,r,n,i){switch(t){case"focusin":return Lt=Ft(Lt,e,t,r,n,i),!0;case"dragenter":return Mt=Ft(Mt,e,t,r,n,i),!0;case"mouseover":return zt=Ft(zt,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return Tt.set(s,Ft(Tt.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Ot.set(s,Ft(Ot.get(s)||null,e,t,r,n,i)),!0}return!1}(i,e,t,r,n))n.stopPropagation();else if(Nt(e,n),4&t&&-1<Dt.indexOf(e)){for(;null!==i;){var s=yi(i);if(null!==s&&wt(s),null===(s=Xt(e,t,r,n))&&Vn(e,t,n,Zt,r),s===i)break;i=s}null!==i&&n.stopPropagation()}else Vn(e,t,n,null,r)}}var Zt=null;function Xt(e,t,r,n){if(Zt=null,null!==(e=bi(e=we(n))))if(null===(t=Ue(e)))e=null;else if(13===(r=t.tag)){if(null!==(e=We(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zt=e,null}function Kt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qe()){case Je:return 1;case et:return 4;case tt:case rt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var $t=null,Qt=null,Jt=null;function er(){if(Jt)return Jt;var e,t,r=Qt,n=r.length,i="value"in $t?$t.value:$t.textContent,s=i.length;for(e=0;e<n&&r[e]===i[e];e++);var a=n-e;for(t=1;t<=a&&r[n-t]===i[s-t];t++);return Jt=i.slice(e,1<t?1-t:void 0)}function tr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rr(){return!0}function nr(){return!1}function ir(e){function t(t,r,n,i,s){for(var a in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rr:nr,this.isPropagationStopped=nr,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),t}var sr,ar,or,lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cr=ir(lr),ur=R({},lr,{view:0,detail:0}),hr=ir(ur),dr=R({},ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==or&&(or&&"mousemove"===e.type?(sr=e.screenX-or.screenX,ar=e.screenY-or.screenY):ar=sr=0,or=e),sr)},movementY:function(e){return"movementY"in e?e.movementY:ar}}),fr=ir(dr),pr=ir(R({},dr,{dataTransfer:0})),mr=ir(R({},ur,{relatedTarget:0})),gr=ir(R({},lr,{animationName:0,elapsedTime:0,pseudoElement:0})),vr=R({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),br=ir(vr),yr=ir(R({},lr,{data:0})),_r={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=xr[e])&&!!t[e]}function Cr(){return Sr}var kr=R({},ur,{key:function(e){if(e.key){var t=_r[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cr,charCode:function(e){return"keypress"===e.type?tr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Er=ir(kr),Ar=ir(R({},dr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Lr=ir(R({},ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cr})),Mr=ir(R({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0})),zr=R({},dr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Tr=ir(zr),Or=[9,13,27,32],Pr=u&&"CompositionEvent"in window,Dr=null;u&&"documentMode"in document&&(Dr=document.documentMode);var Nr=u&&"TextEvent"in window&&!Dr,Fr=u&&(!Pr||Dr&&8<Dr&&11>=Dr),Rr=String.fromCharCode(32),Ir=!1;function jr(e,t){switch(e){case"keyup":return-1!==Or.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gr(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Br=!1;var Ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ur[e.type]:"textarea"===t}function Vr(e,t,r,n){Ee(n),0<(t=qn(t,"onChange")).length&&(r=new cr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Hr=null,qr=null;function Yr(e){In(e,0)}function Zr(e){if(Y(_i(e)))return e}function Xr(e,t){if("change"===e)return t}var Kr=!1;if(u){var $r;if(u){var Qr="oninput"in document;if(!Qr){var Jr=document.createElement("div");Jr.setAttribute("oninput","return;"),Qr="function"===typeof Jr.oninput}$r=Qr}else $r=!1;Kr=$r&&(!document.documentMode||9<document.documentMode)}function en(){Hr&&(Hr.detachEvent("onpropertychange",tn),qr=Hr=null)}function tn(e){if("value"===e.propertyName&&Zr(qr)){var t=[];Vr(t,qr,e,we(e)),Te(Yr,t)}}function rn(e,t,r){"focusin"===e?(en(),qr=r,(Hr=t).attachEvent("onpropertychange",tn)):"focusout"===e&&en()}function nn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Zr(qr)}function sn(e,t){if("click"===e)return Zr(t)}function an(e,t){if("input"===e||"change"===e)return Zr(t)}var on="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function ln(e,t){if(on(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!h.call(t,i)||!on(e[i],t[i]))return!1}return!0}function cn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function un(e,t){var r,n=cn(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cn(n)}}function hn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dn(){for(var e=window,t=Z();t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=Z((e=t.contentWindow).document)}return t}function fn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pn(e){var t=dn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&hn(r.ownerDocument.documentElement,r)){if(null!==n&&fn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=void 0===n.end?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=un(r,s);var a=un(r,n);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof r.focus&&r.focus(),r=0;r<t.length;r++)(e=t[r]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mn=u&&"documentMode"in document&&11>=document.documentMode,gn=null,vn=null,bn=null,yn=!1;function _n(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;yn||null==gn||gn!==Z(n)||("selectionStart"in(n=gn)&&fn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},bn&&ln(bn,n)||(bn=n,0<(n=qn(vn,"onSelect")).length&&(t=new cr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=gn)))}function wn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var xn={animationend:wn("Animation","AnimationEnd"),animationiteration:wn("Animation","AnimationIteration"),animationstart:wn("Animation","AnimationStart"),transitionend:wn("Transition","TransitionEnd")},Sn={},Cn={};function kn(e){if(Sn[e])return Sn[e];if(!xn[e])return e;var t,r=xn[e];for(t in r)if(r.hasOwnProperty(t)&&t in Cn)return Sn[e]=r[t];return e}u&&(Cn=document.createElement("div").style,"AnimationEvent"in window||(delete xn.animationend.animation,delete xn.animationiteration.animation,delete xn.animationstart.animation),"TransitionEvent"in window||delete xn.transitionend.transition);var En=kn("animationend"),An=kn("animationiteration"),Ln=kn("animationstart"),Mn=kn("transitionend"),zn=new Map,Tn="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function On(e,t){zn.set(e,t),l(t,[e])}for(var Pn=0;Pn<Tn.length;Pn++){var Dn=Tn[Pn];On(Dn.toLowerCase(),"on"+(Dn[0].toUpperCase()+Dn.slice(1)))}On(En,"onAnimationEnd"),On(An,"onAnimationIteration"),On(Ln,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(Mn,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focu
2sin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fn=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nn));function Rn(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,a,o,l,c){if(Be.apply(this,arguments),Fe){if(!Fe)throw Error(s(198));var u=Re;Fe=!1,Re=null,Ie||(Ie=!0,je=u)}}(n,t,void 0,e),e.currentTarget=null}function In(e,t){t=0!==(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;Rn(i,o,c),s=l}else for(a=0;a<n.length;a++){if(l=(o=n[a]).instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;Rn(i,o,c),s=l}}}if(Ie)throw e=je,Ie=!1,je=null,e}function jn(e,t){var r=t[mi];void 0===r&&(r=t[mi]=new Set);var n=e+"__bubble";r.has(n)||(Wn(t,e,2,!1),r.add(n))}function Gn(e,t,r){var n=0;t&&(n|=4),Wn(r,e,n,t)}var Bn="_reactListening"+Math.random().toString(36).slice(2);function Un(e){if(!e[Bn]){e[Bn]=!0,a.forEach((function(t){"selectionchange"!==t&&(Fn.has(t)||Gn(t,!1,e),Gn(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Bn]||(t[Bn]=!0,Gn("selectionchange",!1,t))}}function Wn(e,t,r,n){switch(Kt(t)){case 1:var i=Ht;break;case 4:i=qt;break;default:i=Yt}r=i.bind(null,t,r,e),i=void 0,!Pe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Vn(e,t,r,n,i){var s=n;if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var a=n.tag;if(3===a||4===a){var o=n.stateNode.containerInfo;if(o===i||8===o.nodeType&&o.parentNode===i)break;if(4===a)for(a=n.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==o;){if(null===(a=bi(o)))return;if(5===(l=a.tag)||6===l){n=s=a;continue e}o=o.parentNode}}n=n.return}Te((function(){var n=s,i=we(r),a=[];e:{var o=zn.get(e);if(void 0!==o){var l=cr,c=e;switch(e){case"keypress":if(0===tr(r))break e;case"keydown":case"keyup":l=Er;break;case"focusin":c="focus",l=mr;break;case"focusout":c="blur",l=mr;break;case"beforeblur":case"afterblur":l=mr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=pr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Lr;break;case En:case An:case Ln:l=gr;break;case Mn:l=Mr;break;case"scroll":l=hr;break;case"wheel":l=Tr;break;case"copy":case"cut":case"paste":l=br;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Ar}var u=0!==(4&t),h=!u&&"scroll"===e,d=u?null!==o?o+"Capture":null:o;u=[];for(var f,p=n;null!==p;){var m=(f=p).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==d&&(null!=(m=Oe(p,d))&&u.push(Hn(p,m,f)))),h)break;p=p.return}0<u.length&&(o=new l(o,c,null,r,i),a.push({event:o,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||r===_e||!(c=r.relatedTarget||r.fromElement)||!bi(c)&&!c[pi])&&(l||o)&&(o=i.window===i?i:(o=i.ownerDocument)?o.defaultView||o.parentWindow:window,l?(l=n,null!==(c=(c=r.relatedTarget||r.toElement)?bi(c):null)&&(c!==(h=Ue(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=n),l!==c)){if(u=fr,m="onMouseLeave",d="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=Ar,m="onPointerLeave",d="onPointerEnter",p="pointer"),h=null==l?o:_i(l),f=null==c?o:_i(c),(o=new u(m,p+"leave",l,r,i)).target=h,o.relatedTarget=f,m=null,bi(i)===n&&((u=new u(d,p+"enter",c,r,i)).target=f,u.relatedTarget=h,m=u),h=m,l&&c)e:{for(d=c,p=0,f=u=l;f;f=Yn(f))p++;for(f=0,m=d;m;m=Yn(m))f++;for(;0<p-f;)u=Yn(u),p--;for(;0<f-p;)d=Yn(d),f--;for(;p--;){if(u===d||null!==d&&u===d.alternate)break e;u=Yn(u),d=Yn(d)}u=null}else u=null;null!==l&&Zn(a,o,l,u,!1),null!==c&&null!==h&&Zn(a,h,c,u,!0)}if("select"===(l=(o=n?_i(n):window).nodeName&&o.nodeName.toLowerCase())||"input"===l&&"file"===o.type)var g=Xr;else if(Wr(o))if(Kr)g=an;else{g=nn;var v=rn}else(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(g=sn);switch(g&&(g=g(e,n))?Vr(a,g,r,i):(v&&v(e,o,n),"focusout"===e&&(v=o._wrapperState)&&v.controlled&&"number"===o.type&&ee(o,"number",o.value)),v=n?_i(n):window,e){case"focusin":(Wr(v)||"true"===v.contentEditable)&&(gn=v,vn=n,bn=null);break;case"focusout":bn=vn=gn=null;break;case"mousedown":yn=!0;break;case"contextmenu":case"mouseup":case"dragend":yn=!1,_n(a,r,i);break;case"selectionchange":if(mn)break;case"keydown":case"keyup":_n(a,r,i)}var b;if(Pr)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Br?jr(e,r)&&(y="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(y="onCompositionStart");y&&(Fr&&"ko"!==r.locale&&(Br||"onCompositionStart"!==y?"onCompositionEnd"===y&&Br&&(b=er()):(Qt="value"in($t=i)?$t.value:$t.textContent,Br=!0)),0<(v=qn(n,y)).length&&(y=new yr(y,e,null,r,i),a.push({event:y,listeners:v}),b?y.data=b:null!==(b=Gr(r))&&(y.data=b))),(b=Nr?function(e,t){switch(e){case"compositionend":return Gr(t);case"keypress":return 32!==t.which?null:(Ir=!0,Rr);case"textInput":return(e=t.data)===Rr&&Ir?null:e;default:return null}}(e,r):function(e,t){if(Br)return"compositionend"===e||!Pr&&jr(e,t)?(e=er(),Jt=Qt=$t=null,Br=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=qn(n,"onBeforeInput")).length&&(i=new yr("onBeforeInput","beforeinput",null,r,i),a.push({event:i,listeners:n}),i.data=b))}In(a,t)}))}function Hn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function qn(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=Oe(e,r))&&n.unshift(Hn(e,s,i)),null!=(s=Oe(e,t))&&n.push(Hn(e,s,i))),e=e.return}return n}function Yn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Zn(e,t,r,n,i){for(var s=t._reactName,a=[];null!==r&&r!==n;){var o=r,l=o.alternate,c=o.stateNode;if(null!==l&&l===n)break;5===o.tag&&null!==c&&(o=c,i?null!=(l=Oe(r,s))&&a.unshift(Hn(r,l,o)):i||null!=(l=Oe(r,s))&&a.push(Hn(r,l,o))),r=r.return}0!==a.length&&e.push({event:t,listeners:a})}var Xn=/\r\n?/g,Kn=/\u0000|\uFFFD/g;function $n(e){return("string"===typeof e?e:""+e).replace(Xn,"\n").replace(Kn,"")}function Qn(e,t,r){if(t=$n(t),$n(e)!==t&&r)throw Error(s(425))}function Jn(){}var ei=null,ti=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ni="function"===typeof setTimeout?setTimeout:void 0,ii="function"===typeof clearTimeout?clearTimeout:void 0,si="function"===typeof Promise?Promise:void 0,ai="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof si?function(e){return si.resolve(null).then(e).catch(oi)}:ni;function oi(e){setTimeout((function(){throw e}))}function li(e,t){var r=t,n=0;do{var i=r.nextSibling;
vendor: 85,667 bytes, line 2
2if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return e.removeChild(i),void Ut(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);Ut(t)}function ci(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ui(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var hi=Math.random().toString(36).slice(2),di="__reactFiber$"+hi,fi="__reactProps$"+hi,pi="__reactContainer$"+hi,mi="__reactEvents$"+hi,gi="__reactListeners$"+hi,vi="__reactHandles$"+hi;function bi(e){var t=e[di];if(t)return t;for(var r=e.parentNode;r;){if(t=r[pi]||r[di]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ui(e);null!==e;){if(r=e[di])return r;e=ui(e)}return t}r=(e=r).parentNode}return null}function yi(e){return!(e=e[di]||e[pi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function _i(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(s(33))}function wi(e){return e[fi]||null}var xi=[],Si=-1;function Ci(e){return{current:e}}function ki(e){0>Si||(e.current=xi[Si],xi[Si]=null,Si--)}function Ei(e,t){Si++,xi[Si]=e.current,e.current=t}var Ai={},Li=Ci(Ai),Mi=Ci(!1),zi=Ai;function Ti(e,t){var r=e.type.contextTypes;if(!r)return Ai;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in r)s[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Oi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Pi(){ki(Mi),ki(Li)}function Di(e,t,r){if(Li.current!==Ai)throw Error(s(168));Ei(Li,t),Ei(Mi,r)}function Ni(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!==typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in t))throw Error(s(108,W(e)||"Unknown",i));return R({},r,n)}function Fi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ai,zi=Li.current,Ei(Li,e),Ei(Mi,Mi.current),!0}function Ri(e,t,r){var n=e.stateNode;if(!n)throw Error(s(169));r?(e=Ni(e,t,zi),n.__reactInternalMemoizedMergedChildContext=e,ki(Mi),ki(Li),Ei(Li,e)):ki(Mi),Ei(Mi,r)}var Ii=null,ji=!1,Gi=!1;function Bi(e){null===Ii?Ii=[e]:Ii.push(e)}function Ui(){if(!Gi&&null!==Ii){Gi=!0;var e=0,t=yt;try{var r=Ii;for(yt=1;e<r.length;e++){var n=r[e];do{n=n(!0)}while(null!==n)}Ii=null,ji=!1}catch(i){throw null!==Ii&&(Ii=Ii.slice(e+1)),Ye(Je,Ui),i}finally{yt=t,Gi=!1}}return null}var Wi=[],Vi=0,Hi=null,qi=0,Yi=[],Zi=0,Xi=null,Ki=1,$i="";function Qi(e,t){Wi[Vi++]=qi,Wi[Vi++]=Hi,Hi=e,qi=t}function Ji(e,t,r){Yi[Zi++]=Ki,Yi[Zi++]=$i,Yi[Zi++]=Xi,Xi=e;var n=Ki;e=$i;var i=32-at(n)-1;n&=~(1<<i),r+=1;var s=32-at(t)+i;if(30<s){var a=i-i%5;s=(n&(1<<a)-1).toString(32),n>>=a,i-=a,Ki=1<<32-at(t)+i|r<<i|n,$i=s+e}else Ki=1<<s|r<<i|n,$i=e}function es(e){null!==e.return&&(Qi(e,1),Ji(e,1,0))}function ts(e){for(;e===Hi;)Hi=Wi[--Vi],Wi[Vi]=null,qi=Wi[--Vi],Wi[Vi]=null;for(;e===Xi;)Xi=Yi[--Zi],Yi[Zi]=null,$i=Yi[--Zi],Yi[Zi]=null,Ki=Yi[--Zi],Yi[Zi]=null}var rs=null,ns=null,is=!1,ss=null;function as(e,t){var r=Oc(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,null===(t=e.deletions)?(e.deletions=[r],e.flags|=16):t.push(r)}function os(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,rs=e,ns=ci(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,rs=e,ns=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(r=null!==Xi?{id:Ki,overflow:$i}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},(r=Oc(18,null,null,0)).stateNode=t,r.return=e,e.child=r,rs=e,ns=null,!0);default:return!1}}function ls(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function cs(e){if(is){var t=ns;if(t){var r=t;if(!os(e,t)){if(ls(e))throw Error(s(418));t=ci(r.nextSibling);var n=rs;t&&os(e,t)?as(n,r):(e.flags=-4097&e.flags|2,is=!1,rs=e)}}else{if(ls(e))throw Error(s(418));e.flags=-4097&e.flags|2,is=!1,rs=e}}}function us(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;rs=e}function hs(e){if(e!==rs)return!1;if(!is)return us(e),is=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=ns)){if(ls(e))throw ds(),Error(s(418));for(;t;)as(e,t),t=ci(t.nextSibling)}if(us(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){ns=ci(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}ns=null}}else ns=rs?ci(e.stateNode.nextSibling):null;return!0}function ds(){for(var e=ns;e;)e=ci(e.nextSibling)}function fs(){ns=rs=null,is=!1}function ps(e){null===ss?ss=[e]:ss.push(e)}var ms=_.ReactCurrentBatchConfig;function gs(e,t){if(e&&e.defaultProps){for(var r in t=R({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var vs=Ci(null),bs=null,ys=null,_s=null;function ws(){_s=ys=bs=null}function xs(e){var t=vs.current;ki(vs),e._currentValue=t}function Ss(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Cs(e,t){bs=e,_s=ys=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(_o=!0),e.firstContext=null)}function ks(e){var t=e._currentValue;if(_s!==e)if(e={context:e,memoizedValue:t,next:null},null===ys){if(null===bs)throw Error(s(308));ys=e,bs.dependencies={lanes:0,firstContext:e}}else ys=ys.next=e;return t}var Es=null;function As(e){null===Es?Es=[e]:Es.push(e)}function Ls(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,As(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ms(e,n)}function Ms(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var zs=!1;function Ts(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Os(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ps(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ds(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&Ml)){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ms(e,r)}return null===(i=n.interleaved)?(t.next=t,As(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ms(e,r)}function Ns(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&r))){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,bt(e,r)}}function Fs(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,s=null;if(null!==(r=r.firstBaseUpdate)){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===s?i=s=a:s=s.next=a,r=r.next}while(null!==r);null===s?i=s=t:s=s.next=t}else i=s=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Rs(e,t,r,n){var i=e.updateQueue;zs=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(null!==o){i.shared.pending=null;var l=o,c=l.next;l.next=null,null===a?s=c:a.next=c,a=l;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(null!==s){var h=i.baseState;for(a=0,u=c=l=null,o=s;;){var d=o.lane,f=o.eventTime;if((n&d)===d){null!==u&&(u=u.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,m=o;switch(d=t,f=r,m.tag){case 1:if("function"===typeof(p=m.payload)){h=p.call(f,h,d);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null===(d="function"===typeof(p=m.payload)?p.call(f,h,d):p)||void 0===d)break e;h=R({},h,d);break e;case 2:zs=!0}}null!==o.callback&&0!==o.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[o]:d.push(o))}else f={eventTime:f,lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=f,l=h):u=u.next=f,a|=d;if(null===(o=o.next)){if(null===(o=i.shared.pending))break;o=(d=o).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===u&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===s&&(i.shared.lanes=0);Rl|=a,e.lanes=a,e.memoizedState=h}}function Is(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!==typeof i)throw Error(s(191,i));i.call(n)}}}var js=(new n.Component).refs;function Gs(e,t,r,n){r=null===(r=r(n,t=e.memoizedState))||void 0===r?t:R({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var Bs={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=tc(),i=rc(e),s=Ps(n,i);s.payload=t,void 0!==r&&null!==r&&(s.callback=r),null!==(t=Ds(e,s,i))&&(nc(t,e,i,n),Ns(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=tc(),i=rc(e),s=Ps(n,i);s.tag=1,s.payload=t,void 0!==r&&null!==r&&(s.callback=r),null!==(t=Ds(e,s,i))&&(nc(t,e,i,n),Ns(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=tc(),n=rc(e),i=Ps(r,n);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),null!==(t=Ds(e,i,n))&&(nc(t,e,n,r),Ns(t,e,n))}};function Us(e,t,r,n,i,s,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,s,a):!t.prototype||!t.prototype.isPureReactComponent||(!ln(r,n)||!ln(i,s))}function Ws(e,t,r){var n=!1,i=Ai,s=t.contextType;return"object"===typeof s&&null!==s?s=ks(s):(i=Oi(t)?zi:Li.current,s=(n=null!==(n=t.contextTypes)&&void 0!==n)?Ti(e,i):Ai),t=new t(r,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Bs,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Vs(e,t,r,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Hs(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=js,Ts(e);var s=t.contextType;"object"===typeof s&&null!==s?i.context=ks(s):(s=Oi(t)?zi:Li.current,i.context=Ti(e,s)),i.state=e.memoizedState,"function"===typeof(s=t.getDerivedStateFromProps)&&(Gs(e,t,s,r),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Bs.enqueueReplaceState(i,i.state,null),Rs(e,r,i,n),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}function qs(e,t,r){if(null!==(e=r.ref)&&"function"!==typeof e&&"object"!==typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(s(309));var n=r.stateNode}if(!n)throw Error(s(147,e));var i=n,a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;t===js&&(t=i.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!==typeof e)throw Error(s(284));if(!r._owner)throw Error(s(290,e))}return e}function Ys(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zs(e){return(0,e._init)(e._payload)}function Xs(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Dc(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=2,r):n:(t.flags|=2,r):(t.flags|=1048576,r)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,r,n){return null===t||6!==t.tag?((t=Ic(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){var s=r.type;return s===S?h(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===s||"object"===typeof s&&null!==s&&s.$$typeof===O&&Zs(s)===t.type)?((n=i(t,r.props)).ref=qs(e,t,r),n.return=e,n):((n=Nc(r.type,r.key,r.props,null,e.mode,n)).ref=qs(e,t,r),n.return=e,n)}function u(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=jc(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function h(e,t,r,n,s){return null===t||7!==t.tag?((t=Fc(r,e.mode,n,s)).return=e,t):((t=i(t,r)).return=e,t)}function d(e,t,r){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Ic(""+t,e.mode,r)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(r=Nc(t.type,t.key,t.props,null,e.mode,r)).ref=qs(e,null,t),r.return=e,r;case x:return(t=jc(t,e.mode,r)).return=e,t;case O:return d(e,(0,t._init)(t._payload),r)}if(te(t)||N(t))return(t=Fc(t,e.mode,r,null)).return=e,t;Ys(e,t)}return null}function f(e,t,r,n){var i=null!==t?t.key:null;if("string"===typeof r&&""!==r||"number"===typeof r)return null!==i?null:l(e,t,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return r.key===i?c(e,t,r,n):null;case x:return r.key===i?u(e,t,r,n):null;case O:return f(e,t,(i=r._init)(r._payload),n)}if(te(r)||N(r))return null!==i?null:h(e,t,r,n,null);Ys(e,r)}return null}function p(e,t,r,n,i){if("string"===typeof n&&""!==n||"number"===typeof n)return l(t,e=e.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return c(t,e=e.get(null===n.key?r:n.key)||null,n,i);case x:return u(t,e=e.get(null===n.key?r:n.key)||null,n,i);case O:return p(e,t,r,(0,n._init)(n._payload),i)}if(te(n)||N(n))return h(t,e=e.get(r)||null,n,i,null);Ys(t,n)}return null}function m(i,s,o,l){for(var c=null,u=null,h=s,m=s=0,g=null;null!==h&&m<o.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var v=f(i,h,o[m],l);if(null===v){null===h&&(h=g);break}e&&h&&null===v.alternate&&t(i,h),s=a(v,s,m),null===u?c=v:u.sibling=v,u=v,h=g}if(m===o.length)return r(i,h),is&&Qi(i,m),c;if(null===h){for(;m<o.length;m++)null!==(h=d(i,o[m],l))&&(s=a(h,s,m),null===u?c=h:u.sibling=h,u=h);return is&&Qi(i,m),c}for(h=n(i,h);m<o.length;m++)null!==(g=p(h,i,m,o[m],l))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),s=a(g,s,m),null===u?c=g:u.sibling=g,u=g);return e&&h.forEach((function(e){return t(i,e)})),is&&Qi(i,m),c}function g(i,o,l,c){var u=N(l);if("function"!==typeof u)throw Error(s(150));if(null==(l=u.call(l)))throw Error(s(151));for(var h=u=null,m=o,g=o=0,v=null,b=l.next();null!==m&&!b.done;g++,b=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var y=f(i,m,b.value,c);if(null===y){null===m&&(m=v);break}e&&m&&null===y.alternate&&t(i,m),o=a(y,o,g),null===h?u=y:h.sibling=y,h=y,m=v}if(b.done)return r(i,m),is&&Qi(i,g),u;if(null===m){for(;!b.done;g++,b=l.next())null!==(b=d(i,b.value,c))&&(o=a(b,o,g),null===h?u=b:h.sibling=b,h=b);return is&&Qi(i,g),u}for(m=n(i,m);!b.done;g++,b=l.next())null!==(b=p(m,i,g,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?g:b.key),o=a(b,o,g),null===h?u=b:h.sibling=b,h=b);return e&&m.forEach((function(e){return t(i,e)})),is&&Qi(i,g),u}return function e(n,s,a,l){if("object"===typeof a&&null!==a&&a.type===S&&null===a.key&&(a=a.props.children),"object"===typeof a&&null!==a){switch(a.$$typeof){case w:e:{for(var c=a.key,u=s;null!==u;){if(u.key===c){if((c=a.type)===S){if(7===u.tag){r(n,u.sibling),(s=i(u,a.props.children)).return=n,n=s;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===O&&Zs(c)===u.type){r(n,u.sibling),(s=i(u,a.props)).ref=qs(n,u,a),s.return=n,n=s;break e}r(n,u);break}t(n,u),u=u.sibling}a.type===S?((s=Fc(a.props.children,n.mode,l,a.key)).return=n,n=s):((l=Nc(a.type,a.key,a.props,null,n.mode,l)).ref=qs(n,s,a),l.return=n,n=l)}return o(n);case x:e:{for(u=a.key;null!==s;){if(s.key===u){if(4===s.tag&&s.stateNode.containerInfo===a.containerInfo&&s.stateNode.implementation===a.implementation){r(n,s.sibling),(s=i(s,a.children||[])).return=n,n=s;break e}r(n,s);break}t(n,s),s=s.sibling}(s=jc(a,n.mode,l)).return=n,n=s}return o(n);case O:return e(n,s,(u=a._init)(a._payload),l)}if(te(a))return m(n,s,a,l);if(N(a))return g(n,s,a,l);Ys(n,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==s&&6===s.tag?(r(n,s.sibling),(s=i(s,a)).return=n,n=s):(r(n,s),(s=Ic(a,n.mode,l)).return=n,n=s),o(n)):r(n,s)}}var Ks=Xs(!0),$s=Xs(!1),Qs={},Js=Ci(Qs),ea=Ci(Qs),ta=Ci(Qs);function ra(e){if(e===Qs)throw Error(s(174));return e}function na(e,t){switch(Ei(ta,t),Ei(ea,e),Ei(Js,Qs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ki(Js),Ei(Js,t)}function ia(){ki(Js),ki(ea),ki(ta)}function sa(e){ra(ta.current);var t=ra(Js.current),r=le(t,e.type);t!==r&&(Ei(ea,e),Ei(Js,r))}function aa(e){ea.current===e&&(ki(Js),ki(ea))}var oa=Ci(0);function la(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ca=[];function ua(){for(var e=0;e<ca.length;e++)ca[e]._workInProgressVersionPrimary=null;ca.length=0}var ha=_.ReactCurrentDispatcher,da=_.ReactCurrentBatchConfig,fa=0,pa=null,ma=null,ga=null,va=!1,ba=!1,ya=0,_a=0;function wa(){throw Error(s(321))}function xa(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!on(e[r],t[r]))return!1;return!0}function Sa(e,t,r,n,i,a){if(fa=a,pa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ha.current=null===e||null===e.memoizedState?ao:oo,e=r(n,i),ba){a=0;do{if(ba=!1,ya=0,25<=a)throw Error(s(301));a+=1,ga=ma=null,t.updateQueue=null,ha.current=lo,e=r(n,i)}while(ba)}if(ha.current=so,t=null!==ma&&null!==ma.next,fa=0,ga=ma=pa=null,va=!1,t)throw Error(s(300));return e}function Ca(){var e=0!==ya;return ya=0,e}function ka(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ga?pa.memoizedState=ga=e:ga=ga.next=e,ga}function Ea(){if(null===ma){var e=pa.alternate;e=null!==e?e.memoizedState:null}else e=ma.next;var t=null===ga?pa.memoizedState:ga.next;if(null!==t)ga=t,ma=e;else{if(null===e)throw Error(s(310));e={memoizedState:(ma=e).memoizedState,baseState:ma.baseState,baseQueue:ma.baseQueue,queue:ma.queue,next:null},null===ga?pa.memoizedState=ga=e:ga=ga.next=e}return ga}function Aa(e,t){return"function"===typeof t?t(e):t}function La(e){var t=Ea(),r=t.queue;if(null===r)throw Error(s(311));r.lastRenderedReducer=e;var n=ma,i=n.baseQueue,a=r.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(null!==i){a=i.next,n=n.baseState;var l=o=null,c=null,u=a;do{var h=u.lane;if((fa&h)===h)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=d,o=n):c=c.next=d,pa.lanes|=h,Rl|=h}u=u.next}while(null!==u&&u!==a);null===c?o=n:c.next=l,on(n,t.memoizedState)||(_o=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(null!==(e=r.interleaved)){i=e;do{a=i.lane,pa.lanes|=a,Rl|=a,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ma(e){var t=Ea(),r=t.queue;if(null===r)throw Error(s(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var o=i=i.next;do{a=e(a,o.action),o=o.next}while(o!==i);on(a,t.memoizedState)||(_o=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function za(){}function Ta(e,t){var r=pa,n=Ea(),i=t(),a=!on(n.memoizedState,i);if(a&&(n.memoizedState=i,_o=!0),n=n.queue,Wa(Da.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||null!==ga&&1&ga.memoizedState.tag){if(r.flags|=2048,Ia(9,Pa.bind(null,r,n,i,t),void 0,null),null===zl)throw Error(s(349));0!==(30&fa)||Oa(r,t,i)}return i}function Oa(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=pa.updateQueue)?(t={lastEffect:null,stores:null},pa.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function Pa(e,t,r,n){t.value=r,t.getSnapshot=n,Na(t)&&Fa(e)}function Da(e,t,r){return r((function(){Na(t)&&Fa(e)}))}function Na(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!on(e,r)}catch(n){return!0}}function Fa(e){var t=Ms(e,1);null!==t&&nc(t,e,1,-1)}function Ra(e){var t=ka();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:e},t.queue=e,e=e.dispatch=to.bind(null,pa,e),[t.memoizedState,e]}function Ia(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=pa.updateQueue)?(t={lastEffect:null,stores:null},pa.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function ja(){return Ea().memoizedState}function Ga(e,t,r,n){var i=ka();pa.flags|=e,i.memoizedState=Ia(1|t,r,void 0,void 0===n?null:n)}function Ba(e,t,r,n){var i=Ea();n=void 0===n?null:n;var s=void 0;if(null!==ma){var a=ma.memoizedState;if(s=a.destroy,null!==n&&xa(n,a.deps))return void(i.memoizedState=Ia(t,r,s,n))}pa.flags|=e,i.memoizedState=Ia(1|t,r,s,n)}function Ua(e,t){return Ga(8390656,8,e,t)}function Wa(e,t){return Ba(2048,8,e,t)}function Va(e,t){return Ba(4,2,e,t)}function Ha(e,t){return Ba(4,4,e,t)}function qa(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ya(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,Ba(4,4,qa.bind(null,t,e),r)}function Za(){}function Xa(e,t){var r=Ea();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&xa(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ka(e,t){var r=Ea();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&xa(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function $a(e,t,r){return 0===(21&fa)?(e.baseState&&(e.baseState=!1,_o=!0),e.memoizedState=r):(on(r,t)||(r=mt(),pa.lanes|=r,Rl|=r,e.baseState=!0),t)}function Qa(e,t){var r=yt;yt=0!==r&&4>r?r:4,e(!0);var n=da.transition;da.transition={};try{e(!1),t()}finally{yt=r,da.transition=n}}function Ja(){return Ea().memoizedState}function eo(e,t,r){var n=rc(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ro(e))no(t,r);else if(null!==(r=Ls(e,t,r,n))){nc(r,e,n,tc()),io(r,t,n)}}function to(e,t,r){var n=rc(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ro(e))no(t,i);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var a=t.lastRenderedState,o=s(a,r);if(i.hasEagerState=!0,i.eagerState=o,on(o,a)){var l=t.interleaved;return null===l?(i.next=i,As(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(c){}null!==(r=Ls(e,t,i,n))&&(nc(r,e,n,i=tc()),io(r,t,n))}}function ro(e){var t=e.alternate;return e===pa||null!==t&&t===pa}function no(e,t){ba=va=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function io(e,t,r){if(0!==(4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,bt(e,r)}}var so={readContext:ks,useCallback:wa,useContext:wa,useEffect:wa,useImperativeHandle:wa,useInsertionEffect:wa,useLayoutEffect:wa,useMemo:wa,useReducer:wa,useRef:wa,useState:wa,useDebugValue:wa,useDeferredValue:wa,useTransition:wa,useMutableSource:wa,useSyncExternalStore:wa,useId:wa,unstable_isNewReconciler:!1},ao={readContext:ks,useCallback:function(e,t){return ka().memoizedState=[e,void 0===t?null:t],e},useContext:ks,useEffect:Ua,useImperativeHandle:function(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,Ga(4194308,4,qa.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ga(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ga(4,2,e,t)},useMemo:function(e,t){var r=ka();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ka();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=eo.bind(null,pa,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ka().memoizedState=e},useState:Ra,useDebugValue:Za,useDeferredValue:function(e){return ka().memoizedState=e},useTransition:function(){var e=Ra(!1),t=e[0];return e=Qa.bind(null,e[1]),ka().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=pa,i=ka();if(is){if(void 0===r)throw Error(s(407));r=r()}else{if(r=t(),null===zl)throw Error(s(349));0!==(30&fa)||Oa(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Ua(Da.bind(null,n,a,e),[e]),n.flags|=2048,Ia(9,Pa.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ka(),t=zl.identifierPrefix;if(is){var r=$i;t=":"+t+"R"+(r=(Ki&~(1<<32-at(Ki)-1)).toString(32)+r),0<(r=ya++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=_a++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oo={readContext:ks,useCallback:Xa,useContext:ks,useEffect:Wa,useImperativeHandle:Ya,useInsertionEffect:Va,useLayoutEffect:Ha,useMemo:Ka,useReducer:La,useRef:ja,useState:function(){return La(Aa)},useDebugValue:Za,useDeferredValue:function(e){return $a(Ea(),ma.memoizedState,e)},useTransition:function(){return[La(Aa)[0],Ea().memoizedState]},useMutableSource:za,useSyncExternalStore:Ta,useId:Ja,unstable_isNewReconciler:!1},lo={readContext:ks,useCallback:Xa,useContext:ks,useEffect:Wa,useImperativeHandle:Ya,useInsertionEffect:Va,useLayoutEffect:Ha,useMemo:Ka,useReducer:Ma,useRef:ja,useState:function(){return Ma(Aa)},useDebugValue:Za,useDeferredValue:function(e){var t=Ea();return null===ma?t.memoizedState=e:$a(t,ma.memoizedState,e)},useTransition:function(){return[Ma(Aa)[0],Ea().memoizedState]},useMutableSource:za,useSyncExternalStore:Ta,useId:Ja,unstable_isNewReconciler:!1};function co(e,t){try{var r="",n=t;do{r+=B(n),n=n.return}while(n);var i=r}catch(s){i="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:i,digest:null}}function uo(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function ho(e,t){try{console.error(t.value)}catch(r){setTimeout((function(){throw r}))}}var fo="function"===typeof WeakMap?WeakMap:Map;function po(e,t,r){(r=Ps(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Hl||(Hl=!0,ql=n),ho(0,t)},r}function mo(e,t,r){(r=Ps(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){ho(0,t)}}var s=e.stateNode;return null!==s&&"function"===typeof s.componentDidCatch&&(r.callback=function(){ho(0,t),"function"!==typeof n&&(null===Yl?Yl=new Set([this]):Yl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function go(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new fo;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Ec.bind(null,e,t,r),t.then(e,e))}function vo(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function bo(e,t,r,n,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=Ps(-1,1)).tag=2,Ds(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var yo=_.ReactCurrentOwner,_o=!1;function wo(e,t,r,n){t.child=null===e?$s(t,null,r,n):Ks(t,e.child,r,n)}function xo(e,t,r,n,i){r=r.render;var s=t.ref;return Cs(t,i),n=Sa(e,t,r,n,s,i),r=Ca(),null===e||_o?(is&&r&&es(t),t.flags|=1,wo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ho(e,t,i))}function So(e,t,r,n,i){if(null===e){var s=r.type;return"function"!==typeof s||Pc(s)||void 0!==s.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Nc(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Co(e,t,s,n,i))}if(s=e.child,0===(e.lanes&i)){var a=s.memoizedProps;if((r=null!==(r=r.compare)?r:ln)(a,n)&&e.ref===t.ref)return Ho(e,t,i)}return t.flags|=1,(e=Dc(s,n)).ref=t.ref,e.return=t,t.child=e}function Co(e,t,r,n,i){if(null!==e){var s=e.memoizedProps;if(ln(s,n)&&e.ref===t.ref){if(_o=!1,t.pendingProps=n=s,0===(e.lanes&i))return t.lanes=e.lanes,Ho(e,t,i);0!==(131072&e.flags)&&(_o=!0)}}return Ao(e,t,r,n,i)}function ko(e,t,r){var n=t.pendingProps,i=n.children,s=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ei(Dl,Pl),Pl|=r;else{if(0===(1073741824&r))return e=null!==s?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ei(Dl,Pl),Pl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==s?s.baseLanes:r,Ei(Dl,Pl),Pl|=n}else null!==s?(n=s.baseLanes|r,t.memoizedState=null):n=r,Ei(Dl,Pl),Pl|=n;return wo(e,t,i,r),t.child}function Eo(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ao(e,t,r,n,i){var s=Oi(r)?zi:Li.current;return s=Ti(t,s),Cs(t,i),r=Sa(e,t,r,n,s,i),n=Ca(),null===e||_o?(is&&n&&es(t),t.flags|=1,wo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ho(e,t,i))}function Lo(e,t,r,n,i){if(Oi(r)){var s=!0;Fi(t)}else s=!1;if(Cs(t,i),null===t.stateNode)Vo(e,t),Ws(t,r,n),Hs(t,r,n,i),n=!0;else if(null===e){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=r.contextType;"object"===typeof c&&null!==c?c=ks(c):c=Ti(t,c=Oi(r)?zi:Li.current);var u=r.getDerivedStateFromProps,h="function"===typeof u||"function"===typeof a.getSnapshotBeforeUpdate;h||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(o!==n||l!==c)&&Vs(t,a,n,c),zs=!1;var d=t.memoizedState;a.state=d,Rs(t,n,a,i),l=t.memoizedState,o!==n||d!==l||Mi.current||zs?("function"===typeof u&&(Gs(t,r,u,n),l=t.memoizedState),(o=zs||Us(t,r,o,n,d,l,c))?(h||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),a.props=n,a.state=l,a.context=c,n=o):("function"===typeof a.componentDidMount&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,Os(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:gs(t.type,o),a.props=c,h=t.pendingProps,d=a.context,"object"===typeof(l=r.contextType)&&null!==l?l=ks(l):l=Ti(t,l=Oi(r)?zi:Li.current);var f=r.getDerivedStateFromProps;(u="function"===typeof f||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(o!==h||d!==l)&&Vs(t,a,n,l),zs=!1,d=t.memoizedState,a.state=d,Rs(t,n,a,i);var p=t.memoizedState;o!==h||d!==p||Mi.current||zs?("function"===typeof f&&(Gs(t,r,f,n),p=t.memoizedState),(c=zs||Us(t,r,c,n,d,p,l)||!1)?(u||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(n,p,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(n,p,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),a.props=n,a.state=p,a.context=l,n=c):("function"!==typeof a.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return Mo(e,t,r,n,s,i)}function Mo(e,t,r,n,i,s){Eo(e,t);var a=0!==(128&t.flags);if(!n&&!a)return i&&Ri(t,r,!1),Ho(e,t,s);n=t.stateNode,yo.current=t;var o=a&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&a?(t.child=Ks(t,e.child,null,s),t.child=Ks(t,null,o,s)):wo(e,t,o,s),t.memoizedState=n.state,i&&Ri(t,r,!0),t.child}function zo(e){var t=e.stateNode;t.pendingContext?Di(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Di(0,t.context,!1),na(e,t.containerInfo)}function To(e,t,r,n,i){return fs(),ps(i),t.flags|=256,wo(e,t,r,n),t.child}var Oo,Po,Do,No,Fo={dehydrated:null,treeContext:null,retryLane:0};function Ro(e){return{baseLanes:e,cachePool:null,transitions:null}}function Io(e,t,r){var n,i=t.pendingProps,a=oa.current,o=!1,l=0!==(128&t.flags);if((n=l)||(n=(null===e||null!==e.memoizedState)&&0!==(2&a)),n?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Ei(oa,1&a),null===e)return cs(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,o?(i=t.mode,o=t.child,l={mode:"hidden",children:l},0===(1&i)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=Rc(l,i,0,null),e=Fc(e,i,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Ro(r),t.memoizedState=Fo,e):jo(t,l));if(null!==(a=e.memoizedState)&&null!==(n=a.dehydrated))return function(e,t,r,n,i,a,o){if(r)return 256&t.flags?(t.flags&=-257,Go(e,t,o,n=uo(Error(s(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Rc({mode:"visible",children:n.children},i,0,null),(a=Fc(a,i,o,null)).flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,0!==(1&t.mode)&&Ks(t,e.child,null,o),t.child.memoizedState=Ro(o),t.memoizedState=Fo,a);if(0===(1&t.mode))return Go(e,t,o,null);if("$!"===i.data){if(n=i.nextSibling&&i.nextSibling.dataset)var l=n.dgst;return n=l,Go(e,t,o,n=uo(a=Error(s(419)),n,void 0))}if(l=0!==(o&e.childLanes),_o||l){if(null!==(n=zl)){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(n.suspendedLanes|o))?0:i)&&i!==a.retryLane&&(a.retryLane=i,Ms(e,i),nc(n,e,i,-1))}return gc(),Go(e,t,o,n=uo(Error(s(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Lc.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,ns=ci(i.nextSibling),rs=t,is=!0,ss=null,null!==e&&(Yi[Zi++]=Ki,Yi[Zi++]=$i,Yi[Zi++]=Xi,Ki=e.id,$i=e.overflow,Xi=t),t=jo(t,n.children),t.flags|=4096,t)}(e,t,l,i,n,a,r);if(o){o=i.fallback,l=t.mode,n=(a=e.child).sibling;var c={mode:"hidden",children:i.children};return 0===(1&l)&&t.child!==a?((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null):(i=Dc(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==n?o=Dc(n,o):(o=Fc(o,l,r,null)).flags|=2,o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,l=null===(l=e.child.memoizedState)?Ro(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~r,t.memoizedState=Fo,i}return e=(o=e.child).sibling,i=Dc(o,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function jo(e,t){return(t=Rc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Go(e,t,r,n){return null!==n&&ps(n),Ks(t,e.child,null,r),(e=jo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bo(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Ss(e.return,t,r)}function Uo(e,t,r,n,i){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function Wo(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(wo(e,t,n.children,r),0!==(2&(n=oa.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bo(e,r,t);else if(19===e.tag)Bo(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ei(oa,n),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===la(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Uo(t,!1,i,r,s);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===la(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Uo(t,!0,r,null,s);break;case"together":Uo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vo(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ho(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Rl|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(r=Dc(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Dc(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function qo(e,t){if(!is)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Yo(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Zo(e,t,r){var n=t.pendingProps;switch(ts(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yo(t),null;case 1:case 17:return Oi(t.type)&&Pi(),Yo(t),null;case 3:return n=t.stateNode,ia(),ki(Mi),ki(Li),ua(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(hs(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ss&&(oc(ss),ss=null))),Po(e,t),Yo(t),null;case 5:aa(t);var i=ra(ta.current);if(r=t.type,null!==e&&null!=t.stateNode)Do(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(s(166));return Yo(t),null}if(e=ra(Js.current),hs(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[di]=t,n[fi]=a,e=0!==(1&t.mode),r){case"dialog":jn("cancel",n),jn("close",n);break;case"iframe":case"object":case"embed":jn("load",n);break;case"video":case"audio":for(i=0;i<Nn.length;i++)jn(Nn[i],n);break;case"source":jn("error",n);break;case"img":case"image":case"link":jn("error",n),jn("load",n);break;case"details":jn("toggle",n);break;case"input":K(n,a),jn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},jn("invalid",n);break;case"textarea":ie(n,a),jn("invalid",n)}for(var l in be(r,a),i=null,a)if(a.hasOwnProperty(l)){var c=a[l];"children"===l?"string"===typeof c?n.textContent!==c&&(!0!==a.suppressHydrationWarning&&Qn(n.textContent,c,e),i=["children",c]):"number"===typeof c&&n.textContent!==""+c&&(!0!==a.suppressHydrationWarning&&Qn(n.textContent,c,e),i=["children",""+c]):o.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&jn("scroll",n)}switch(r){case"input":q(n),J(n,a,!0);break;case"textarea":q(n),ae(n);break;case"select":case"option":break;default:"function"===typeof a.onClick&&(n.onclick=Jn)}n=i,t.updateQueue=n,null!==n&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof n.is?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),"select"===r&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[di]=t,e[fi]=n,Oo(e,t,!1,!1),t.stateNode=e;e:{switch(l=ye(r,n),r){case"dialog":jn("cancel",e),jn("close",e),i=n;break;case"iframe":case"object":case"embed":jn("load",e),i=n;break;case"video":case"audio":for(i=0;i<Nn.length;i++)jn(Nn[i],e);i=n;break;case"source":jn("error",e),i=n;break;case"img":case"image":case"link":jn("error",e),jn("load",e),i=n;break;case"details":jn("toggle",e),i=n;break;case"input":K(e,n),i=X(e,n),jn("invalid",e);break;case"option":default:i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=R({},n,{value:void 0}),jn("invalid",e);break;case"textarea":ie(e,n),i=ne(e,n),jn("invalid",e)}for(a in be(r,i),c=i)if(c.hasOwnProperty(a)){var u=c[a];"style"===a?ge(e,u):"dangerouslySetInnerHTML"===a?null!=(u=u?u.__html:void 0)&&he(e,u):"children"===a?"string"===typeof u?("textarea"!==r||""!==u)&&de(e,u):"number"===typeof u&&de(e,""+u):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(o.hasOwnProperty(a)?null!=u&&"onScroll"===a&&jn("scroll",e):null!=u&&y(e,a,u,l))}switch(r){case"input":q(e),J(e,n,!1);break;case"textarea":q(e),ae(e);break;case"option":null!=n.value&&e.setAttribute("value",""+V(n.value));break;case"select":e.multiple=!!n.multiple,null!=(a=n.value)?re(e,!!n.multiple,a,!1):null!=n.defaultValue&&re(e,!!n.multiple,n.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=Jn)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Yo(t),null;case 6:if(e&&null!=t.stateNode)No(e,t,e.memoizedProps,n);else{if("string"!==typeof n&&null===t.stateNode)throw Error(s(166));if(r=ra(ta.current),ra(Js.current),hs(t)){if(n=t.stateNode,r=t.memoizedProps,n[di]=t,(a=n.nodeValue!==r)&&null!==(e=rs))switch(e.tag){case 3:Qn(n.nodeValue,r,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Qn(n.nodeValue,r,0!==(1&e.mode))}a&&(t.flags|=4)}else(n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[di]=t,t.stateNode=n}return Yo(t),null;case 13:if(ki(oa),n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(is&&null!==ns&&0!==(1&t.mode)&&0===(128&t.flags))ds(),fs(),t.flags|=98560,a=!1;else if(a=hs(t),null!==n&&null!==n.dehydrated){if(null===e){if(!a)throw Error(s(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(s(317));a[di]=t}else fs(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Yo(t),a=!1}else null!==ss&&(oc(ss),ss=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=r,t):((n=null!==n)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&oa.current)?0===Nl&&(Nl=3):gc())),null!==t.updateQueue&&(t.flags|=4),Yo(t),null);case 4:return ia(),Po(e,t),null===e&&Un(t.stateNode.containerInfo),Yo(t),null;case 10:return xs(t.type._context),Yo(t),null;case 19:if(ki(oa),null===(a=t.memoizedState))return Yo(t),null;if(n=0!==(128&t.flags),null===(l=a.rendering))if(n)qo(a,!1);else{if(0!==Nl||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=la(e))){for(t.flags|=128,qo(a,!1),null!==(n=l.updateQueue)&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;null!==r;)e=n,(a=r).flags&=14680066,null===(l=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ei(oa,1&oa.current|2),t.child}e=e.sibling}null!==a.tail&&$e()>Wl&&(t.flags|=128,n=!0,qo(a,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=la(l))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),qo(a,!0),null===a.tail&&"hidden"===a.tailMode&&!l.alternate&&!is)return Yo(t),null}else 2*$e()-a.renderingStartTime>Wl&&1073741824!==r&&(t.flags|=128,n=!0,qo(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=a.last)?r.sibling=l:t.child=l,a.last=l)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=$e(),t.sibling=null,r=oa.current,Ei(oa,n?1&r|2:1&r),t):(Yo(t),null);case 22:case 23:return dc(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!==(1&t.mode)?0!==(1073741824&Pl)&&(Yo(t),6&t.subtreeFlags&&(t.flags|=8192)):Yo(t),null;case 24:case 25:return null}throw Error(s(156,t.tag))}function Xo(e,t){switch(ts(t),t.tag){case 1:return Oi(t.type)&&Pi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ia(),ki(Mi),ki(Li),ua(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return aa(t),null;case 13:if(ki(oa),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(s(340));fs()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ki(oa),null;case 4:return ia(),null;case 10:return xs(t.type._context),null;case 22:case 23:return dc(),null;default:return null}}Oo=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Po=function(){},Do=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,ra(Js.current);var s,a=null;switch(r){case"input":i=X(e,i),n=X(e,n),a=[];break;case"select":i=R({},i,{value:void 0}),n=R({},n,{value:void 0}),a=[];break;case"textarea":i=ne(e,i),n=ne(e,n),a=[];break;default:"function"!==typeof i.onClick&&"function"===typeof n.onClick&&(e.onclick=Jn)}for(u in be(r,n),r=null,i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(o.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var c=n[u];if(l=null!=i?i[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(r||(r={}),r[s]=c[s])}else r||(a||(a=[]),a.push(u,r)),r=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(a=a||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(a=a||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(o.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&jn("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},No=function(e,t,r,n){r!==n&&(t.flags|=4)};var Ko=!1,$o=!1,Qo="function"===typeof WeakSet?WeakSet:Set,Jo=null;function el(e,t){var r=e.ref;if(null!==r)if("function"===typeof r)try{r(null)}catch(n){kc(e,t,n)}else r.current=null}function tl(e,t,r){try{r()}catch(n){kc(e,t,n)}}var rl=!1;function nl(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&tl(t,r,s)}i=i.next}while(i!==n)}}function il(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function sl(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"===typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[di],delete t[fi],delete t[mi],delete t[gi],delete t[vi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ol(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cl(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==t.onclick||(t.onclick=Jn));else if(4!==n&&null!==(e=e.child))for(cl(e,t,r),e=e.sibling;null!==e;)cl(e,t,r),e=e.sibling}function ul(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(ul(e,t,r),e=e.sibling;null!==e;)ul(e,t,r),e=e.sibling}var hl=null,dl=!1;function fl(e,t,r){for(r=r.child;null!==r;)pl(e,t,r),r=r.sibling}function pl(e,t,r){if(st&&"function"===typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(it,r)}catch(o){}switch(r.tag){case 5:$o||el(r,t);case 6:var n=hl,i=dl;hl=null,fl(e,t,r),dl=i,null!==(hl=n)&&(dl?(e=hl,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):hl.removeChild(r.stateNode));break;case 18:null!==hl&&(dl?(e=hl,r=r.stateNode,8===e.nodeType?li(e.parentNode,r):1===e.nodeType&&li(e,r),Ut(e)):li(hl,r.stateNode));break;case 4:n=hl,i=dl,hl=r.stateNode.containerInfo,dl=!0,fl(e,t,r),hl=n,dl=i;break;case 0:case 11:case 14:case 15:if(!$o&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var s=i,a=s.destroy;s=s.tag,void 0!==a&&(0!==(2&s)||0!==(4&s))&&tl(r,t,a),i=i.next}while(i!==n)}fl(e,t,r);break;case 1:if(!$o&&(el(r,t),"function"===typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){kc(r,t,o)}fl(e,t,r);break;case 21:fl(e,t,r);break;case 22:1&r.mode?($o=(n=$o)||null!==r.memoizedState,fl(e,t,r),$o=n):fl(e,t,r);break;default:fl(e,t,r)}}function ml(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Qo),t.forEach((function(t){var n=Mc.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function gl(e,t){var r=t.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 5:hl=l.stateNode,dl=!1;break e;case 3:case 4:hl=l.stateNode.containerInfo,dl=!0;break e}l=l.return}if(null===hl)throw Error(s(160));pl(a,o,i),hl=null,dl=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(u){kc(i,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)vl(t,e),t=t.sibling}function vl(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gl(t,e),bl(e),4&n){try{nl(3,e,e.return),il(3,e)}catch(g){kc(e,e.return,g)}try{nl(5,e,e.return)}catch(g){kc(e,e.return,g)}}break;case 1:gl(t,e),bl(e),512&n&&null!==r&&el(r,r.return);break;case 5:if(gl(t,e),bl(e),512&n&&null!==r&&el(r,r.return),32&e.flags){var i=e.stateNode;try{de(i,"")}catch(g){kc(e,e.return,g)}}if(4&n&&null!=(i=e.stateNode)){var a=e.memoizedProps,o=null!==r?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===a.type&&null!=a.name&&$(i,a),ye(l,o);var u=ye(l,a);for(o=0;o<c.length;o+=2){var h=c[o],d=c[o+1];"style"===h?ge(i,d):"dangerouslySetInnerHTML"===h?he(i,d):"children"===h?de(i,d):y(i,h,d,u)}switch(l){case"input":Q(i,a);break;case"textarea":se(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?re(i,!!a.multiple,p,!1):f!==!!a.multiple&&(null!=a.defaultValue?re(i,!!a.multiple,a.defaultValue,!0):re(i,!!a.multiple,a.multiple?[]:"",!1))}i[fi]=a}catch(g){kc(e,e.return,g)}}break;case 6:if(gl(t,e),bl(e),4&n){if(null===e.stateNode)throw Error(s(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){kc(e,e.return,g)}}break;case 3:if(gl(t,e),bl(e),4&n&&null!==r&&r.memoizedState.isDehydrated)try{Ut(t.containerInfo)}catch(g){kc(e,e.return,g)}break;case 4:default:gl(t,e),bl(e);break;case 13:gl(t,e),bl(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||(Ul=$e())),4&n&&ml(e);break;case 22:if(h=null!==r&&null!==r.memoizedState,1&e.mode?($o=(u=$o)||h,gl(t,e),$o=u):gl(t,e),bl(e),8192&n){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!h&&0!==(1&e.mode))for(Jo=e,h=e.child;null!==h;){for(d=Jo=h;null!==Jo;){switch(p=(f=Jo).child,f.tag){case 0:case 11:case 14:case 15:nl(4,f,f.return);break;case 1:el(f,f.return);var m=f.stateNode;if("function"===typeof m.componentWillUnmount){n=f,r=f.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){kc(n,r,g)}}break;case 5:el(f,f.return);break;case 22:if(null!==f.memoizedState){xl(d);continue}}null!==p?(p.return=f,Jo=p):xl(d)}h=h.sibling}e:for(h=null,d=e;;){if(5===d.tag){if(null===h){h=d;try{i=d.stateNode,u?"function"===typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=d.stateNode,o=void 0!==(c=d.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=me("display",o))}catch(g){kc(e,e.return,g)}}}else if(6===d.tag){if(null===h)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){kc(e,e.return,g)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:gl(t,e),bl(e),4&n&&ml(e);case 21:}}function bl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(ol(r)){var n=r;break e}r=r.return}throw Error(s(160))}switch(n.tag){case 5:var i=n.stateNode;32&n.flags&&(de(i,""),n.flags&=-33),ul(e,ll(e),i);break;case 3:case 4:var a=n.stateNode.containerInfo;cl(e,ll(e),a);break;default:throw Error(s(161))}}catch(o){kc(e,e.return,o)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function yl(e,t,r){Jo=e,_l(e,t,r)}function _l(e,t,r){for(var n=0!==(1&e.mode);null!==Jo;){var i=Jo,s=i.child;if(22===i.tag&&n){var a=null!==i.memoizedState||Ko;if(!a){var o=i.alternate,l=null!==o&&null!==o.memoizedState||$o;o=Ko;var c=$o;if(Ko=a,($o=l)&&!c)for(Jo=i;null!==Jo;)l=(a=Jo).child,22===a.tag&&null!==a.memoizedState?Sl(i):null!==l?(l.return=a,Jo=l):Sl(i);for(;null!==s;)Jo=s,_l(s,t,r),s=s.sibling;Jo=i,Ko=o,$o=c}wl(e)}else 0!==(8772&i.subtreeFlags)&&null!==s?(s.return=i,Jo=s):wl(e)}}function wl(e){for(;null!==Jo;){var t=Jo;if(0!==(8772&t.flags)){var r=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:$o||il(5,t);break;case 1:var n=t.stateNode;if(4&t.flags&&!$o)if(null===r)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:gs(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Is(t,a,n);break;case 3:var o=t.updateQueue;if(null!==o){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Is(t,o,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var h=u.memoizedState;if(null!==h){var d=h.dehydrated;null!==d&&Ut(d)}}}break;default:throw Error(s(163))}$o||512&t.flags&&sl(t)}catch(f){kc(t,t.return,f)}}if(t===e){Jo=null;break}if(null!==(r=t.sibling)){r.return=t.return,Jo=r;break}Jo=t.return}}function xl(e){for(;null!==Jo;){var t=Jo;if(t===e){Jo=null;break}var r=t.sibling;if(null!==r){r.return=t.return,Jo=r;break}Jo=t.return}}function Sl(e){for(;null!==Jo;){var t=Jo;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{il(4,t)}catch(l){kc(t,r,l)}break;case 1:var n=t.stateNode;if("function"===typeof n.componentDidMount){var i=t.return;try{n.componentDidMount()}catch(l){kc(t,i,l)}}var s=t.return;try{sl(t)}catch(l){kc(t,s,l)}break;case 5:var a=t.return;try{sl(t)}catch(l){kc(t,a,l)}}}catch(l){kc(t,t.return,l)}if(t===e){Jo=null;break}var o=t.sibling;if(null!==o){o.return=t.return,Jo=o;break}Jo=t.return}}var Cl,kl=Math.ceil,El=_.ReactCurrentDispatcher,Al=_.ReactCurrentOwner,Ll=_.ReactCurrentBatchConfig,Ml=0,zl=null,Tl=null,Ol=0,Pl=0,Dl=Ci(0),Nl=0,Fl=null,Rl=0,Il=0,jl=0,Gl=null,Bl=null,Ul=0,Wl=1/0,Vl=null,Hl=!1,ql=null,Yl=null,Zl=!1,Xl=null,Kl=0,$l=0,Ql=null,Jl=-1,ec=0;function tc(){return 0!==(6&Ml)?$e():-1!==Jl?Jl:Jl=$e()}function rc(e){return 0===(1&e.mode)?1:0!==(2&Ml)&&0!==Ol?Ol&-Ol:null!==ms.transition?(0===ec&&(ec=mt()),ec):0!==(e=yt)?e:e=void 0===(e=window.event)?16:Kt(e.type)}function nc(e,t,r,n){if(50<$l)throw $l=0,Ql=null,Error(s(185));vt(e,r,n),0!==(2&Ml)&&e===zl||(e===zl&&(0===(2&Ml)&&(Il|=r),4===Nl&&lc(e,Ol)),ic(e,n),1===r&&0===Ml&&0===(1&t.mode)&&(Wl=$e()+500,ji&&Ui()))}function ic(e,t){var r=e.callbackNode;!function(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-at(s),o=1<<a,l=i[a];-1===l?0!==(o&r)&&0===(o&n)||(i[a]=ft(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}(e,t);var n=dt(e,e===zl?Ol:0);if(0===n)null!==r&&Ze(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=r&&Ze(r),1===t)0===e.tag?function(e){ji=!0,Bi(e)}(cc.bind(null,e)):Bi(cc.bind(null,e)),ai((function(){0===(6&Ml)&&Ui()})),r=null;else{switch(_t(n)){case 1:r=Je;break;case 4:r=et;break;case 16:default:r=tt;break;case 536870912:r=nt}r=zc(r,sc.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function sc(e,t){if(Jl=-1,ec=0,0!==(6&Ml))throw Error(s(327));var r=e.callbackNode;if(Sc()&&e.callbackNode!==r)return null;var n=dt(e,e===zl?Ol:0);if(0===n)return null;if(0!==(30&n)||0!==(n&e.expiredLanes)||t)t=vc(e,n);else{t=n;var i=Ml;Ml|=2;var a=mc();for(zl===e&&Ol===t||(Vl=null,Wl=$e()+500,fc(e,t));;)try{yc();break}catch(l){pc(e,l)}ws(),El.current=a,Ml=i,null!==Tl?t=0:(zl=null,Ol=0,t=Nl)}if(0!==t){if(2===t&&(0!==(i=pt(e))&&(n=i,t=ac(e,i))),1===t)throw r=Fl,fc(e,0),lc(e,n),ic(e,$e()),r;if(6===t)lc(e,n);else{if(i=e.current.alternate,0===(30&n)&&!function(e){for(var t=e;;){if(16384&t.flags){var r=t.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!on(s(),i))return!1}catch(o){return!1}}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=vc(e,n))&&(0!==(a=pt(e))&&(n=a,t=ac(e,a))),1===t))throw r=Fl,fc(e,0),lc(e,n),ic(e,$e()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(s(345));case 2:case 5:xc(e,Bl,Vl);break;case 3:if(lc(e,n),(130023424&n)===n&&10<(t=Ul+500-$e())){if(0!==dt(e,0))break;if(((i=e.suspendedLanes)&n)!==n){tc(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ni(xc.bind(null,e,Bl,Vl),t);break}xc(e,Bl,Vl);break;case 4:if(lc(e,n),(4194240&n)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-at(n);a=1<<o,(o=t[o])>i&&(i=o),n&=~a}if(n=i,10<(n=(120>(n=$e()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*kl(n/1960))-n)){e.timeoutHandle=ni(xc.bind(null,e,Bl,Vl),n);break}xc(e,Bl,Vl);break;default:throw Error(s(329))}}}return ic(e,$e()),e.callbackNode===r?sc.bind(null,e):null}function ac(e,t){var r=Gl;return e.current.memoizedState.isDehydrated&&(fc(e,t).flags|=256),2!==(e=vc(e,t))&&(t=Bl,Bl=r,null!==t&&oc(t)),e}function oc(e){null===Bl?Bl=e:Bl.push.apply(Bl,e)}function lc(e,t){for(t&=~jl,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-at(t),n=1<<r;e[r]=-1,t&=~n}}function cc(e){if(0!==(6&Ml))throw Error(s(327));Sc();var t=dt(e,0);if(0===(1&t))return ic(e,$e()),null;var r=vc(e,t);if(0!==e.tag&&2===r){var n=pt(e);0!==n&&(t=n,r=ac(e,n))}if(1===r)throw r=Fl,fc(e,0),lc(e,t),ic(e,$e()),r;if(6===r)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xc(e,Bl,Vl),ic(e,$e()),null}function uc(e,t){var r=Ml;Ml|=1;try{return e(t)}finally{0===(Ml=r)&&(Wl=$e()+500,ji&&Ui())}}function hc(e){null!==Xl&&0===Xl.tag&&0===(6&Ml)&&Sc();var t=Ml;Ml|=1;var r=Ll.transition,n=yt;try{if(Ll.transition=null,yt=1,e)return e()}finally{yt=n,Ll.transition=r,0===(6&(Ml=t))&&Ui()}}function dc(){Pl=Dl.current,ki(Dl)}function fc(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ii(r)),null!==Tl)for(r=Tl.return;null!==r;){var n=r;switch(ts(n),n.tag){case 1:null!==(n=n.type.childContextTypes)&&void 0!==n&&Pi();break;case 3:ia(),ki(Mi),ki(Li),ua();break;case 5:aa(n);break;case 4:ia();break;case 13:case 19:ki(oa);break;case 10:xs(n.type._context);break;case 22:case 23:dc()}r=r.return}if(zl=e,Tl=e=Dc(e.current,null),Ol=Pl=t,Nl=0,Fl=null,jl=Il=Rl=0,Bl=Gl=null,null!==Es){for(t=0;t<Es.length;t++)if(null!==(n=(r=Es[t]).interleaved)){r.interleaved=null;var i=n.next,s=r.pending;if(null!==s){var a=s.next;s.next=i,n.next=a}r.pending=n}Es=null}return e}function pc(e,t){for(;;){var r=Tl;try{if(ws(),ha.current=so,va){for(var n=pa.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}va=!1}if(fa=0,ga=ma=pa=null,ba=!1,ya=0,Al.current=null,null===r||null===r.return){Nl=1,Fl=t,Tl=null;break}e:{var a=e,o=r.return,l=r,c=t;if(t=Ol,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,h=l,d=h.tag;if(0===(1&h.mode)&&(0===d||11===d||15===d)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=vo(o);if(null!==p){p.flags&=-257,bo(p,o,l,0,t),1&p.mode&&go(a,u,t),c=u;var m=(t=p).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){go(a,u,t),gc();break e}c=Error(s(426))}else if(is&&1&l.mode){var v=vo(o);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),bo(v,o,l,0,t),ps(co(c,l));break e}}a=c=co(c,l),4!==Nl&&(Nl=2),null===Gl?Gl=[a]:Gl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Fs(a,po(0,c,t));break e;case 1:l=c;var b=a.type,y=a.stateNode;if(0===(128&a.flags)&&("function"===typeof b.getDerivedStateFromError||null!==y&&"function"===typeof y.componentDidCatch&&(null===Yl||!Yl.has(y)))){a.flags|=65536,t&=-t,a.lanes|=t,Fs(a,mo(a,l,t));break e}}a=a.return}while(null!==a)}wc(r)}catch(_){t=_,Tl===r&&null!==r&&(Tl=r=r.return);continue}break}}function mc(){var e=El.current;return El.current=so,null===e?so:e}function gc(){0!==Nl&&3!==Nl&&2!==Nl||(Nl=4),null===zl||0===(268435455&Rl)&&0===(268435455&Il)||lc(zl,Ol)}function vc(e,t){var r=Ml;Ml|=2;var n=mc();for(zl===e&&Ol===t||(Vl=null,fc(e,t));;)try{bc();break}catch(i){pc(e,i)}if(ws(),Ml=r,El.current=n,null!==Tl)throw Error(s(261));return zl=null,Ol=0,Nl}function bc(){for(;null!==Tl;)_c(Tl)}function yc(){for(;null!==Tl&&!Xe();)_c(Tl)}function _c(e){var t=Cl(e.alternate,e,Pl);e.memoizedProps=e.pendingProps,null===t?wc(e):Tl=t,Al.current=null}function wc(e){var t=e;do{var r=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(r=Zo(r,t,Pl)))return void(Tl=r)}else{if(null!==(r=Xo(r,t)))return r.flags&=32767,void(Tl=r);if(null===e)return Nl=6,void(Tl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Tl=t);Tl=t=e}while(null!==t);0===Nl&&(Nl=5)}function xc(e,t,r){var n=yt,i=Ll.transition;try{Ll.transition=null,yt=1,function(e,t,r,n){do{Sc()}while(null!==Xl);if(0!==(6&Ml))throw Error(s(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-at(r),s=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~s}}(e,a),e===zl&&(Tl=zl=null,Ol=0),0===(2064&r.subtreeFlags)&&0===(2064&r.flags)||Zl||(Zl=!0,zc(tt,(function(){return Sc(),null}))),a=0!==(15990&r.flags),0!==(15990&r.subtreeFlags)||a){a=Ll.transition,Ll.transition=null;var o=yt;yt=1;var l=Ml;Ml|=4,Al.current=null,function(e,t){if(ei=Vt,fn(e=dn())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch(w){r=null;break e}var o=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var p;d!==r||0!==i&&3!==d.nodeType||(l=o+i),d!==a||0!==n&&3!==d.nodeType||(c=o+n),3===d.nodeType&&(o+=d.nodeValue.length),null!==(p=d.firstChild);)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++u===i&&(l=o),f===a&&++h===n&&(c=o),null!==(p=d.nextSibling))break;f=(d=f).parentNode}d=p}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ti={focusedElem:e,selectionRange:r},Vt=!1,Jo=t;null!==Jo;)if(e=(t=Jo).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Jo=e;else for(;null!==Jo;){t=Jo;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:gs(t.type,g),v);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var _=t.stateNode.containerInfo;1===_.nodeType?_.textContent="":9===_.nodeType&&_.documentElement&&_.removeChild(_.documentElement);break;default:throw Error(s(163))}}catch(w){kc(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Jo=e;break}Jo=t.return}m=rl,rl=!1}(e,r),vl(r,e),pn(ti),Vt=!!ei,ti=ei=null,e.current=r,yl(r,e,i),Ke(),Ml=l,yt=o,Ll.transition=a}else e.current=r;if(Zl&&(Zl=!1,Xl=e,Kl=i),a=e.pendingLanes,0===a&&(Yl=null),function(e){if(st&&"function"===typeof st.onCommitFiberRoot)try{st.onCommitFiberRoot(it,e,void 0,128===(128&e.current.flags))}catch(t){}}(r.stateNode),ic(e,$e()),null!==t)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Hl)throw Hl=!1,e=ql,ql=null,e;0!==(1&Kl)&&0!==e.tag&&Sc(),a=e.pendingLanes,0!==(1&a)?e===Ql?$l++:($l=0,Ql=e):$l=0,Ui()}(e,t,r,n)}finally{Ll.transition=i,yt=n}return null}function Sc(){if(null!==Xl){var e=_t(Kl),t=Ll.transition,r=yt;try{if(Ll.transition=null,yt=16>e?16:e,null===Xl)var n=!1;else{if(e=Xl,Xl=null,Kl=0,0!==(6&Ml))throw Error(s(331));var i=Ml;for(Ml|=4,Jo=e.current;null!==Jo;){var a=Jo,o=a.child;if(0!==(16&Jo.flags)){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Jo=u;null!==Jo;){var h=Jo;switch(h.tag){case 0:case 11:case 15:nl(8,h,a)}var d=h.child;if(null!==d)d.return=h,Jo=d;else for(;null!==Jo;){var f=(h=Jo).sibling,p=h.return;if(al(h),h===u){Jo=null;break}if(null!==f){f.return=p,Jo=f;break}Jo=p}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}Jo=a}}if(0!==(2064&a.subtreeFlags)&&null!==o)o.return=a,Jo=o;else e:for(;null!==Jo;){if(0!==(2048&(a=Jo).flags))switch(a.tag){case 0:case 11:case 15:nl(9,a,a.return)}var b=a.sibling;if(null!==b){b.return=a.return,Jo=b;break e}Jo=a.return}}var y=e.current;for(Jo=y;null!==Jo;){var _=(o=Jo).child;if(0!==(2064&o.subtreeFlags)&&null!==_)_.return=o,Jo=_;else e:for(o=y;null!==Jo;){if(0!==(2048&(l=Jo).flags))try{switch(l.tag){case 0:case 11:case 15:il(9,l)}}catch(x){kc(l,l.return,x)}if(l===o){Jo=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Jo=w;break e}Jo=l.return}}if(Ml=i,Ui(),st&&"function"===typeof st.onPostCommitFiberRoot)try{st.onPostCommitFiberRoot(it,e)}catch(x){}n=!0}return n}finally{yt=r,Ll.transition=t}}return!1}function Cc(e,t,r){e=Ds(e,t=po(0,t=co(r,t),1),1),t=tc(),null!==e&&(vt(e,1,t),ic(e,t))}function kc(e,t,r){if(3===e.tag)Cc(e,e,r);else for(;null!==t;){if(3===t.tag){Cc(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Yl||!Yl.has(n))){t=Ds(t,e=mo(t,e=co(r,e),1),1),e=tc(),null!==t&&(vt(t,1,e),ic(t,e));break}}t=t.return}}function Ec(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=tc(),e.pingedLanes|=e.suspendedLanes&r,zl===e&&(Ol&r)===r&&(4===Nl||3===Nl&&(130023424&Ol)===Ol&&500>$e()-Ul?fc(e,0):jl|=r),ic(e,t)}function Ac(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ut,0===(130023424&(ut<<=1))&&(ut=4194304)));var r=tc();null!==(e=Ms(e,t))&&(vt(e,t,r),ic(e,r))}function Lc(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),Ac(e,r)}function Mc(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(s(314))}null!==n&&n.delete(t),Ac(e,r)}function zc(e,t){return Ye(e,t)}function Tc(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oc(e,t,r,n){return new Tc(e,t,r,n)}function Pc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Dc(e,t){var r=e.alternate;return null===r?((r=Oc(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Nc(e,t,r,n,i,a){var o=2;if(n=e,"function"===typeof e)Pc(e)&&(o=1);else if("string"===typeof e)o=5;else e:switch(e){case S:return Fc(r.children,i,a,t);case C:o=8,i|=8;break;case k:return(e=Oc(12,r,t,2|i)).elementType=k,e.lanes=a,e;case M:return(e=Oc(13,r,t,i)).elementType=M,e.lanes=a,e;case z:return(e=Oc(19,r,t,i)).elementType=z,e.lanes=a,e;case P:return Rc(r,i,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case E:o=10;break e;case A:o=9;break e;case L:o=11;break e;case T:o=14;break e;case O:o=16,n=null;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=Oc(o,r,t,i)).elementType=e,t.type=n,t.lanes=a,t}function Fc(e,t,r,n){return(e=Oc(7,e,n,t)).lanes=r,e}function Rc(e,t,r,n){return(e=Oc(22,e,n,t)).elementType=P,e.lanes=r,e.stateNode={isHidden:!1},e}function Ic(e,t,r){return(e=Oc(6,e,null,t)).lanes=r,e}function jc(e,t,r){return(t=Oc(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Gc(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Bc(e,t,r,n,i,s,a,o,l){return e=new Gc(e,t,r,o,l),1===t?(t=1,!0===s&&(t|=8)):t=0,s=Oc(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ts(s),e}function Uc(e){if(!e)return Ai;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(s(171))}if(1===e.tag){var r=e.type;if(Oi(r))return Ni(e,r,t)}return t}function Wc(e,t,r,n,i,s,a,o,l){return(e=Bc(r,n,!0,e,0,s,0,o,l)).context=Uc(null),r=e.current,(s=Ps(n=tc(),i=rc(r))).callback=void 0!==t&&null!==t?t:null,Ds(r,s,i),e.current.lanes=i,vt(e,i,n),ic(e,n),e}function Vc(e,t,r,n){var i=t.current,s=tc(),a=rc(i);return r=Uc(r),null===t.context?t.context=r:t.pendingContext=r,(t=Ps(s,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=Ds(i,t,a))&&(nc(e,i,a,s),Ns(e,i,a)),a}function Hc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function qc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function Yc(e,t){qc(e,t),(e=e.alternate)&&qc(e,t)}Cl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||Mi.current)_o=!0;else{if(0===(e.lanes&r)&&0===(128&t.flags))return _o=!1,function(e,t,r){switch(t.tag){case 3:zo(t),fs();break;case 5:sa(t);break;case 1:Oi(t.type)&&Fi(t);break;case 4:na(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ei(vs,n._currentValue),n._currentValue=i;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(Ei(oa,1&oa.current),t.flags|=128,null):0!==(r&t.child.childLanes)?Io(e,t,r):(Ei(oa,1&oa.current),null!==(e=Ho(e,t,r))?e.sibling:null);Ei(oa,1&oa.current);break;case 19:if(n=0!==(r&t.childLanes),0!==(128&e.flags)){if(n)return Wo(e,t,r);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ei(oa,oa.current),n)break;return null;case 22:case 23:return t.lanes=0,ko(e,t,r)}return Ho(e,t,r)}(e,t,r);_o=0!==(131072&e.flags)}else _o=!1,is&&0!==(1048576&t.flags)&&Ji(t,qi,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Vo(e,t),e=t.pendingProps;var i=Ti(t,Li.current);Cs(t,r),i=Sa(null,t,n,e,i,r);var a=Ca();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oi(n)?(a=!0,Fi(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ts(t),i.updater=Bs,t.stateNode=i,i._reactInternals=t,Hs(t,n,e,r),t=Mo(null,t,n,!0,a,r)):(t.tag=0,is&&a&&es(t),wo(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Vo(e,t),e=t.pendingProps,n=(i=n._init)(n._payload),t.type=n,i=t.tag=function(e){if("function"===typeof e)return Pc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===L)return 11;if(e===T)return 14}return 2}(n),e=gs(n,e),i){case 0:t=Ao(null,t,n,e,r);break e;case 1:t=Lo(null,t,n,e,r);break e;case 11:t=xo(null,t,n,e,r);break e;case 14:t=So(null,t,n,gs(n.type,e),r);break e}throw Error(s(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,Ao(e,t,n,i=t.elementType===n?i:gs(n,i),r);case 1:return n=t.type,i=t.pendingProps,Lo(e,t,n,i=t.elementType===n?i:gs(n,i),r);case 3:e:{if(zo(t),null===e)throw Error(s(387));n=t.pendingProps,i=(a=t.memoizedState).element,Os(e,t),Rs(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated){if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=To(e,t,n,r,i=co(Error(s(423)),t));break e}if(n!==i){t=To(e,t,n,r,i=co(Error(s(424)),t));break e}for(ns=ci(t.stateNode.containerInfo.firstChild),rs=t,is=!0,ss=null,r=$s(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(fs(),n===i){t=Ho(e,t,r);break e}wo(e,t,n,r)}t=t.child}return t;case 5:return sa(t),null===e&&cs(t),n=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,ri(n,i)?o=null:null!==a&&ri(n,a)&&(t.flags|=32),Eo(e,t),wo(e,t,o,r),t.child;case 6:return null===e&&cs(t),null;case 13:return Io(e,t,r);case 4:return na(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=Ks(t,null,n,r):wo(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,xo(e,t,n,i=t.elementType===n?i:gs(n,i),r);case 7:return wo(e,t,t.pendingProps,r),t.child;case 8:case 12:return wo(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ei(vs,n._currentValue),n._currentValue=o,null!==a)if(on(a.value,o)){if(a.children===i.children&&!Mi.current){t=Ho(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){o=a.child;for(var c=l.firstContext;null!==c;){if(c.context===n){if(1===a.tag){(c=Ps(-1,r&-r)).tag=2;var u=a.updateQueue;if(null!==u){var h=(u=u.shared).pending;null===h?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),Ss(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(10===a.tag)o=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(o=a.return))throw Error(s(341));o.lanes|=r,null!==(l=o.alternate)&&(l.lanes|=r),Ss(o,r,t),o=a.sibling}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===t){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}wo(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Cs(t,r),n=n(i=ks(i)),t.flags|=1,wo(e,t,n,r),t.child;case 14:return i=gs(n=t.type,t.pendingProps),So(e,t,n,i=gs(n.type,i),r);case 15:return Co(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:gs(n,i),Vo(e,t),t.tag=1,Oi(n)?(e=!0,Fi(t)):e=!1,Cs(t,r),Ws(t,n,i),Hs(t,n,i,r),Mo(null,t,n,!0,e,r);case 19:return Wo(e,t,r);case 22:return ko(e,t,r)}throw Error(s(156,t.tag))};var Zc="function"===typeof reportError?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}function Kc(e){this._internalRoot=e}function $c(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Qc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jc(){}function eu(e,t,r,n,i){var s=r._reactRootContainer;if(s){var a=s;if("function"===typeof i){var o=i;i=function(){var e=Hc(a);o.call(e)}}Vc(t,a,e,i)}else a=function(e,t,r,n,i){if(i){if("function"===typeof n){var s=n;n=function(){var e=Hc(a);s.call(e)}}var a=Wc(t,n,e,0,null,!1,0,"",Jc);return e._reactRootContainer=a,e[pi]=a.current,Un(8===e.nodeType?e.parentNode:e),hc(),a}for(;i=e.lastChild;)e.removeChild(i);if("function"===typeof n){var o=n;n=function(){var e=Hc(l);o.call(e)}}var l=Bc(e,0,!1,null,0,!1,0,"",Jc);return e._reactRootContainer=l,e[pi]=l.current,Un(8===e.nodeType?e.parentNode:e),hc((function(){Vc(t,l,r,n)})),l}(r,t,e,i,n);return Hc(a)}Kc.prototype.render=Xc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(s(409));Vc(e,t,null,null)},Kc.prototype.unmount=Xc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;hc((function(){Vc(null,e,null,null)})),t[pi]=null}},Kc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ct();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Pt.length&&0!==t&&t<Pt[r].priority;r++);Pt.splice(r,0,e),0===r&&Rt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ht(t.pendingLanes);0!==r&&(bt(t,1|r),ic(t,$e()),0===(6&Ml)&&(Wl=$e()+500,Ui()))}break;case 13:hc((function(){var t=Ms(e,1);if(null!==t){var r=tc();nc(t,e,1,r)}})),Yc(e,1)}},xt=function(e){if(13===e.tag){var t=Ms(e,134217728);if(null!==t)nc(t,e,134217728,tc());Yc(e,134217728)}},St=function(e){if(13===e.tag){var t=rc(e),r=Ms(e,t);if(null!==r)nc(r,e,t,tc());Yc(e,t)}},Ct=function(){return yt},kt=function(e,t){var r=yt;try{return yt=e,t()}finally{yt=r}},xe=function(e,t,r){switch(t){case"input":if(Q(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=wi(n);if(!i)throw Error(s(90));Y(n),Q(n,i)}}}break;case"textarea":se(e,r);break;case"select":null!=(t=r.value)&&re(e,!!r.multiple,t,!1)}},Le=uc,Me=hc;var tu={usingClientEntryPoint:!1,Events:[yi,_i,wi,Ee,Ae,uc]},ru={findFiberByHostInstance:bi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},nu={bundleType:ru.bundleType,version:ru.version,rendererPackageName:ru.rendererPackageName,rendererConfig:ru.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=He(e))?null:e.stateNode},findFiberByHostInstance:ru.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{it=iu.inject(nu),st=iu}catch(ue){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tu,t.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!$c(t))throw Error(s(200));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:x,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,r)},t.createRoot=function(e,t){if(!$c(e))throw Error(s(299));var r=!1,n="",i=Zc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Bc(e,1,!1,null,0,r,0,n,i),e[pi]=t.current,Un(8===e.nodeType?e.parentNode:e),new Xc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(s(188));throw e=Object.keys(e).join(","),Error(s(268,e))}return e=null===(e=He(t))?null:e.stateNode},t.flushSync=function(e){return hc(e)},t.hydrate=function(e,t,r){if(!Qc(t))throw Error(s(200));return eu(null,e,t,!0,r)},t.hydrateRoot=function(e,t,r){if(!$c(e))throw Error(s(405));var n=null!=r&&r.hydratedSources||null,i=!1,a="",o=Zc;if(null!==r&&void 0!==r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(o=r.onRecoverableError)),t=Wc(t,null,e,1,null!=r?r:null,i,0,a,o),e[pi]=t.current,Un(e),n)for(e=0;e<n.length;e++)i=(i=(r=n[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Kc(t)},t.render=function(e,t,r){if(!Qc(t))throw Error(s(200));return eu(null,e,t,!1,r)},t.unmountComponentAtNode=function(e){if(!Qc(e))throw Error(s(40));return!!e._reactRootContainer&&(hc((function(){eu(null,null,e,!1,(function(){e._reactRootContainer=null,e[pi]=null}))})),!0)},t.unstable_batchedUpdates=uc,t.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Qc(r))throw Error(s(200));if(null==e||void 0===e._reactInternals)throw Error(s(38));return eu(e,t,r,!1,n)},t.version="18.2.0-next-9e3b772b8-20220608"},180:(e,t,r)=>{"use strict";var n=r(292);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},292:(e,t,r)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(144)},524:(e,t,r)=>{"use strict";
vendor: 12,800 bytes, line 2
2Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(r(60)),i=d(r(460)),s=d(r(292)),a=d(r(160)),o=r(800),l=r(864),c=r(288),u=d(r(779)),h=d(r(448));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}function m(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class g extends n.Component{static getDerivedStateFromProps(e,t){let{position:r}=e,{prevPropsPosition:n}=t;return!r||n&&r.x===n.x&&r.y===n.y?null:((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:r,prevPropsPosition:n}),{x:r.x,y:r.y,prevPropsPosition:{...r}})}constructor(e){super(e),m(this,"onDragStart",((e,t)=>{(0,h.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),m(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",t);const r=(0,l.createDraggableData)(this,t),n={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=n;n.x+=this.state.slackX,n.y+=this.state.slackY;const[i,s]=(0,l.getBoundPosition)(this,n.x,n.y);n.x=i,n.y=s,n.slackX=this.state.slackX+(e-n.x),n.slackY=this.state.slackY+(t-n.y),r.x=n.x,r.y=n.y,r.deltaX=n.x-this.state.x,r.deltaY=n.y-this.state.y}if(!1===this.props.onDrag(e,r))return!1;this.setState(n)})),m(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,h.default)("Draggable: onDragStop: %j",t);const r={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;r.x=e,r.y=t}this.setState(r)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){"undefined"!==typeof window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:s.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:r,defaultPosition:i,defaultClassName:s,defaultClassNameDragging:c,defaultClassNameDragged:h,position:d,positionOffset:f,scale:m,...g}=this.props;let v={},b=null;const y=!Boolean(d)||this.state.dragging,_=d||i,w={x:(0,l.canDragX)(this)&&y?this.state.x:_.x,y:(0,l.canDragY)(this)&&y?this.state.y:_.y};this.state.isElementSVG?b=(0,o.createSVGTransform)(w,f):v=(0,o.createCSSTransform)(w,f);const x=(0,a.default)(r.props.className||"",s,{[c]:this.state.dragging,[h]:this.state.dragged});return n.createElement(u.default,p({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),n.cloneElement(n.Children.only(r),{className:x,style:{...r.props.style,...v},transform:b}))}}t.default=g,m(g,"displayName","Draggable"),m(g,"propTypes",{...u.default.propTypes,axis:i.default.oneOf(["both","x","y","none"]),bounds:i.default.oneOfType([i.default.shape({left:i.default.number,right:i.default.number,top:i.default.number,bottom:i.default.number}),i.default.string,i.default.oneOf([!1])]),defaultClassName:i.default.string,defaultClassNameDragging:i.default.string,defaultClassNameDragged:i.default.string,defaultPosition:i.default.shape({x:i.default.number,y:i.default.number}),positionOffset:i.default.shape({x:i.default.oneOfType([i.default.number,i.default.string]),y:i.default.oneOfType([i.default.number,i.default.string])}),position:i.default.shape({x:i.default.number,y:i.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),m(g,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},779:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(r(60)),i=u(r(460)),s=u(r(292)),a=r(800),o=r(864),l=r(288),c=u(r(448));function u(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function d(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const f={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let m=p;class g extends n.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"===typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=t;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,a.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,a.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const n=(0,a.getTouchIdentifier)(e);this.touchIdentifier=n;const i=(0,o.getControlPosition)(e,n,this);if(null==i)return;const{x:s,y:l}=i,u=(0,o.createCoreData)(this,s,l);(0,c.default)("DraggableCore: handleDragStart: %j",u),(0,c.default)("calling",this.props.onStart);!1!==this.props.onStart(e,u)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,a.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=l,(0,a.addEvent)(r,m.move,this.handleDrag),(0,a.addEvent)(r,m.stop,this.handleDragStop))})),d(this,"handleDrag",(e=>{const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX,t=n-this.lastY;if([e,t]=(0,o.snapToGrid)(this.props.grid,e,t),!e&&!t)return;r=this.lastX+e,n=this.lastY+t}const i=(0,o.createCoreData)(this,r,n);(0,c.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=r,this.lastY=n;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(s){const e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}})),d(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX||0,t=n-this.lastY||0;[e,t]=(0,o.snapToGrid)(this.props.grid,e,t),r=this.lastX+e,n=this.lastY+t}const i=(0,o.createCoreData)(this,r,n);if(!1===this.props.onStop(e,i)||!1===this.mounted)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,a.removeUserSelectStyles)(s.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,c.default)("DraggableCore: Removing handlers"),(0,a.removeEvent)(s.ownerDocument,m.move,this.handleDrag),(0,a.removeEvent)(s.ownerDocument,m.stop,this.handleDragStop))})),d(this,"onMouseDown",(e=>(m=p,this.handleDragStart(e)))),d(this,"onMouseUp",(e=>(m=p,this.handleDragStop(e)))),d(this,"onTouchStart",(e=>(m=f,this.handleDragStart(e)))),d(this,"onTouchEnd",(e=>(m=f,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,a.addEvent)(e,f.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,a.removeEvent)(t,p.move,this.handleDrag),(0,a.removeEvent)(t,f.move,this.handleDrag),(0,a.removeEvent)(t,p.stop,this.handleDragStop),(0,a.removeEvent)(t,f.stop,this.handleDragStop),(0,a.removeEvent)(e,f.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,a.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:s.default.findDOMNode(this)}render(){return n.cloneElement(n.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=g,d(g,"displayName","DraggableCore"),d(g,"propTypes",{allowAnyClick:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),d(g,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},880:(e,t,r)=>{"use strict";const{default:n,DraggableCore:i}=r(524);e.exports=n,e.exports.default=n,e.exports.DraggableCore=i},800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=c,t.addEvent=function(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&c(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const r=l(e,t,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:r}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,n.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,n.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}
vendor: 5,649 bytes, line 2
2,t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,n.int)(r.paddingTop),t-=(0,n.int)(r.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,n.int)(r.paddingLeft),t-=(0,n.int)(r.paddingRight),t},t.matchesSelector=o,t.matchesSelectorAndParentsTo=function(e,t,r){let n=e;do{if(o(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1},t.offsetXYFromParent=function(e,t,r){const n=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-n.left)/r,s=(e.clientY+t.scrollTop-n.top)/r;return{x:i,y:s}},t.outerHeight=function(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,n.int)(r.borderTopWidth),t+=(0,n.int)(r.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,n.int)(r.borderLeftWidth),t+=(0,n.int)(r.borderRightWidth),t},t.removeClassName=u,t.removeEvent=function(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&u(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(t){}};var n=r(288),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,r&&r.set(e,n);return n}(r(600));function s(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}let a="";function o(e,t){return a||(a=(0,n.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,n.isFunction)(e[t])}))),!!(0,n.isFunction)(e[a])&&e[a](t)}function l(e,t,r){let{x:n,y:i}=e,s="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const e="".concat("string"===typeof t.x?t.x:t.x+r),n="".concat("string"===typeof t.y?t.y:t.y+r);s="translate(".concat(e,", ").concat(n,")")+s}return s}function c(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function u(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},600:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=i,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=n;const r=["Moz","Webkit","O","ms"];function n(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"===typeof window)return"";const n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(let s=0;s<r.length;s++)if(i(t,r[s])in n)return r[s];return""}function i(e,t){return t?"".concat(t).concat(function(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):"-"===e[n]?r=!0:t+=e[n];return t}(e)):e}t.default=n()},448:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){0}},864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,r){const i=!(0,n.isNum)(e.lastX),a=s(e);return i?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:a,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}},t.createDraggableData=function(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:a}=e.props;a="string"===typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);const o=s(e);if("string"===typeof a){const{ownerDocument:e}=o,t=e.defaultView;let r;if(r="parent"===a?o.parentNode:e.querySelector(a),!(r instanceof t.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const s=r,l=t.getComputedStyle(o),c=t.getComputedStyle(s);a={left:-o.offsetLeft+(0,n.int)(c.paddingLeft)+(0,n.int)(l.marginLeft),top:-o.offsetTop+(0,n.int)(c.paddingTop)+(0,n.int)(l.marginTop),right:(0,i.innerWidth)(s)-(0,i.outerWidth)(o)-o.offsetLeft+(0,n.int)(c.paddingRight)-(0,n.int)(l.marginRight),bottom:(0,i.innerHeight)(s)-(0,i.outerHeight)(o)-o.offsetTop+(0,n.int)(c.paddingBottom)-(0,n.int)(l.marginBottom)}}(0,n.isNum)(a.right)&&(t=Math.min(t,a.right));(0,n.isNum)(a.bottom)&&(r=Math.min(r,a.bottom));(0,n.isNum)(a.left)&&(t=Math.max(t,a.left));(0,n.isNum)(a.top)&&(r=Math.max(r,a.top));return[t,r]},t.getControlPosition=function(e,t,r){const n="number"===typeof t?(0,i.getTouch)(e,t):null;if("number"===typeof t&&!n)return null;const a=s(r),o=r.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,i.offsetXYFromParent)(n||e,o,r.props.scale)}
vendor: 11,767 bytes, line 2
2,t.snapToGrid=function(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]};var n=r(288),i=r(800);function s(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}},288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]},t.int=function(e){return parseInt(e,10)},t.isFunction=function(e){return"function"===typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"===typeof e&&!isNaN(e)}},36:(e,t,r)=>{"use strict";var n=r(60),i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:i,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},564:(e,t)=>{"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}function b(){}function y(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var _=y.prototype=new b;_.constructor=y,m(_,v.prototype),_.isPureReactComponent=!0;var w=Array.isArray,x=Object.prototype.hasOwnProperty,S={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,n){var i,s={},a=null,o=null;if(null!=t)for(i in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,i)&&!C.hasOwnProperty(i)&&(s[i]=t[i]);var l=arguments.length-2;if(1===l)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===s[i]&&(s[i]=l[i]);return{$$typeof:r,type:e,key:a,ref:o,props:s,_owner:S.current}}function E(e){return"object"===typeof e&&null!==e&&e.$$typeof===r}var A=/\/+/g;function L(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function M(e,t,i,s,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case n:l=!0}}if(l)return a=a(l=e),e=""===s?"."+L(l,0):s,w(a)?(i="",null!=e&&(i=e.replace(A,"$&/")+"/"),M(a,t,i,"",(function(e){return e}))):null!=a&&(E(a)&&(a=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(A,"$&/")+"/")+e)),t.push(a)),1;if(l=0,s=""===s?".":s+":",w(e))for(var c=0;c<e.length;c++){var u=s+L(o=e[c],c);l+=M(o,t,i,u,a)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(o=e.next()).done;)l+=M(o=o.value,t,i,u=s+L(o,c++),a);else if("object"===o)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function z(e,t,r){if(null==e)return e;var n=[],i=0;return M(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function T(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},P={transition:null},D={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:P,ReactCurrentOwner:S};t.Children={map:z,forEach:function(e,t,r){z(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return z(e,(function(){t++})),t},toArray:function(e){return z(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=i,t.Profiler=a,t.PureComponent=y,t.StrictMode=s,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=m({},e.props),s=e.key,a=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,o=S.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)x.call(t,c)&&!C.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:r,type:e.type,key:s,ref:a,props:i,_owner:o}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=E,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:T}},t.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return O.current.useCallback(e,t)},t.useContext=function(e){return O.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return O.current.useDeferredValue(e)},t.useEffect=function(e,t){return O.current.useEffect(e,t)},t.useId=function(){return O.current.useId()},t.useImperativeHandle=function(e,t,r){return O.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return O.current.useMemo(e,t)},t.useReducer=function(e,t,r){return O.current.useReducer(e,t,r)},t.useRef=function(e){return O.current.useRef(e)},t.useState=function(e){return O.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return O.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return O.current.useTransition()},t.version="18.2.0"},60:(e,t,r)=>{"use strict";e.exports=r(564)},496:(e,t,r)=>{"use strict";e.exports=r(36)},692:(e,t)=>{"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<s(i,t)))break e;e[n]=t,e[r]=i,r=n}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,a=i>>>1;n<a;){var o=2*(n+1)-1,l=e[o],c=o+1,u=e[c];if(0>s(l,r))c<i&&0>s(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[o]=r,n=o);else{if(!(c<i&&0>s(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function s(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function _(e){for(var t=n(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function w(e){if(g=!1,_(e),!m)if(null!==n(c))m=!0,P(x);else{var t=n(u);null!==t&&D(w,t.startTime-e)}}function x(e,r){m=!1,g&&(g=!1,b(E),E=-1),p=!0;var s=f;try{for(_(r),d=n(c);null!==d&&(!(d.expirationTime>r)||e&&!M());){var a=d.callback;if("function"===typeof a){d.callback=null,f=d.priorityLevel;var o=a(d.expirationTime<=r);r=t.unstable_now(),"function"===typeof o?d.callback=o:d===n(c)&&i(c),_(r)}else i(c);d=n(c)}if(null!==d)var l=!0;else{var h=n(u);null!==h&&D(w,h.startTime-r),l=!1}return l}finally{d=null,f=s,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,C=!1,k=null,E=-1,A=5,L=-1;function M(){return!(t.unstable_now()-L<A)}function z(){if(null!==k){var e=t.unstable_now();L=e;var r=!0;try{r=k(!0,e)}finally{r?S():(C=!1,k=null)}}else C=!1}if("function"===typeof y)S=function(){y(z)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,O=T.port2;T.port1.onmessage=z,S=function(){O.postMessage(null)}}else S=function(){v(z,0)};function P(e){k=e,C||(C=!0,S())}function D(e,r){E=v((function(){e(t.unstable_now())}),r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,P(x))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var r=f;f=t;try{return e()}finally{f=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=f;f=e;try{return t()}finally{f=r}},t.unstable_scheduleCallback=function(e,i,s){var a=t.unstable_now();switch("object"===typeof s&&null!==s?s="number"===typeof(s=s.delay)&&0<s?a+s:a:s=a,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:h++,callback:i,priorityLevel:e,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(e.sortIndex=s,r(u,e),null===n(c)&&e===n(u)&&(g?(b(E),E=-1):g=!0,D(w,s-a))):(e.sortIndex=o,r(c,e),m||p||(m=!0,P(x))),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=f;return function(){var r=f;f=t;try{return e.apply(this,arguments)}finally{f=r}}}},724:(e,t,r)=>{"use strict";e.exports=r(692)},264:(e,t)=>
2{var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=a(e,s(r)))}return e}function s(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=a(t,r));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;__webpack_require__.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"===typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"===typeof r.then)return r}var i=Object.create(null);__webpack_require__.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&r;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>r[e]));return s.default=()=>r,__webpack_require__.d(i,s),i}})(),__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,r)=>(__webpack_require__.f[r](e,t),t)),[])),__webpack_require__.u=e=>"static/js/"+e+".630692fc.chunk.js",__webpack_require__.miniCssF=e=>{},__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="3dmol-demo:";__webpack_require__.l=(r,n,i,s)=>{if(e[r])e[r].push(n);else{var a,o;if(void 0!==i)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+i){a=u;break}}a||(o=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.setAttribute("data-webpack",t+i),a.src=r),e[r]=[n];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(d);var i=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(n))),t)return t(n)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),o&&document.head.appendChild(a)}}})(),__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.p="/",(()=>{var e={590:0};__webpack_require__.f.j=(t,r)=>{var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=e[t]=[r,i]));r.push(n[2]=i);var s=__webpack_require__.p+__webpack_require__.u(t),a=new Error;__webpack_require__.l(s,(r=>{if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",a.name="ChunkLoadError",a.type=i,a.request=s,n[1](a)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,i,s=r[0],a=r[1],o=r[2],l=0;if(s.some((t=>0!==e[t]))){for(n in a)__webpack_require__.o(a,n)&&(__webpack_require__.m[n]=a[n]);if(o)o(__webpack_require__)}for(t&&t(r);l<s.length;l++)i=s[l],__webpack_require__.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=self.webpackChunk_3dmol_demo=self.webpackChunk_3dmol_demo||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__={};(()=>{"use strict";var e,t=__webpack_require__(60),r=__webpack_require__.t(t,2),n=__webpack_require__(180),i=__webpack_require__(292),s=__webpack_require__.t(i,2);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
2for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(e||(e={}));const o="popstate";function l(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function c(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}function u(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,r,n){return void 0===r&&(r=null),a({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?f(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function f(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function p(t,r,n,i){void 0===i&&(i={});let{window:s=document.defaultView,v5Compat:c=!1}=i,f=s.history,p=e.Pop,m=null,g=v();function v(){return(f.state||{idx:null}).idx}function b(){p=e.Pop;let t=v(),r=null==t?null:t-g;g=t,m&&m({action:p,location:_.location,delta:r})}function y(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"===typeof e?e:d(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==g&&(g=0,f.replaceState(a({},f.state,{idx:g}),""));let _={get action(){return p},get location(){return t(s,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(o,b),m=e,()=>{s.removeEventListener(o,b),m=null}},createHref:e=>r(s,e),createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,r){p=e.Push;let i=h(_.location,t,r);n&&n(i,t),g=v()+1;let a=u(i,g),o=_.createHref(i);try{f.pushState(a,"",o)}catch(l){if(l instanceof DOMException&&"DataCloneError"===l.name)throw l;s.location.assign(o)}c&&m&&m({action:p,location:_.location,delta:1})},replace:function(t,r){p=e.Replace;let i=h(_.location,t,r);n&&n(i,t),g=v();let s=u(i,g),a=_.createHref(i);f.replaceState(s,"",a),c&&m&&m({action:p,location:_.location,delta:0})},go:e=>f.go(e)};return _}var m;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(m||(m={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function g(e,t,r){void 0===r&&(r="/");
2let n=z(("string"===typeof t?f(t):t).pathname||"/",r);if(null==n)return null;let i=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let s=null;for(let a=0;null==s&&a<i.length;++a)s=A(i[a],M(n));return s}function v(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let i=(e,i,s)=>{let a={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(l(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(n.length));let o=N([n,a.relativePath]),c=r.concat(a);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),v(e.children,t,c,o)),(null!=e.path||e.index)&&t.push({path:o,score:E(o,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of b(e.path))i(e,t,n);else i(e,t)})),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(0===n.length)return i?[s,""]:[s];let a=b(n.join("/")),o=[];return o.push(...a.map((e=>""===e?s:[s,e].join("/")))),i&&o.push(...a),o.map((t=>e.startsWith("/")&&""===t?"/":t))}const y=/^:[\w-]+$/,_=3,w=2,x=1,S=10,C=-2,k=e=>"*"===e;function E(e,t){let r=e.split("/"),n=r.length;return r.some(k)&&(n+=C),t&&(n+=w),r.filter((e=>!k(e))).reduce(((e,t)=>e+(y.test(t)?_:""===t?x:S)),n)}function A(e,t){let{routesMeta:r}=e,n={},i="/",s=[];for(let a=0;a<r.length;++a){let e=r[a],o=a===r.length-1,l="/"===i?t:t.slice(i.length)||"/",c=L({path:e.relativePath,caseSensitive:e.caseSensitive,end:o},l);if(!c)return null;
2Object.assign(n,c.params);let u=e.route;s.push({params:n,pathname:N([i,c.pathname]),pathnameBase:F(N([i,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(i=N([i,c.pathnameBase]))}return s}function L(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);c("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let s=new RegExp(i,t?void 0:"i");return[s,n]}(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:i}=t;if("*"===n){let e=o[r]||"";a=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[r];return e[n]=i&&!l?void 0:function(e,t){try{return decodeURIComponent(e)}catch(r){return c(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l||"",n),e}),{}),pathname:s,pathnameBase:a,pattern:e}}function M(e){try{return decodeURI(e)}catch(t){return c(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function T(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function O(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function P(e,t){let r=O(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function D(e,t,r,n){let i;void 0===n&&(n=!1),"string"===typeof e?i=f(e):(i=a({},e),l(!i.pathname||!i.pathname.includes("?"),T("?","pathname","search",i)),l(!i.pathname||!i.pathname.includes("#"),T("#","pathname","hash",i)),l(!i.search||!i.search.includes("#"),T("#","search","hash",i)));let s,o=""===e||""===i.pathname,c=o?"/":i.pathname;if(null==c)s=r;else{let e=t.length-1;if(!n&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}s=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:i=""}="string"===typeof e?f(e):e,s=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:s,search:R(n),hash:I(i)}}(i,s),h=c&&"/"!==c&&c.endsWith("/"),d=(o||"."===c)&&r.endsWith("/");return u.pathname.endsWith("/")||!h&&!d||(u.pathname+="/"),u}const N=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),R=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",I=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function j(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const G=["post","put","patch","delete"],B=(new Set(G),["get",...G]);new Set(B),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
2for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U.apply(this,arguments)}const W=t.createContext(null);const V=t.createContext(null);const H=t.createContext(null);const q=t.createContext(null);const Y=t.createContext({outlet:null,matches:[],isDataRoute:!1});const Z=t.createContext(null);function X(){return null!=t.useContext(q)}function K(){return X()||l(!1),t.useContext(q).location}function $(e){t.useContext(H).static||t.useLayoutEffect(e)}function Q(){let{isDataRoute:e}=t.useContext(Y);return e?function(){let{router:e}=le(ae.UseNavigateStable),r=ue(oe.UseNavigateStable),n=t.useRef(!1);$((()=>{n.current=!0}));let i=t.useCallback((function(t,i){void 0===i&&(i={}),n.current&&("number"===typeof t?e.navigate(t):e.navigate(t,U({fromRouteId:r},i)))}),[e,r]);return i}():function(){X()||l(!1);let e=t.useContext(W),{basename:r,future:n,navigator:i}=t.useContext(H),{matches:s}=t.useContext(Y),{pathname:a}=K(),o=JSON.stringify(P(s,n.v7_relativeSplatPath)),c=t.useRef(!1);$((()=>{c.current=!0}));let u=t.useCallback((function(t,n){if(void 0===n&&(n={}),!c.current)return;if("number"===typeof t)return void i.go(t);let s=D(t,JSON.parse(o),a,"path"===n.relative);null==e&&"/"!==r&&(s.pathname="/"===s.pathname?r:N([r,s.pathname])),(n.replace?i.replace:i.push)(s,n.state,n)}),[r,i,o,a,e]);return u}()}function J(e,r){let{relative:n}=void 0===r?{}:r,{future:i}=t.useContext(H),{matches:s}=t.useContext(Y),{pathname:a}=K(),o=JSON.stringify(P(s,i.v7_relativeSplatPath));return t.useMemo((()=>D(e,JSON.parse(o),a,"path"===n)),[e,o,a,n])}function ee(r,n,i,s){X()||l(!1);let{navigator:a}=t.useContext(H),{matches:o}=t.useContext(Y),c=o[o.length-1],u=c?c.params:{},h=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let d,p=K();if(n){var m;let e="string"===typeof n?f(n):n;"/"===h||(null==(m=e.pathname)?void 0:m.startsWith(h))||l(!1),d=e}else d=p;let v=d.pathname||"/",b=g(r,{pathname:"/"===h?v:v.slice(h.length)||"/"});let y=se(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:N([h,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:N([h,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),o,i,s);return n&&y?t.createElement(q.Provider,{value:{location:U({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:e.Pop}},y):y}function te(){let e=function(){var e;let r=t.useContext(Z),n=ce(oe.UseRouteError),i=ue(oe.UseRouteError);if(void 0!==r)return r;return null==(e=n.errors)?void 0:e[i]}(),r=j(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},r),n?t.createElement("pre",{style:s},n):null,null)}const re=t.createElement(te,null);class ne extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(Y.Provider,{value:this.props.routeContext},t.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ie(e){let{routeContext:r,match:n,children:i}=e,s=t.useContext(W);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),t.createElement(Y.Provider,{value:r},i)}function se(e,r,n,i){var s;if(void 0===r&&(r=[]),void 0===n&&(n=null),void 0===i&&(i=null),null==e){var a;
2if(null==(a=n)||!a.errors)return null;e=n.matches}let o=e,c=null==(s=n)?void 0:s.errors;if(null!=c){let e=o.findIndex((e=>e.route.id&&(null==c?void 0:c[e.route.id])));e>=0||l(!1),o=o.slice(0,Math.min(o.length,e+1))}let u=!1,h=-1;if(n&&i&&i.v7_partialHydration)for(let t=0;t<o.length;t++){let e=o[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(h=t),e.route.id){let{loaderData:t,errors:r}=n,i=e.route.loader&&void 0===t[e.route.id]&&(!r||void 0===r[e.route.id]);if(e.route.lazy||i){u=!0,o=h>=0?o.slice(0,h+1):[o[0]];break}}}return o.reduceRight(((e,i,s)=>{let a,l=!1,d=null,f=null;var p;n&&(a=c&&i.route.id?c[i.route.id]:void 0,d=i.route.errorElement||re,u&&(h<0&&0===s?(p="route-fallback",!1||he[p]||(he[p]=!0),l=!0,f=null):h===s&&(l=!0,f=i.route.hydrateFallbackElement||null)));let m=r.concat(o.slice(0,s+1)),g=()=>{let r;return r=a?d:l?f:i.route.Component?t.createElement(i.route.Component,null):i.route.element?i.route.element:e,t.createElement(ie,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:r})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===s)?t.createElement(ne,{location:n.location,revalidation:n.revalidation,component:d,error:a,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()}),null)}var ae=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ae||{}),oe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(oe||{});function le(e){let r=t.useContext(W);return r||l(!1),r}function ce(e){let r=t.useContext(V);return r||l(!1),r}function ue(e){let r=function(e){let r=t.useContext(Y);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}const he={};r.startTransition;function de(e){l(!1)}function fe(r){let{basename:n="/",children:i=null,location:s,navigationType:a=e.Pop,navigator:o,static:c=!1,future:u}=r;X()&&l(!1);let h=n.replace(/^\/*/,"/"),d=t.useMemo((()=>({basename:h,navigator:o,static:c,future:U({v7_relativeSplatPath:!1},u)})),[h,u,o,c]);"string"===typeof s&&(s=f(s));let{pathname:p="/",search:m="",hash:g="",state:v=null,key:b="default"}=s,y=t.useMemo((()=>{let e=z(p,h);return null==e?null:{location:{pathname:e,search:m,hash:g,state:v,key:b},navigationType:a}}),[h,p,m,g,v,b,a]);return null==y?null:t.createElement(H.Provider,{value:d},t.createElement(q.Provider,{children:i,value:y}))}function pe(e){let{children:t,location:r}=e;return ee(me(t),r)}new Promise((()=>{}));t.Component;function me(e,r){void 0===r&&(r=[]);let n=[];return t.Children.forEach(e,((e,i)=>{if(!t.isValidElement(e))return;let s=[...r,i];if(e.type===t.Fragment)return void n.push.apply(n,me(e.props.children,s));e.type!==de&&l(!1),e.props.index&&e.props.children&&l(!1);let a={id:e.props.id||s.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=me(e.props.children,s)),n.push(a)})),n}function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge.apply(this,arguments)}function ve(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const be=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(Gi){}new Map;const ye=r.startTransition;s.flushSync,r.useId;function _e(e){let{basename:r,children:n,future:i,window:s}=e,a=t.useRef();null==a.current&&(a.current=function(e){return void 0===e&&(e={}),p((function(e,t){let{pathname:r,search:n,hash:i}=e.location;return h("",{pathname:r,search:n,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:d(t)}),null,e)}({window:s,v5Compat:!0}));let o=a.current,[l,c]=t.useState({action:o.action,location:o.location}),{v7_startTransition:u}=i||{},f=t.useCallback((e=>{u&&ye?ye((()=>c(e))):c(e)}),[c,u]);return t.useLayoutEffect((()=>o.listen(f)),[o,f]),t.createElement(fe,{basename:r,children:n,location:l.location,navigationType:l.action,navigator:o,future:i})}const we="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,xe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Se=t.forwardRef((function(e,r){let n,{onClick:i,relative:s,reloadDocument:a,replace:o,state:c,target:u,to:h,preventScrollReset:f,unstable_viewTransition:p}
2=e,m=ve(e,be),{basename:g}=t.useContext(H),v=!1;if("string"===typeof h&&xe.test(h)&&(n=h,we))try{let e=new URL(window.location.href),t=h.startsWith("//")?new URL(e.protocol+h):new URL(h),r=z(t.pathname,g);t.origin===e.origin&&null!=r?h=r+t.search+t.hash:v=!0}catch(Gi){}let b=function(e,r){let{relative:n}=void 0===r?{}:r;X()||l(!1);let{basename:i,navigator:s}=t.useContext(H),{hash:a,pathname:o,search:c}=J(e,{relative:n}),u=o;return"/"!==i&&(u="/"===o?i:N([i,o])),s.createHref({pathname:u,search:c,hash:a})}(h,{relative:s}),y=function(e,r){let{target:n,replace:i,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l}=void 0===r?{}:r,c=Q(),u=K(),h=J(e,{relative:o});return t.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,n)){t.preventDefault();let r=void 0!==i?i:d(u)===d(h);c(e,{replace:r,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l})}}),[u,c,h,i,s,n,e,a,o,l])}(h,{replace:o,state:c,target:u,preventScrollReset:f,relative:s,unstable_viewTransition:p});return t.createElement("a",ge({},m,{href:n||b,onClick:v||a?i:function(e){i&&i(e),e.defaultPrevented||y(e)},ref:r,target:u}))}));var Ce,ke;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ce||(Ce={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(ke||(ke={}));var Ee=__webpack_require__(496);const Ae=()=>{const e=Q();return(0,t.useEffect)((()=>((e=>{const t=document.createElement("script");t.src=e,t.async=!0,document.body.appendChild(t)})("https://www.powr-staging.io/powr_staging.js?platform=html"),()=>{document.querySelectorAll('script[src="https://www.powr-staging.io/powr_staging.js?platform=html"]').forEach((e=>e.remove()))})),[]),(0,Ee.jsxs)("div",{className:"landing-page-container",children:[(0,Ee.jsxs)("header",{className:"header",children:[(0,Ee.jsxs)("h1",{children:["Welcome to ",(0,Ee.jsx)("span",{className:"acompchemlab",children:"ACompChemLab"})," Explorer!"]}),(0,Ee.jsx)("p",{children:"Your journey into the molecular world begins here."})]}),(0,Ee.jsx)("main",{className:"main-content",children:(0,Ee.jsxs)("div",{className:"cards-container",children:[(0,Ee.jsxs)("div",{className:"card",onClick:()=>{e("/Membrane-Nanoplastic-Interactions")},children:[(0,Ee.jsx)("h2",{children:"Membrane Nanoplastic Interactions"}),(0,Ee.jsx)("p",{children:"Click to explore the interactive gallery of molecules."})]}),(0,Ee.jsxs)("div",{className:"card disabled",children:[(0,Ee.jsx)("h2",{children:"Bacterial Nanowire"}),(0,Ee.jsx)("p",{children:"Coming Soon! This feature is under development and will be available soon."})]})]})}),(0,Ee.jsxs)("footer",{className:"footer",children:[(0,Ee.jsx)("p",{children:"\xa9 2024 ACompChemLab. All rights reserved."}),(0,Ee.jsxs)("div",{className:"hit-counter",children:[(0,Ee.jsx)("div",{className:"powr-hit-counter",id:"c3e370f3_1725559918"}),(0,Ee.jsx)("div",{className:"counter-label",children:"Visit Counter"})]})]})]})};var Le=__webpack_require__(264),Me=__webpack_require__.n(Le);const ze=["xxl","xl","lg","md","sm","xs"],Te="xs",Oe=t.createContext({prefixes:{},breakpoints:ze,minBreakpoint:Te}),{Consumer:Pe,Provider:De}=Oe;function Ne(e,r){const{prefixes:n}=(0,t.useContext)(Oe);return e||n[r]||r}function Fe(){const{breakpoints:e}=(0,t.useContext)(Oe);return e}function Re(){const{minBreakpoint:e}=(0,t.useContext)(Oe);return e}const Ie=t.forwardRef(((e,t)=>{let{bsPrefix:r,fluid:n=!1,as:i="div",className:s,...a}=e;const o=Ne(r,"container"),l="string"===typeof n?"-".concat(n):"-fluid";return(0,Ee.jsx)(i,{ref:t,...a,className:Me()(s,n?"".concat(o).concat(l):o)})}));Ie.displayName="Container";const je=Ie,Ge=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,as:i="div",...s}=e;const a=Ne(r,"row"),o=Fe(),l=Re(),c="".concat(a,"-cols"),u=[];return o.forEach((e=>{const t=s[e];let r;delete s[e],null!=t&&"object"===typeof t?({cols:r}=t):r=t;
2const n=e!==l?"-".concat(e):"";null!=r&&u.push("".concat(c).concat(n,"-").concat(r))})),(0,Ee.jsx)(i,{ref:t,...s,className:Me()(n,a,...u)})}));Ge.displayName="Row";const Be=Ge;const Ue=t.forwardRef(((e,t)=>{const[{className:r,...n},{as:i="div",bsPrefix:s,spans:a}]=function(e){let{as:t,bsPrefix:r,className:n,...i}=e;r=Ne(r,"col");const s=Fe(),a=Re(),o=[],l=[];return s.forEach((e=>{const t=i[e];let n,s,c;delete i[e],"object"===typeof t&&null!=t?({span:n,offset:s,order:c}=t):n=t;const u=e!==a?"-".concat(e):"";n&&o.push(!0===n?"".concat(r).concat(u):"".concat(r).concat(u,"-").concat(n)),null!=c&&l.push("order".concat(u,"-").concat(c)),null!=s&&l.push("offset".concat(u,"-").concat(s))})),[{...i,className:Me()(n,...o,...l)},{as:t,bsPrefix:r,spans:o}]}(e);return(0,Ee.jsx)(i,{...n,ref:t,className:Me()(r,!a.length&&s)})}));Ue.displayName="Col";const We=Ue,Ve=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"card-body"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));Ve.displayName="CardBody";const He=Ve,qe=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"card-footer"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));qe.displayName="CardFooter";const Ye=qe,Ze=t.createContext(null);Ze.displayName="CardHeaderContext";const Xe=Ze,Ke=t.forwardRef(((e,r)=>{let{bsPrefix:n,className:i,as:s="div",...a}=e;const o=Ne(n,"card-header"),l=(0,t.useMemo)((()=>({cardHeaderBsPrefix:o})),[o]);return(0,Ee.jsx)(Xe.Provider,{value:l,children:(0,Ee.jsx)(s,{ref:r,...a,className:Me()(i,o)})})}));Ke.displayName="CardHeader";const $e=Ke,Qe=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,variant:i,as:s="img",...a}=e;const o=Ne(r,"card-img");return(0,Ee.jsx)(s,{ref:t,className:Me()(i?"".concat(o,"-").concat(i):o,n),...a})}));Qe.displayName="CardImg";const Je=Qe,et=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"card-img-overlay"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));et.displayName="CardImgOverlay";const tt=et,rt=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="a",...s}=e;return n=Ne(n,"card-link"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));rt.displayName="CardLink";const nt=rt,it=e=>t.forwardRef(((t,r)=>(0,Ee.jsx)("div",{...t,ref:r,className:Me()(t.className,e)}))),st=it("h6"),at=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i=st,...s}=e;return n=Ne(n,"card-subtitle"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));at.displayName="CardSubtitle";const ot=at,lt=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="p",...s}=e;return n=Ne(n,"card-text"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));lt.displayName="CardText";const ct=lt,ut=it("h5"),ht=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i=ut,...s}=e;return n=Ne(n,"card-title"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));ht.displayName="CardTitle";const dt=ht,ft=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,bg:i,text:s,border:a,body:o=!1,children:l,as:c="div",...u}=e;const h=Ne(r,"card");return(0,Ee.jsx)(c,{ref:t,...u,className:Me()(n,h,i&&"bg-".concat(i),s&&"text-".concat(s),a&&"border-".concat(a)),children:o?(0,Ee.jsx)(He,{children:l}):l})}));ft.displayName="Card";
2const pt=Object.assign(ft,{Img:Je,Title:dt,Subtitle:ot,Body:He,Link:nt,Text:ct,Header:$e,Footer:Ye,ImgOverlay:tt});var mt=__webpack_require__(188);const gt={H:"#FFFFFF",He:"#58C4DD",Li:"#FFA500",Be:"#800080",B:"#FF0000",C:"#000000",N:"#0000FF",O:"#FF0000",F:"#00FF00",Ne:"#00008B",Na:"#FFD700",Mg:"#8B4513",Al:"#FA8072",Si:"#4682B4",P:"#FFA500",S:"#FFFF00",Cl:"#00FA9A",Ar:"#4B0082",K:"#FF4500",Ca:"#2E8B57",Sc:"#EAA2A2",Ti:"#F8C2D1",V:"#A6A6AB",Cr:"#8A99C7",Mn:"#9C7AC7",Fe:"#E06633",Co:"#F090A0",Ni:"#50D050",Cu:"#C88033",Zn:"#7D80B0",Ga:"#C28F8F",Ge:"#668F8F",As:"#BD80E3",Se:"#FFA100",Br:"#A62929",Kr:"#5CB8D1",Rb:"#702EB0",Sr:"#00FF00",Y:"#94FFFF",Zr:"#94E0E0",Nb:"#73C2C9",Mo:"#54B5B5",Tc:"#3B9E9E",Ru:"#248F8F",Rh:"#0A7D8C",Pd:"#006985",Ag:"#C0C0C0",Cd:"#FFD98F",In:"#A67573",Sn:"#668080",Sb:"#9E63B5",Te:"#D47A00",I:"#940094",Xe:"#429EB0",Cs:"#57178F",Ba:"#00C900",La:"#70D4FF",Ce:"#FFFFC7",Pr:"#D9FFC7",Nd:"#C7FFC7",Pm:"#A3FFC7",Sm:"#8FFFC7",Eu:"#61FFC7",Gd:"#45FFC7",Tb:"#30FFC7",Dy:"#1FFFC7",Ho:"#00FF9C",Er:"#00E675",Tm:"#00D452",Yb:"#00BF38",Lu:"#00AB24",Hf:"#4DC2FF",Ta:"#4DA6FF",W:"#2194D6",Re:"#267DAB",Os:"#266696",Ir:"#175487",Pt:"#D0D0E0",Au:"#FFD123",Hg:"#B8B8D0",Tl:"#A6544D",Pb:"#575961",Bi:"#9E4FB5",Po:"#AB5C00",At:"#754F45",Rn:"#428296",Fr:"#420066",Ra:"#007D00",Ac:"#70ABFA",Th:"#00BAFF",Pa:"#00A1FF",U:"#008FFF",Np:"#0080FF",Pu:"#006BFF",Am:"#545CF2",Cm:"#785CE3",Bk:"#8A4FE3",Cf:"#A136D4",Es:"#B31FD4",Fm:"#B31FBA",Md:"#B30DA6",No:"#BD0D87",Lr:"#C70066",Rf:"#CC0059",Db:"#D1004F",Sg:"#D90045",Bh:"#E00038",Hs:"#E6002E",Mt:"#EB0026"},vt=e=>{let{filePath:r,label:n,singleStructure:i}=e;const s=(0,t.useRef)(),a=(0,t.useRef)();return(0,t.useEffect)((()=>{if(!r)return;const e=mt.createViewer(s.current,{width:400,height:400,antialias:!0,quality:"high",backgroundColor:"#273b59",zoomEnabled:!1});return fetch(r).then((e=>e.text())).then((t=>{const n=r.endsWith(".gro")?"gro":"pdb";e.addModel(t,n,{keepH:!0}),"Y"===i?Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{stick:{color:gt[t],radius:.2}})})):(Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{stick:{color:gt[t],radius:.2}})})),e.setStyle({elem:"P"},{sphere:{radius:3,color:"orange"}})),e.zoomTo(),e.render(),e.rotate(270,{x:1,y:0,z:0}),function(e){const t=.7;function r(){e&&(e.rotate(t,{x:0,y:0,z:1}),e.render(),requestAnimationFrame(r))}r()}(e),"N"===i&&e.rotate(25,{x:1,y:0,z:0})})),()=>{e&&"function"===typeof e.destroy&&e.destroy()}}),[r,i]),(0,Ee.jsx)("div",{ref:a,style:{width:"400px",height:"400px",position:"relative",overflowX:"hidden",overflowY:"hidden"},children:(0,Ee.jsx)("div",{ref:s,style:{width:"100%",height:"100%"}})})},bt=()=>{let e=Q();const t=t=>{e(t)};return(0,Ee.jsx)("div",{className:"banner",children:(0,Ee.jsx)(je,{children:(0,Ee.jsx)(Be,{className:"align-items-center text-center",children:(0,Ee.jsxs)(We,{children:[(0,Ee.jsxs)("h2",{className:"headline",children:["Your window to ",(0,Ee.jsx)("span",{className:"acompchemlab",children:"ACompChemLab"})," Research"]}),(0,Ee.jsx)("p",{className:"subheadline",children:"Learn about membranes and how nanoplastic interacts with them"}),(0,Ee.jsx)("p",{className:"subheadline-intro",children:"Biological membranes are primarily composed of a phospholipid bilayer. The hydrophilic (water-attracting) heads face outward towards the aqueous environment, while the hydrophobic (water-repelling) tails face inward, forming a semi-permeable barrier. One of the most prevalent polymers found in marine plastic debris is polystyrene (PS). The ingestion of plastic microparticles poses significant risks to marine life, as it can lead to the release of harmful plastic monomers and toxic chemical additives, including phthalates. Biological membranes represent the first line of defense against such foreign particles, playing a crucial role in mitigating the entry and subsequent effects of these potentially hazardous substances at the cellular level. The ongoing accumulation of PS in marine environments highlights the urgent need for comprehensive strategies to address plastic pollution and protect marine ecosystems."}),(0,Ee.jsxs)(Be,{className:"mt-4 g-4 justify-content-center",children:[(0,Ee.jsx)(We,{md:6,lg:4,onClick:()=>t("/Membrane"),children:(0,Ee.jsxs)("div",{className:"custom-card",children:[(0,Ee.jsxs)("div",{className:"custom-card-img",children:[(0,Ee.jsx)(vt,{filePath:"/lipids/pureLipids/200_POPC_initial.pdb",singleStructure:"N"}),(0,Ee.jsx)("div",{className:"custom-card-title",children:"Membrane"})]}),(0,Ee.jsx)("div",{className:"custom-card-overlay",children:(0,Ee.jsx)(pt.Body,{children:(0,Ee.jsx)(pt.Text,{children:"Learn about Membranes and their role in biology"})})})]})}),(0,Ee.jsx)(We,{md:6,lg:4,onClick:()=>t("/Membrane-with-Polystyrene"),children:(0,Ee.jsxs)("div",{className:"custom-card",children:[(0,Ee.jsxs)("div",{className:"custom-card-img",children:[(0,Ee.jsx)(vt,{filePath:"/lipids/mixtureLipids/popc_poly_nowat_ion.pdb",singleStructure:"N"}),(0,Ee.jsx)("div",{className:"custom-card-title",children:"Membrane with Polystyrene"})]}),(0,Ee.jsx)("div",{className:"custom-card-overlay",children:(0,Ee.jsx)(pt.Body,{children:(0,Ee.jsx)(pt.Text,{children:"Explore the complex world of Membranes with Polystyrene"})})})]})})]})]})})})})},yt=["as","disabled"];function _t(e){let{tagName:t,disabled:r,href:n,target:i,rel:s,role:a,onClick:o,tabIndex:l=0,type:c}=e;t||(t=null!=n||null!=i||null!=s?"a":"button");const u={tagName:t};if("button"===t)return[{type:c||"button",disabled:r},u];const h=e=>{(r||"a"===t&&function(e){return!e||"#"===e.trim()}(n))&&e.preventDefault(),r?e.stopPropagation():null==o||o(e)};return"a"===t&&(n||(n="#"),r&&(n=void 0)),[{role:null!=a?a:"button",disabled:void 0,tabIndex:r?void 0:l,href:n,target:"a"===t?i:void 0,"aria-disabled":r||void 0,rel:"a"===t?s:void 0,onClick:h,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),h(e))}},u]}const wt=t.forwardRef(((e,t)=>{let{as:r,disabled:n}=e,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,yt);const[s,{tagName:a}]=_t(Object.assign({tagName:r,disabled:n}
2,i));return(0,Ee.jsx)(a,Object.assign({},i,s,{ref:t}))}));wt.displayName="Button";const xt=wt,St=t.forwardRef(((e,t)=>{let{as:r,bsPrefix:n,variant:i="primary",size:s,active:a=!1,disabled:o=!1,className:l,...c}=e;const u=Ne(n,"btn"),[h,{tagName:d}]=_t({tagName:r,disabled:o,...c}),f=d;return(0,Ee.jsx)(f,{...h,...c,ref:t,disabled:o,className:Me()(l,u,a&&"active",i&&"".concat(u,"-").concat(i),s&&"".concat(u,"-").concat(s),c.href&&o&&"disabled")})}));St.displayName="Button";const Ct=St,kt=!("undefined"===typeof window||!window.document||!window.document.createElement);var Et=!1,At=!1;try{var Lt={get passive(){return Et=!0},get once(){return At=Et=!0}};kt&&(window.addEventListener("test",Lt,Lt),window.removeEventListener("test",Lt,!0))}catch(Gi){}const Mt=function(e,t,r,n){if(n&&"boolean"!==typeof n&&!At){var i=n.once,s=n.capture,a=r;!At&&i&&(a=r.__once||function e(n){this.removeEventListener(t,e,s),r.call(this,n)},r.__once=a),e.addEventListener(t,a,Et?n:s)}e.addEventListener(t,r,n)};function zt(e){return e&&e.ownerDocument||document}const Tt=function(e,t,r,n){var i=n&&"boolean"!==typeof n?n.capture:n;e.removeEventListener(t,r,i),r.__once&&e.removeEventListener(t,r.__once,i)};var Ot;function Pt(e){if((!Ot&&0!==Ot||e)&&kt){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Ot=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ot}const Dt=function(e){const r=(0,t.useRef)(e);return(0,t.useEffect)((()=>{r.current=e}),[e]),r};function Nt(e){const r=Dt(e);return(0,t.useCallback)((function(){return r.current&&r.current(...arguments)}),[r])}const Ft=e=>e&&"function"!==typeof e?t=>{e.current=t}:e;const Rt=function(e,r){return(0,t.useMemo)((()=>function(e,t){const r=Ft(e),n=Ft(t);return e=>{r&&r(e),n&&n(e)}}(e,r)),[e,r])};function It(e){const r=function(e){const r=(0,t.useRef)(e);return r.current=e,r}(e);(0,t.useEffect)((()=>()=>r.current()),[])}function jt(e,t){return function(e){var t=zt(e);return t&&t.defaultView||window}(e).getComputedStyle(e,t)}var Gt=/([A-Z])/g;var Bt=/^ms-/;function Ut(e){return function(e){return e.replace(Gt,"-$1").toLowerCase()}(e).replace(Bt,"-ms-")}var Wt=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;const Vt=function(e,t){var r="",n="";if("string"===typeof t)return e.style.getPropertyValue(Ut(t))||jt(e).getPropertyValue(Ut(t));Object.keys(t).forEach((function(i){var s=t[i];s||0===s?!function(e){return!(!e||!Wt.test(e))}(i)?r+=Ut(i)+": "+s+";":n+=i+"("+s+") ":e.style.removeProperty(Ut(i))})),n&&(r+="transform: "+n+";"),e.style.cssText+=";"+r};const Ht=function(e,t,r,n){return Mt(e,t,r,n),function(){Tt(e,t,r,n)}};function qt(e,t,r){void 0===r&&(r=5);var n=!1,i=setTimeout((function(){n||function(e,t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent(t,r,n),e.dispatchEvent(i)}}(e,"transitionend",!0)}),t+r),s=Ht(e,"transitionend",(function(){n=!0}),{once:!0});return function(){clearTimeout(i),s()}}function Yt(e,t,r,n){null==r&&(r=function(e){var t=Vt(e,"transitionDuration")||"",r=-1===t.indexOf("ms")?1e3:1;return parseFloat(t)*r}(e)||0);var i=qt(e,r,n),s=Ht(e,"transitionend",t);return function(){i(),s()}}function Zt(e){void 0===e&&(e=zt());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(Gi){return e.body}}function Xt(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}const Kt="data-rr-ui-";function $t(e){return"".concat(Kt).concat(e)}const Qt=$t("modal-open");const Jt=class{constructor(){let{ownerDocument:e,handleContainerOverflow:t=!0,isRTL:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.handleContainerOverflow=t,this.isRTL=r,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",n=this.getElement();e.style={overflow:n.style.overflow,[r]:n.style[r]},e.scrollBarWidth&&(t[r]="".concat(parseInt(Vt(n,r)||"0",10)+e.scrollBarWidth,"px")),n.setAttribute(Qt,""),Vt(n,t)}
2reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(Qt),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t?t:(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),t)}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}},er=(0,t.createContext)(kt?window:void 0);er.Provider;function tr(){return(0,t.useContext)(er)}const rr=(e,t)=>kt?null==e?(t||zt()).body:("function"===typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;const nr="undefined"!==typeof __webpack_require__.g&&__webpack_require__.g.navigator&&"ReactNative"===__webpack_require__.g.navigator.product,ir="undefined"!==typeof document||nr?t.useLayoutEffect:t.useEffect;const sr=function(e){let{children:r,in:n,onExited:i,mountOnEnter:s,unmountOnExit:a}=e;const o=(0,t.useRef)(null),l=(0,t.useRef)(n),c=Nt(i);(0,t.useEffect)((()=>{n?l.current=!0:c(o.current)}),[n,c]);const u=Rt(o,r.ref),h=(0,t.cloneElement)(r,{ref:u});return n?h:a||!l.current&&s?null:h};const ar=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function or(e){let{onEnter:r,onEntering:n,onEntered:i,onExit:s,onExiting:a,onExited:o,addEndListener:l,children:c}=e,u=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,ar);const{major:h}=function(){const e=t.version.split(".");return{major:+e[0],minor:+e[1],patch:+e[2]}}(),d=h>=19?c.props.ref:c.ref,f=(0,t.useRef)(null),p=Rt(f,"function"===typeof c?null:d),m=e=>t=>{e&&f.current&&e(f.current,t)},g=(0,t.useCallback)(m(r),[r]),v=(0,t.useCallback)(m(n),[n]),b=(0,t.useCallback)(m(i),[i]),y=(0,t.useCallback)(m(s),[s]),_=(0,t.useCallback)(m(a),[a]),w=(0,t.useCallback)(m(o),[o]),x=(0,t.useCallback)(m(l),[l]);return Object.assign({},u,{nodeRef:f},r&&{onEnter:g},n&&{onEntering:v},i&&{onEntered:b},s&&{onExit:y},a&&{onExiting:_},o&&{onExited:w},l&&{addEndListener:x},{children:"function"===typeof c?(e,t)=>c(e,Object.assign({},t,{ref:p})):(0,t.cloneElement)(c,{ref:p})})}const lr=["component"];const cr=t.forwardRef(((e,t)=>{let{component:r}=e;const n=or(function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,lr));return(0,Ee.jsx)(r,Object.assign({ref:t},n))}));function ur(e){let{children:r,in:n,onExited:i,onEntered:s,transition:a}=e;const[o,l]=(0,t.useState)(!n);n&&o&&l(!1);const c=function(e){let{in:r,onTransition:n}=e;const i=(0,t.useRef)(null),s=(0,t.useRef)(!0),a=Nt(n);return ir((()=>{if(!i.current)return;let e=!1;return a({in:r,element:i.current,initial:s.current,isStale:()=>e}),()=>{e=!0}}),[r,a]),ir((()=>(s.current=!1,()=>{s.current=!0})),[]),i}({in:!!n,onTransition:e=>{Promise.resolve(a(e)).then((()=>{e.isStale()||(e.in?null==s||s(e.element,e.initial):(l(!0),null==i||i(e.element)))}),(t=>{throw e.in||l(!0),t}))}}),u=Rt(c,r.ref);return o&&!n?null:(0,t.cloneElement)(r,{ref:u})}function hr(e,t,r){return e?(0,Ee.jsx)(cr,Object.assign({},r,{component:e})):t?(0,Ee.jsx)(ur,Object.assign({},r,{transition:t})):(0,Ee.jsx)(sr,Object.assign({},r))}const dr=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let fr;function pr(e){const r=tr(),n=e||function(e){return fr||(fr=new Jt({ownerDocument:null==e?void 0:e.document})),fr}(r),i=(0,t.useRef)({dialog:null,backdrop:null});return Object.assign(i.current,{add:()=>n.add(i.current),remove:()=>n.remove(i.current),isTopModal:()=>n.isTopModal(i.current),setDialogRef:(0,t.useCallback)((e=>{i.current.dialog=e}),[]),setBackdropRef:(0,t.useCallback)((e=>{i.current.backdrop=e}),[])})}const mr=(0,t.forwardRef)(((e,r)=>{let{show:n=!1,role:s="dialog",className:a,style:o,children:l,backdrop:c=!0,keyboard:u=!0,onBackdropClick:h,onEscapeKeyDown:d,transition:f,runTransition:p,backdropTransition:m,runBackdropTransition:g,autoFocus:v=!0,enforceFocus:b=!0,restoreFocus:y=!0,restoreFocusOptions:_,renderDialog:w,renderBackdrop:x=(e=>(0,Ee.jsx)("div",Object.assign({},e))),manager:S,container:C,onShow:k,onHide:E=(()=>{}),onExit:A,onExited:L,onExiting:M,onEnter:z,onEntering:T,onEntered:O}
vendor: 2,551 bytes, line 2
2=e,P=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,dr);const D=tr(),N=function(e,r){const n=tr(),[i,s]=(0,t.useState)((()=>rr(e,null==n?void 0:n.document)));if(!i){const t=rr(e);t&&s(t)}return(0,t.useEffect)((()=>{r&&i&&r(i)}),[r,i]),(0,t.useEffect)((()=>{const t=rr(e);t!==i&&s(t)}),[e,i]),i}(C),F=pr(S),R=function(){const e=(0,t.useRef)(!0),r=(0,t.useRef)((()=>e.current));return(0,t.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),r.current}(),I=function(e){const r=(0,t.useRef)(null);return(0,t.useEffect)((()=>{r.current=e})),r.current}(n),[j,G]=(0,t.useState)(!n),B=(0,t.useRef)(null);(0,t.useImperativeHandle)(r,(()=>F),[F]),kt&&!I&&n&&(B.current=Zt(null==D?void 0:D.document)),n&&j&&G(!1);const U=Nt((()=>{if(F.add(),Z.current=Ht(document,"keydown",q),Y.current=Ht(document,"focus",(()=>setTimeout(V)),!0),k&&k(),v){var e,t;const r=Zt(null!=(e=null==(t=F.dialog)?void 0:t.ownerDocument)?e:null==D?void 0:D.document);F.dialog&&r&&!Xt(F.dialog,r)&&(B.current=r,F.dialog.focus())}})),W=Nt((()=>{var e;(F.remove(),null==Z.current||Z.current(),null==Y.current||Y.current(),y)&&(null==(e=B.current)||null==e.focus||e.focus(_),B.current=null)}));(0,t.useEffect)((()=>{n&&N&&U()}),[n,N,U]),(0,t.useEffect)((()=>{j&&W()}),[j,W]),It((()=>{W()}));const V=Nt((()=>{if(!b||!R()||!F.isTopModal())return;const e=Zt(null==D?void 0:D.document);F.dialog&&e&&!Xt(F.dialog,e)&&F.dialog.focus()})),H=Nt((e=>{e.target===e.currentTarget&&(null==h||h(e),!0===c&&E())})),q=Nt((e=>{u&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&F.isTopModal()&&(null==d||d(e),e.defaultPrevented||E())})),Y=(0,t.useRef)(),Z=(0,t.useRef)();if(!N)return null;const X=Object.assign({role:s,ref:F.setDialogRef,"aria-modal":"dialog"===s||void 0},P,{style:o,className:a,tabIndex:-1});let K=w?w(X):(0,Ee.jsx)("div",Object.assign({},X,{children:t.cloneElement(l,{role:"document"})}));K=hr(f,p,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:A,onExiting:M,onExited:function(){G(!0),null==L||L(...arguments)},onEnter:z,onEntering:T,onEntered:O,children:K});let $=null;return c&&($=x({ref:F.setBackdropRef,onClick:H}),$=hr(m,g,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:$})),(0,Ee.jsx)(Ee.Fragment,{children:i.createPortal((0,Ee.jsxs)(Ee.Fragment,{children:[$,K]}),N)})}));mr.displayName="Modal";const gr=Object.assign(mr,{Manager:Jt});var vr=Function.prototype.bind.call(Function.prototype.call,[].slice);function br(e,t){return vr(e.querySelectorAll(t))}
2function yr(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const _r=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",wr=".sticky-top",xr=".navbar-toggler";class Sr extends Jt{adjustAndStore(e,t,r){const n=t.style[e];t.dataset[e]=n,Vt(t,{[e]:"".concat(parseFloat(Vt(t,e))+r,"px")})}restore(e,t){const r=t.dataset[e];void 0!==r&&(delete t.dataset[e],Vt(t,{[e]:r}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var r,n;if(n="modal-open",(r=t).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"===typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)),!e.scrollBarWidth)return;const i=this.isRTL?"paddingLeft":"paddingRight",s=this.isRTL?"marginLeft":"marginRight";br(t,_r).forEach((t=>this.adjustAndStore(i,t,e.scrollBarWidth))),br(t,wr).forEach((t=>this.adjustAndStore(s,t,-e.scrollBarWidth))),br(t,xr).forEach((t=>this.adjustAndStore(s,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var r,n;n="modal-open",(r=t).classList?r.classList.remove(n):"string"===typeof r.className?r.className=yr(r.className,n):r.setAttribute("class",yr(r.className&&r.className.baseVal||"",n));const i=this.isRTL?"paddingLeft":"paddingRight",s=this.isRTL?"marginLeft":"marginRight";br(t,_r).forEach((e=>this.restore(i,e))),br(t,wr).forEach((e=>this.restore(s,e))),br(t,xr).forEach((e=>this.restore(s,e)))}}let Cr;function kr(e){return Cr||(Cr=new Sr(e)),Cr}const Er=Sr;function Ar(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}const Mr=!1,zr=t.createContext(null);var Tr="unmounted",Or="exited",Pr="entering",Dr="entered",Nr="exiting",Fr=function(e){var r,n;function s(t,r){var n;n=e.call(this,t,r)||this;var i,s=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?s?(i=Or,n.appearStatus=Pr):i=Dr:i=t.unmountOnExit||t.mountOnEnter?Tr:Or,n.state={status:i},n.nextCallback=null,n}n=e,(r=s).prototype=Object.create(n.prototype),r.prototype.constructor=r,Lr(r,n),s.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Tr?{status:Or}:null};var a=s.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==Pr&&r!==Dr&&(t=Pr):r!==Pr&&r!==Dr||(t=Nr)}this.updateStatus(!1,t)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!==typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},a.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Pr){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:i.findDOMNode(this);r&&function(e){e.scrollTop}(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Or&&this.setState({status:Tr})},a.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,s=this.props.nodeRef?[n]:[i.findDOMNode(this),n],a=s[0],o=s[1],l=this.getTimeouts(),c=n?l.appear:l.enter;!e&&!r||Mr?this.safeSetState({status:Dr},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:Pr},(function(){t.props.onEntering(a,o),t.onTransitionEnd(c,(function(){t.safeSetState({status:Dr},(function(){t.props.onEntered(a,o)}))}))})))},a.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:i.findDOMNode(this);t&&!Mr?(this.props.onExit(n),this.safeSetState({status:Nr},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:Or},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:Or},(function(){e.props.onExited(n)}))},a.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},a.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},a.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:i.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=s[0],o=s[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},a.render=function(){var e=this.state.status;if(e===Tr)return null;var r=this.props,n=r.children,i=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,Ar(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return t.createElement(zr.Provider,{value:null},"function"===typeof n?n(e,i):t.cloneElement(t.Children.only(n),i))},s}(t.Component);function Rr(){}Fr.contextType=zr,Fr.propTypes={},Fr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter
vendor: 5,655 bytes, line 2
2:!0,exit:!0,onEnter:Rr,onEntering:Rr,onEntered:Rr,onExit:Rr,onExiting:Rr,onExited:Rr},Fr.UNMOUNTED=Tr,Fr.EXITED=Or,Fr.ENTERING=Pr,Fr.ENTERED=Dr,Fr.EXITING=Nr;const Ir=Fr;function jr(e,t){const r=Vt(e,t)||"",n=-1===r.indexOf("ms")?1e3:1;return parseFloat(r)*n}function Gr(e,t){const r=jr(e,"transitionDuration"),n=jr(e,"transitionDelay"),i=Yt(e,(r=>{r.target===e&&(i(),t(r))}),r+n)}function Br(e){e.offsetHeight}const Ur=t.forwardRef(((e,r)=>{let{onEnter:n,onEntering:s,onEntered:a,onExit:o,onExiting:l,onExited:c,addEndListener:u,children:h,childRef:d,...f}=e;const p=(0,t.useRef)(null),m=Rt(p,d),g=e=>{var t;m((t=e)&&"setState"in t?i.findDOMNode(t):null!=t?t:null)},v=e=>t=>{e&&p.current&&e(p.current,t)},b=(0,t.useCallback)(v(n),[n]),y=(0,t.useCallback)(v(s),[s]),_=(0,t.useCallback)(v(a),[a]),w=(0,t.useCallback)(v(o),[o]),x=(0,t.useCallback)(v(l),[l]),S=(0,t.useCallback)(v(c),[c]),C=(0,t.useCallback)(v(u),[u]);return(0,Ee.jsx)(Ir,{ref:r,...f,onEnter:b,onEntered:_,onEntering:y,onExit:w,onExited:S,onExiting:x,addEndListener:C,nodeRef:p,children:"function"===typeof h?(e,t)=>h(e,{...t,ref:g}):t.cloneElement(h,{ref:g})})})),Wr={[Pr]:"show",[Dr]:"show"},Vr=t.forwardRef(((e,r)=>{let{className:n,children:i,transitionClasses:s={},onEnter:a,...o}=e;const l={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...o},c=(0,t.useCallback)(((e,t)=>{Br(e),null==a||a(e,t)}),[a]);return(0,Ee.jsx)(Ur,{ref:r,addEndListener:Gr,...l,onEnter:c,childRef:i.ref,children:(e,r)=>t.cloneElement(i,{...r,className:Me()("fade",n,i.props.className,Wr[e],s[e])})})}));Vr.displayName="Fade";const Hr=Vr,qr=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"modal-body"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));qr.displayName="ModalBody";const Yr=qr,Zr=t.createContext({onHide(){}}),Xr=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,contentClassName:i,centered:s,size:a,fullscreen:o,children:l,scrollable:c,...u}=e;r=Ne(r,"modal");const h="".concat(r,"-dialog"),d="string"===typeof o?"".concat(r,"-fullscreen-").concat(o):"".concat(r,"-fullscreen");return(0,Ee.jsx)("div",{...u,ref:t,className:Me()(h,n,a&&"".concat(r,"-").concat(a),s&&"".concat(h,"-centered"),c&&"".concat(h,"-scrollable"),o&&d),children:(0,Ee.jsx)("div",{className:Me()("".concat(r,"-content"),i),children:l})})}));Xr.displayName="ModalDialog";const Kr=Xr,$r=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"modal-footer"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));$r.displayName="ModalFooter";const Qr=$r;var Jr=__webpack_require__(460),en=__webpack_require__.n(Jr);const tn={"aria-label":en().string,onClick:en().func,variant:en().oneOf(["white"])},rn=t.forwardRef(((e,t)=>{let{className:r,variant:n,"aria-label":i="Close",...s}=e;return(0,Ee.jsx)("button",{ref:t,type:"button",className:Me()("btn-close",n&&"btn-close-".concat(n),r),"aria-label":i,...s})}));rn.displayName="CloseButton",rn.propTypes=tn;const nn=rn,sn=t.forwardRef(((e,r)=>{let{closeLabel:n="Close",closeVariant:i,closeButton:s=!1,onHide:a,children:o,...l}=e;const c=(0,t.useContext)(Zr),u=Nt((()=>{null==c||c.onHide(),null==a||a()}));return(0,Ee.jsxs)("div",{ref:r,...l,children:[o,s&&(0,Ee.jsx)(nn,{"aria-label":n,variant:i,onClick:u})]})})),an=sn,on=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,closeLabel:i="Close",closeButton:s=!1,...a}=e;return r=Ne(r,"modal-header"),(0,Ee.jsx)(an,{ref:t,...a,className:Me()(n,r),closeLabel:i,closeButton:s})}));on.displayName="ModalHeader";const ln=on,cn=it("h4"),un=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i=cn,...s}=e;return n=Ne(n,"modal-title"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));un.displayName="ModalTitle";const hn=un;function dn(e){return(0,Ee.jsx)(Hr,{...e,timeout:null})}function fn(e){return(0,Ee.jsx)(Hr,{...e,timeout:null})}const pn=t.forwardRef(((e,r)=>{let{bsPrefix:n,className:i,style:s,dialogClassName:a,contentClassName:o,children:l,dialogAs:c=Kr,"data-bs-theme":u,"aria-labelledby":h,"aria-describedby":d,"aria-label":f,show:p=!1,animation:m=!0,backdrop:g=!0,keyboard:v=!0,onEscapeKeyDown:b,onShow:y,onHide:_,container:w,autoFocus:x=!0,enforceFocus:S=!0,restoreFocus:C=!0,restoreFocusOptions:k,onEntered:E,onExit:A,onExiting:L,onEnter:M,onEntering:z,onExited:T,backdropClassName:O,manager:P,...D}=e;const[N,F]=(0,t.useState)({}),[R,I]=(0,t.useState)(!1),j=(0,t.useRef)(!1),G=(0,t.useRef)(!1),B=(0,t.useRef)(null),[U,W]=(0,t.useState)(null),V=Rt(r,W),H=Nt(_),q=function(){const{dir:e}=(0,t.useContext)(Oe);return"rtl"===e}();n=Ne(n,"modal");const Y=(0,t.useMemo)((()=>({onHide:H})),[H]);function Z(){return P||kr({isRTL:q})}function X(e){if(!kt)return;const t=Z().getScrollbarWidth()>0,r=e.scrollHeight>zt(e).documentElement.clientHeight;F({paddingRight:t&&!r?Pt():void 0,paddingLeft:!t&&r?Pt():void 0})}const K=Nt((()=>{U&&X(U.dialog)}));It((()=>{Tt(window,"resize",K),null==B.current||B.current()}));const $=()=>{j.current=!0},Q=e=>{j.current&&U&&e.target===U.dialog&&(G.current=!0),j.current=!1},J=()=>{I(!0),B.current=Yt(U.dialog,(()=>{I(!1)}))},ee=e=>{"static"!==g?G.current||e.target!==e.currentTarget?G.current=!1:null==_||_():(e=>{e.target===e.currentTarget&&J()})(e)},te=(0,t.useCallback)((e=>(0,Ee.jsx)("div",{...e,className:Me()("".concat(n,"-backdrop"),O,!m&&"show")})),[m,O,n]),re={...s,...N};re.display="block";return(0,Ee.jsx)(Zr.Provider,{value:Y,children:(0,Ee.jsx)(gr,{show:p,ref:V,backdrop:g,container:w,keyboard:!0,autoFocus:x,enforceFocus:S,restoreFocus:C,restoreFocusOptions:k,onEscapeKeyDown:e=>{v?null==b||b(e):(e.preventDefault(),"static"===g&&J())},onShow:y,onHide:_,onEnter:(e,t)=>{e&&X(e),null==M||M(e,t)},onEntering:(e,t)=>
2{null==z||z(e,t),Mt(window,"resize",K)},onEntered:E,onExit:e=>{null==B.current||B.current(),null==A||A(e)},onExiting:L,onExited:e=>{e&&(e.style.display=""),null==T||T(e),Tt(window,"resize",K)},manager:Z(),transition:m?dn:void 0,backdropTransition:m?fn:void 0,renderBackdrop:te,renderDialog:e=>(0,Ee.jsx)("div",{role:"dialog",...e,style:re,className:Me()(i,n,R&&"".concat(n,"-static"),!m&&"show"),onClick:g?ee:void 0,onMouseUp:Q,"data-bs-theme":u,"aria-label":f,"aria-labelledby":h,"aria-describedby":d,children:(0,Ee.jsx)(c,{...D,onMouseDown:$,className:a,contentClassName:o,children:l})})})})}));pn.displayName="Modal";const mn=Object.assign(pn,{Body:Yr,Header:ln,Title:hn,Footer:Qr,Dialog:Kr,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),gn=e=>{let{filePath:r,style:n,label:i,singleStructure:s}=e;const a=(0,t.useRef)(),o=(0,t.useRef)();return(0,t.useEffect)((()=>{if(!r)return;const e=mt.createViewer(a.current,{width:400,height:400,antialias:!0,quality:"high",backgroundColor:" #2a4163"});return fetch(r).then((e=>e.text())).then((t=>{const i=r.endsWith(".gro")?"gro":"pdb";switch(e.addModel(t,i,{keepH:!0}),n){case"line":Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{line:{color:gt[t],lineWidth:500}})}));break;case"sphere":Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{sphere:{color:gt[t],lineWidth:500}})})),e.setStyle({elem:"P"},{sphere:{color:"orange"}});break;default:"Y"===s?Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{stick:{color:gt[t],radius:.2}})})):(Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{stick:{color:gt[t],radius:.2}})})),e.setStyle({elem:"P"},{sphere:{radius:3,color:"orange"}}))}e.zoomTo(),e.render(),e.rotate(270,{x:1,y:0,z:0})})),()=>{e&&"function"===typeof e.destroy&&e.destroy()}}),[r,n,s]),(0,Ee.jsxs)("div",{ref:o,style:{width:"800px",height:"600px",position:"relative"},children:[(0,Ee.jsx)("div",{ref:a,style:{width:"100%",height:"100%"}}),i&&(0,Ee.jsx)("div",{style:{position:"absolute",bottom:"8px",right:"350px",color:"white",backgroundColor:"rgba(0, 0, 0, 0.5)",padding:"5px 10px",borderRadius:"5px",fontSize:"20px"},children:i})]})},vn=e=>{let{animationPath:r,label:n,style:i}=e;const s=(0,t.useRef)(),a=(0,t.useRef)(),o=(0,t.useRef)();return(0,t.useEffect)((()=>{if(!r)return;const e=mt.createViewer(s.current,{backgroundColor:"#2a4163"}),t={keepH:!0,assignbonds:!0};return fetch(r).then((e=>e.text())).then((r=>{switch(e.addModelsAsFrames(r,"pdb",t),e.animate({loop:"forward",reps:0}),i){case"line":Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{line:{color:gt[t],lineWidth:500}})}));break;case"sphere":Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{sphere:{color:gt[t],lineWidth:500}})})),e.setStyle({elem:"P"},{sphere:{color:"orange"}});break;default:Object.keys(gt).forEach((t=>{e.setStyle({elem:t},{stick:{color:gt[t],radius:.2}})})),e.setStyle({elem:"P"},{sphere:{radius:3,color:"orange"}})}e.zoomTo(),e.rotate(270,{x:1,y:0,z:0});const n=()=>{e.render(),o.current=requestAnimationFrame(n)};n()})),()=>{e&&"function"===typeof e.destroy&&e.destroy(),o.current&&cancelAnimationFrame(o.current)}}),[r,i]),(0,Ee.jsxs)("div",{ref:a,style:{width:"800px",height:"753px",position:"relative"},children:[(0,Ee.jsx)("div",{ref:s,style:{width:"100%",height:"100%"}}),n&&(0,Ee.jsx)("div",{style:{position:"absolute",bottom:"10px",right:"10px",color:"white",backgroundColor:"rgba(0, 0, 0, 0.8)",padding:"5px 10px",borderRadius:"5px",fontSize:"16px"},children:n})]})};var bn=__webpack_require__(880),yn=__webpack_require__.n(bn);const _n=e=>{let{pureLipidsData:r}=e;const[n,i]=(0,t.useState)(null),[s,a]=(0,t.useState)(!1),[o,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)(0),[h,d]=(0,t.useState)("stick"),[f,p]=(0,t.useState)(!1),[m,g]=(0,t.useState)("stick"),[v,b]=(0,t.useState)(!1);return(0,Ee.jsxs)(je,{className:"molecule-selection-page",children:[r.molecules.map(((e,t,r)=>(0,Ee.jsxs)("div",{className:"card-style",children:[" ",(0,Ee.jsxs)(Be,{className:"mb-4 align-items-center ".concat(t%2===0?"flex-row":"flex-row-reverse"," ").concat(c>300*t?"animate":""),children:[(0,Ee.jsx)(We,{md:4,className:"molecule-image",children:(0,Ee.jsx)(vt,{filePath:e.image,singleStructure:e.singleStructure})}),(0,Ee.jsxs)(We,{md:6,className:"molecule-info",children:[(0,Ee.jsx)("h2",{children:e.name}),(0,Ee.jsx)("h6",{style:{fontStyle:"italic",color:"#e23737"},children:e.chemName}),(0,Ee.jsx)("p",{style:{marginBottom:"0.5rem",textAlign:"justify"},children:e.description}),(0,Ee.jsx)(Ct,{variant:"primary",className:"explore-button",onClick:()=>{i(e.files[0]),a(!0)},children:"Explore"})]})]},t)]}))),n&&(0,Ee.jsxs)(mn,{show:s,onHide:()=>{a(!1)},size:"lg",fullscreen:!0,centered:!0,children:[(0,Ee.jsxs)(mn.Header,{closeButton:!0,className:"cursor-move",children:[(0,Ee.jsxs)("div",{className:"select",style:{position:"absolute",left:"10px",top:"20%"},children:[(0,Ee.jsxs)("div",{className:"selected",onClick:()=>
2p(!f),children:[h.charAt(0).toUpperCase()+h.slice(1)," ",(0,Ee.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",className:"arrow",children:(0,Ee.jsx)("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})]}),f&&(0,Ee.jsx)("div",{className:"options",children:["line","sphere","stick"].map((e=>(0,Ee.jsx)("div",{className:"option",onClick:()=>{d(e),p(!1)},children:e.charAt(0).toUpperCase()+e.slice(1)},e)))})]}),(0,Ee.jsx)(mn.Title,{style:{flex:"1 1 auto",textAlign:"center",color:"#d6fb00",fontSize:"2rem",fontWeight:"bold"},children:n.displayName}),n&&n.animations&&n.animations.link&&(0,Ee.jsx)(Ct,{onClick:()=>{l(!0)},variant:"secondary",className:"explore-button",children:"View Animation"})]}),(0,Ee.jsx)(mn.Body,{children:(0,Ee.jsxs)(je,{fluid:!0,children:[(0,Ee.jsx)(Be,{className:"justify-content-md-center",children:n.paths&&Object.entries(n.paths).map((e=>{let[t,r]=e;return(0,Ee.jsx)(We,{md:6,className:"mb-3",children:(0,Ee.jsx)(gn,{filePath:r.link,label:r.title,style:h,singleStructure:r.singleStructure})},t)}))}),(0,Ee.jsx)(Be,{className:"justify-content-md-center"}),(0,Ee.jsx)(Be,{children:(0,Ee.jsx)(We,{children:(0,Ee.jsx)("p",{children:n.description})})})]})})]}),n&&o&&(0,Ee.jsx)(yn(),{handle:".modal-header",children:(0,Ee.jsxs)(mn,{show:o,onHide:()=>{l(!1)},dialogClassName:"custom-animation-modal-dialog",centered:!0,children:[(0,Ee.jsxs)(mn.Header,{closeButton:!0,className:"cursor-move",children:[(0,Ee.jsx)(mn.Title,{style:{flex:"1 1 auto",textAlign:"center",fontSize:"2.3rem",color:"#d6fb00"},children:n.animations.title}),(0,Ee.jsxs)("div",{className:"select",style:{position:"absolute",right:"0px",left:"10px",top:"25px"},children:[(0,Ee.jsxs)("div",{className:"selected",onClick:()=>b(!v),children:[m.charAt(0).toUpperCase()+m.slice(1)," ",(0,Ee.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",className:"arrow",children:(0,Ee.jsx)("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})]}),v&&(0,Ee.jsx)("div",{className:"options",children:["line","sphere","stick"].map((e=>(0,Ee.jsx)("div",{className:"option",onClick:()=>{g(e),b(!1)},children:e.charAt(0).toUpperCase()+e.slice(1)},e)))})]})]}),(0,Ee.jsx)(mn.Body,{className:"d-flex justify-content-center align-items-center",children:(0,Ee.jsx)(vn,{animationPath:n.animations.link,style:m})})]})})]})},wn={title:"Membrane",content:"Explore the complex and fascinating world of cellular membranes.",molecules:[{name:"POPC",chemName:"1-palmitoyl-2-oleoyl-sn-glycero-3-phosphocholine",description:"Click 'Explore' to view the membrane structure consisting of 200 POPC molecules on both leaflets, and to wat
2ch the animation on MD simulation of the membrane.",image:"/lipids/pureLipids/popc.pdb",singleStructure:"Y",files:[{displayName:"POPC",description:"The structure displayed on the left represents a single POPC molecule, while the right side illustrates the animation of a molecular dynamics (MD) simulation involving a membrane composed of 200 POPC molecules per leaflet, immersed in water and ions. The simulation was conducted over a duration of 200 ns. Water and ions are not shown due to clarity. Phosphorous atoms are shown as yellow sphere.",paths:{path1:{link:"/lipids/pureLipids/popc.pdb",title:"Single POPC",singleStructure:"Y"},path2:{link:"/lipids/pureLipids/200_POPC_initial.pdb",title:"200 POPC",singleStructure:"N"}},animations:{link:"/animations/POPC.pdb",title:"200 POPC"}}]},{name:"DPPC",chemName:"1,2-dipalmitoyl-sn-glycero-3-phosphocholine",description:"Click 'Explore' to view the membrane structure consisting of 200 DPPC molecules on both leaflets, and to watch the animation on MD simulation of the membrane.",image:"/lipids/pureLipids/single_DPPC_initial.pdb",singleStructure:"Y",files:[{displayName:"DPPC",description:"The structure displayed on the left represents a single POPC molecule, while the right side illustrates the animation of a molecular dynamics (MD) simulation involving a membrane composed of 200 DPPC molecules per leaflet, immersed in water and ions. The simulation was conducted over a duration of 200 ns. Water and ions are not shown due to clarity. Phosphorous atoms are shown as yellow sphere.",paths:{path1:{link:"/lipids/pureLipids/single_DPPC_initial.pdb",title:"Single DPPC",singleStructure:"Y"},path2:{link:"/lipids/pureLipids/200_DPPC_initial.pdb",title:"200 DPPC",singleStructure:"N"}},animations:{link:"/animations/DPPC.pdb",title:"200 DPPC"}}]},{name:"Mixtures of different type of lipids",description:"Click 'Explore' to view the membrane structure consisting of mixutres of different types of lipids molecules on both leaflets, and to wat
2ch the animation on MD simulation of the membrane.",image:"/lipids/pureLipids/asymm_membrane_npt_200.pdb",singleStructure:"Y",files:[{displayName:"Mixtures of different type of lipids",description:"The membrane is composed of six distinct lipid types: POPC, POPE, PSM, POPS, PIP2, and CHOL. The structure of each lipid is shown above. In the upper leaflet, the lipid composition is distributed in a ratio of 41:8:23:4:4:20, respectively, while in the lower leaflet, with a ratio of 11:37:5:16:10:21. The system is simulated in water and ion environment for 1.2 us.",paths:{path1:{link:"/lipids/pureLipids/POPC.pdb",title:"POPC",singleStructure:"Y"},path2:{link:"/lipids/pureLipids/pope.pdb",title:"POPE",singleStructure:"Y"},path3:{link:"/lipids/pureLipids/psm.pdb",title:"PSM",singleStructure:"Y"},path4:{link:"/lipids/pureLipids/pops.pdb",title:"POPS",singleStructure:"Y"},path5:{link:"/lipids/pureLipids/pip2.pdb",title:"PIP2",singleStructure:"Y"},path6:{link:"/lipids/pureLipids/chol.pdb",title:"CHOL",singleStructure:"Y"},path7:{link:"/lipids/pureLipids/asymm_membrane_npt_200.pdb",title:"Asymmetric Plasma Membrane",singleStructure:"N"}},animations:{link:"/animations/Asymmetric.pdb",title:"Asymmetric Plasma Membrane"}}]}]},xn=()=>(0,Ee.jsx)(_n,{pureLipidsData:wn}),Sn={title:"Polystyrene",content:"Explore the complex and fascinating world of cellular membranes.",molecules:[{name:"POPC with Polystyrene",chemName:"1-palmitoyl-2-oleoyl-sn-glycero-3-phosphocholine with polystyrene",description:"Click 'Explore' to view the membrane structure consisting of 200 POPC with Polystyrene molecules on both leaflets, and to wat
2ch the animation on MD simulation of the membrane.",image:"/lipids/mixtureLipids/popc_poly_nowat_ion.pdb",singleStructure:"N",files:[{displayName:"POPC with Polystyrene",description:"The structures of POPC, polystyrene and the system consisting of 200 POPC in each leaflet, PS, water, and ions are shown above. The system is simulated for 1.2 us. Water and ions are not shown due to clarity.",paths:{path1:{link:"/lipids/pureLipids/popc.pdb",title:"Single POPC",singleStructure:"Y"},path2:{link:"/lipids/mixtureLipids/polystyrene.pdb",title:"Polystyrene",singleStructure:"Y"},path3:{link:"/lipids/mixtureLipids/popc_poly_nowat_ion.pdb",title:"200 POPC with Polystyrene",singleStructure:"N"}},animations:{link:"/animations/popcwpoly.pdb",title:"200 POPC with Polystyrene"}}]},{name:"DPPC with Polystyrene",chemName:"1,2-dipalmitoyl-sn-glycero-3-phosphocholine with polystyrene",description:"Click 'Explore' to view the membrane structure consisting of 200 DPPC with Polystyrene molecules on both leaflets, and to watch the animation on MD simulation of the membrane.",image:"/lipids/mixtureLipids/dppc_poly_nowat_ion.pdb",singleStructure:"N",files:[{displayName:"DPPC with Polystyrene",description:"The structures of DPPC, polystyrene and the system consisting of 200 DPPC in each leaflet, PS, water, and ions are shown above. The system is simulated for 1.2 us. Water and ions are not shown due to clarity.",paths:{path1:{link:"/lipids/pureLipids/single_DPPC_initial.pdb",title:"Single DPPC",singleStructure:"Y"},path2:{link:"/lipids/mixtureLipids/polystyrene.pdb",title:"Polystyrene",singleStructure:"Y"},path3:{link:"/lipids/mixtureLipids/dppc_poly_nowat_ion.pdb",title:"200 DPPC with Polystyrene",singleStructure:"N"}},animations:{link:"/animations/ddpcwpoly.pdb",title:"200 DPPC with Polystyrene"}}]},{name:"Asymmetric Plasma Membrane with Polystyrene",description:"Click 'Explore' to view the membrane structure consisting of Asymmetric Plasma Membrane with Polystyrene, and to watch the animation on MD simulation of the membrane.",image:"/lipids/mixtureLipids/asymm_poly_nowat_ion.pdb",singleStructure:"N",files:[{displayName:"Asymmetric Plasma Membrane with Polystyrene",description:"The structures of Asymmetric Plasma Membrane, polystyrene and the system consisting of 6 different types of lipids, PS, water, and ions are shown above. The system is simulated for 1.2 us. Water and ions are not shown due to clarity.",paths:{path1:{link:"/lipids/pureLipids/asymm_membrane_npt_200.pdb",title:"Asymmetric Plasma Membrane",singleStructure:"N"},path2:{link:"/lipids/mixtureLipids/polystyrene.pdb",title:"Polystyrene",singleStructure:"Y"},path3:{link:"/lipids/mixtureLipids/asymm_poly_nowat_ion.pdb",title:"Asymmetric Plasma Membrane with Polystyrene",singleStructure:"N"}},animations:{link:"/animations/Asymmetricwpoly.pdb",title:"Asymmetric Plasma Membrane with Polystyrene"}}]}]},Cn=()=>(0,Ee.jsx)(_n,{pureLipidsData:Sn}),kn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!=e?String(e):t||null},En=t.createContext(null);function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},An.apply(null,arguments)}__webpack_require__(992);function Ln(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function Mn(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}function zn(e,r){return Object.keys(r).reduce((function(n,i){var s,a=n,o=a[Ln(i)],l=a[i],c=Ar(a,[Ln(i),i].map(Mn)),u=r[i],h=function(e,r,n){var i=(0,t.useRef)(void 0!==e),s=(0,t.useState)(r),a=s[0],o=s[1],l=void 0!==e,c=i.current;return i.current=l,!l&&c&&a!==r&&o(r),[l?e:a,(0,t.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];n&&n.apply(void 0,[e].concat(r)),o(e)}),[n])]}(l,o,e[u]),d=h[0],f=h[1];return An({},c,((s={})[i]=d,s[u]=f,s))}),e)}function Tn(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function On(e){this.setState(function(t){var r=this.constructor.getDerivedStateFromProps(e,t);return null!==r&&void 0!==r?r:null}.bind(this))}function Pn(e,t){try{var r=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}Tn.__suppressDeprecationWarning=!0,On.__suppressDeprecationWarning=!0,Pn.__suppressDeprecationWarning=!0;const Dn=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,as:i,...s}=e;r=Ne(r,"navbar-brand");const a=i||(s.href?"a":"span");return(0,Ee.jsx)(a,{...s,ref:t,className:Me()(n,r)})}));Dn.displayName="NavbarBrand";const Nn=Dn;const Fn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!==typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n),t.apply(this,n)}}),null)},Rn={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function In(e,t){const r=t["offset".concat(e[0].toUpperCase()).concat(e.slice(1))],n=Rn[e];
2return r+parseInt(Vt(t,n[0]),10)+parseInt(Vt(t,n[1]),10)}const jn={[Or]:"collapse",[Nr]:"collapsing",[Pr]:"collapsing",[Dr]:"collapse show"},Gn=t.forwardRef(((e,r)=>{let{onEnter:n,onEntering:i,onEntered:s,onExit:a,onExiting:o,className:l,children:c,dimension:u="height",in:h=!1,timeout:d=300,mountOnEnter:f=!1,unmountOnExit:p=!1,appear:m=!1,getDimensionValue:g=In,...v}=e;const b="function"===typeof u?u():u,y=(0,t.useMemo)((()=>Fn((e=>{e.style[b]="0"}),n)),[b,n]),_=(0,t.useMemo)((()=>Fn((e=>{const t="scroll".concat(b[0].toUpperCase()).concat(b.slice(1));e.style[b]="".concat(e[t],"px")}),i)),[b,i]),w=(0,t.useMemo)((()=>Fn((e=>{e.style[b]=null}),s)),[b,s]),x=(0,t.useMemo)((()=>Fn((e=>{e.style[b]="".concat(g(b,e),"px"),Br(e)}),a)),[a,g,b]),S=(0,t.useMemo)((()=>Fn((e=>{e.style[b]=null}),o)),[b,o]);return(0,Ee.jsx)(Ur,{ref:r,addEndListener:Gr,...v,"aria-expanded":v.role?h:null,onEnter:y,onEntering:_,onEntered:w,onExit:x,onExiting:S,childRef:c.ref,in:h,timeout:d,mountOnEnter:f,unmountOnExit:p,appear:m,children:(e,r)=>t.cloneElement(c,{...r,className:Me()(l,c.props.className,jn[e],"width"===b&&"collapse-horizontal")})})})),Bn=t.createContext(null);Bn.displayName="NavbarContext";const Un=Bn,Wn=t.forwardRef(((e,r)=>{let{children:n,bsPrefix:i,...s}=e;i=Ne(i,"navbar-collapse");const a=(0,t.useContext)(Un);return(0,Ee.jsx)(Gn,{in:!(!a||!a.expanded),...s,children:(0,Ee.jsx)("div",{ref:r,className:i,children:n})})}));Wn.displayName="NavbarCollapse";const Vn=Wn,Hn=t.forwardRef(((e,r)=>{let{bsPrefix:n,className:i,children:s,label:a="Toggle navigation",as:o="button",onClick:l,...c}=e;n=Ne(n,"navbar-toggler");const{onToggle:u,expanded:h}=(0,t.useContext)(Un)||{},d=Nt((e=>{l&&l(e),u&&u()}));return"button"===o&&(c.type="button"),(0,Ee.jsx)(o,{...c,ref:r,onClick:d,"aria-label":a,className:Me()(i,n,!h&&"collapsed"),children:s||(0,Ee.jsx)("span",{className:"".concat(n,"-icon")})})}));Hn.displayName="NavbarToggle";const qn=Hn,Yn=new WeakMap,Zn=(e,t)=>{if(!e||!t)return;const r=Yn.get(t)||new Map;Yn.set(t,r);let n=r.get(e);return n||(n=t.matchMedia(e),n.refCount=0,r.set(n.media,n)),n};function Xn(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"undefined"===typeof window?void 0:window;const n=Zn(e,r),[i,s]=(0,t.useState)((()=>!!n&&n.matches));return ir((()=>{let t=Zn(e,r);if(!t)return s(!1);let n=Yn.get(r);const i=()=>{s(t.matches)};return t.refCount++,t.addListener(i),i(),()=>{t.removeListener(i),t.refCount--,t.refCount<=0&&(null==n||n.delete(t.media)),t=void 0}}),[e]),i}const Kn=function(e){const r=Object.keys(e);function n(e,t){return e===t?t:e?"".concat(e," and ").concat(t):t}function i(t){const n=function(e){return r[Math.min(r.indexOf(e)+1,r.length-1)]}(t);let i=e[n];return i="number"===typeof i?"".concat(i-.2,"px"):"calc(".concat(i," - 0.2px)"),"(max-width: ".concat(i,")")}return function(r,s,a){let o;return"object"===typeof r?(o=r,a=s,s=!0):o={[r]:s=s||!0},Xn((0,t.useMemo)((()=>Object.entries(o).reduce(((t,r)=>{let[s,a]=r;return"up"!==a&&!0!==a||(t=n(t,function(t){let r=e[t];return"number"===typeof r&&(r="".concat(r,"px")),"(min-width: ".concat(r,")")}(s))),"down"!==a&&!0!==a||(t=n(t,i(s))),t}),"")),[JSON.stringify(o)]),a)}}({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),$n=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"offcanvas-body"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));$n.displayName="OffcanvasBody";const Qn=$n,Jn={[Pr]:"show",[Dr]:"show"},ei=t.forwardRef(((e,r)=>{let{bsPrefix:n,className:i,children:s,in:a=!1,mountOnEnter:o=!1,unmountOnExit:l=!1,appear:c=!1,...u}=e;return n=Ne(n,"offcanvas"),(0,Ee.jsx)(Ur,{ref:r,addEndListener:Gr,in:a,mountOnEnter:o,unmountOnExit:l,appear:c,...u,childRef:s.ref,children:(e,r)=>t.cloneElement(s,{...r,className:Me()(i,s.props.className,(e===Pr||e===Nr)&&"".concat(n,"-toggling"),Jn[e])})})}));ei.displayName="OffcanvasToggling";const ti=ei,ri=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,closeLabel:i="Close",closeButton:s=!1,...a}=e;return r=Ne(r,"offcanvas-header"),(0,Ee.jsx)(an,{ref:t,...a,className:Me()(n,r),closeLabel:i,closeButton:s})}));ri.displayName="OffcanvasHeader";const ni=ri,ii=it("h5"),si=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i=ii,...s}=e;return n=Ne(n,"offcanvas-title"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));si.displayName="OffcanvasTitle";const ai=si;function oi(e){return(0,Ee.jsx)(ti,{...e})}function li(e){return(0,Ee.jsx)(Hr,{...e})}const ci=t.forwardRef(((e,r)=>{let{bsPrefix:n,className:i,children:s,"aria-labelledby":a,placement:o="start",responsive:l,show:c=!1,backdrop:u=!0,keyboard:h=!0,scroll:d=!1,onEscapeKeyDown:f,onShow:p,onHide:m,container:g,autoF
2ocus:v=!0,enforceFocus:b=!0,restoreFocus:y=!0,restoreFocusOptions:_,onEntered:w,onExit:x,onExiting:S,onEnter:C,onEntering:k,onExited:E,backdropClassName:A,manager:L,renderStaticNode:M=!1,...z}=e;const T=(0,t.useRef)();n=Ne(n,"offcanvas");const{onToggle:O}=(0,t.useContext)(Un)||{},[P,D]=(0,t.useState)(!1),N=Kn(l||"xs","up");(0,t.useEffect)((()=>{D(l?c&&!N:c)}),[c,l,N]);const F=Nt((()=>{null==O||O(),null==m||m()})),R=(0,t.useMemo)((()=>({onHide:F})),[F]);const I=(0,t.useCallback)((e=>(0,Ee.jsx)("div",{...e,className:Me()("".concat(n,"-backdrop"),A)})),[A,n]),j=e=>(0,Ee.jsx)("div",{...e,...z,className:Me()(i,l?"".concat(n,"-").concat(l):n,"".concat(n,"-").concat(o)),"aria-labelledby":a,children:s});return(0,Ee.jsxs)(Ee.Fragment,{children:[!P&&(l||M)&&j({}),(0,Ee.jsx)(Zr.Provider,{value:R,children:(0,Ee.jsx)(gr,{show:P,ref:r,backdrop:u,container:g,keyboard:h,autoFocus:v,enforceFocus:b&&!d,restoreFocus:y,restoreFocusOptions:_,onEscapeKeyDown:f,onShow:p,onHide:F,onEnter:function(e){e&&(e.style.visibility="visible");for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];null==C||C(e,...r)},onEntering:k,onEntered:w,onExit:x,onExiting:S,onExited:function(e){e&&(e.style.visibility="");for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];null==E||E(...r)},manager:L||(d?(T.current||(T.current=new Er({handleContainerOverflow:!1})),T.current):kr()),transition:oi,backdropTransition:li,renderBackdrop:I,renderDialog:j})})]})}));ci.displayName="Offcanvas";const ui=Object.assign(ci,{Body:Qn,Header:ni,Title:ai}),hi=t.forwardRef(((e,r)=>{const n=(0,t.useContext)(Un);return(0,Ee.jsx)(ui,{ref:r,show:!(null==n||!n.expanded),...e,render
vendor: 5,781 bytes, line 2
2StaticNode:!0})}));hi.displayName="NavbarOffcanvas";const di=hi,fi=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="span",...s}=e;return n=Ne(n,"navbar-text"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));fi.displayName="NavbarText";const pi=fi,mi=t.forwardRef(((e,r)=>{const{bsPrefix:n,expand:i=!0,variant:s="light",bg:a,fixed:o,sticky:l,className:c,as:u="nav",expanded:h,onToggle:d,onSelect:f,collapseOnSelect:p=!1,...m}=zn(e,{expanded:"onToggle"}),g=Ne(n,"navbar"),v=(0,t.useCallback)((function(){null==f||f(...arguments),p&&h&&(null==d||d(!1))}),[f,p,h,d]);void 0===m.role&&"nav"!==u&&(m.role="navigation");let b="".concat(g,"-expand");"string"===typeof i&&(b="".concat(b,"-").concat(i));const y=(0,t.useMemo)((()=>({onToggle:()=>null==d?void 0:d(!h),bsPrefix:g,expanded:!!h,expand:i})),[g,h,i,d]);return(0,Ee.jsx)(Un.Provider,{value:y,children:(0,Ee.jsx)(En.Provider,{value:v,children:(0,Ee.jsx)(u,{ref:r,...m,className:Me()(c,g,i&&b,s&&"".concat(g,"-").concat(s),a&&"bg-".concat(a),l&&"sticky-".concat(l),o&&"fixed-".concat(o))})})})}));mi.displayName="Navbar";const gi=Object.assign(mi,{Brand:Nn,Collapse:Vn,Offcanvas:di,Text:pi,Toggle:qn});__webpack_require__(304);const vi=t.createContext(null);vi.displayName="NavContext";const bi=vi,yi=t.createContext(null),_i=["as","active","eventKey"];function wi(e){let{key:r,onClick:n,active:i,id:s,role:a,disabled:o}=e;const l=(0,t.useContext)(En),c=(0,t.useContext)(bi),u=(0,t.useContext)(yi);let h=i;const d={role:a};if(c){a||"tablist"!==c.role||(d.role="tab");const e=c.getControllerId(null!=r?r:null),t=c.getControlledId(null!=r?r:null);d[$t("event-key")]=r,d.id=e||s,h=null==i&&null!=r?c.activeKey===r:i,!h&&(null!=u&&u.unmountOnExit||null!=u&&u.mountOnEnter)||(d["aria-controls"]=t)}return"tab"===d.role&&(d["aria-selected"]=h,h||(d.tabIndex=-1),o&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=Nt((e=>{o||(null==n||n(e),null!=r&&l&&!e.isPropagationStopped()&&l(r,e))})),[d,{isActive:h}]}const xi=t.forwardRef(((e,t)=>{let{as:r=xt,active:n,eventKey:i}=e,s=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,_i);const[a,o]=wi(Object.assign({key:kn(i,s.href),active:n},s));return a[$t("active")]=o.isActive,(0,Ee.jsx)(r,Object.assign({},s,a,{ref:t}))}));xi.displayName="NavItem";const Si=xi,Ci=["as","onSelect","activeKey","role","onKeyDown"];const ki=()=>{},Ei=$t("event-key"),Ai=t.forwardRef(((e,r)=>{let{as:n="div",onSelect:i,activeKey:s,role:a,onKeyDown:o}=e,l=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,Ci);const c=function(){const[,e]=(0,t.useReducer)((e=>!e),!1);return e}(),u=(0,t.useRef)(!1),h=(0,t.useContext)(En),d=(0,t.useContext)(yi);let f,p;d&&(a=a||"tablist",s=d.activeKey,f=d.getControlledId,p=d.getControllerId);const m=(0,t.useRef)(null),g=e=>{const t=m.current;if(!t)return null;const r=br(t,"[".concat(Ei,"]:not([aria-disabled=true])")),n=t.querySelector("[aria-selected=true]");if(!n||n!==document.activeElement)return null;const i=r.indexOf(n);if(-1===i)return null;let s=i+e;return s>=r.length&&(s=0),s<0&&(s=r.length-1),r[s]},v=(e,t)=>{null!=e&&(null==i||i(e,t),null==h||h(e,t))};(0,t.useEffect)((()=>{if(m.current&&u.current){const e=m.current.querySelector("[".concat(Ei,"][aria-selected=true]"));null==e||e.focus()}u.current=!1}));const b=Rt(r,m);return(0,Ee.jsx)(En.Provider,{value:v,children:(0,Ee.jsx)(bi.Provider,{value:{role:a,activeKey:kn(s),getControlledId:f||ki,getControllerId:p||ki},children:(0,Ee.jsx)(n,Object.assign({},l,{onKeyDown:e=>{if(null==o||o(e),!d)return;let t;switch(e.key){case"ArrowLeft":case"ArrowUp":t=g(-1);break;case"ArrowRight":case"ArrowDown":t=g(1);break;default:return}var r;t&&(e.preventDefault(),v(t.dataset[(r="EventKey","".concat("rrUi").concat(r))]||null,e),u.current=!0,c())},ref:b,role:a}))})})}));Ai.displayName="Nav";const Li=Object.assign(Ai,{Item:Si}),Mi=t.forwardRef(((e,t)=>{let{className:r,bsPrefix:n,as:i="div",...s}=e;return n=Ne(n,"nav-item"),(0,Ee.jsx)(i,{ref:t,className:Me()(r,n),...s})}));Mi.displayName="NavItem";const zi=Mi;new WeakMap;const Ti=["onKeyDown"];const Oi=t.forwardRef(((e,t)=>{let{onKeyDown:r}=e,n=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,Ti);const[i]=_t(Object.assign({tagName:"a"},n)),s=Nt((e=>{i.onKeyDown(e),null==r||r(e)}));return(a=n.href)&&"#"!==a.trim()&&"button"!==n.role?(0,Ee.jsx)("a",Object.assign({ref:t},n,{onKeyDown:r})):(0,Ee.jsx)("a",Object.assign({ref:t},n,i,{onKeyDown:s}));var a}));Oi.displayName="Anchor";const Pi=Oi,Di=t.forwardRef(((e,t)=>{let{bsPrefix:r,className:n,as:i=Pi,active:s,eventKey:a,disabled:o=!1,...l}=e;r=Ne(r,"nav-link");const[c,u]=wi({key:kn(a,l.href),active:s,disabled:o,...l});return(0,Ee.jsx)(i,{...l,...c,ref:t,disabled:o,className:Me()(n,r,o&&"disabled",u.isActive&&"active")})}));Di.displayName="NavLink";const Ni=Di,Fi=t.forwardRef(((e,r)=>{const{as:n="div",bsPrefix:i,variant:s,fill:a=!1,justify:o=!1,navbar:l,navbarScroll:c,className:u,activeKey:h,...d}=zn(e,{activeKey:"onSelect"}),f=Ne(i,"nav");let p,m,g=!1;const v=(0,t.useContext)(Un),b=(0,t.useContext)(Xe);return v?(p=v.bsPrefix,g=null==l||l):b&&({cardHeaderBsPrefix:m}=b),(0,Ee.jsx)(Li,{as:n,ref:r,activeKey:h,className:Me()(u,{[f]:!g,["".concat(p,"-nav")]:g,["".concat(p,"-nav-scroll")]:g&&c,["".concat(m,"-").concat(s)]:!!m,["".concat(f,"-").concat(s)]:!!s,["".concat(f,"-fill")]:a,["".concat(f,"-justified")]:o}),...d})}));Fi.displayName="Nav";const Ri=Object.assign(Fi,{Item:zi,Link:Ni});__webpack_require__.p;__webpack_require__.p;const Ii=()=>((0,t.useEffect)((()=>{document.querySelectorAll(".chemistry-icon").forEach((e=>
2{const t=100*Math.random(),r=100*Math.random();e.style.top="".concat(t,"vh"),e.style.left="".concat(r,"vw")}))}),[]),(0,Ee.jsxs)(_e,{children:[(0,Ee.jsx)(gi,{bg:"dark",variant:"dark",expand:"lg",children:(0,Ee.jsxs)(je,{children:[(0,Ee.jsx)(gi.Brand,{as:Se,to:"/",children:"ACompChemLab"}),(0,Ee.jsx)(gi.Toggle,{"aria-controls":"basic-navbar-nav"}),(0,Ee.jsx)(gi.Collapse,{id:"basic-navbar-nav",children:(0,Ee.jsxs)(Ri,{className:"me-auto",children:[(0,Ee.jsx)(Ri.Link,{as:Se,to:"/Membrane-Nanoplastic-Interactions",children:"Membrane Nanoplastic Interactions"}),(0,Ee.jsx)(Ri.Link,{as:Se,to:"/Membrane",children:"Membrane"}),(0,Ee.jsx)(Ri.Link,{as:Se,to:"/Membrane-with-Polystyrene",children:"Membrane with Polystyrene"})]})})]})}),(0,Ee.jsxs)(pe,{children:[(0,Ee.jsx)(de,{path:"/",element:(0,Ee.jsx)(Ae,{})}),(0,Ee.jsx)(de,{path:"/Membrane-Nanoplastic-Interactions",element:(0,Ee.jsx)(bt,{})}),(0,Ee.jsx)(de,{path:"/Membrane",element:(0,Ee.jsx)(xn,{})}),(0,Ee.jsx)(de,{path:"/Membrane-with-Polystyrene",element:(0,Ee.jsx)(Cn,{})})]})]})),ji=e=>{e&&e instanceof Function&&__webpack_require__.e(592).then(__webpack_require__.bind(__webpack_require__,592)).then((t=>{let{getCLS:r,getFID:n,getFCP:i,getLCP:s,getTTFB:a}=t;r(e),n(e),i(e),s(e),a(e)}))};n.createRoot(document.getElementById("root")).render((0,Ee.jsx)(t.StrictMode,{children:(0,Ee.jsx)(Ii,{})})),ji()})()})();
3//# sourceMappingURL=main.d7b2e370.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.