-
Notifications
You must be signed in to change notification settings - Fork 7
/
bundle.js
15 lines (15 loc) · 257 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=57)}([function(e,t,r){"use strict";var n=r(3),i=r(35),o=r(17),a=r(77),s=r(11);function u(e){return e}function l(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}t.newBlob=function(e,r){t.checkSupport("blob");try{return new Blob([e],{type:r})}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function c(e){var r=65536,n=t.getTypeOf(e),i=!0;if("uint8array"===n?i=f.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=f.applyCanBeUsed.nodebuffer),i)for(;r>1;)try{return f.stringifyByChunk(e,n,r)}catch(e){r=Math.floor(r/2)}return f.stringifyByChar(e)}function h(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}t.applyFromCharCode=c;var d={};d.string={string:u,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,o.allocBuffer(e.length))}},d.array={string:c,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},d.arraybuffer={string:function(e){return c(new Uint8Array(e))},array:function(e){return h(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:c,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return o.newBufferFrom(e)}},d.nodebuffer={string:c,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return h(e,new Uint8Array(e.length))},nodebuffer:u},t.transformTo=function(e,r){if(r||(r=""),!e)return r;t.checkSupport(e);var n=t.getTypeOf(r);return d[n][e](r)},t.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&o.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},t.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},t.delay=function(e,t,r){a(function(){e.apply(r||null,t||[])})},t.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r},t.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},t.prepareContent=function(e,r,o,a,u){return s.Promise.resolve(r).then(function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise(function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)}):e}).then(function(r){var f=t.getTypeOf(r);return f?("arraybuffer"===f?r=t.transformTo("uint8array",r):"string"===f&&(u?r=i.decode(r):o&&!0!==a&&(r=function(e){return l(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(r))),r):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},e.exports=n},function(e,t,r){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(59),i=r(60),o=r(30);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}return l(this,e,t,r)}function l(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|d(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function c(e,t){if(f(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(n)return z(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;h<u;h++)if(l(e,o+h)!==l(t,h)){c=!1;break}if(c)return o}return-1}function _(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function y(e,t,r,n){return Y(z(t,e.length-r),e,r,n)}function b(e,t,r,n){return Y(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return b(e,t,r,n)}function E(e,t,r,n){return Y(j(t),e,r,n)}function x(e,t,r,n){return Y(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,l=e[i],f=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return l(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return c(null,e)},u.allocUnsafeSlow=function(e){return c(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):function(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,s=Math.min(o,a),l=this.slice(n,i),f=e.slice(t,r),c=0;c<s;++c)if(l[c]!==f[c]){o=l[c],a=f[c];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function P(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=L(e[o]);return i}function B(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||M(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,o){return o||M(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=u.isBuffer(e)?e:z(new u(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(9))},function(e,t,r){"use strict";(function(e){if(t.base64=!0,t.array=!0,t.string=!0,t.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,t.nodebuffer=void 0!==e,t.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)t.blob=!1;else{var n=new ArrayBuffer(0);try{t.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),t.blob=0===i.getBlob("application/zip").size}catch(e){t.blob=!1}}}try{t.nodestream=!!r(31).Readable}catch(e){t.nodestream=!1}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(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 n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,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++)o=e[t],a.set(o,i),i+=o.length;return a}},a={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(n)},function(e,t,r){
/*!
* @license twgl.js 4.4.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* Available via the MIT license.
* see: http://github.com/greggman/twgl.js for details
*/
!function(t,r){e.exports=r()}("undefined"!=typeof self&&self,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=9)}([function(e,t,r){"use strict";t.__esModule=!0,t.copyExistingProperties=function(e,t){Object.keys(t).forEach(function(r){t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&(t[r]=e[r])})},t.copyNamedProperties=function(e,t,r){e.forEach(function(e){var n=t[e];void 0!==n&&(r[e]=n)})},t.isBuffer=function(e,t){o||(o=e.createBuffer());return t instanceof o.constructor},t.isRenderbuffer=function(e,t){a||(a=e.createRenderbuffer());return t instanceof a.constructor},t.isShader=function(e,t){s||(s=e.createShader(e.VERTEX_SHADER));return t instanceof s.constructor},t.isTexture=function(e,t){u||(u=e.createTexture());return t instanceof u.constructor},t.isSampler=function(e,t){if(!l){if(!e.createSampler)return!1;l=e.createSampler()}return t instanceof l.constructor},t.warn=t.error=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2));var i=n.default.console&&n.default.console.error&&"function"==typeof n.default.console.error?n.default.console.error.bind(n.default.console):function(){};t.error=i;var o,a,s,u,l,f=n.default.console&&n.default.console.warn&&"function"==typeof n.default.console.warn?n.default.console.warn.bind(n.default.console):function(){};t.warn=f},function(e,t,r){"use strict";t.__esModule=!0,t.getGLTypeForTypedArray=function(e){if(e instanceof Int8Array)return i;if(e instanceof Uint8Array)return o;if(e instanceof Uint8ClampedArray)return o;if(e instanceof Int16Array)return a;if(e instanceof Uint16Array)return s;if(e instanceof Int32Array)return u;if(e instanceof Uint32Array)return l;if(e instanceof Float32Array)return f;throw"unsupported typed array type"},t.getGLTypeForTypedArrayType=function(e){if(e===Int8Array)return i;if(e===Uint8Array)return o;if(e===Uint8ClampedArray)return o;if(e===Int16Array)return a;if(e===Uint16Array)return s;if(e===Int32Array)return u;if(e===Uint32Array)return l;if(e===Float32Array)return f;throw"unsupported typed array type"},t.getTypedArrayTypeForGLType=function(e){var t=c[e];if(!t)throw"unknown gl type";return t},t.isArrayBuffer=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2));var i=5120,o=5121,a=5122,s=5123,u=5124,l=5125,f=5126,c={},h=c;h[i]=Int8Array,h[o]=Uint8Array,h[a]=Int16Array,h[s]=Uint16Array,h[u]=Int32Array,h[l]=Uint32Array,h[f]=Float32Array,h[32819]=Uint16Array,h[32820]=Uint16Array,h[33635]=Uint16Array,h[5131]=Uint16Array,h[33640]=Uint32Array,h[35899]=Uint32Array,h[35902]=Uint32Array,h[36269]=Uint32Array,h[34042]=Uint32Array;var d=n.default.SharedArrayBuffer?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof n.default.SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};t.isArrayBuffer=d},function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};t.default=n},function(e,t,r){"use strict";t.__esModule=!0,t.add=function(e,t,r){return(r=r||new n(3))[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r},t.copy=function(e,t){return(t=t||new n(3))[0]=e[0],t[1]=e[1],t[2]=e[2],t},t.create=function(e,t,r){var i=new n(3);e&&(i[0]=e);t&&(i[1]=t);r&&(i[2]=r);return i},t.cross=function(e,t,r){r=r||new n(3);var i=e[2]*t[0]-e[0]*t[2],o=e[0]*t[1]-e[1]*t[0];return r[0]=e[1]*t[2]-e[2]*t[1],r[1]=i,r[2]=o,r},t.distance=function(e,t){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)},t.distanceSq=function(e,t){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i},t.divide=function(e,t,r){return(r=r||new n(3))[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r},t.divScalar=function(e,t,r){return(r=r||new n(3))[0]=e[0]/t,r[1]=e[1]/t,r[2]=e[2]/t,r},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},t.lerp=function(e,t,r,i){return(i=i||new n(3))[0]=(1-r)*e[0]+r*t[0],i[1]=(1-r)*e[1]+r*t[1],i[2]=(1-r)*e[2]+r*t[2],i},t.length=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])},t.lengthSq=function(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]},t.mulScalar=function(e,t,r){return(r=r||new n(3))[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r},t.multiply=function(e,t,r){return(r=r||new n(3))[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r},t.negate=function(e,t){return(t=t||new n(3))[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},t.normalize=function(e,t){t=t||new n(3);var r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=Math.sqrt(r);i>1e-5?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=0,t[1]=0,t[2]=0);return t},t.setDefaultType=function(e){var t=n;return n=e,t},t.subtract=function(e,t,r){return(r=r||new n(3))[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r};var n=Float32Array},function(e,t,r){"use strict";t.__esModule=!0,t.isWebGL1=function(e){return!e.texStorage2D},t.isWebGL2=function(e){return!!e.texStorage2D},t.glEnumToString=void 0;var n=function(){var e={},t={};return function(r,n){return function(r){var n=r.constructor.name;if(!e[n]){for(var i in r)if("number"==typeof r[i]){var o=t[r[i]];t[r[i]]=o?"".concat(o," | ").concat(i):i}e[n]=!0}}(r),t[n]||"0x"+n.toString(16)}}();t.glEnumToString=n},function(e,t,r){"use strict";t.__esModule=!0,t.createAttributeSetters=j,t.createProgram=B,t.createProgramFromScripts=function(e,t,r,n,i){for(var o=S(r,n,i),a=[],s=0;s<t.length;++s){var u=C(e,t[s],e[R[s]],o.errorCallback);if(!u)return null;a.push(u)}return B(e,a,o)},t.createProgramFromSources=I,t.createProgramInfo=function(e,t,r,n,i){var o=S(r,n,i),a=!0;if(t=t.map(function(e){if(e.indexOf("\n")<0){var t=l(e);t?e=t.text:(o.errorCallback("no element with id: "+e),a=!1)}return e}),!a)return null;var s=I(e,t,o);if(!s)return null;return X(e,s)},t.createProgramInfoFromProgram=X,t.createUniformSetters=O,t.createUniformBlockSpecFromProgram=D,t.createUniformBlockInfoFromProgram=L,t.createUniformBlockInfo=function(e,t,r){return L(e,t.program,t.uniformBlockSpec,r)},t.createTransformFeedback=function(e,t,r){var n=e.createTransformFeedback();return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,n),e.useProgram(t.program),U(e,t,r),e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),function(e,t,r){for(var n in t.transformFeedbackInfo&&(t=t.transformFeedbackInfo),r.attribs&&(r=r.attribs),r){var i=t[n];i&&e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,i.index,null)}}(e,t,r),n},t.createTransformFeedbackInfo=M,t.bindTransformFeedbackInfo=U,t.setAttributes=Y,t.setBuffersAndAttributes=function(e,t,r){r.vertexArrayObject?e.bindVertexArray(r.vertexArrayObject):(Y(t.attribSetters||t,r.attribs),r.indices&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.indices))},t.setUniforms=function e(t,r){var n=t.uniformSetters||t;var i=arguments.length;for(var o=1;o<i;++o){var a=arguments[o];if(Array.isArray(a))for(var s=a.length,u=0;u<s;++u)e(n,a[u]);else for(var l in a){var f=n[l];f&&f(a[l])}}},t.setUniformBlock=function(e,t,r){z(e,t,r)&&e.bufferData(e.UNIFORM_BUFFER,r.array,e.DYNAMIC_DRAW)},t.setBlockUniforms=function(e,t){var r=e.uniforms;for(var n in t){var i=r[n];if(i){var o=t[n];o.length?i.set(o):i[0]=o}}},t.bindUniformBlock=z;var n=a(r(4)),i=a(r(0)),o=function(e){return e&&e.__esModule?e:{default:e}}(r(2));function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}var s=i.error,u=i.warn,l=o.default&&o.default.document&&o.default.document.getElementById?o.default.document.getElementById.bind(o.default.document):function(){return null},f={};function c(e,t){return f[t].bindPoint}function h(e,t){return function(r){e.uniform1i(t,r)}}function d(e,t){return function(r){e.uniform1iv(t,r)}}function p(e,t){return function(r){e.uniform2iv(t,r)}}function m(e,t){return function(r){e.uniform3iv(t,r)}}function g(e,t){return function(r){e.uniform4iv(t,r)}}function v(e,t,r,o){var a=c(0,t);return n.isWebGL2(e)?function(t){var n,s;i.isTexture(e,t)?(n=t,s=null):(n=t.texture,s=t.sampler),e.uniform1i(o,r),e.activeTexture(e.TEXTURE0+r),e.bindTexture(a,n),e.bindSampler(r,s)}:function(t){e.uniform1i(o,r),e.activeTexture(e.TEXTURE0+r),e.bindTexture(a,t)}}function _(e,t,r,o,a){for(var s=c(0,t),u=new Int32Array(a),l=0;l<a;++l)u[l]=r+l;return n.isWebGL2(e)?function(t){e.uniform1iv(o,u),t.forEach(function(t,n){var o,a;e.activeTexture(e.TEXTURE0+u[n]),i.isTexture(e,t)?(o=t,a=null):(o=t.texture,a=t.sampler),e.bindSampler(r,a),e.bindTexture(s,o)})}:function(t){e.uniform1iv(o,u),t.forEach(function(t,r){e.activeTexture(e.TEXTURE0+u[r]),e.bindTexture(s,t)})}}function y(e,t){return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,r.numComponents||r.size,r.type||e.FLOAT,r.normalize||!1,r.stride||0,r.offset||0),void 0!==r.divisor&&e.vertexAttribDivisor(t,r.divisor)}}function b(e,t){return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,r.numComponents||r.size,r.type||e.INT,r.stride||0,r.offset||0),void 0!==r.divisor&&e.vertexAttribDivisor(t,r.divisor)}}function w(e,t,r){var n=r.size,i=r.count;return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer);for(var o=r.size||r.numComponents||n,a=o/i,s=r.type||e.FLOAT,u=f[s].size*o,l=r.normalize||!1,c=r.offset||0,h=u/i,d=0;d<i;++d)e.enableVertexAttribArray(t+d),e.vertexAttribPointer(t+d,a,s,l,u,c+h*d),void 0!==r.divisor&&e.vertexAttribDivisor(t+d,r.divisor)}}f[5126]={Type:Float32Array,size:4,setter:function(e,t){return function(r){e.uniform1f(t,r)}},arraySetter:function(e,t){return function(r){e.uniform1fv(t,r)}}},f[35664]={Type:Float32Array,size:8,setter:function(e,t){return function(r){e.uniform2fv(t,r)}}},f[35665]={Type:Float32Array,size:12,setter:function(e,t){return function(r){e.uniform3fv(t,r)}}},f[35666]={Type:Float32Array,size:16,setter:function(e,t){return function(r){e.uniform4fv(t,r)}}},f[5124]={Type:Int32Array,size:4,setter:h,arraySetter:d},f[35667]={Type:Int32Array,size:8,setter:p},f[35668]={Type:Int32Array,size:12,setter:m},f[35669]={Type:Int32Array,size:16,setter:g},f[5125]={Type:Uint32Array,size:4,setter:function(e,t){return function(r){e.uniform1ui(t,r)}},arraySetter:function(e,t){return function(r){e.uniform1uiv(t,r)}}},f[36294]={Type:Uint32Array,size:8,setter:function(e,t){return function(r){e.uniform2uiv(t,r)}}},f[36295]={Type:Uint32Array,size:12,setter:function(e,t){return function(r){e.uniform3uiv(t,r)}}},f[36296]={Type:Uint32Array,size:16,setter:function(e,t){return function(r){e.uniform4uiv(t,r)}}},f[35670]={Type:Uint32Array,size:4,setter:h,arraySetter:d},f[35671]={Type:Uint32Array,size:8,setter:p},f[35672]={Type:Uint32Array,size:12,setter:m},f[35673]={Type:Uint32Array,size:16,setter:g},f[35674]={Type:Float32Array,size:16,setter:function(e,t){return function(r){e.uniformMatrix2fv(t,!1,r)}}},f[35675]={Type:Float32Array,size:36,setter:function(e,t){return function(r){e.uniformMatrix3fv(t,!1,r)}}},f[35676]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4fv(t,!1,r)}}},f[35685]={Type:Float32Array,size:24,setter:function(e,t){return function(r){e.uniformMatrix2x3fv(t,!1,r)}}},f[35686]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2x4fv(t,!1,r)}}},f[35687]={Type:Float32Array,size:24,setter:function(e,t){return function(r){e.uniformMatrix3x2fv(t,!1,r)}}},f[35688]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3x4fv(t,!1,r)}}},f[35689]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix4x2fv(t,!1,r)}}},f[35690]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix4x3fv(t,!1,r)}}},f[35678]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:3553},f[35680]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:34067},f[35679]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:32879},f[35682]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:3553},f[36289]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:35866},f[36292]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:35866},f[36293]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:34067},f[36298]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:3553},f[36299]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:32879},f[36300]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:34067},f[36303]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:35866},f[36306]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:3553},f[36307]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:32879},f[36308]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:34067},f[36311]={Type:null,size:0,setter:v,arraySetter:_,bindPoint:35866};var E={};E[5126]={size:4,setter:y},E[35664]={size:8,setter:y},E[35665]={size:12,setter:y},E[35666]={size:16,setter:y},E[5124]={size:4,setter:b},E[35667]={size:8,setter:b},E[35668]={size:12,setter:b},E[35669]={size:16,setter:b},E[5125]={size:4,setter:b},E[36294]={size:8,setter:b},E[36295]={size:12,setter:b},E[36296]={size:16,setter:b},E[35670]={size:4,setter:b},E[35671]={size:8,setter:b},E[35672]={size:12,setter:b},E[35673]={size:16,setter:b},E[35674]={size:4,setter:w,count:2},E[35675]={size:9,setter:w,count:3},E[35676]={size:16,setter:w,count:4};var x=void 0;var A=/^[ \t]*\n/;function T(e,t,r,n){var i=n||s,o=e.createShader(r),a=0;if(A.test(t)&&(a=1,t=t.replace(A,"")),e.shaderSource(o,t),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS)){var u=e.getShaderInfoLog(o);return i(function(e,t){return t=t||0,++t,e.split("\n").map(function(e,r){return r+t+": "+e}).join("\n")}(t,a)+"\n*** Error compiling shader: "+u),e.deleteShader(o),null}return o}function S(e,t,r){var n;if("function"==typeof t&&(r=t,t=void 0),"function"==typeof e)r=e,e=void 0;else if(e&&!Array.isArray(e)){if(e.errorCallback)return e;var i=e;r=i.errorCallback,e=i.attribLocations,n=i.transformFeedbackVaryings}var o={errorCallback:r||s,transformFeedbackVaryings:n};if(e){var a={};Array.isArray(e)?e.forEach(function(e,r){a[e]=t?t[r]:r}):a=e,o.attribLocations=a}return o}var R=["VERTEX_SHADER","FRAGMENT_SHADER"];function k(e){return e.indexOf("frag")>=0?x.FRAGMENT_SHADER:e.indexOf("vert")>=0?x.VERTEX_SHADER:void 0}function P(e,t){t.forEach(function(t){e.deleteShader(t)})}function B(e,t,r,n,o){for(var a=S(r,n,o),s=[],u=[],f=0;f<t.length;++f){var c=t[f];if("string"==typeof c){var h=l(c),d=h?h.text:c,p=e[R[f]];h&&h.type&&(p=k(h.type)||p),c=T(e,d,p,a.errorCallback),u.push(c)}i.isShader(e,c)&&s.push(c)}if(s.length!==t.length)return a.errorCallback("not enough shaders for program"),P(e,u),null;var m=e.createProgram();s.forEach(function(t){e.attachShader(m,t)}),a.attribLocations&&Object.keys(a.attribLocations).forEach(function(t){e.bindAttribLocation(m,a.attribLocations[t],t)});var g=a.transformFeedbackVaryings;if(g&&(g.attribs&&(g=g.attribs),Array.isArray(g)||(g=Object.keys(g)),e.transformFeedbackVaryings(m,g,a.transformFeedbackMode||e.SEPARATE_ATTRIBS)),e.linkProgram(m),!e.getProgramParameter(m,e.LINK_STATUS)){var v=e.getProgramInfoLog(m);return a.errorCallback("Error in program linking:"+v),e.deleteProgram(m),P(e,u),null}return m}function C(e,t,r,n){var i,o=l(t);if(!o)throw"*** Error: unknown script element"+t;i=o.text;var a=r||k(o.type);if(!a)throw"*** Error: unknown shader type";return T(e,i,a,n)}function I(e,t,r,n,i){for(var o=S(r,n,i),a=[],s=0;s<t.length;++s){var u=T(e,t[s],e[R[s]],o.errorCallback);if(!u)return null;a.push(u)}return B(e,a,o)}function F(e){var t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}function O(e,t){var r=0;function n(t,n){var i,o=e.getUniformLocation(t,n.name),a=n.size>1&&"[0]"===n.name.substr(-3),s=n.type,u=f[s];if(!u)throw"unknown type: 0x"+s.toString(16);if(u.bindPoint){var l=r;r+=n.size,i=a?u.arraySetter(e,s,l,o,n.size):u.setter(e,s,l,o,n.size)}else i=u.arraySetter&&a?u.arraySetter(e,o):u.setter(e,o);return i.location=o,i}for(var i={},o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),a=0;a<o;++a){var s=e.getActiveUniform(t,a);if(!F(s)){var u=s.name;"[0]"===u.substr(-3)&&(u=u.substr(0,u.length-3));var l=n(t,s);i[u]=l}}return i}function M(e,t){for(var r={},n=e.getProgramParameter(t,e.TRANSFORM_FEEDBACK_VARYINGS),i=0;i<n;++i){var o=e.getTransformFeedbackVarying(t,i);r[o.name]={index:i,type:o.type,size:o.size}}return r}function U(e,t,r){for(var n in t.transformFeedbackInfo&&(t=t.transformFeedbackInfo),r.attribs&&(r=r.attribs),r){var i=t[n];if(i){var o=r[n];o.offset?e.bindBufferRange(e.TRANSFORM_FEEDBACK_BUFFER,i.index,o.buffer,o.offset,o.size):e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,i.index,o.buffer)}}}function D(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=[],i=[],o=0;o<r;++o){i.push(o),n.push({});var a=e.getActiveUniform(t,o);if(F(a))break;n[o].name=a.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(r){var o=r[0],a=r[1];e.getActiveUniforms(t,i,e[o]).forEach(function(e,t){n[t][a]=e})});for(var s={},u=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS),l=0;l<u;++l){var f=e.getActiveUniformBlockName(t,l),c={index:l,usedByVertexShader:e.getActiveUniformBlockParameter(t,l,e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),usedByFragmentShader:e.getActiveUniformBlockParameter(t,l,e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),size:e.getActiveUniformBlockParameter(t,l,e.UNIFORM_BLOCK_DATA_SIZE),uniformIndices:e.getActiveUniformBlockParameter(t,l,e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)};c.used=c.usedByVertexSahder||c.usedByFragmentShader,s[f]=c}return{blockSpecs:s,uniformData:n}}var N=/\[\d+\]\.$/;function L(e,t,r,n){var i=r.blockSpecs,o=r.uniformData,a=i[n];if(!a)return u("no uniform block object named:",n),{name:n,uniforms:{}};var s=new ArrayBuffer(a.size),l=e.createBuffer(),c=a.index;e.bindBuffer(e.UNIFORM_BUFFER,l),e.uniformBlockBinding(t,a.index,c);var h=n+".";N.test(h)&&(h=h.replace(N,"."));var d={};return a.uniformIndices.forEach(function(e){var t=o[e],r=f[t.type],n=r.Type,i=t.size*r.size,a=t.name;a.substr(0,h.length)===h&&(a=a.substr(h.length)),d[a]=new n(s,t.offset,i/n.BYTES_PER_ELEMENT)}),{name:n,array:s,asFloat:new Float32Array(s),buffer:l,uniforms:d}}function z(e,t,r){var n=(t.uniformBlockSpec||t).blockSpecs[r.name];if(n){var i=n.index;return e.bindBufferRange(e.UNIFORM_BUFFER,i,r.buffer,r.offset||0,r.array.byteLength),!0}return!1}function j(e,t){for(var r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<n;++i){var o=e.getActiveAttrib(t,i);if(!F(o)){var a=e.getAttribLocation(t,o.name),s=E[o.type],u=s.setter(e,a,s);u.location=a,r[o.name]=u}}return r}function Y(e,t){for(var r in t){var n=e[r];n&&n(t[r])}}function X(e,t){var r={program:t,uniformSetters:O(e,t),attribSetters:j(e,t)};return n.isWebGL2(e)&&(r.uniformBlockSpec=D(e,t),r.transformFeedbackInfo=M(e,t)),r}},function(e,t,r){"use strict";t.__esModule=!0,t.axisRotate=function(e,t,r,n){n=n||new i(16);var o=t[0],a=t[1],s=t[2],u=Math.sqrt(o*o+a*a+s*s),l=(o/=u)*o,f=(a/=u)*a,c=(s/=u)*s,h=Math.cos(r),d=Math.sin(r),p=1-h,m=l+(1-l)*h,g=o*a*p+s*d,v=o*s*p-a*d,_=o*a*p-s*d,y=f+(1-f)*h,b=a*s*p+o*d,w=o*s*p+a*d,E=a*s*p-o*d,x=c+(1-c)*h,A=e[0],T=e[1],S=e[2],R=e[3],k=e[4],P=e[5],B=e[6],C=e[7],I=e[8],F=e[9],O=e[10],M=e[11];n[0]=m*A+g*k+v*I,n[1]=m*T+g*P+v*F,n[2]=m*S+g*B+v*O,n[3]=m*R+g*C+v*M,n[4]=_*A+y*k+b*I,n[5]=_*T+y*P+b*F,n[6]=_*S+y*B+b*O,n[7]=_*R+y*C+b*M,n[8]=w*A+E*k+x*I,n[9]=w*T+E*P+x*F,n[10]=w*S+E*B+x*O,n[11]=w*R+E*C+x*M,e!==n&&(n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]);return n},t.axisRotation=function(e,t,r){r=r||new i(16);var n=e[0],o=e[1],a=e[2],s=Math.sqrt(n*n+o*o+a*a),u=(n/=s)*n,l=(o/=s)*o,f=(a/=s)*a,c=Math.cos(t),h=Math.sin(t),d=1-c;return r[0]=u+(1-u)*c,r[1]=n*o*d+a*h,r[2]=n*a*d-o*h,r[3]=0,r[4]=n*o*d-a*h,r[5]=l+(1-l)*c,r[6]=o*a*d+n*h,r[7]=0,r[8]=n*a*d+o*h,r[9]=o*a*d-n*h,r[10]=f+(1-f)*c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},t.copy=u,t.frustum=function(e,t,r,n,o,a,s){s=s||new i(16);var u=t-e,l=n-r,f=o-a;return s[0]=2*o/u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*o/l,s[6]=0,s[7]=0,s[8]=(e+t)/u,s[9]=(n+r)/l,s[10]=a/f,s[11]=-1,s[12]=0,s[13]=0,s[14]=o*a/f,s[15]=0,s},t.getAxis=function(e,t,r){r=r||n.create();var i=4*t;return r[0]=e[i+0],r[1]=e[i+1],r[2]=e[i+2],r},t.getTranslation=function(e,t){return(t=t||n.create())[0]=e[12],t[1]=e[13],t[2]=e[14],t},t.identity=l,t.inverse=f,t.lookAt=function(e,t,r,u){u=u||new i(16);var l=o,f=a,c=s;return n.normalize(n.subtract(e,t,c),c),n.normalize(n.cross(r,c,l),l),n.normalize(n.cross(c,l,f),f),u[0]=l[0],u[1]=l[1],u[2]=l[2],u[3]=0,u[4]=f[0],u[5]=f[1],u[6]=f[2],u[7]=0,u[8]=c[0],u[9]=c[1],u[10]=c[2],u[11]=0,u[12]=e[0],u[13]=e[1],u[14]=e[2],u[15]=1,u},t.multiply=function(e,t,r){r=r||new i(16);var n=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5],f=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],g=e[12],v=e[13],_=e[14],y=e[15],b=t[0],w=t[1],E=t[2],x=t[3],A=t[4],T=t[5],S=t[6],R=t[7],k=t[8],P=t[9],B=t[10],C=t[11],I=t[12],F=t[13],O=t[14],M=t[15];return r[0]=n*b+u*w+h*E+g*x,r[1]=o*b+l*w+d*E+v*x,r[2]=a*b+f*w+p*E+_*x,r[3]=s*b+c*w+m*E+y*x,r[4]=n*A+u*T+h*S+g*R,r[5]=o*A+l*T+d*S+v*R,r[6]=a*A+f*T+p*S+_*R,r[7]=s*A+c*T+m*S+y*R,r[8]=n*k+u*P+h*B+g*C,r[9]=o*k+l*P+d*B+v*C,r[10]=a*k+f*P+p*B+_*C,r[11]=s*k+c*P+m*B+y*C,r[12]=n*I+u*F+h*O+g*M,r[13]=o*I+l*F+d*O+v*M,r[14]=a*I+f*F+p*O+_*M,r[15]=s*I+c*F+m*O+y*M,r},t.negate=function(e,t){return(t=t||new i(16))[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},t.ortho=function(e,t,r,n,o,a,s){return(s=s||new i(16))[0]=2/(t-e),s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2/(n-r),s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2/(o-a),s[11]=0,s[12]=(t+e)/(e-t),s[13]=(n+r)/(r-n),s[14]=(a+o)/(o-a),s[15]=1,s},t.perspective=function(e,t,r,n,o){o=o||new i(16);var a=Math.tan(.5*Math.PI-.5*e),s=1/(r-n);return o[0]=a/t,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(r+n)*s,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*n*s*2,o[15]=0,o},t.rotateX=function(e,t,r){r=r||new i(16);var n=e[4],o=e[5],a=e[6],s=e[7],u=e[8],l=e[9],f=e[10],c=e[11],h=Math.cos(t),d=Math.sin(t);r[4]=h*n+d*u,r[5]=h*o+d*l,r[6]=h*a+d*f,r[7]=h*s+d*c,r[8]=h*u-d*n,r[9]=h*l-d*o,r[10]=h*f-d*a,r[11]=h*c-d*s,e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]);return r},t.rotateY=function(e,t,r){r=r||new i(16);var n=e[0],o=e[1],a=e[2],s=e[3],u=e[8],l=e[9],f=e[10],c=e[11],h=Math.cos(t),d=Math.sin(t);r[0]=h*n-d*u,r[1]=h*o-d*l,r[2]=h*a-d*f,r[3]=h*s-d*c,r[8]=h*u+d*n,r[9]=h*l+d*o,r[10]=h*f+d*a,r[11]=h*c+d*s,e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]);return r},t.rotateZ=function(e,t,r){r=r||new i(16);var n=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5],f=e[6],c=e[7],h=Math.cos(t),d=Math.sin(t);r[0]=h*n+d*u,r[1]=h*o+d*l,r[2]=h*a+d*f,r[3]=h*s+d*c,r[4]=h*u-d*n,r[5]=h*l-d*o,r[6]=h*f-d*a,r[7]=h*c-d*s,e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]);return r},t.rotationX=function(e,t){t=t||new i(16);var r=Math.cos(e),n=Math.sin(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.rotationY=function(e,t){t=t||new i(16);var r=Math.cos(e),n=Math.sin(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.rotationZ=function(e,t){t=t||new i(16);var r=Math.cos(e),n=Math.sin(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.scale=function(e,t,r){r=r||new i(16);var n=t[0],o=t[1],a=t[2];r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=n*e[3],r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=o*e[7],r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=a*e[11],e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]);return r},t.scaling=function(e,t){return(t=t||new i(16))[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.setAxis=function(e,t,r,n){n!==e&&(n=u(e,n));var i=4*r;return n[i+0]=t[0],n[i+1]=t[1],n[i+2]=t[2],n},t.setDefaultType=function(e){var t=i;return i=e,t},t.setTranslation=function(e,t,r){r=r||l(),e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11]);return r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r},t.transformDirection=function(e,t,r){r=r||n.create();var i=t[0],o=t[1],a=t[2];return r[0]=i*e[0]+o*e[4]+a*e[8],r[1]=i*e[1]+o*e[5]+a*e[9],r[2]=i*e[2]+o*e[6]+a*e[10],r},t.transformNormal=function(e,t,r){r=r||n.create();var i=f(e),o=t[0],a=t[1],s=t[2];return r[0]=o*i[0]+a*i[1]+s*i[2],r[1]=o*i[4]+a*i[5]+s*i[6],r[2]=o*i[8]+a*i[9]+s*i[10],r},t.transformPoint=function(e,t,r){r=r||n.create();var i=t[0],o=t[1],a=t[2],s=i*e[3]+o*e[7]+a*e[11]+e[15];return r[0]=(i*e[0]+o*e[4]+a*e[8]+e[12])/s,r[1]=(i*e[1]+o*e[5]+a*e[9]+e[13])/s,r[2]=(i*e[2]+o*e[6]+a*e[10]+e[14])/s,r},t.translate=function(e,t,r){r=r||new i(16);var n=t[0],o=t[1],a=t[2],s=e[0],u=e[1],l=e[2],f=e[3],c=e[4],h=e[5],d=e[6],p=e[7],m=e[8],g=e[9],v=e[10],_=e[11],y=e[12],b=e[13],w=e[14],E=e[15];e!==r&&(r[0]=s,r[1]=u,r[2]=l,r[3]=f,r[4]=c,r[5]=h,r[6]=d,r[7]=p,r[8]=m,r[9]=g,r[10]=v,r[11]=_);return r[12]=s*n+c*o+m*a+y,r[13]=u*n+h*o+g*a+b,r[14]=l*n+d*o+v*a+w,r[15]=f*n+p*o+_*a+E,r},t.translation=function(e,t){return(t=t||new i(16))[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},t.transpose=function(e,t){if((t=t||new i(16))===e){var r;return r=e[1],e[1]=e[4],e[4]=r,r=e[2],e[2]=e[8],e[8]=r,r=e[3],e[3]=e[12],e[12]=r,r=e[6],e[6]=e[9],e[9]=r,r=e[7],e[7]=e[13],e[13]=r,r=e[11],e[11]=e[14],e[14]=r,t}var n=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5],f=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],g=e[12],v=e[13],_=e[14],y=e[15];return t[0]=n,t[1]=u,t[2]=h,t[3]=g,t[4]=o,t[5]=l,t[6]=d,t[7]=v,t[8]=a,t[9]=f,t[10]=p,t[11]=_,t[12]=s,t[13]=c,t[14]=m,t[15]=y,t};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}(r(3));var i=Float32Array,o=n.create(),a=n.create(),s=n.create();function u(e,t){return(t=t||new i(16))[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function l(e){return(e=e||new i(16))[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function f(e,t){t=t||new i(16);var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],f=e[7],c=e[8],h=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],_=e[15],y=d*_,b=v*p,w=l*_,E=v*f,x=l*p,A=d*f,T=o*_,S=v*a,R=o*p,k=d*a,P=o*f,B=l*a,C=c*g,I=m*h,F=s*g,O=m*u,M=s*h,U=c*u,D=r*g,N=m*n,L=r*h,z=c*n,j=r*u,Y=s*n,X=y*u+E*h+x*g-(b*u+w*h+A*g),W=b*n+T*h+k*g-(y*n+S*h+R*g),G=w*n+S*u+P*g-(E*n+T*u+B*g),V=A*n+R*u+B*h-(x*n+k*u+P*h),H=1/(r*X+s*W+c*G+m*V);return t[0]=H*X,t[1]=H*W,t[2]=H*G,t[3]=H*V,t[4]=H*(b*s+w*c+A*m-(y*s+E*c+x*m)),t[5]=H*(y*r+S*c+R*m-(b*r+T*c+k*m)),t[6]=H*(E*r+T*s+B*m-(w*r+S*s+P*m)),t[7]=H*(x*r+k*s+P*c-(A*r+R*s+B*c)),t[8]=H*(C*f+O*p+M*_-(I*f+F*p+U*_)),t[9]=H*(I*a+D*p+z*_-(C*a+N*p+L*_)),t[10]=H*(F*a+N*f+j*_-(O*a+D*f+Y*_)),t[11]=H*(U*a+L*f+Y*p-(M*a+z*f+j*p)),t[12]=H*(F*d+U*v+I*l-(M*v+C*l+O*d)),t[13]=H*(L*v+C*o+N*d-(D*d+z*v+I*o)),t[14]=H*(D*l+Y*v+O*o-(j*v+F*o+N*l)),t[15]=H*(j*d+M*o+z*l-(L*l+Y*d+U*o)),t}},function(e,t,r){"use strict";t.__esModule=!0,t.createAttribsFromArrays=g,t.createBuffersFromArrays=function(e,t){var r={};Object.keys(t).forEach(function(n){r[n]=_(e,t[n],n)}),t.indices?(r.numElements=t.indices.length,r.elementType=n.getGLTypeForTypedArray(m(t.indices),"indices")):r.numElements=function(e){for(var t,r=0;r<v.length&&!((t=v[r])in e);++r);ii===v.length&&(t=Object.keys(e)[0]);var n=e[t],i=f(n).length,o=p(n,t),a=i/o;if(i%o>0)throw"numComponents "+o+" not correct for length "+i;return a}(t);return r},t.createBufferFromArray=_,t.createBufferFromTypedArray=u,t.createBufferInfoFromArrays=function(e,t){var r={attribs:g(e,t)},i=t.indices;if(i){var o=m(i,"indices");r.indices=u(e,o,e.ELEMENT_ARRAY_BUFFER),r.numElements=o.length,r.elementType=n.getGLTypeForTypedArray(o)}else r.numElements=function(e,t){var r,n;for(n=0;n<v.length&&!((r=v[n])in t)&&!((r=a.attribPrefix+r)in t);++n);n===v.length&&(r=Object.keys(t)[0]);var i=t[r];e.bindBuffer(e.ARRAY_BUFFER,i.buffer);var o=e.getBufferParameter(e.ARRAY_BUFFER,e.BUFFER_SIZE);e.bindBuffer(e.ARRAY_BUFFER,null);var s=function(e,t){return t===e.BYTE?1:t===e.UNSIGNED_BYTE?1:t===e.SHORT?2:t===e.UNSIGNED_SHORT?2:t===e.INT?4:t===e.UNSIGNED_INT?4:t===e.FLOAT?4:0}(e,i.type),u=o/s,l=i.numComponents||i.size,f=u/l;if(f%1!=0)throw"numComponents "+l+" not correct for length "+length;return f}(e,r.attribs);return r},t.setAttribInfoBufferFromArray=function(e,t,r,n){r=m(r),void 0!==n?(e.bindBuffer(e.ARRAY_BUFFER,t.buffer),e.bufferSubData(e.ARRAY_BUFFER,n,r)):s(e,e.ARRAY_BUFFER,t.buffer,r,t.drawType)},t.setAttributePrefix=function(e){a.attribPrefix=e},t.setAttributeDefaults_=function(e){i.copyExistingProperties(e,a)},t.getNumComponents_=p,t.getArray_=f;var n=o(r(1)),i=o(r(0));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}var a={attribPrefix:""};function s(e,t,r,n,i){e.bindBuffer(t,r),e.bufferData(t,n,i||e.STATIC_DRAW)}function u(e,t,r,n){if(i.isBuffer(e,t))return t;r=r||e.ARRAY_BUFFER;var o=e.createBuffer();return s(e,r,o,t,n),o}function l(e){return"indices"===e}function f(e){return e.length?e:e.data}var c=/coord|texture/i,h=/color|colour/i;function d(e,t){var r;if(t%(r=c.test(e)?2:h.test(e)?4:3)>0)throw"Can not guess numComponents for attribute '"+e+"'. Tried "+r+" but "+t+" values is not evenly divisible by "+r+". You should specify it.";return r}function p(e,t){return e.numComponents||e.size||d(t,f(e).length)}function m(e,t){if(n.isArrayBuffer(e))return e;if(n.isArrayBuffer(e.data))return e.data;Array.isArray(e)&&(e={data:e});var r=e.type;return r||(r=l(t)?Uint16Array:Float32Array),new r(e.data)}function g(e,t){var r={};return Object.keys(t).forEach(function(i){if(!l(i)){var o,s,f,c,h,g=t[i],v=g.attrib||g.name||g.attribName||a.attribPrefix+i;if("number"==typeof g||"number"==typeof g.data){h=g.data||g;var _=g.type||Float32Array,y=h*_.BYTES_PER_ELEMENT;s=n.getGLTypeForTypedArrayType(_),f=void 0!==g.normalize?g.normalize:function(e){return e===Int8Array||e===Uint8Array}(_),c=g.numComponents||g.size||d(i,h),o=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,y,g.drawType||e.STATIC_DRAW)}else{var b=m(g,i);o=u(e,b,void 0,g.drawType),s=n.getGLTypeForTypedArray(b),f=void 0!==g.normalize?g.normalize:function(e){return e instanceof Int8Array||e instanceof Uint8Array}(b),c=p(g,i),h=b.length}r[v]={buffer:o,numComponents:c,type:s,normalize:f,stride:g.stride||0,offset:g.offset||0,divisor:void 0===g.divisor?void 0:g.divisor,drawType:g.drawType}}}),e.bindBuffer(e.ARRAY_BUFFER,null),r}var v=["position","positions","a_position"];function _(e,t,r){var n="indices"===r?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;return u(e,m(t,r),n)}},function(e,t,r){"use strict";t.__esModule=!0,t.setTextureDefaults_=function(e){o.copyExistingProperties(e,u),e.textureColor&&E(e.textureColor)},t.createSampler=C,t.createSamplers=function(e,t){var r={};return Object.keys(t).forEach(function(n){r[n]=C(e,t[n])}),r},t.setSamplerParameters=B,t.createTexture=V,t.setEmptyTexture=G,t.setTextureFromArray=W,t.loadTextureFromUrl=j,t.setTextureFromElement=U,t.setTextureFilteringForSize=I,t.setTextureParameters=P,t.setDefaultTextureColor=E,t.createTextures=function(e,t,r){r=r||D;var n=0,i=[],o={},a={};function s(){0===n&&setTimeout(function(){r(i.length?i:void 0,o,a)},0)}return Object.keys(t).forEach(function(r){var u,l=t[r];(function(e){return"string"==typeof e||Array.isArray(e)&&"string"==typeof e[0]})(l.src)&&(u=function(e,t,o){a[r]=o,--n,e&&i.push(e),s()},++n),o[r]=V(e,l,u)}),s(),o},t.resizeTexture=function(e,t,r,n,i){n=n||r.width,i=i||r.height;var o=r.target||e.TEXTURE_2D;e.bindTexture(o,t);var a,s=r.level||0,u=r.internalFormat||r.format||e.RGBA,f=_(u),c=r.format||f.format,h=r.src;a=h&&(l(h)||Array.isArray(h)&&"number"==typeof h[0])?r.type||b(e,h,f.type):r.type||f.type;if(o===e.TEXTURE_CUBE_MAP)for(var d=0;d<6;++d)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,s,u,n,i,0,c,a,null);else e.texImage2D(o,s,u,n,i,0,c,a,null)},t.getNumComponentsForFormat=function(e){var t=d[e];if(!t)throw"unknown format: "+e;return t.numColorComponents},t.getBytesPerElementForInternalFormat=v;var n=s(r(4)),i=s(r(1)),o=s(r(0)),a=function(e){return e&&e.__esModule?e:{default:e}}(r(2));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}var u={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},l=i.isArrayBuffer,f=a.default.document&&a.default.document.createElement?a.default.document.createElement("canvas").getContext("2d"):null,c=6407,h=33319,d={},p=d;p[6406]={numColorComponents:1},p[6409]={numColorComponents:1},p[6410]={numColorComponents:2},p[c]={numColorComponents:3},p[6408]={numColorComponents:4},p[6403]={numColorComponents:1},p[36244]={numColorComponents:1},p[h]={numColorComponents:2},p[33320]={numColorComponents:2},p[c]={numColorComponents:3},p[36248]={numColorComponents:3},p[6408]={numColorComponents:4},p[36249]={numColorComponents:4},p[6402]={numColorComponents:1},p[34041]={numColorComponents:2};var m={},g=m;function v(e,t){var r=m[e];if(!r)throw"unknown internal format";var n=r.bytesPerElementMap[t];if(void 0===n)throw"unknown internal format";return n}function _(e){var t=m[e];if(!t)throw"unknown internal format";return{format:t.textureFormat,type:Array.isArray(t.type)?t.type[0]:t.type}}function y(e){return 0==(e&e-1)}function b(e,t,r){return l(t)?i.getGLTypeForTypedArray(t):r||e.UNSIGNED_BYTE}function w(e,t,r,n,i){if(i%1!=0)throw"can't guess dimensions";if(r||n){if(n){if(!r&&(r=i/n)%1)throw"can't guess dimensions"}else if((n=i/r)%1)throw"can't guess dimensions"}else{var o=Math.sqrt(i/(t===e.TEXTURE_CUBE_MAP?6:1));o%1==0?(r=o,n=o):(r=i,n=1)}return{width:r,height:n}}function E(e){u.textureColor=new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}g[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},g[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},g[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[5121,5131,36193,5126]},g[c]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},g[6408]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},g[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:5121},g[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:5120},g[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[5126,5131]},g[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:5126},g[33330]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5121},g[33329]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5120},g[33332]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5123},g[33331]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5122},g[33334]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},g[33333]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5124},g[33323]={textureFormat:h,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:5121},g[36757]={textureFormat:h,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:5120},g[33327]={textureFormat:h,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[5126,5131]},g[33328]={textureFormat:h,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:5126},g[33336]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5121},g[33335]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5120},g[33338]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5123},g[33337]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5122},g[33340]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5125},g[33339]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5124},g[32849]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:5121},g[35905]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5121},g[36194]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[5121,33635]},g[36758]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5120},g[35898]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35899]},g[35901]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35902]},g[34843]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[5126,5131]},g[34837]={textureFormat:c,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5126},g[36221]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5121},g[36239]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5120},g[36215]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5123},g[36233]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5122},g[36209]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5125},g[36227]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5124},g[32856]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},g[35907]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},g[36759]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:5120},g[32855]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[5121,32820,33640]},g[32854]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[5121,32819]},g[32857]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:33640},g[34842]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[5126,5131]},g[34836]={textureFormat:6408,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:5126},g[36220]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5121},g[36238]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5120},g[36975]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:33640},g[36214]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5123},g[36232]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5122},g[36226]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5124},g[36208]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5125},g[33189]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5123,5125]},g[33190]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},g[36012]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5126},g[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},g[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(g).forEach(function(e){var t=g[e];if(t.bytesPerElementMap={},Array.isArray(t.bytesPerElement))t.bytesPerElement.forEach(function(e,r){var n=t.type[r];t.bytesPerElementMap[n]=e});else{var r=t.type;t.bytesPerElementMap[r]=t.bytesPerElement}});var x={};function A(e,t){void 0!==t.colorspaceConversion&&(x.colorspaceConversion=e.getParameter(e.UNPACK_COLORSPACE_CONVERSION_WEBGL),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.colorspaceConversion)),void 0!==t.premultiplyAlpha&&(x.premultiplyAlpha=e.getParameter(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha)),void 0!==t.flipY&&(x.flipY=e.getParameter(e.UNPACK_FLIP_Y_WEBGL),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY))}function T(e,t){void 0!==t.colorspaceConversion&&e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.colorspaceConversion),void 0!==t.premultiplyAlpha&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),void 0!==t.flipY&&e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,x.flipY)}function S(e){x.unpackAlignment=e.getParameter(e.UNPACK_ALIGNMENT),n.isWebGL2(e)&&(x.unpackRowLength=e.getParameter(e.UNPACK_ROW_LENGTH),x.unpackImageHeight=e.getParameter(e.UNPACK_IMAGE_HEIGHT),x.unpackSkipPixels=e.getParameter(e.UNPACK_SKIP_PIXELS),x.unpackSkipRows=e.getParameter(e.UNPACK_SKIP_ROWS),x.unpackSkipImages=e.getParameter(e.UNPACK_SKIP_IMAGES))}function R(e){e.pixelStorei(e.UNPACK_ALIGNMENT,x.unpackAlignment),n.isWebGL2(e)&&(e.pixelStorei(e.UNPACK_ROW_LENGTH,x.unpackRowLength),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,x.unpackImageHeight),e.pixelStorei(e.UNPACK_SKIP_PIXELS,x.unpackSkipPixels),e.pixelStorei(e.UNPACK_SKIP_ROWS,x.unpackSkipRows),e.pixelStorei(e.UNPACK_SKIP_IMAGES,x.unpackSkipImages))}function k(e,t,r,n){n.minMag&&(r.call(e,t,e.TEXTURE_MIN_FILTER,n.minMag),r.call(e,t,e.TEXTURE_MAG_FILTER,n.minMag)),n.min&&r.call(e,t,e.TEXTURE_MIN_FILTER,n.min),n.mag&&r.call(e,t,e.TEXTURE_MAG_FILTER,n.mag),n.wrap&&(r.call(e,t,e.TEXTURE_WRAP_S,n.wrap),r.call(e,t,e.TEXTURE_WRAP_T,n.wrap),(t===e.TEXTURE_3D||o.isSampler(e,t))&&r.call(e,t,e.TEXTURE_WRAP_R,n.wrap)),n.wrapR&&r.call(e,t,e.TEXTURE_WRAP_R,n.wrapR),n.wrapS&&r.call(e,t,e.TEXTURE_WRAP_S,n.wrapS),n.wrapT&&r.call(e,t,e.TEXTURE_WRAP_T,n.wrapT),n.minLod&&r.call(e,t,e.TEXTURE_MIN_LOD,n.minLod),n.maxLod&&r.call(e,t,e.TEXTURE_MAX_LOD,n.maxLod),n.baseLevel&&r.call(e,t,e.TEXTURE_BASE_LEVEL,n.baseLevel),n.maxLevel&&r.call(e,t,e.TEXTURE_MAX_LEVEL,n.maxLevel)}function P(e,t,r){var n=r.target||e.TEXTURE_2D;e.bindTexture(n,t),k(e,n,e.texParameteri,r)}function B(e,t,r){k(e,t,e.samplerParameteri,r)}function C(e,t){var r=e.createSampler();return B(e,r,t),r}function I(e,t,r,i,o,a,s){r=r||u.textureOptions,a=a||e.RGBA,s=s||e.UNSIGNED_BYTE;var l=r.target||e.TEXTURE_2D;if(i=i||r.width,o=o||r.height,e.bindTexture(l,t),function(e,t,r,i){if(!n.isWebGL2(e))return y(t)&&y(r);var o=m[i];if(!o)throw"unknown internal format";return o.colorRenderable&&o.textureFilterable}(e,i,o,a))e.generateMipmap(l);else{var f=function(e){var t=m[e];if(!t)throw"unknown internal format";return t.textureFilterable}(a)?e.LINEAR:e.NEAREST;e.texParameteri(l,e.TEXTURE_MIN_FILTER,f),e.texParameteri(l,e.TEXTURE_MAG_FILTER,f),e.texParameteri(l,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(l,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}function F(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function O(e,t){return(t=t||{}).cubeFaceOrder||[e.TEXTURE_CUBE_MAP_POSITIVE_X,e.TEXTURE_CUBE_MAP_NEGATIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_Y,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,e.TEXTURE_CUBE_MAP_POSITIVE_Z,e.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function M(e,t){var r=O(e,t).map(function(e,t){return{face:e,ndx:t}});return r.sort(function(e,t){return e.face-t.face}),r}function U(e,t,r,n){var i=(n=n||u.textureOptions).target||e.TEXTURE_2D,o=n.level||0,s=r.width,l=r.height,c=n.internalFormat||n.format||e.RGBA,h=_(c),d=n.format||h.format,p=n.type||h.type;if(A(e,n),e.bindTexture(i,t),i===e.TEXTURE_CUBE_MAP){var m,g,v=r.width,y=r.height;if(v/6===y)m=y,g=[0,0,1,0,2,0,3,0,4,0,5,0];else if(y/6===v)m=v,g=[0,0,0,1,0,2,0,3,0,4,0,5];else if(v/3==y/2)m=v/3,g=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(v/2!=y/3)throw"can't figure out cube map from element: "+(r.src?r.src:r.nodeName);m=v/2,g=[0,0,1,0,0,1,1,1,0,2,1,2]}f?(f.canvas.width=m,f.canvas.height=m,s=m,l=m,M(e,n).forEach(function(t){var n=g[2*t.ndx+0]*m,i=g[2*t.ndx+1]*m;f.drawImage(r,n,i,m,m,0,0,m,m),e.texImage2D(t.face,o,c,d,p,f.canvas)}),f.canvas.width=1,f.canvas.height=1):a.default.createImageBitmap&&(s=m,l=m,M(e,n).forEach(function(u){var f=g[2*u.ndx+0]*m,h=g[2*u.ndx+1]*m;e.texImage2D(u.face,o,c,m,m,0,d,p,null),a.default.createImageBitmap(r,f,h,m,m,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(r){A(e,n),e.bindTexture(i,t),e.texImage2D(u.face,o,c,d,p,r),T(e,n),F(n)&&I(e,t,n,s,l,c,p)})}))}else if(i===e.TEXTURE_3D||i===e.TEXTURE_2D_ARRAY){var b=Math.min(r.width,r.height),w=Math.max(r.width,r.height),E=w/b;if(E%1!=0)throw"can not compute 3D dimensions of element";var x=r.width===w?1:0,k=r.height===w?1:0;S(e),e.pixelStorei(e.UNPACK_ALIGNMENT,1),e.pixelStorei(e.UNPACK_ROW_LENGTH,r.width),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),e.texImage3D(i,o,c,b,b,b,0,d,p,null);for(var B=0;B<E;++B){var C=B*b*x,O=B*b*k;e.pixelStorei(e.UNPACK_SKIP_PIXELS,C),e.pixelStorei(e.UNPACK_SKIP_ROWS,O),e.texSubImage3D(i,o,0,0,B,b,b,1,d,p,r)}R(e)}else e.texImage2D(i,o,c,d,p,r);T(e,n),F(n)&&I(e,t,n,s,l,c,p),P(e,t,n)}function D(){}function N(e){return a.default.ImageBitmap&&e instanceof a.default.ImageBitmap||a.default.ImageData&&e instanceof a.default.ImageData||a.default.HTMLElement&&e instanceof a.default.HTMLElement}function L(e,t,r){return N(e)?(setTimeout(function(){r(null,e)}),e):function(e,t,r){var n;if(r=r||D,a.default.Image){n=new a.default.Image,void 0!==(t=void 0!==t?t:u.crossOrigin)&&(n.crossOrigin=t);var i=function(){n.removeEventListener("error",s),n.removeEventListener("load",l),n=null},s=function(){var t="couldn't load image: "+e;o.error(t),r(t,n),i()},l=function(){r(null,n),i()};return n.addEventListener("error",s),n.addEventListener("load",l),n.src=e,n}if(a.default.ImageBitmap){var f,c,h=function(){r(f,c)},d={};t&&(d.mode="cors"),fetch(e,d).then(function(e){if(!e.ok)throw e;return e.blob()}).then(function(e){return a.default.createImageBitmap(e,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(e){c=e,setTimeout(h)}).catch(function(e){f=e,setTimeout(h)}),n=null}return n}(e,t,r)}function z(e,t,r){var n=(r=r||u.textureOptions).target||e.TEXTURE_2D;if(e.bindTexture(n,t),!1!==r.color){var i=function(e){return e=e||u.textureColor,l(e)?e:new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}(r.color);if(n===e.TEXTURE_CUBE_MAP)for(var o=0;o<6;++o)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);else n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i):e.texImage2D(n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i)}}function j(e,t,r,n){return n=n||D,r=r||u.textureOptions,z(e,t,r),L((r=Object.assign({},r)).src,r.crossOrigin,function(i,o){i?n(i,t,o):(U(e,t,o,r),n(null,t,o))})}function Y(e,t,r,n){n=n||D;var i=r.src;if(6!==i.length)throw"there must be 6 urls for a cubemap";var o=r.level||0,a=r.internalFormat||r.format||e.RGBA,s=_(a),u=r.format||s.format,l=r.type||e.UNSIGNED_BYTE,f=r.target||e.TEXTURE_2D;if(f!==e.TEXTURE_CUBE_MAP)throw"target must be TEXTURE_CUBE_MAP";z(e,t,r),r=Object.assign({},r);var c,h=6,d=[],p=O(e,r);c=i.map(function(i,s){return L(i,r.crossOrigin,function(i){return function(s,p){--h,s?d.push(s):p.width!==p.height?d.push("cubemap face img is not a square: "+p.src):(A(e,r),e.bindTexture(f,t),5===h?O(e).forEach(function(t){e.texImage2D(t,o,a,u,l,p)}):e.texImage2D(i,o,a,u,l,p),T(e,r),F(r)&&e.generateMipmap(f)),0===h&&n(d.length?d:void 0,t,c)}}(p[s]))})}function X(e,t,r,n){n=n||D;var i=r.src,o=r.internalFormat||r.format||e.RGBA,a=_(o),s=r.format||a.format,u=r.type||e.UNSIGNED_BYTE,l=r.target||e.TEXTURE_2D_ARRAY;if(l!==e.TEXTURE_3D&&l!==e.TEXTURE_2D_ARRAY)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";z(e,t,r),r=Object.assign({},r);var c,h=i.length,d=[],p=r.level||0,m=r.width,g=r.height,v=i.length,y=!0;c=i.map(function(i,a){return L(i,r.crossOrigin,function(i){return function(a,_){if(--h,a)d.push(a);else{if(A(e,r),e.bindTexture(l,t),y){y=!1,m=r.width||_.width,g=r.height||_.height,e.texImage3D(l,p,o,m,g,v,0,s,u,null);for(var b=0;b<v;++b)e.texSubImage3D(l,p,0,0,b,m,g,1,s,u,_)}else{var w=_;_.width===m&&_.height===g||(w=f.canvas,f.canvas.width=m,f.canvas.height=g,f.drawImage(_,0,0,m,g)),e.texSubImage3D(l,p,0,0,i,m,g,1,s,u,w),w===f.canvas&&(f.canvas.width=0,f.canvas.height=0)}T(e,r),F(r)&&e.generateMipmap(l)}0===h&&n(d.length?d:void 0,t,c)}}(a))})}function W(e,t,r,o){var a=(o=o||u.textureOptions).target||e.TEXTURE_2D;e.bindTexture(a,t);var s=o.width,f=o.height,c=o.depth,h=o.level||0,d=o.internalFormat||o.format||e.RGBA,p=_(d),m=o.format||p.format,g=o.type||b(e,r,p.type);if(l(r))r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));else{var y=i.getTypedArrayTypeForGLType(g);r=new y(r)}var E,x=v(d,g),k=r.byteLength/x;if(k%1)throw"length wrong size for format: "+n.glEnumToString(e,m);if(a===e.TEXTURE_3D)if(s||f||c)!s||f&&c?!f||s&&c?(E=w(e,a,s,f,k/c),s=E.width,f=E.height):(E=w(e,a,s,c,k/f),s=E.width,c=E.height):(E=w(e,a,f,c,k/s),f=E.width,c=E.height);else{var P=Math.cbrt(k);if(P%1!=0)throw"can't guess cube size of array of numElements: "+k;s=P,f=P,c=P}else E=w(e,a,s,f,k),s=E.width,f=E.height;if(S(e),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment||1),A(e,o),a===e.TEXTURE_CUBE_MAP){var B=k/6*(x/r.BYTES_PER_ELEMENT);M(e,o).forEach(function(t){var n=B*t.ndx,i=r.subarray(n,n+B);e.texImage2D(t.face,h,d,s,f,0,m,g,i)})}else a===e.TEXTURE_3D?e.texImage3D(a,h,d,s,f,c,0,m,g,r):e.texImage2D(a,h,d,s,f,0,m,g,r);return T(e,o),R(e),{width:s,height:f,depth:c,type:g}}function G(e,t,r){var n=r.target||e.TEXTURE_2D;e.bindTexture(n,t);var i=r.level||0,o=r.internalFormat||r.format||e.RGBA,a=_(o),s=r.format||a.format,u=r.type||a.type;if(A(e,r),n===e.TEXTURE_CUBE_MAP)for(var l=0;l<6;++l)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+l,i,o,r.width,r.height,0,s,u,null);else n===e.TEXTURE_3D?e.texImage3D(n,i,o,r.width,r.height,r.depth,0,s,u,null):e.texImage2D(n,i,o,r.width,r.height,0,s,u,null);T(e,r)}function V(e,t,r){r=r||D,t=t||u.textureOptions;var n=e.createTexture(),i=t.target||e.TEXTURE_2D,o=t.width||1,a=t.height||1,s=t.internalFormat||e.RGBA,f=_(s),c=t.type||f.type;e.bindTexture(i,n),i===e.TEXTURE_CUBE_MAP&&(e.texParameteri(i,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(i,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE));var h=t.src;if(h)if("function"==typeof h&&(h=h(e,t)),"string"==typeof h)j(e,n,t,r);else if(l(h)||Array.isArray(h)&&("number"==typeof h[0]||Array.isArray(h[0])||l(h[0]))){var d=W(e,n,h,t);o=d.width,a=d.height,c=d.type}else if(Array.isArray(h)&&("string"==typeof h[0]||N(h[0])))i===e.TEXTURE_CUBE_MAP?Y(e,n,t,r):X(e,n,t,r);else{if(!N(h))throw"unsupported src type";U(e,n,h,t),o=h.width,a=h.height}else G(e,n,t);return F(t)&&I(e,n,t,o,a,s,c),P(e,n,t),n}},function(e,t,r){"use strict";t.__esModule=!0;var n={m4:!0,v3:!0,primitives:!0};t.primitives=t.v3=t.m4=void 0;var i=u(r(6));t.m4=i;var o=u(r(3));t.v3=o;var a=u(r(10));t.primitives=a;var s=r(11);function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=s[e]))})},function(e,t,r){"use strict";t.__esModule=!0,t.create3DFVertices=R,t.createAugmentedTypedArray=h,t.createCubeVertices=A,t.createPlaneVertices=w,t.createSphereVertices=E,t.createTruncatedConeVertices=T,t.createXYQuadVertices=b,t.createCresentVertices=k,t.createCylinderVertices=P,t.createTorusVertices=B,t.createDiscVertices=C,t.deindexVertices=function(e){var t=e.indices,r={},n=t.length;return Object.keys(e).filter(d).forEach(function(i){for(var o=e[i],a=o.numComponents,s=h(a,n,o.constructor),u=0;u<n;++u)for(var l=t[u],f=l*a,c=0;c<a;++c)s.push(o[f+c]);r[i]=s}),r},t.flattenNormals=function(e){if(e.indices)throw"can't flatten normals of indexed vertices. deindex them first";for(var t=e.normal,r=t.length,n=0;n<r;n+=9){var i=t[n+0],o=t[n+1],a=t[n+2],s=t[n+3],u=t[n+4],l=t[n+5],f=t[n+6],c=t[n+7],h=t[n+8],d=i+s+f,p=o+u+c,m=a+l+h,g=Math.sqrt(d*d+p*p+m*m);d/=g,p/=g,m/=g,t[n+0]=d,t[n+1]=p,t[n+2]=m,t[n+3]=d,t[n+4]=p,t[n+5]=m,t[n+6]=d,t[n+7]=p,t[n+8]=m}return e},t.makeRandomVertexColors=function(e,t){t=t||{};var r=e.position.numElements,n=h(4,r,Uint8Array),i=t.rand||function(e,t){return t<3?function(e){return Math.random()*e|0}(256):255};if(e.color=n,e.indices)for(var o=0;o<r;++o)n.push(i(o,0),i(o,1),i(o,2),i(o,3));else for(var a=t.vertsPerColor||3,s=r/a,u=0;u<s;++u)for(var l=[i(u,0),i(u,1),i(u,2),i(u,3)],f=0;f<a;++f)n.push(l);return e},t.reorientDirections=g,t.reorientNormals=v,t.reorientPositions=_,t.reorientVertices=y,t.concatVertices=function(e){for(var t,r={},n=function(n){var i=e[n];Object.keys(i).forEach(function(e){r[e]||(r[e]=[]),t||"indices"===e||(t=e);var n=i[e],o=f(n,e),a=l(n),s=a.length/o;r[e].push(s)})},i=0;i<e.length;++i)n(i);var o=r[t],a={};return Object.keys(r).forEach(function(t){var r=function(t){for(var r,n=0,i=0;i<e.length;++i){var o=e[i],a=o[t],s=l(a);n+=s.length,r&&!a.data||(r=a)}return{length:n,spec:r}}(t),n=U(r.spec,r.length);!function(t,r,n){for(var i=0,o=0,a=0;a<e.length;++a){var s=e[a],u=s[t],f=l(u);"indices"===t?(M(f,n,o,i),i+=r[a]):M(f,n,o),o+=f.length}}(t,o,l(n)),a[t]=n}),a},t.duplicateVertices=function(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r],i=l(n),o=U(n,i.length);M(i,l(o),0),t[r]=o}),t},t.createDiscBuffers=t.createDiscBufferInfo=t.createTorusBuffers=t.createTorusBufferInfo=t.createCylinderBuffers=t.createCylinderBufferInfo=t.createCresentBuffers=t.createCresentBufferInfo=t.createXYQuadBuffers=t.createXYQuadBufferInfo=t.createTruncatedConeBuffers=t.createTruncatedConeBufferInfo=t.createSphereBuffers=t.createSphereBufferInfo=t.createPlaneBuffers=t.createPlaneBufferInfo=t.createCubeBuffers=t.createCubeBufferInfo=t.create3DFBuffers=t.create3DFBufferInfo=void 0;var n=u(r(7)),i=u(r(0)),o=u(r(1)),a=u(r(6)),s=u(r(3));function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}var l=n.getArray_,f=n.getNumComponents_;function c(e,t){var r=0;return e.push=function(){for(var t=0;t<arguments.length;++t){var n=arguments[t];if(n instanceof Array||o.isArrayBuffer(n))for(var i=0;i<n.length;++i)e[r++]=n[i];else e[r++]=n}},e.reset=function(e){r=e||0},e.numComponents=t,Object.defineProperty(e,"numElements",{get:function(){return this.length/this.numComponents|0}}),e}function h(e,t,r){return c(new(r||Float32Array)(e*t),e)}function d(e){return"indices"!==e}function p(e,t,r){for(var n=e.length,i=new Float32Array(3),o=0;o<n;o+=3)r(t,[e[o],e[o+1],e[o+2]],i),e[o]=i[0],e[o+1]=i[1],e[o+2]=i[2]}function m(e,t,r){r=r||s.create();var n=t[0],i=t[1],o=t[2];return r[0]=n*e[0]+i*e[1]+o*e[2],r[1]=n*e[4]+i*e[5]+o*e[6],r[2]=n*e[8]+i*e[9]+o*e[10],r}function g(e,t){return p(e,t,a.transformDirection),e}function v(e,t){return p(e,a.inverse(t),m),e}function _(e,t){return p(e,t,a.transformPoint),e}function y(e,t){return Object.keys(e).forEach(function(r){var n=e[r];r.indexOf("pos")>=0?_(n,t):r.indexOf("tan")>=0||r.indexOf("binorm")>=0?g(n,t):r.indexOf("norm")>=0&&v(n,t)}),e}function b(e,t,r){return e=e||2,{position:{numComponents:2,data:[(t=t||0)+-1*(e*=.5),(r=r||0)+-1*e,t+1*e,r+-1*e,t+-1*e,r+1*e,t+1*e,r+1*e]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function w(e,t,r,n,i){e=e||1,t=t||1,r=r||1,n=n||1,i=i||a.identity();for(var o=(r+1)*(n+1),s=h(3,o),u=h(3,o),l=h(2,o),f=0;f<=n;f++)for(var c=0;c<=r;c++){var d=c/r,p=f/n;s.push(e*d-.5*e,0,t*p-.5*t),u.push(0,1,0),l.push(d,p)}for(var m=r+1,g=h(3,r*n*2,Uint16Array),v=0;v<n;v++)for(var _=0;_<r;_++)g.push((v+0)*m+_,(v+1)*m+_,(v+0)*m+_+1),g.push((v+1)*m+_,(v+1)*m+_+1,(v+0)*m+_+1);return y({position:s,normal:u,texcoord:l,indices:g},i)}function E(e,t,r,n,i,o,a){if(t<=0||r<=0)throw Error("subdivisionAxis and subdivisionHeight must be > 0");n=n||0,i=i||Math.PI,o=o||0;for(var s=i-n,u=(a=a||2*Math.PI)-o,l=(t+1)*(r+1),f=h(3,l),c=h(3,l),d=h(2,l),p=0;p<=r;p++)for(var m=0;m<=t;m++){var g=m/t,v=p/r,_=u*g,y=s*v,b=Math.sin(_),w=Math.cos(_),E=Math.sin(y),x=w*E,A=Math.cos(y),T=b*E;f.push(e*x,e*A,e*T),c.push(x,A,T),d.push(1-g,v)}for(var S=t+1,R=h(3,t*r*2,Uint16Array),k=0;k<t;k++)for(var P=0;P<r;P++)R.push((P+0)*S+k,(P+0)*S+k+1,(P+1)*S+k),R.push((P+1)*S+k,(P+0)*S+k+1,(P+1)*S+k+1);return{position:f,normal:c,texcoord:d,indices:R}}var x=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function A(e){for(var t=(e=e||1)/2,r=[[-t,-t,-t],[+t,-t,-t],[-t,+t,-t],[+t,+t,-t],[-t,-t,+t],[+t,-t,+t],[-t,+t,+t],[+t,+t,+t]],n=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],i=[[1,0],[0,0],[0,1],[1,1]],o=h(3,24),a=h(3,24),s=h(2,24),u=h(3,12,Uint16Array),l=0;l<6;++l){for(var f=x[l],c=0;c<4;++c){var d=r[f[c]],p=n[l],m=i[c];o.push(d),a.push(p),s.push(m)}var g=4*l;u.push(g+0,g+1,g+2),u.push(g+0,g+2,g+3)}return{position:o,normal:a,texcoord:s,indices:u}}function T(e,t,r,n,i,o,a){if(n<3)throw Error("radialSubdivisions must be 3 or greater");if(i<1)throw Error("verticalSubdivisions must be 1 or greater");for(var s=void 0===o||o,u=void 0===a||a,l=(s?2:0)+(u?2:0),f=(n+1)*(i+1+l),c=h(3,f),d=h(3,f),p=h(2,f),m=h(3,n*(i+l)*2,Uint16Array),g=n+1,v=Math.atan2(e-t,r),_=Math.cos(v),y=Math.sin(v),b=i+(u?2:0),w=s?-2:0;w<=b;++w){var E=w/i,x=r*E,A=void 0;w<0?(x=0,E=1,A=e):w>i?(x=r,E=1,A=t):A=e+w/i*(t-e),-2!==w&&w!==i+2||(A=0,E=0),x-=r/2;for(var T=0;T<g;++T){var S=Math.sin(T*Math.PI*2/n),R=Math.cos(T*Math.PI*2/n);c.push(S*A,x,R*A),d.push(w<0||w>i?0:S*_,w<0?-1:w>i?1:y,w<0||w>i?0:R*_),p.push(T/n,1-E)}}for(var k=0;k<i+l;++k)for(var P=0;P<n;++P)m.push(g*(k+0)+0+P,g*(k+0)+1+P,g*(k+1)+1+P),m.push(g*(k+0)+0+P,g*(k+1)+1+P,g*(k+1)+0+P);return{position:c,normal:d,texcoord:p,indices:m}}function S(e,t){t=t||[];for(var r=[],n=0;n<e.length;n+=4){var i=e[n],o=e.slice(n+1,n+4);o.push.apply(o,t);for(var a=0;a<i;++a)r.push.apply(r,o)}return r}function R(){var e=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],t=S([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),r=S([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),n=e.length/3,i={position:h(3,n),texcoord:h(2,n),normal:h(3,n),color:h(4,n,Uint8Array),indices:h(3,n/3,Uint16Array)};i.position.push(e),i.texcoord.push([.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0]),i.normal.push(t),i.color.push(r);for(var o=0;o<n;++o)i.indices.push(o);return i}function k(e,t,r,n,i,o,a){if(i<=0)throw Error("subdivisionDown must be > 0");o=o||0;var u=2,l=(a=a||1)-o,f=2*(i+1)*(2+u),c=h(3,f),d=h(3,f),p=h(2,f);function m(e,t,r){return e+(t-e)*r}function g(t,r,a,f,h,g){for(var v=0;v<=i;v++){var _=r/(u-1),y=v/i,b=2*(_-.5),w=(o+y*l)*Math.PI,E=Math.sin(w),x=Math.cos(w),A=m(e,t,E),T=b*n,S=x*e,R=E*A;c.push(T,S,R);var k=s.add(s.multiply([0,E,x],a),f);d.push(k),p.push(_*h+g,y)}}for(var v=0;v<u;v++){var _=2*(v/(u-1)-.5);g(t,v,[1,1,1],[0,0,0],1,0),g(t,v,[0,0,0],[_,0,0],0,0),g(r,v,[1,1,1],[0,0,0],1,0),g(r,v,[0,0,0],[_,0,0],0,1)}var y=h(3,2*i*(2+u),Uint16Array);function b(e,t){for(var r=0;r<i;++r)y.push(e+r+0,e+r+1,t+r+0),y.push(e+r+1,t+r+1,t+r+0)}var w=i+1;return b(0*w,4*w),b(5*w,7*w),b(6*w,2*w),b(3*w,1*w),{position:c,normal:d,texcoord:p,indices:y}}function P(e,t,r,n,i,o){return T(e,e,t,r,n,i,o)}function B(e,t,r,n,i,o){if(r<3)throw Error("radialSubdivisions must be 3 or greater");if(n<3)throw Error("verticalSubdivisions must be 3 or greater");i=i||0;for(var a=(o=o||2*Math.PI)-i,s=r+1,u=n+1,l=s*u,f=h(3,l),c=h(3,l),d=h(2,l),p=h(3,r*n*2,Uint16Array),m=0;m<u;++m)for(var g=m/n,v=g*Math.PI*2,_=Math.sin(v),y=e+_*t,b=Math.cos(v),w=b*t,E=0;E<s;++E){var x=E/r,A=i+x*a,T=Math.sin(A),S=Math.cos(A),R=T*y,k=S*y,P=T*_,B=S*_;f.push(R,w,k),c.push(P,b,B),d.push(x,1-g)}for(var C=0;C<n;++C)for(var I=0;I<r;++I){var F=1+I,O=1+C;p.push(s*C+I,s*O+I,s*C+F),p.push(s*O+I,s*O+F,s*C+F)}return{position:f,normal:c,texcoord:d,indices:p}}function C(e,t,r,n,i){if(t<3)throw Error("divisions must be at least 3");r=r||1,i=i||1,n=n||0;for(var o=(t+1)*(r+1),a=h(3,o),s=h(3,o),u=h(2,o),l=h(3,r*t*2,Uint16Array),f=0,c=e-n,d=t+1,p=0;p<=r;++p){for(var m=n+c*Math.pow(p/r,i),g=0;g<=t;++g){var v=2*Math.PI*g/t,_=m*Math.cos(v),y=m*Math.sin(v);if(a.push(_,0,y),s.push(0,1,0),u.push(1-g/t,p/r),p>0&&g!==t){var b=f+(g+1),w=f+g,E=f+g-d,x=f+(g+1)-d;l.push(b,w,E),l.push(b,E,x)}}f+=t+1}return{position:a,normal:s,texcoord:u,indices:l}}function I(e){return function(t){var r=e.apply(this,Array.prototype.slice.call(arguments,1));return n.createBuffersFromArrays(t,r)}}function F(e){return function(t){var r=e.apply(null,Array.prototype.slice.call(arguments,1));return n.createBufferInfoFromArrays(t,r)}}var O=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function M(e,t,r,n){n=n||0;for(var i=e.length,o=0;o<i;++o)t[r+o]=e[o]+n}function U(e,t){var r=l(e),n=new r.constructor(t),o=n;return r.numComponents&&r.numElements&&c(n,r.numComponents),e.data&&(o={data:n},i.copyNamedProperties(O,e,o)),o}var D=F(R);t.create3DFBufferInfo=D;var N=I(R);t.create3DFBuffers=N;var L=F(A);t.createCubeBufferInfo=L;var z=I(A);t.createCubeBuffers=z;var j=F(w);t.createPlaneBufferInfo=j;var Y=I(w);t.createPlaneBuffers=Y;var X=F(E);t.createSphereBufferInfo=X;var W=I(E);t.createSphereBuffers=W;var G=F(T);t.createTruncatedConeBufferInfo=G;var V=I(T);t.createTruncatedConeBuffers=V;var H=F(b);t.createXYQuadBufferInfo=H;var K=I(b);t.createXYQuadBuffers=K;var Z=F(k);t.createCresentBufferInfo=Z;var q=I(k);t.createCresentBuffers=q;var $=F(P);t.createCylinderBufferInfo=$;var J=I(P);t.createCylinderBuffers=J;var Q=F(B);t.createTorusBufferInfo=Q;var ee=I(B);t.createTorusBuffers=ee;var te=F(C);t.createDiscBufferInfo=te;var re=I(C);t.createDiscBuffers=re},function(e,t,r){"use strict";t.__esModule=!0;var n={addExtensionsToContext:!0,getContext:!0,getWebGLContext:!0,resizeCanvasToDisplaySize:!0,setDefaults:!0};t.addExtensionsToContext=_,t.getContext=function(e,t){return function(e,t){for(var r=["webgl2","webgl","experimental-webgl"],n=null,i=0;i<r.length;++i)if(n=e.getContext(r[i],t)){p.addExtensionsToContext&&_(n);break}return n}(e,t)},t.getWebGLContext=function(e,t){return function(e,t){for(var r=["webgl","experimental-webgl"],n=null,i=0;i<r.length;++i)if(n=e.getContext(r[i],t)){p.addExtensionsToContext&&_(n);break}return n}(e,t)},t.resizeCanvasToDisplaySize=function(e,t){t=t||1,t=Math.max(0,t);var r=e.clientWidth*t|0,n=e.clientHeight*t|0;if(e.width!==r||e.height!==n)return e.width=r,e.height=n,!0;return!1},t.setDefaults=function(e){a.copyExistingProperties(e,p),i.setAttributeDefaults_(e),o.setTextureDefaults_(e)};var i=d(r(7));Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=i[e]))});var o=d(r(8));Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=o[e]))});var a=d(r(0)),s=d(r(4));Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=s[e]))});var u=r(12);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=u[e]))});var l=r(13);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=l[e]))});var f=r(5);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=f[e]))});var c=r(1);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=c[e]))});var h=r(14);function d(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}Object.keys(h).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||(t[e]=h[e]))});var p={addExtensionsToContext:!0};var m=/^(.*?)_/;function g(e,t){s.glEnumToString(e,0);var r=e.getExtension(t);if(r){var n={},i=m.exec(t)[1],o="_"+i;for(var u in r){var l=r[u],f="function"==typeof l,c=f?i:o,h=u;u.endsWith(c)&&(h=u.substring(0,u.length-c.length)),void 0!==e[h]?f||e[h]===l||a.warn(h,e[h],l,u):f?e[h]=function(e){return function(){return e.apply(r,arguments)}}(l):(e[h]=l,n[h]=l)}n.constructor={name:r.constructor.name},s.glEnumToString(n,0)}return r}var v=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function _(e){for(var t=0;t<v.length;++t)g(e,v[t])}},function(e,t,r){"use strict";t.__esModule=!0,t.drawBufferInfo=i,t.drawObjectList=function(e,t){var r=null,o=null;t.forEach(function(t){if(!1!==t.active){var a=t.programInfo,s=t.vertexArrayInfo||t.bufferInfo,u=!1,l=void 0===t.type?e.TRIANGLES:t.type;a!==r&&(r=a,e.useProgram(a.program),u=!0),(u||s!==o)&&(o&&o.vertexArrayObject&&!s.vertexArrayObject&&e.bindVertexArray(null),o=s,n.setBuffersAndAttributes(e,a,s)),n.setUniforms(a,t.uniforms),i(e,s,l,t.count,t.offset,t.instanceCount)}}),o.vertexArrayObject&&e.bindVertexArray(null)};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}(r(5));function i(e,t,r,n,i,o){r=void 0===r?e.TRIANGLES:r;var a=t.indices,s=t.elementType,u=void 0===n?t.numElements:n;i=void 0===i?0:i,s||a?void 0!==o?e.drawElementsInstanced(r,u,void 0===s?e.UNSIGNED_SHORT:t.elementType,i,o):e.drawElements(r,u,void 0===s?e.UNSIGNED_SHORT:t.elementType,i):void 0!==o?e.drawArraysInstanced(r,i,u,o):e.drawArrays(r,i,u)}},function(e,t,r){"use strict";t.__esModule=!0,t.bindFramebufferInfo=function(e,t,r){r=r||e.FRAMEBUFFER,t?(e.bindFramebuffer(r,t.framebuffer),e.viewport(0,0,t.width,t.height)):(e.bindFramebuffer(r,null),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight))},t.createFramebufferInfo=function(e,t,r,o){var f=e.FRAMEBUFFER,c=e.createFramebuffer();e.bindFramebuffer(f,c),r=r||e.drawingBufferWidth,o=o||e.drawingBufferHeight;var h=0,d={framebuffer:c,attachments:[],width:r,height:o};return(t=t||s).forEach(function(t){var s=t.attachment,c=t.format,p=function(e){return u[e]}(c);if(p||(p=a+h++),!s)if(function(e){return l[e]}(c))s=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s),e.renderbufferStorage(e.RENDERBUFFER,c,r,o);else{var m=Object.assign({},t);m.width=r,m.height=o,void 0===m.auto&&(m.auto=!1,m.min=m.min||m.minMag||e.LINEAR,m.mag=m.mag||m.minMag||e.LINEAR,m.wrapS=m.wrapS||m.wrap||e.CLAMP_TO_EDGE,m.wrapT=m.wrapT||m.wrap||e.CLAMP_TO_EDGE),s=n.createTexture(e,m)}if(i.isRenderbuffer(e,s))e.framebufferRenderbuffer(f,p,e.RENDERBUFFER,s);else{if(!i.isTexture(e,s))throw"unknown attachment type";e.framebufferTexture2D(f,p,t.texTarget||e.TEXTURE_2D,s,t.level||0)}d.attachments.push(s)}),d},t.resizeFramebufferInfo=function(e,t,r,o,a){o=o||e.drawingBufferWidth,a=a||e.drawingBufferHeight,t.width=o,t.height=a,(r=r||s).forEach(function(r,s){var u=t.attachments[s],l=r.format;if(i.isRenderbuffer(e,u))e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,l,o,a);else{if(!i.isTexture(e,u))throw"unknown attachment type";n.resizeTexture(e,u,r,o,a)}})};var n=o(r(8)),i=o(r(0));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}var a=36064,s=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],u={};u[34041]=33306,u[6401]=36128,u[36168]=36128,u[6402]=36096,u[33189]=36096;var l={};l[32854]=!0,l[32855]=!0,l[36194]=!0,l[34041]=!0,l[33189]=!0,l[6401]=!0,l[36168]=!0},function(e,t,r){"use strict";t.__esModule=!0,t.createVertexArrayInfo=function(e,t,r){var i=e.createVertexArray();e.bindVertexArray(i),t.length||(t=[t]);return t.forEach(function(t){n.setBuffersAndAttributes(e,t,r)}),e.bindVertexArray(null),{numElements:r.numElements,elementType:r.elementType,vertexArrayObject:i}},t.createVAOAndSetAttributes=i,t.createVAOFromBufferInfo=function(e,t,r){return i(e,t.attribSetters||t,r.attribs,r.indices)};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}(r(5));function i(e,t,r,i){var o=e.createVertexArray();return e.bindVertexArray(o),n.setAttributes(t,r),i&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),e.bindVertexArray(null),o}}])})},function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(21),o=r(10);o.inherits=r(8);var a=r(32),s=r(22);o.inherits(c,a);for(var u=n(s.prototype),l=0;l<u.length;l++){var f=u[l];c.prototype[f]||(c.prototype[f]=s.prototype[f])}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||i(d,this)}function d(e){e.end()}},function(e,t,r){"use strict";for(var n=r(0),i=r(3),o=r(17),a=r(1),s=new Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;function l(){a.call(this,"utf-8 decode"),this.leftOver=null}function f(){a.call(this,"utf-8 encode")}t.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),a=0,o=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),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}(e)},t.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,u=new Array(2*a);for(r=0,t=0;t<a;)if((i=e[t++])<128)u[r++]=i;else if((o=s[i])>4)u[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&t<a;)i=i<<6|63&e[t++],o--;o>1?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(l,a),l.prototype.processChunk=function(e){var r=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=r;(r=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),r.set(o,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var a=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?t:0===r?t:r+s[e[r]]>t?r:t}(r),u=r;a!==r.length&&(i.uint8array?(u=r.subarray(0,a),this.leftOver=r.subarray(a,r.length)):(u=r.slice(0,a),this.leftOver=r.slice(a,r.length))),this.push({data:t.utf8decode(u),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=l,n.inherits(f,a),f.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=f},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:r(91),e.exports={Promise:n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.printerPixelsX=1920,t.printerPixelsY=1080,t.printerSizeX=96,t.printerSizeY=54,t.printerSliceThickness=.05,t.printerSliceSubsampling=1,t.sliceColor=[255,255,255],t.lineWidthTop=1,t.lineWidthBottom=1,t.offscreenMultisampling=8},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToColor=t.colorToString=t.composeTransformations=t.degToRad=void 0;var n=r(5);t.degToRad=function(e){return e*Math.PI/180},t.composeTransformations=function(){let e=n.m4.identity();for(let t=arguments.length-1;t>=0;t--)e=n.m4.multiply(e,arguments[t]);return e},t.colorToString=function([e,t,r]){function n(e){return e.length<2?"0"+e:e}return n(e.toString(16))+n(t.toString(16))+n(r.toString(16))},t.stringToColor=function(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}},function(e,t,r){e.exports=i;var n=r(15).EventEmitter;function i(){n.call(this)}r(8)(i,n),i.Readable=r(67),i.Writable=r(73),i.Duplex=r(74),i.Transform=r(75),i.PassThrough=r(76),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",l),e.on("error",l),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,a,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(o(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1),a=(l=r.slice()).length,u=0;u<a;u++)l[u].apply(this,s);return!0},r.prototype.addListener=function(e,t){var a;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(a=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&a>0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,o,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(r=this._events[e]).length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,l=[],f=!1,c=-1;function h(){f&&u&&(f=!1,u.length?l=u.concat(l):c=-1,l.length&&d())}function d(){if(!f){var e=s(h);f=!0;for(var t=l.length;t;){for(u=l,l=[];++c<t;)u&&u[c].run();c=-1,t=l.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||f||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";(function(t){e.exports={isNode:void 0!==t,newBufferFrom:function(e,r){return new t(e,r)},allocBuffer:function(e){return t.alloc?t.alloc(e):new t(e)},isBuffer:function(e){return t.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}}).call(this,r(2).Buffer)},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.centerModel=t.rotateModel=t.getModelMatrix=t.getModelBounds=t.getModelData=t.loadModel=t.loadParsedSTL=void 0;var n=r(5),i=s(r(12)),o=s(r(20)),a=r(13);function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}let u=null,l=null,f=n.m4.identity();function c(e){const t=e.a_position.data;u=e,f=n.m4.identity();let r={x_min:Number.MAX_VALUE,y_min:Number.MAX_VALUE,z_min:Number.MAX_VALUE,x_max:-1*Number.MAX_VALUE,y_max:-1*Number.MAX_VALUE,z_max:-1*Number.MAX_VALUE};for(let e=0;e<t.length;e+=3)r.x_min=Math.min(r.x_min,t[e+0]),r.x_max=Math.max(r.x_max,t[e+0]),r.y_min=Math.min(r.y_min,t[e+1]),r.y_max=Math.max(r.y_max,t[e+1]),r.z_min=Math.min(r.z_min,t[e+2]),r.z_max=Math.max(r.z_max,t[e+2]);l=r}function h(e){const t={x:n.m4.rotateX,y:n.m4.rotateY,z:n.m4.rotateZ};f=t[e](f,Math.PI/2)}function d(){const e=-1*(l.x_min+l.x_max)/2,t=-1*(l.y_min+l.y_max)/2,r=-1*(l.z_min+l.z_max)/2,s=n.m4.translation([e,t,r]),u=n.m4.setTranslation(f,[0,0,0]),c=-.5*o.getPlaneNormalVector()[2]*i.printerSizeY,h=[(l.x_max-l.x_min)/2,(l.y_max-l.y_min)/2,(l.z_max-l.z_min)/2],d=n.m4.transformPoint(u,h),p=c+Math.abs(d[1]),m=n.m4.translation([0,p,0]);f=(0,a.composeTransformations)(s,u,m)}const p={a_position:{numComponents:3,data:new Float32Array([0,0,0,0,15,0,3,0,0,0,15,0,3,15,0,3,0,0,3,0,0,3,3,0,10,0,0,3,3,0,10,3,0,10,0,0,3,6,0,3,9,0,6.7,6,0,3,9,0,6.7,9,0,6.7,6,0,0,0,3,3,0,3,0,15,3,0,15,3,3,0,3,3,15,3,3,0,3,10,0,3,3,3,3,3,3,3,10,0,3,10,3,3,3,6,3,6.7,6,3,3,9,3,3,9,3,6.7,6,3,6.7,9,3,0,0,0,10,0,0,10,0,3,0,0,0,10,0,3,0,0,3,10,0,0,10,3,0,10,3,3,10,0,0,10,3,3,10,0,3,3,3,0,3,3,3,10,3,3,3,3,0,10,3,3,10,3,0,3,3,0,3,6,3,3,3,3,3,3,0,3,6,0,3,6,3,3,6,0,6.7,6,3,3,6,3,3,6,0,6.7,6,0,6.7,6,3,6.7,6,0,6.7,9,3,6.7,6,3,6.7,6,0,6.7,9,0,6.7,9,3,3,9,0,3,9,3,6.7,9,3,3,9,0,6.7,9,3,6.7,9,0,3,9,0,3,15,3,3,9,3,3,9,0,3,15,0,3,15,3,0,15,0,0,15,3,3,15,3,0,15,0,3,15,3,3,15,0,0,0,0,0,0,3,0,15,3,0,0,0,0,15,3,0,15,0])},a_normal:{numComponents:3,data:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0])}};t.loadParsedSTL=function(e){const t=e.positions.length,r=e.cells.length,n={a_position:{numComponents:3,data:new Float32Array(3*t)},a_normal:{numComponents:3,data:new Float32Array(3*t)}};if(e.vertexNormals)for(let t=0;t<r;t++)for(let r=0;r<3;r++){const[i,o,a]=e.positions[e.cells[t][r]],[s,u,l]=e.vertexNormals[e.cells[t][r]];n.a_position.data[9*t+3*r+0]=i,n.a_position.data[9*t+3*r+1]=o,n.a_position.data[9*t+3*r+2]=a,n.a_normal.data[9*t+3*r+0]=s,n.a_normal.data[9*t+3*r+1]=u,n.a_normal.data[9*t+3*r+2]=l}else for(let t=0;t<r;t++){const[r,i,o]=e.faceNormals[t];for(let a=0;a<3;a++){const[s,u,l]=e.positions[e.cells[t][a]];n.a_position.data[9*t+3*a+0]=s,n.a_position.data[9*t+3*a+1]=u,n.a_position.data[9*t+3*a+2]=l,n.a_normal.data[9*t+3*a+0]=r,n.a_normal.data[9*t+3*a+1]=i,n.a_normal.data[9*t+3*a+2]=o}}c(n)},t.loadModel=c,t.getModelData=function(){return u||(c(p),h("x"),h("x"),d()),u},t.getModelBounds=function(){return l},t.getModelMatrix=function(){return f},t.rotateModel=h,t.centerModel=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.update=t.loadNextSlice=t.setSlicePosition=t.getSliceMatrix=t.getViewMatrix=t.getPlaneData=t.setPlaneAngle=t.getPlaneNormalVector=t.getPlaneMatrix=void 0;var n=r(5),i=a(r(12)),o=a(r(19));r(13);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}let s=0,u=.5,l=0,f=0,c=0;function h(){const e=n.m4.rotationX(-1*s);return n.m4.scale(e,[1,-1,1])}t.getPlaneMatrix=h,t.getPlaneNormalVector=function(){return[0,Math.sin(s),Math.cos(s)]},t.setPlaneAngle=function(e){s=e},t.getPlaneData=function(){const e=.5*i.printerSizeX,t=.5*i.printerSizeY;return{a_position:{numComponents:3,data:new Float32Array([e,t,0,-e,t,0,-e,-t,0,e,-t,0])},a_normal:{numComponents:3,data:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},indices:{numComponents:3,data:[0,1,2,2,3,0]}}},t.getViewMatrix=function(){return n.m4.inverse(h())},t.getSliceMatrix=function(e=0){const t=u-e*(l/i.printerSliceSubsampling),r=(1-t)*c+t*f;return n.m4.translation([0,0,r])},t.setSlicePosition=function(e){u=e},t.loadNextSlice=function(){return(u+=l)>1&&(u=1),u<1},t.update=function(){const e=o.getModelMatrix(),t=o.getModelBounds(),r=[[t.x_min,t.y_min,t.z_min],[t.x_min,t.y_min,t.z_max],[t.x_min,t.y_max,t.z_min],[t.x_min,t.y_max,t.z_max],[t.x_max,t.y_min,t.z_min],[t.x_max,t.y_min,t.z_max],[t.x_max,t.y_max,t.z_min],[t.x_max,t.y_max,t.z_max]].map(t=>n.m4.transformPoint(e,t)),a=Math.min(...r.map(e=>e[1])),h=Math.max(...r.map(e=>e[1])),d=Math.min(...r.map(e=>e[2])),p=Math.max(...r.map(e=>e[2]));f=-1*(p+h*Math.tan(s)),c=-1*(d+a*Math.tan(s)),l=i.printerSliceThickness/(c-f)/Math.cos(s);const m=Math.floor(1/l);document.getElementById("slice_number").innerText=`Slice ${Math.floor(u*m)}`,document.getElementById("slice_info").innerText=`${m} slices total`}},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports=function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}:e.exports=t.nextTick}).call(this,r(16))},function(e,t,r){"use strict";(function(t,n){e.exports=d;var i=r(21),o=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:i,a=r(2).Buffer;d.WritableState=h;var s=r(10);s.inherits=r(8);var u,l={deprecate:r(71)};!function(){try{u=r(14)}catch(e){}finally{u||(u=r(15).EventEmitter)}}();var f;a=r(2).Buffer;function c(){}function h(e,t){f=f||r(6),e=e||{},this.objectMode=!!e.objectMode,t instanceof f&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,a=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?i(o,n):o(n);e._writableState.errorEmitted=!0,e.emit("error",n)}(e,r,n,t,a);else{var s=v(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||g(e,r),n?o(m,e,r,s,a):m(e,r,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new b(this),this.corkedRequestsFree.next=new b(this)}function d(e){if(f=f||r(6),!(this instanceof d||this instanceof f))return new d(e);this._writableState=new h(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),u.call(this)}function p(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function m(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),y(e,t)}function g(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0;r;)i[a]=r,r=r.next,a+=1;p(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,t.corkedRequestsFree=o.next,o.next=null}else{for(;r;){var s=r.chunk,u=r.encoding,l=r.callback;if(p(e,t,!1,t.objectMode?1:s.length,s,u,l),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function y(e,t){var r=v(t);return r&&(0===t.pendingcb?(_(e,t),t.finished=!0,e.emit("finish")):_(e,t)),r}function b(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}s.inherits(d,u),h.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(h.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}(),d.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},d.prototype.write=function(e,t,r){var n=this._writableState,o=!1;return"function"==typeof t&&(r=t,t=null),a.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=c),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i(t,r)}(this,r):function(e,t,r,n){var o=!0;if(!a.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),i(n,s),o=!1}return o}(this,n,e,r)&&(n.pendingcb++,o=function(e,t,r,n,i){r=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=new a(t,r)),t}(t,r,n),a.isBuffer(r)&&(n="buffer");var o=t.objectMode?1:r.length;t.length+=o;var s=t.length<t.highWaterMark;s||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest=new function(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}(r,n,i),u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else p(e,t,!1,o,r,n,i);return s}(this,n,e,t,r)),o},d.prototype.cork=function(){this._writableState.corked++},d.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||g(this,e))},d.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e},d.prototype._write=function(e,t,r){r(new Error("not implemented"))},d.prototype._writev=null,d.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,y(e,t),r&&(t.finished?i(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)}}).call(this,r(16),r(69).setImmediate)},function(e,t,r){"use strict";e.exports=a;var n=r(6),i=r(10);function o(e){this.afterTransform=function(t,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r);i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState=new o(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){s(t,e)}):s(t)})}function s(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}i.inherits=r(8),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){e.exports=!r(38)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";var n=r(11),i=r(42),o=r(43),a=r(44);o=r(43);function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new a).pipe(new o("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},e.exports=s},function(e,t,r){"use strict";var n=r(0);var i=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,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},function(e,t,r){"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"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.drawOffscreenRender=t.renderOffscreen=t.render3d=t.loadModels=t.update=t.init=t.camera=void 0;var n=c(r(5)),i=c(r(12)),o=c(r(118)),a=c(r(119)),s=c(r(19)),u=c(r(20)),l=r(13),f=r(120);function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}const h=n.m4;let d=null,p=null,m=null,g=null,v=null,_=null,y=null,b=null,w={framebuffer:null,colorbuffer:null,depthstencil:null},E={framebuffer:null,colorbuffer:null};const x=1,A=3e3,T=t.camera=new f.Camera;function S(){const e=Math.hypot(i.printerSizeX,i.printerSizeY);T.setRadius(1.5*e),m.bindFramebuffer(m.FRAMEBUFFER,w.framebuffer),w.framebuffer.width=i.printerPixelsX,w.framebuffer.height=i.printerPixelsY,w.colorbuffer&&m.deleteRenderbuffer(w.colorbuffer),w.colorbuffer=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,w.colorbuffer),m.renderbufferStorageMultisample(m.RENDERBUFFER,i.offscreenMultisampling,m.RGBA4,i.printerPixelsX,i.printerPixelsY),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,w.colorbuffer),w.depthstencil&&m.deleteRenderbuffer(w.depthstencil),w.depthstencil=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,w.depthstencil),m.renderbufferStorageMultisample(m.RENDERBUFFER,i.offscreenMultisampling,m.DEPTH24_STENCIL8,i.printerPixelsX,i.printerPixelsY),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,w.depthstencil),m.bindFramebuffer(m.FRAMEBUFFER,E.framebuffer),E.framebuffer.width=i.printerPixelsX,E.framebuffer.height=i.printerPixelsY,E.colorbuffer&&m.deleteRenderbuffer(E.colorbuffer),E.colorbuffer=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,E.colorbuffer),m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,i.printerPixelsX,i.printerPixelsY),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,E.colorbuffer),m.bindFramebuffer(m.FRAMEBUFFER,null),R()}function R(){y=n.createBufferInfoFromArrays(m,s.getModelData()),b=n.createBufferInfoFromArrays(m,u.getPlaneData())}t.init=function(e,t){p=t,(m=(d=e).getContext("webgl2"))||alert("Error: WebGL 2 not supported by your browser!"),document.getElementById("webgl_version").innerText=m.getParameter(m.VERSION),g=p.getContext("2d"),v=n.createProgramInfo(m,[o.vs3d,o.fs3d]),_=n.createProgramInfo(m,[o.vsSlice,o.fsSlice]),w.framebuffer=m.createFramebuffer(),E.framebuffer=m.createFramebuffer(),d.onmousedown=a.mousedownCallback,d.onmouseup=a.mouseupCallback,d.onmousemove=a.mousemoveCallback,d.onmouseleave=a.mouseleaveCallback,d.onwheel=a.wheelCallback,d.oncontextmenu=a.contextmenuCallback,p.oncontextmenu=a.contextmenuCallback,S(),u.update()},t.update=S,t.loadModels=R,t.render3d=function(e){m.bindFramebuffer(m.FRAMEBUFFER,null),m.viewport(0,0,m.canvas.width,m.canvas.height);const t=m.canvas.clientWidth/m.canvas.clientHeight;m.useProgram(v.program),m.clearColor(0,0,0,1),m.clear(m.COLOR_BUFFER_BIT|m.DEPTH_BUFFER_BIT),m.enable(m.DEPTH_TEST),m.disable(m.STENCIL_TEST),m.enable(m.CULL_FACE),m.enable(m.BLEND),m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA),n.setBuffersAndAttributes(m,v,y);const r=s.getModelMatrix(e),i=u.getSliceMatrix(),o=T.viewMatrix(),a=h.perspective((0,l.degToRad)(45),t,x,A);n.setUniforms(v,{u_modelViewProjection:(0,l.composeTransformations)(r,i,o,a),u_modelInverseTranspose:h.transpose(h.inverse(r)),u_light:n.v3.normalize(T.vector()),u_alpha:1}),n.drawBufferInfo(m,y),m.disable(m.CULL_FACE),n.setBuffersAndAttributes(m,v,b);const f=u.getPlaneMatrix();n.setUniforms(v,{u_modelViewProjection:(0,l.composeTransformations)(f,o,a),u_modelInverseTranspose:h.transpose(h.inverse(f)),u_light:u.getPlaneNormalVector(),u_alpha:.5}),n.drawBufferInfo(m,b)},t.renderOffscreen=function(e){m.bindFramebuffer(m.FRAMEBUFFER,w.framebuffer),m.viewport(0,0,w.framebuffer.width,w.framebuffer.height),m.useProgram(_.program),m.disable(m.DEPTH_TEST),m.disable(m.CULL_FACE),m.enable(m.BLEND),m.blendFunc(m.ONE,m.ONE),m.clearColor(0,0,0,1),m.clear(m.COLOR_BUFFER_BIT|m.DEPTH_BUFFER_BIT),n.setBuffersAndAttributes(m,_,y);const t=s.getModelMatrix(e),r=u.getViewMatrix(),o=.5*i.printerSizeX,a=.5*i.printerSizeY,f=h.ortho(-1*o,o,-1*a,a,0,1e6);n.setUniforms(_,{u_r:i.sliceColor[0]/255/i.printerSliceSubsampling,u_g:i.sliceColor[1]/255/i.printerSliceSubsampling,u_b:i.sliceColor[2]/255/i.printerSliceSubsampling});for(let e=0;e<i.printerSliceSubsampling;e++){const i=u.getSliceMatrix(2*e);n.setUniforms(_,{u_modelViewProjection:(0,l.composeTransformations)(t,i,r,f)}),m.clear(m.STENCIL_BUFFER_BIT),m.colorMask(!1,!1,!1,!1),m.enable(m.STENCIL_TEST),m.stencilFunc(m.ALWAYS,0,255),m.stencilOpSeparate(m.FRONT,m.KEEP,m.KEEP,m.INCR_WRAP),m.stencilOpSeparate(m.BACK,m.KEEP,m.KEEP,m.DECR_WRAP),n.drawBufferInfo(m,y),m.colorMask(!0,!0,!0,!0),m.stencilFunc(m.NOTEQUAL,0,255),m.stencilOp(m.KEEP,m.KEEP,m.KEEP),n.drawBufferInfo(m,y)}m.bindFramebuffer(m.READ_FRAMEBUFFER,w.framebuffer),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,E.framebuffer),m.blitFramebuffer(0,0,w.framebuffer.width,w.framebuffer.height,0,0,E.framebuffer.width,E.framebuffer.height,m.COLOR_BUFFER_BIT,m.NEAREST);const c=document.createElement("canvas");c.width=i.printerPixelsX,c.height=i.printerPixelsY;const d=c.getContext("2d"),p=d.createImageData(i.printerPixelsX,i.printerPixelsY),g=new Uint8Array(p.data.buffer);return m.bindFramebuffer(m.FRAMEBUFFER,E.framebuffer),m.readPixels(0,0,w.framebuffer.width,w.framebuffer.height,m.RGBA,m.UNSIGNED_BYTE,g),d.putImageData(p,0,0),c},t.drawOffscreenRender=function(e){const t=p.width/i.printerPixelsX,r=p.height/i.printerPixelsY,n=Math.min(t,r),o=Math.floor(n*i.printerPixelsX),a=Math.floor(n*i.printerPixelsY),s=new Image;s.onload=function(){g.imageSmoothingEnabled=!1,g.clearRect(0,0,p.width,p.height),g.setTransform(1,0,0,1,0,0),g.scale(n,n),g.drawImage(s,0,0),g.setTransform(1,0,0,1,0,0),g.strokeStyle="#FF0000",g.lineWidth=5,g.strokeRect(0,0,o,a)},e.toBlob(e=>{s.src=URL.createObjectURL(e)})}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){e.exports=r(14)},function(e,t,r){"use strict";(function(t){e.exports=p;var n=r(21),i=r(30),o=r(2).Buffer;p.ReadableState=d;r(15);var a,s=function(e,t){return e.listeners(t).length};!function(){try{a=r(14)}catch(e){}finally{a||(a=r(15).EventEmitter)}}();o=r(2).Buffer;var u=r(10);u.inherits=r(8);var l,f,c=r(68),h=void 0;function d(e,t){f=f||r(6),e=e||{},this.objectMode=!!e.objectMode,t instanceof f&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(33).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function p(e){if(f=f||r(6),!(this instanceof p))return new p(e);this._readableState=new d(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),a.call(this)}function m(e,t,r,i,a){var s=function(e,t){var r=null;o.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(s)e.emit("error",s);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,_(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!a){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&a){u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var l;!t.decoder||a||i||(r=t.decoder.write(r),l=!t.objectMode&&0===r.length),a||(t.reading=!1),l||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,a?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&_(e))),function(e,t){t.readingMore||(t.readingMore=!0,n(b,e,t))}(e,t)}else a||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}h=c&&c.debuglog?c.debuglog("stream"):function(){},u.inherits(p,a),p.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding)!==r.encoding&&(e=new o(e,t),t=""),m(this,r,e,t,!1)},p.prototype.unshift=function(e){return m(this,this._readableState,e,"",!0)},p.prototype.isPaused=function(){return!1===this._readableState.flowing},p.prototype.setEncoding=function(e){return l||(l=r(33).StringDecoder),this._readableState.decoder=new l(e),this._readableState.encoding=e,this};var g=8388608;function v(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=g?e=g:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function _(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n(y,e):y(e))}function y(e){h("emit readable"),e.emit("readable"),x(e)}function b(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function w(e){h("readable nexttick read 0"),e.read(0)}function E(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,e.emit("resume"),x(e),t.flowing&&!t.reading&&e.read(0)}function x(e){var t=e._readableState;if(h("flow",t.flowing),t.flowing)do{var r=e.read()}while(null!==r&&t.flowing)}function A(e,t){var r,n=t.buffer,i=t.length,a=!!t.decoder,s=!!t.objectMode;if(0===n.length)return null;if(0===i)r=null;else if(s)r=n.shift();else if(!e||e>=i)r=a?n.join(""):1===n.length?n[0]:o.concat(n,i),n.length=0;else{if(e<n[0].length)r=(c=n[0]).slice(0,e),n[0]=c.slice(e);else if(e===n[0].length)r=n.shift();else{r=a?"":new o(e);for(var u=0,l=0,f=n.length;l<f&&u<e;l++){var c=n[0],h=Math.min(e-u,c.length);a?r+=c.slice(0,h):c.copy(r,u,0,h),h<c.length?n[0]=c.slice(h):n.shift(),u+=h}}}return r}function T(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,n(S,t,e))}function S(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}p.prototype.read=function(e){h("read",e);var t=this._readableState,r=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):_(this),null;if(0===(e=v(e,t))&&t.ended)return 0===t.length&&T(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),(t.ended||t.reading)&&h("reading or ended",i=!1),i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=v(r,t)),null===(n=e>0?A(e,t):null)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&T(this),null!==n&&this.emit("data",n),n},p.prototype._read=function(e){this.emit("error",new Error("not implemented"))},p.prototype.pipe=function(e,r){var o=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,r);var u=(!r||!1!==r.end)&&e!==t.stdout&&e!==t.stderr?f:p;function l(e){h("onunpipe"),e===o&&p()}function f(){h("onend"),e.end()}a.endEmitted?n(u):o.once("end",u),e.on("unpipe",l);var c=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,x(e))}}(o);e.on("drain",c);var d=!1;function p(){h("cleanup"),e.removeListener("close",v),e.removeListener("finish",_),e.removeListener("drain",c),e.removeListener("error",g),e.removeListener("unpipe",l),o.removeListener("end",f),o.removeListener("end",p),o.removeListener("data",m),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||c()}function m(t){h("ondata"),!1===e.write(t)&&(1!==a.pipesCount||a.pipes[0]!==e||1!==o.listenerCount("data")||d||(h("false write response, pause",o._readableState.awaitDrain),o._readableState.awaitDrain++),o.pause())}function g(t){h("onerror",t),y(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",_),y()}function _(){h("onfinish"),e.removeListener("close",v),y()}function y(){h("unpipe"),o.unpipe(e)}return o.on("data",m),e._events&&e._events.error?i(e._events.error)?e._events.error.unshift(g):e._events.error=[g,e._events.error]:e.on("error",g),e.once("close",v),e.once("finish",_),e.emit("pipe",o),a.flowing||(h("pipe resume"),o.resume()),e},p.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},p.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&!this._readableState.endEmitted){var i=this._readableState;i.readableListening||(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading?i.length&&_(this):n(w,this))}return r},p.prototype.addListener=p.prototype.on,p.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n(E,e,t))}(this,e)),this},p.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},p.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",function(){if(h("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){(h("wrapped data"),t.decoder&&(i=t.decoder.write(i)),!t.objectMode||null!==i&&void 0!==i)&&((t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause())))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(["error","close","destroy","pause","resume"],function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},n},p._fromList=A}).call(this,r(16))},function(e,t,r){"use strict";var n=r(72).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=c,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=o;var n=r(23),i=r(10);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(8),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n=r(0),i=r(3),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.encode=function(e){for(var t,r,i,a,s,u,l,f=[],c=0,h=e.length,d=h,p="string"!==n.getTypeOf(e);c<e.length;)d=h-c,p?(t=e[c++],r=c<h?e[c++]:0,i=c<h?e[c++]:0):(t=e.charCodeAt(c++),r=c<h?e.charCodeAt(c++):0,i=c<h?e.charCodeAt(c++):0),a=t>>2,s=(3&t)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,l=d>2?63&i:64,f.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(l));return f.join("")},t.decode=function(e){var t,r,n,a,s,u,l=0,f=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var c,h=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&h--,e.charAt(e.length-2)===o.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(c=i.uint8array?new Uint8Array(0|h):new Array(0|h);l<e.length;)t=o.indexOf(e.charAt(l++))<<2|(a=o.indexOf(e.charAt(l++)))>>4,r=(15&a)<<4|(s=o.indexOf(e.charAt(l++)))>>2,n=(3&s)<<6|(u=o.indexOf(e.charAt(l++))),c[f++]=t,64!==s&&(c[f++]=r),64!==u&&(c[f++]=n);return c}},function(e,t){var r=e.exports={version:"2.3.0"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(80);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(24),i=r(18).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(93),o=r(1),a=r(35),s=r(3),u=r(11),l=null;if(s.nodestream)try{l=r(94)}catch(e){}function f(e,r){return new u.Promise(function(i,o){var s=[],u=e._internalType,l=e._outputType,f=e._mimeType;e.on("data",function(e,t){s.push(e),r&&r(t)}).on("error",function(e){s=[],o(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),r);case"base64":return a.encode(t);default:return n.transformTo(e,t)}}(l,function(e,r){var n,i=0,o=null,a=0;for(n=0;n<r.length;n++)a+=r[n].length;switch(e){case"string":return r.join("");case"array":return Array.prototype.concat.apply([],r);case"uint8array":for(o=new Uint8Array(a),n=0;n<r.length;n++)o.set(r[n],i),i+=r[n].length;return o;case"nodebuffer":return t.concat(r);default:throw new Error("concat : unsupported type '"+e+"'")}}(u,s),f);i(e)}catch(e){o(e)}s=[]}).resume()})}function c(e,t,r){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=r,n.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){return f(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){n.delay(t,arguments,r)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},e)}},e.exports=c}).call(this,r(2).Buffer)},function(e,t,r){"use strict";t.base64=!1,t.binary=!1,t.dir=!1,t.createFolders=!0,t.date=null,t.compression=null,t.compressionOptions=null,t.comment=null,t.unixPermissions=null,t.dosPermissions=null},function(e,t,r){"use strict";var n=r(0),i=r(1);function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},function(e,t,r){"use strict";var n=r(0),i=r(1);function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},e.exports=o},function(e,t,r){"use strict";var n=r(1),i=r(27);function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r(0).inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},e.exports=o},function(e,t,r){"use strict";var n=r(1);t.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},t.DEFLATE=r(97)},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=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,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var n=r(4),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65537&&(e.subarray&&o||!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,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),a=0,o=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),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 u(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,o,s=t||e.length,l=new Array(2*s);for(n=0,r=0;r<s;)if((i=e[r++])<128)l[n++]=i;else if((o=a[i])>4)l[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<s;)i=i<<6|63&e[r++],o--;o>1?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return u(l,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?t:0===r?t:r+a[e[r]]>t?r:t}},function(e,t,r){"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}},function(e,t,r){"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}},function(e,t,r){"use strict";t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\b"},function(e,t,r){"use strict";var n=r(0),i=r(3),o=r(53),a=r(111),s=r(112),u=r(55);e.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new u(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},function(e,t,r){"use strict";var n=r(54);function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}r(0).inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=i},function(e,t,r){"use strict";var n=r(0);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},e.exports=i},function(e,t,r){"use strict";var n=r(53);function i(e){n.call(this,e)}r(0).inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=i},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,r){e.exports=r(58)},function(e,t,r){"use strict";(function(e){var t=m(r(5)),n=p(r(61)),i=p(r(64)),o=p(r(65)),a=p(r(114)),s=r(115);r(117);var u=m(r(29)),l=m(r(12)),f=m(r(19)),c=m(r(20)),h=m(r(121)),d=r(13);function p(e){return e&&e.__esModule?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}const g=document.getElementById("render_canvas"),v=document.getElementById("slice_canvas");let _=0,y=0,b=!0;function w(){if((_+=1)>10){const e=Date.now(),t=_/((e-y)/1e3);y=e,_=0,document.getElementById("webgl_fps").innerText=`[${t} fps]`}if(t.resizeCanvasToDisplaySize(g),t.resizeCanvasToDisplaySize(v),u.render3d(),b){const e=u.renderOffscreen();u.drawOffscreenRender(e),b=!1}requestAnimationFrame(w)}function E(){const t=document.getElementById("file_type_select").value,r=this.files[0],o=new FileReader;o.onload=function(){if("stl"===t){const t=(0,n.default)(new e(o.result));f.loadParsedSTL(t)}if("obj"===t){const t=(0,i.default)(new e(o.result));f.loadParsedSTL(t)}"line"===t&&(h.parseArrayBuffer(o.result),h.make3dModel()),u.update(),b=!0},o.readAsArrayBuffer(r)}let x=!1;function A(){x?x=!1:(x=!0,async function(){const e=new o.default;document.getElementById("slice_button").innerText="Rendering...",c.setSlicePosition(0),c.update();let t=0;do{document.getElementById("slice_button").innerText=`Rendering ${t} (click to cancel)`;const r=u.renderOffscreen(),n=await new Promise(e=>{r.toBlob(e)}),i=`slices/${t}.png`;e.file(i,n),t+=1}while(x&&c.loadNextSlice());if(x){document.getElementById("slice_button").innerText="Saving...";const t=await e.generateAsync({type:"blob"});return t}}().then(e=>{e&&function(e){const t=document.getElementById("download_popup");a.default.registerDialog(t),document.getElementById("close_button").onclick=function(){t.close()},document.getElementById("download_button").onclick=function(){(0,s.saveAs)(e)},document.getElementById("upload_button").onclick=function(){!function(e){const t=document.getElementById("post_address").value;if(!t)return void(document.getElementById("upload_button").innerText="Please fill out URL below");document.getElementById("upload_button").innerText="Uploading...";const r=new FormData;r.append("file",e),fetch(t,{method:"POST",cache:"no-store",mode:"no-cors",body:r}).then(e=>{e.ok?document.getElementById("upload_button").innerText="Upload successful":document.getElementById("upload_button").innerText=`${e.status} ${e.statusText}`}).catch(e=>{document.getElementById("upload_button").innerText="Error! (see browser console)",console.log(e)})}(e)},document.getElementById("upload_button").innerText="POST to remote address:",t.showModal()}(e),x=!1,document.getElementById("slice_button").innerText="Slice",k(),b=!0}))}function T(){const e=document.getElementById("file_type_select").value;document.getElementById("line_settings").style.display="line"===e?"block":"none"}function S(){l.lineWidthTop=Number(document.getElementById("width_top").value),l.lineWidthBottom=Number(document.getElementById("width_bottom").value),h.make3dModel(),b=!0}function R(){f.centerModel(),c.update(),b=!0}function k(){const e=Number(document.getElementById("slice_slider").value);c.setSlicePosition(e),c.update(),b=!0}function P(){l.printerPixelsX=Number(document.getElementById("printer_pixels_x").value),l.printerPixelsY=Number(document.getElementById("printer_pixels_y").value),l.printerSizeX=Number(document.getElementById("printer_size_x").value),l.printerSizeY=Number(document.getElementById("printer_size_y").value),l.printerSliceThickness=Number(document.getElementById("printer_slice_thickness").value),l.printerSliceSubsampling=Number(document.getElementById("printer_slice_subsampling").value),l.offscreenMultisampling=Number(document.getElementById("printer_slice_multisampling").value);const e=(0,d.degToRad)(Number(document.getElementById("slice_plane_angle").value));c.setPlaneAngle(e),l.sliceColor=(0,d.stringToColor)(document.getElementById("slice_color").value),u.update(),c.update(),b=!0}document.getElementById("width_top").value=l.lineWidthTop,document.getElementById("width_bottom").value=l.lineWidthBottom,document.getElementById("printer_pixels_x").value=l.printerPixelsX,document.getElementById("printer_pixels_y").value=l.printerPixelsY,document.getElementById("printer_size_x").value=l.printerSizeX,document.getElementById("printer_size_y").value=l.printerSizeY,document.getElementById("slice_plane_angle").value="0",document.getElementById("printer_slice_thickness").value=l.printerSliceThickness,document.getElementById("printer_slice_multisampling").value=l.offscreenMultisampling,document.getElementById("printer_slice_subsampling").value=l.printerSliceSubsampling,document.getElementById("slice_color").value=(0,d.colorToString)(l.sliceColor),document.getElementById("file_type_select").onchange=T,document.getElementById("file_upload").onchange=E,document.getElementById("line_settings_button").onclick=S,T(),document.getElementById("rotate_x_button").onclick=function(){f.rotateModel("x")},document.getElementById("rotate_y_button").onclick=function(){f.rotateModel("y")},document.getElementById("rotate_z_button").onclick=function(){f.rotateModel("z")},document.getElementById("center_button").onclick=R,document.getElementById("printer_settings_button").onclick=P,document.getElementById("slice_slider").oninput=k,document.getElementById("slice_button").onclick=A,u.init(g,v),requestAnimationFrame(w)}).call(this,r(2).Buffer)},function(e,t,r){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=l(e),n=r[0],a=r[1],s=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,a)),u=0,f=a>0?n-4:n,c=0;c<f;c+=4)t=i[e.charCodeAt(c)]<<18|i[e.charCodeAt(c+1)]<<12|i[e.charCodeAt(c+2)]<<6|i[e.charCodeAt(c+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=i[e.charCodeAt(c)]<<2|i[e.charCodeAt(c+1)]>>4,s[u++]=255&t);1===a&&(t=i[e.charCodeAt(c)]<<10|i[e.charCodeAt(c+1)]<<4|i[e.charCodeAt(c+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(f(n));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<<l)-1,c=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*m}},function(e,t,r){var n=r(62),i=r(63);e.exports=function(e){return"string"==typeof e?n(e):84+50*e.readUInt32LE(80)===e.length?i(e):n(e)}},function(e,t){e.exports=function(e){"string"!=typeof e&&(e=e.toString());for(var t=[],r=[],n=[],i=null,o=e.split("\n"),a=[],s=0;s<o.length;s++){var u=o[s].trim().split(" ").filter(function(e){return""!==e});switch(u[0]){case"solid":i=u.slice(1).join(" ");break;case"facet":var l=u.slice(2).map(Number);n.push(l);break;case"vertex":var f=u.slice(1).map(Number);a.push(t.length),t.push(f);break;case"endfacet":r.push(a),a=[]}}return{positions:t,cells:r,faceNormals:n,name:i}}},function(e,t){function r(e,t){return[e.readFloatLE(t+0),e.readFloatLE(t+4),e.readFloatLE(t+8)]}e.exports=function(e){var t=80,n=e.readUInt32LE(t);t+=4;for(var i=[],o=[],a=[],s=0;s<n;s++){var u=[],l=r(e,t);t+=12,a.push(l);for(var f=0;f<3;f++){var c=r(e,t);t+=12,u.push(o.length),o.push(c)}i.push(u),t+=2}return{positions:o,cells:i,faceNormals:a}}},function(e,t){function r(e,t){return e>0?e-1:e+t}e.exports=function(e){"string"!=typeof buf&&(e=e.toString());for(var t=e.trim().split("\n"),n=[],i=[],o=[],a=[],s=[],u=[],l=null,f=0;f<t.length;f++){var c=t[f];if("#"!==c[0]){var h=c.trim().replace(/ +/g," ").split(" ");switch(h[0]){case"o":l=h.slice(1).join(" ");break;case"v":var d=h.slice(1).map(Number).slice(0,3);n.push(d);break;case"vt":var p=h.slice(1).map(Number);o.push(p);break;case"vn":var m=h.slice(1).map(Number);a.push(m);break;case"f":var g=[],v=[],_=[];h.slice(1).forEach(function(e){var t=e.split("/").map(function(e){return""===e?NaN:Number(e)});g.push(r(t[0],n.length)),t.length>1&&(isNaN(t[1])||v.push(r(t[1],o.length)),isNaN(t[2])||_.push(r(t[2],a.length)))}),i.push(g),v.length>0&&s.push(v),_.length>0&&u.push(_)}}}var y={positions:n,cells:i};return o.length>0&&(y.vertexUVs=o),s.length>0&&(y.faceUVs=s),a.length>0&&(y.vertexNormals=a),u.length>0&&(y.faceNormals=u),null!==l&&(y.name=l),y}},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}n.prototype=r(66),n.prototype.loadAsync=r(109),n.support=r(3),n.defaults=r(41),n.version="3.1.5",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=r(11),e.exports=n},function(e,t,r){"use strict";var n=r(7),i=r(0),o=r(1),a=r(40),s=r(41),u=r(26),l=r(95),f=r(96),c=r(17),h=r(108),d=function(e,t,r){var n,a=i.getTypeOf(t),f=i.extend(r||{},s);f.date=f.date||new Date,null!==f.compression&&(f.compression=f.compression.toUpperCase()),"string"==typeof f.unixPermissions&&(f.unixPermissions=parseInt(f.unixPermissions,8)),f.unixPermissions&&16384&f.unixPermissions&&(f.dir=!0),f.dosPermissions&&16&f.dosPermissions&&(f.dir=!0),f.dir&&(e=m(e)),f.createFolders&&(n=p(e))&&g.call(this,n,!0);var d="string"===a&&!1===f.binary&&!1===f.base64;r&&void 0!==r.binary||(f.binary=!d),(t instanceof u&&0===t.uncompressedSize||f.dir||!t||0===t.length)&&(f.base64=!1,f.binary=!0,t="",f.compression="STORE",a="string");var v=null;v=t instanceof u||t instanceof o?t:c.isNode&&c.isStream(t)?new h(e,t):i.prepareContent(e,t,f.binary,f.optimizedBinaryString,f.base64);var _=new l(e,v,f);this.files[e]=_},p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:s.createFolders,e=m(e),this.files[e]||d.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function v(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n))},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1===arguments.length){if(v(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,d.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(v(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=i.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");i.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var s=r.comment||this.comment||"";t=f.generateWorker(this,r,s)}catch(e){(t=new o("error")).error(e)}return new a(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};e.exports=_},function(e,t,r){var n=function(){try{return r(14)}catch(e){}}();(t=e.exports=r(32)).Stream=n||t,t.Readable=t,t.Writable=r(22),t.Duplex=r(6),t.Transform=r(23),t.PassThrough=r(34)},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(70),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(9))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i=1,o={},a=!1,s=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?function(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"==typeof r.data&&0===r.data.indexOf(t)&&f(+r.data.slice(t.length))};e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),n=function(r){e.postMessage(t+r,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},n=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;n=function(t){var r=s.createElement("script");r.onreadystatechange=function(){f(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r)}}():n=function(e){setTimeout(f,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var a={callback:e,args:t};return o[i]=a,n(i),i++},u.clearImmediate=l}function l(e){delete o[e]}function f(e){if(a)setTimeout(f,0,e);else{var t=o[e];if(t){a=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}(t)}finally{l(e),a=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(9),r(16))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(9))},function(e,t,r){var n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){e.exports=r(22)},function(e,t,r){e.exports=r(6)},function(e,t,r){e.exports=r(23)},function(e,t,r){e.exports=r(34)},function(e,t,r){r(78),e.exports=r(36).setImmediate},function(e,t,r){var n=r(79),i=r(87);n(n.G+n.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,r){var n=r(18),i=r(36),o=r(37),a=r(81),s=function(e,t,r){var u,l,f,c=e&s.F,h=e&s.G,d=e&s.S,p=e&s.P,m=e&s.B,g=e&s.W,v=h?i:i[t]||(i[t]={}),_=v.prototype,y=h?n:d?n[t]:(n[t]||{}).prototype;for(u in h&&(r=t),r)(l=!c&&y&&void 0!==y[u])&&u in v||(f=l?y[u]:r[u],v[u]=h&&"function"!=typeof y[u]?r[u]:m&&l?o(f,n):g&&y[u]==f?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):p&&"function"==typeof f?o(Function.call,f):f,p&&((v.virtual||(v.virtual={}))[u]=f,e&s.R&&_&&!_[u]&&a(_,u,f)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var n=r(82),i=r(86);e.exports=r(25)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(83),i=r(84),o=r(85),a=Object.defineProperty;t.f=r(25)?Object.defineProperty:function(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(24);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){e.exports=!r(25)&&!r(38)(function(){return 7!=Object.defineProperty(r(39)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(24);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n,i,o,a=r(37),s=r(88),u=r(89),l=r(39),f=r(18),c=f.process,h=f.setImmediate,d=f.clearImmediate,p=f.MessageChannel,m=0,g={},v=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){v.call(e.data)};h&&d||(h=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return g[++m]=function(){s("function"==typeof e?e:Function(e),t)},n(m),m},d=function(e){delete g[e]},"process"==r(90)(c)?n=function(e){c.nextTick(a(v,e,1))}:p?(o=(i=new p).port2,i.port1.onmessage=_,n=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(n=function(e){f.postMessage(e+"","*")},f.addEventListener("message",_,!1)):n="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),v.call(e)}}:function(e){setTimeout(a(v,e,1),0)}),e.exports={set:h,clear:d}},function(e,t){e.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){e.exports=r(18).document&&document.documentElement},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){"use strict";var n=r(92);function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(e,t,r){n(function(){var n;try{n=t(r)}catch(t){return o.reject(e,t)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)})}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=p(function(){t(i,n)});"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}e.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);this.state!==u?c(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t));return r},f.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){o.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},l.resolve=function(e){if(e instanceof this)return e;return o.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return o.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var a=new Array(r),s=0,u=-1,l=new this(i);for(;++u<r;)f(e[u],u);return l;function f(e,i){t.resolve(e).then(function(e){a[i]=e,++s!==r||n||(n=!0,o.resolve(l,a))},function(e){n||(n=!0,o.reject(l,e))})}},l.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var a=-1,s=new this(i);for(;++a<r;)u(e[a]);return s;function u(e){t.resolve(e).then(function(e){n||(n=!0,o.resolve(s,e))},function(e){n||(n=!0,o.reject(s,e))})}}},function(e,t,r){"use strict";(function(t){var r,n,i=t.MutationObserver||t.WebKitMutationObserver;if(i){var o=0,a=new i(f),s=t.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=o=++o%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){f(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(f,0)};else{var u=new t.MessageChannel;u.port1.onmessage=f,r=function(){u.port2.postMessage(0)}}var l=[];function f(){var e,t;n=!0;for(var r=l.length;r;){for(t=l,l=[],e=-1;++e<r;)t[e]();r=l.length}n=!1}e.exports=function(e){1!==l.push(e)||n||r()}}).call(this,r(9))},function(e,t,r){"use strict";var n=r(1),i=r(0);function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},e.exports=o},function(e,t,r){"use strict";var n=r(31).Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",function(e,t){i.push(e)||i._helper.pause(),r&&r(t)}).on("error",function(e){i.emit("error",e)}).on("end",function(){i.push(null)})}r(0).inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},function(e,t,r){"use strict";var n=r(40),i=r(42),o=r(7),a=r(26),s=r(1),u=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};u.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var i="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var a=!this._dataBinary;a&&!i&&(t=t.pipe(new o.Utf8EncodeWorker)),!a&&i&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new s("error")).error(e)}return new n(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof a&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof s?this._data:new i(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<l.length;c++)u.prototype[l[c]]=f;e.exports=u},function(e,t,r){"use strict";var n=r(45),i=r(107);t.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach(function(e,r){a++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,l=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:u,date:l,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)}),o.entriesCount=a}catch(e){o.error(e)}return o}},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=r(98),o=r(0),a=r(1),s=n?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}t.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},t.compressWorker=function(e){return new u("Deflate",e)},t.uncompressWorker=function(){return new u("Inflate",{})}},function(e,t,r){"use strict";var n={};(0,r(4).assign)(n,r(99),r(102),r(50)),e.exports=n},function(e,t,r){"use strict";var n=r(100),i=r(4),o=r(48),a=r(28),s=r(49),u=Object.prototype.toString,l=0,f=-1,c=0,h=8;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({level:f,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,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 s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==l)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==l)throw new Error(a[r]);this._dict_set=!0}}function p(e,t){var r=new d(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}d.prototype.push=function(e,t){var r,a,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=n.deflate(s,a))&&r!==l)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l):2!==a||(this.onEnd(l),s.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===l&&("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=d,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)}},function(e,t,r){"use strict";var n,i=r(4),o=r(101),a=r(46),s=r(47),u=r(28),l=0,f=1,c=3,h=4,d=5,p=0,m=1,g=-2,v=-3,_=-5,y=-1,b=1,w=2,E=3,x=4,A=0,T=2,S=8,R=9,k=15,P=8,B=286,C=30,I=19,F=2*B+1,O=15,M=3,U=258,D=U+M+1,N=32,L=42,z=69,j=73,Y=91,X=103,W=113,G=666,V=1,H=2,K=3,Z=4,q=3;function $(e,t){return e.msg=u[t],t}function J(e){return(e<<1)-(e>4?9:0)}function Q(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(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 te(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ne(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),0===o?0:(e.avail_in-=o,i.arraySet(t,e.input,e.next_in,o,r),1===e.state.wrap?e.adler=a(e.adler,t,o,r):2===e.state.wrap&&(e.adler=s(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function oe(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,l=e.window,f=e.w_mask,c=e.prev,h=e.strstart+U,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<h);if(n=U-(h-o),o=h-U,n>a){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}}while((t=c[t&f])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function ae(e){var t,r,n,o,a,s=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-D)){i.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);t=r=s;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);o+=s}if(0===e.strm.avail_in)break;if(r=ie(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=r,e.lookahead+e.insert>=M)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+M-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<M)););}while(e.lookahead<D&&0!==e.strm.avail_in)}function se(e,t){for(var r,n;;){if(e.lookahead<D){if(ae(e),e.lookahead<D&&t===l)return V;if(0===e.lookahead)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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-D&&(e.match_length=oe(e,r)),e.match_length>=M)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=e.strstart<M-1?e.strstart:M-1,t===h?(te(e,!0),0===e.strm.avail_out?K:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:H}function ue(e,t){for(var r,n,i;;){if(e.lookahead<D){if(ae(e),e.lookahead<D&&t===l)return V;if(0===e.lookahead)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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=M-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-D&&(e.match_length=oe(e,r),e.match_length<=5&&(e.strategy===b||e.match_length===M&&e.strstart-e.match_start>4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-M,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),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+M-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=M-1,e.strstart++,n&&(te(e,!1),0===e.strm.avail_out))return V}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&te(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return V}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<M-1?e.strstart:M-1,t===h?(te(e,!0),0===e.strm.avail_out?K:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:H}function le(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 fe(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=T,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?L:W,e.adler=2===t.wrap?0:1,t.last_flush=l,o._tr_init(t),p):$(e,g)}function ce(e){var t=fe(e);return t===p&&function(e){e.window_size=2*e.w_size,Q(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}(e.state),t}function he(e,t,r,n,o,a){if(!e)return g;var s=1;if(t===y&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>R||r!==S||n<8||n>15||t<0||t>9||a<0||a>x)return $(e,g);8===n&&(n=9);var u=new function(){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=S,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*F),this.dyn_dtree=new i.Buf16(2*(2*C+1)),this.bl_tree=new i.Buf16(2*(2*I+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(O+1),this.heap=new i.Buf16(2*B+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*B+1),Q(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};return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+M-1)/M),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=r,ce(e)}n=[new le(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(ae(e),0===e.lookahead&&t===l)return V;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,te(e,!1),0===e.strm.avail_out))return V;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?K:Z):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),V)}),new le(4,4,8,4,se),new le(4,5,16,8,se),new le(4,6,32,32,se),new le(4,4,16,16,ue),new le(8,16,32,32,ue),new le(8,16,128,128,ue),new le(8,32,128,256,ue),new le(32,128,258,1024,ue),new le(32,258,258,4096,ue)],t.deflateInit=function(e,t){return he(e,t,S,k,P,A)},t.deflateInit2=he,t.deflateReset=ce,t.deflateResetKeep=fe,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,p):g},t.deflate=function(e,t){var r,i,a,u;if(!e||!e.state||t>d||t<0)return e?$(e,g):g;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===G&&t!==h)return $(e,0===e.avail_out?_:g);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===L)if(2===i.wrap)e.adler=0,re(i,31),re(i,139),re(i,8),i.gzhead?(re(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)),re(i,255&i.gzhead.time),re(i,i.gzhead.time>>8&255),re(i,i.gzhead.time>>16&255),re(i,i.gzhead.time>>24&255),re(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),re(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(re(i,255&i.gzhead.extra.length),re(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=z):(re(i,0),re(i,0),re(i,0),re(i,0),re(i,0),re(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),re(i,q),i.status=W);else{var v=S+(i.w_bits-8<<4)<<8;v|=(i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=N),v+=31-v%31,i.status=W,ne(i,v),0!==i.strstart&&(ne(i,e.adler>>>16),ne(i,65535&e.adler)),e.adler=1}if(i.status===z)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=s(e.adler,i.pending_buf,i.pending-a,a)),ee(e),a=i.pending,i.pending!==i.pending_buf_size));)re(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=j)}else i.status=j;if(i.status===j)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),ee(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,re(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=Y)}else i.status=Y;if(i.status===Y)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),ee(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,re(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=X)}else i.status=X;if(i.status===X&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(re(i,255&e.adler),re(i,e.adler>>8&255),e.adler=0,i.status=W)):i.status=W),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==h)return $(e,_);if(i.status===G&&0!==e.avail_in)return $(e,_);if(0!==e.avail_in||0!==i.lookahead||t!==l&&i.status!==G){var y=i.strategy===w?function(e,t){for(var r;;){if(0===e.lookahead&&(ae(e),0===e.lookahead)){if(t===l)return V;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?K:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:H}(i,t):i.strategy===E?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=U){if(ae(e),e.lookahead<=U&&t===l)return V;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+U;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=U-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(r=o._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return V}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?K:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?V:H}(i,t):n[i.level].func(i,t);if(y!==K&&y!==Z||(i.status=G),y===V||y===K)return 0===e.avail_out&&(i.last_flush=-1),p;if(y===H&&(t===f?o._tr_align(i):t!==d&&(o._tr_stored_block(i,0,0,!1),t===c&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,p}return t!==h?p:i.wrap<=0?m:(2===i.wrap?(re(i,255&e.adler),re(i,e.adler>>8&255),re(i,e.adler>>16&255),re(i,e.adler>>24&255),re(i,255&e.total_in),re(i,e.total_in>>8&255),re(i,e.total_in>>16&255),re(i,e.total_in>>24&255)):(ne(i,e.adler>>>16),ne(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==L&&t!==z&&t!==j&&t!==Y&&t!==X&&t!==W&&t!==G?$(e,g):(e.state=null,t===W?$(e,v):p):g},t.deflateSetDictionary=function(e,t){var r,n,o,s,u,l,f,c,h=t.length;if(!e||!e.state)return g;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==L||r.lookahead)return g;for(1===s&&(e.adler=a(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,t,h-r.w_size,r.w_size,0),t=c,h=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=h,e.next_in=0,e.input=t,ae(r);r.lookahead>=M;){n=r.strstart,o=r.lookahead-(M-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+M-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=M-1,ae(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=M-1,r.match_available=0,e.next_in=l,e.input=f,e.avail_in=u,r.wrap=s,p},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,r){"use strict";var n=r(4),i=4,o=0,a=1,s=2;function u(e){for(var t=e.length;--t>=0;)e[t]=0}var l=0,f=1,c=2,h=29,d=256,p=d+1+h,m=30,g=19,v=2*p+1,_=15,y=16,b=7,w=256,E=16,x=17,A=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=new Array(2*(p+2));u(P);var B=new Array(2*m);u(B);var C=new Array(512);u(C);var I=new Array(256);u(I);var F=new Array(h);u(F);var O,M,U,D=new Array(m);function N(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 L(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function z(e){return e<256?C[e]:C[256+(e>>>7)]}function j(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Y(e,t,r){e.bi_valid>y-r?(e.bi_buf|=t<<e.bi_valid&65535,j(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=r-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function X(e,t,r){Y(e,r[2*t],r[2*t+1])}function W(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function G(e,t,r){var n,i,o=new Array(_+1),a=0;for(n=1;n<=_;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=W(o[s]++,s))}}function V(e){var t;for(t=0;t<p;t++)e.dyn_ltree[2*t]=0;for(t=0;t<m;t++)e.dyn_dtree[2*t]=0;for(t=0;t<g;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*w]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function H(e){e.bi_valid>8?j(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 K(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function Z(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&K(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!K(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,o,a,s=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?X(e,i,t):(X(e,(o=I[i])+d+1,t),0!==(a=T[o])&&Y(e,i-=F[o],a),X(e,o=z(--n),r),0!==(a=S[o])&&Y(e,n-=D[o],a))}while(s<e.last_lit);X(e,w,t)}function $(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=v,r=0;r<u;r++)0!==o[2*r]?(e.heap[++e.heap_len]=l=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=l,r=e.heap_len>>1;r>=1;r--)Z(e,o,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Z(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Z(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,u=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,c=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(o=0;o<=_;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<v;r++)(o=u[2*u[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,m++),u[2*n+1]=o,n>l||(e.bl_count[o]++,a=0,n>=d&&(a=h[n-d]),s=u[2*n],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==m){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>l||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(e,t),G(o,l,e.bl_count)}function J(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[2*E]++):s<=10?e.bl_tree[2*x]++:e.bl_tree[2*A]++,s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4))}function Q(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<l)do{X(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(X(e,i,e.bl_tree),s--),X(e,E,e.bl_tree),Y(e,s-3,2)):s<=10?(X(e,x,e.bl_tree),Y(e,s-3,3)):(X(e,A,e.bl_tree),Y(e,s-11,7));s=0,o=i,0===a?(u=138,l=3):i===a?(u=6,l=3):(u=7,l=4)}}u(D);var ee=!1;function te(e,t,r,i){Y(e,(l<<1)+(i?1:0),3),function(e,t,r,i){H(e),i&&(j(e,r),j(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){ee||(function(){var e,t,r,n,i,o=new Array(_+1);for(r=0,n=0;n<h-1;n++)for(F[n]=r,e=0;e<1<<T[n];e++)I[r++]=n;for(I[r-1]=n,i=0,n=0;n<16;n++)for(D[n]=i,e=0;e<1<<S[n];e++)C[i++]=n;for(i>>=7;n<m;n++)for(D[n]=i<<7,e=0;e<1<<S[n]-7;e++)C[256+i++]=n;for(t=0;t<=_;t++)o[t]=0;for(e=0;e<=143;)P[2*e+1]=8,e++,o[8]++;for(;e<=255;)P[2*e+1]=9,e++,o[9]++;for(;e<=279;)P[2*e+1]=7,e++,o[7]++;for(;e<=287;)P[2*e+1]=8,e++,o[8]++;for(G(P,p+1,o),e=0;e<m;e++)B[2*e+1]=5,B[2*e]=W(e,5);O=new N(P,T,d+1,p,_),M=new N(B,S,0,m,_),U=new N(new Array(0),R,0,g,b)}(),ee=!0),e.l_desc=new L(e.dyn_ltree,O),e.d_desc=new L(e.dyn_dtree,M),e.bl_desc=new L(e.bl_tree,U),e.bi_buf=0,e.bi_valid=0,V(e)},t._tr_stored_block=te,t._tr_flush_block=function(e,t,r,n){var u,l,h=0;e.level>0?(e.strm.data_type===s&&(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 o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return a;for(t=32;t<d;t++)if(0!==e.dyn_ltree[2*t])return a;return o}(e)),$(e,e.l_desc),$(e,e.d_desc),h=function(e){var t;for(J(e,e.dyn_ltree,e.l_desc.max_code),J(e,e.dyn_dtree,e.d_desc.max_code),$(e,e.bl_desc),t=g-1;t>=3&&0===e.bl_tree[2*k[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),u=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=u&&(u=l)):u=l=r+5,r+4<=u&&-1!==t?te(e,t,r,n):e.strategy===i||l===u?(Y(e,(f<<1)+(n?1:0),3),q(e,P,B)):(Y(e,(c<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Y(e,t-257,5),Y(e,r-1,5),Y(e,n-4,4),i=0;i<n;i++)Y(e,e.bl_tree[2*k[i]+1],3);Q(e,e.dyn_ltree,t-1),Q(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,h+1),q(e,e.dyn_ltree,e.dyn_dtree)),V(e),n&&H(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*(I[r]+d+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){Y(e,f<<1,3),X(e,w,P),function(e){16===e.bi_valid?(j(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)}},function(e,t,r){"use strict";var n=r(103),i=r(4),o=r(48),a=r(50),s=r(28),u=r(49),l=r(106),f=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(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 u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new l,n.inflateGetHeader(this.strm,this.header)}function h(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(e,t){var r,s,u,l,c,h,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===f.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(p),d.next_out=0,d.avail_out=p),(r=n.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&m&&(h="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===f.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,h)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!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||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(d.output,d.next_out),l=d.next_out-u,c=o.buf2string(d.output,u),d.next_out=l,d.avail_out=p-l,l&&i.arraySet(d.output,d.output,u,l,0),this.onData(c)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(g=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.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=c,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},function(e,t,r){"use strict";var n=r(4),i=r(46),o=r(47),a=r(104),s=r(105),u=0,l=1,f=2,c=4,h=5,d=6,p=0,m=1,g=2,v=-2,_=-3,y=-4,b=-5,w=8,E=1,x=2,A=3,T=4,S=5,R=6,k=7,P=8,B=9,C=10,I=11,F=12,O=13,M=14,U=15,D=16,N=17,L=18,z=19,j=20,Y=21,X=22,W=23,G=24,V=25,H=26,K=27,Z=28,q=29,$=30,J=31,Q=32,ee=852,te=592,re=15;function ne(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ie(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=E,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(ee),t.distcode=t.distdyn=new n.Buf32(te),t.sane=1,t.back=-1,p):v}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):v}function ae(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)?v:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,oe(e))):v}function se(e,t){var r,i;return e?(i=new function(){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},e.state=i,i.window=null,(r=ae(e,t))!==p&&(e.state=null),r):v}var ue,le,fe=!0;function ce(e){if(fe){var t;for(ue=new n.Buf32(512),le=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(s(l,e.lens,0,288,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(f,e.lens,0,32,le,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=le,e.distbits=5}function he(e,t,r,i){var o,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):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=oe,t.inflateReset2=ae,t.inflateResetKeep=ie,t.inflateInit=function(e){return se(e,re)},t.inflateInit2=se,t.inflate=function(e,t){var r,ee,te,re,ie,oe,ae,se,ue,le,fe,de,pe,me,ge,ve,_e,ye,be,we,Ee,xe,Ae,Te,Se=0,Re=new n.Buf8(4),ke=[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 v;(r=e.state).mode===F&&(r.mode=O),ie=e.next_out,te=e.output,ae=e.avail_out,re=e.next_in,ee=e.input,oe=e.avail_in,se=r.hold,ue=r.bits,le=oe,fe=ae,xe=p;e:for(;;)switch(r.mode){case E:if(0===r.wrap){r.mode=O;break}for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(2&r.wrap&&35615===se){r.check=0,Re[0]=255&se,Re[1]=se>>>8&255,r.check=o(r.check,Re,2,0),se=0,ue=0,r.mode=x;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((15&se)!==w){e.msg="unknown compression method",r.mode=$;break}if(ue-=4,Ee=8+(15&(se>>>=4)),0===r.wbits)r.wbits=Ee;else if(Ee>r.wbits){e.msg="invalid window size",r.mode=$;break}r.dmax=1<<Ee,e.adler=r.check=1,r.mode=512&se?C:F,se=0,ue=0;break;case x:for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(r.flags=se,(255&r.flags)!==w){e.msg="unknown compression method",r.mode=$;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=se>>8&1),512&r.flags&&(Re[0]=255&se,Re[1]=se>>>8&255,r.check=o(r.check,Re,2,0)),se=0,ue=0,r.mode=A;case A:for(;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.head&&(r.head.time=se),512&r.flags&&(Re[0]=255&se,Re[1]=se>>>8&255,Re[2]=se>>>16&255,Re[3]=se>>>24&255,r.check=o(r.check,Re,4,0)),se=0,ue=0,r.mode=T;case T:for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.head&&(r.head.xflags=255&se,r.head.os=se>>8),512&r.flags&&(Re[0]=255&se,Re[1]=se>>>8&255,r.check=o(r.check,Re,2,0)),se=0,ue=0,r.mode=S;case S:if(1024&r.flags){for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.length=se,r.head&&(r.head.extra_len=se),512&r.flags&&(Re[0]=255&se,Re[1]=se>>>8&255,r.check=o(r.check,Re,2,0)),se=0,ue=0}else r.head&&(r.head.extra=null);r.mode=R;case R:if(1024&r.flags&&((de=r.length)>oe&&(de=oe),de&&(r.head&&(Ee=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,ee,re,de,Ee)),512&r.flags&&(r.check=o(r.check,ee,de,re)),oe-=de,re+=de,r.length-=de),r.length))break e;r.length=0,r.mode=k;case k:if(2048&r.flags){if(0===oe)break e;de=0;do{Ee=ee[re+de++],r.head&&Ee&&r.length<65536&&(r.head.name+=String.fromCharCode(Ee))}while(Ee&&de<oe);if(512&r.flags&&(r.check=o(r.check,ee,de,re)),oe-=de,re+=de,Ee)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=P;case P:if(4096&r.flags){if(0===oe)break e;de=0;do{Ee=ee[re+de++],r.head&&Ee&&r.length<65536&&(r.head.comment+=String.fromCharCode(Ee))}while(Ee&&de<oe);if(512&r.flags&&(r.check=o(r.check,ee,de,re)),oe-=de,re+=de,Ee)break e}else r.head&&(r.head.comment=null);r.mode=B;case B:if(512&r.flags){for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(se!==(65535&r.check)){e.msg="header crc mismatch",r.mode=$;break}se=0,ue=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=F;break;case C:for(;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}e.adler=r.check=ne(se),se=0,ue=0,r.mode=I;case I:if(0===r.havedict)return e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=oe,r.hold=se,r.bits=ue,g;e.adler=r.check=1,r.mode=F;case F:if(t===h||t===d)break e;case O:if(r.last){se>>>=7&ue,ue-=7&ue,r.mode=K;break}for(;ue<3;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}switch(r.last=1&se,ue-=1,3&(se>>>=1)){case 0:r.mode=M;break;case 1:if(ce(r),r.mode=j,t===d){se>>>=2,ue-=2;break e}break;case 2:r.mode=N;break;case 3:e.msg="invalid block type",r.mode=$}se>>>=2,ue-=2;break;case M:for(se>>>=7&ue,ue-=7&ue;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if((65535&se)!=(se>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=65535&se,se=0,ue=0,r.mode=U,t===d)break e;case U:r.mode=D;case D:if(de=r.length){if(de>oe&&(de=oe),de>ae&&(de=ae),0===de)break e;n.arraySet(te,ee,re,de,ie),oe-=de,re+=de,ae-=de,ie+=de,r.length-=de;break}r.mode=F;break;case N:for(;ue<14;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(r.nlen=257+(31&se),se>>>=5,ue-=5,r.ndist=1+(31&se),se>>>=5,ue-=5,r.ncode=4+(15&se),se>>>=4,ue-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=L;case L:for(;r.have<r.ncode;){for(;ue<3;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.lens[ke[r.have++]]=7&se,se>>>=3,ue-=3}for(;r.have<19;)r.lens[ke[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ae={bits:r.lenbits},xe=s(u,r.lens,0,19,r.lencode,0,r.work,Ae),r.lenbits=Ae.bits,xe){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=z;case z:for(;r.have<r.nlen+r.ndist;){for(;ve=(Se=r.lencode[se&(1<<r.lenbits)-1])>>>16&255,_e=65535&Se,!((ge=Se>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(_e<16)se>>>=ge,ue-=ge,r.lens[r.have++]=_e;else{if(16===_e){for(Te=ge+2;ue<Te;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(se>>>=ge,ue-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=$;break}Ee=r.lens[r.have-1],de=3+(3&se),se>>>=2,ue-=2}else if(17===_e){for(Te=ge+3;ue<Te;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}ue-=ge,Ee=0,de=3+(7&(se>>>=ge)),se>>>=3,ue-=3}else{for(Te=ge+7;ue<Te;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}ue-=ge,Ee=0,de=11+(127&(se>>>=ge)),se>>>=7,ue-=7}if(r.have+de>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$;break}for(;de--;)r.lens[r.have++]=Ee}}if(r.mode===$)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,Ae={bits:r.lenbits},xe=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,Ae),r.lenbits=Ae.bits,xe){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,Ae={bits:r.distbits},xe=s(f,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ae),r.distbits=Ae.bits,xe){e.msg="invalid distances set",r.mode=$;break}if(r.mode=j,t===d)break e;case j:r.mode=Y;case Y:if(oe>=6&&ae>=258){e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=oe,r.hold=se,r.bits=ue,a(e,fe),ie=e.next_out,te=e.output,ae=e.avail_out,re=e.next_in,ee=e.input,oe=e.avail_in,se=r.hold,ue=r.bits,r.mode===F&&(r.back=-1);break}for(r.back=0;ve=(Se=r.lencode[se&(1<<r.lenbits)-1])>>>16&255,_e=65535&Se,!((ge=Se>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(ve&&0==(240&ve)){for(ye=ge,be=ve,we=_e;ve=(Se=r.lencode[we+((se&(1<<ye+be)-1)>>ye)])>>>16&255,_e=65535&Se,!(ye+(ge=Se>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}se>>>=ye,ue-=ye,r.back+=ye}if(se>>>=ge,ue-=ge,r.back+=ge,r.length=_e,0===ve){r.mode=H;break}if(32&ve){r.back=-1,r.mode=F;break}if(64&ve){e.msg="invalid literal/length code",r.mode=$;break}r.extra=15&ve,r.mode=X;case X:if(r.extra){for(Te=r.extra;ue<Te;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.length+=se&(1<<r.extra)-1,se>>>=r.extra,ue-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=W;case W:for(;ve=(Se=r.distcode[se&(1<<r.distbits)-1])>>>16&255,_e=65535&Se,!((ge=Se>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(0==(240&ve)){for(ye=ge,be=ve,we=_e;ve=(Se=r.distcode[we+((se&(1<<ye+be)-1)>>ye)])>>>16&255,_e=65535&Se,!(ye+(ge=Se>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}se>>>=ye,ue-=ye,r.back+=ye}if(se>>>=ge,ue-=ge,r.back+=ge,64&ve){e.msg="invalid distance code",r.mode=$;break}r.offset=_e,r.extra=15&ve,r.mode=G;case G:if(r.extra){for(Te=r.extra;ue<Te;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.offset+=se&(1<<r.extra)-1,se>>>=r.extra,ue-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$;break}r.mode=V;case V:if(0===ae)break e;if(de=fe-ae,r.offset>de){if((de=r.offset-de)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$;break}de>r.wnext?(de-=r.wnext,pe=r.wsize-de):pe=r.wnext-de,de>r.length&&(de=r.length),me=r.window}else me=te,pe=ie-r.offset,de=r.length;de>ae&&(de=ae),ae-=de,r.length-=de;do{te[ie++]=me[pe++]}while(--de);0===r.length&&(r.mode=Y);break;case H:if(0===ae)break e;te[ie++]=r.length,ae--,r.mode=Y;break;case K:if(r.wrap){for(;ue<32;){if(0===oe)break e;oe--,se|=ee[re++]<<ue,ue+=8}if(fe-=ae,e.total_out+=fe,r.total+=fe,fe&&(e.adler=r.check=r.flags?o(r.check,te,fe,ie-fe):i(r.check,te,fe,ie-fe)),fe=ae,(r.flags?se:ne(se))!==r.check){e.msg="incorrect data check",r.mode=$;break}se=0,ue=0}r.mode=Z;case Z:if(r.wrap&&r.flags){for(;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(se!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=$;break}se=0,ue=0}r.mode=q;case q:xe=m;break e;case $:xe=_;break e;case J:return y;case Q:default:return v}return e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=oe,r.hold=se,r.bits=ue,(r.wsize||fe!==e.avail_out&&r.mode<$&&(r.mode<K||t!==c))&&he(e,e.output,e.next_out,fe-e.avail_out)?(r.mode=J,y):(le-=e.avail_in,fe-=e.avail_out,e.total_in+=le,e.total_out+=fe,r.total+=fe,r.wrap&&fe&&(e.adler=r.check=r.flags?o(r.check,te,fe,e.next_out-fe):i(r.check,te,fe,e.next_out-fe)),e.data_type=r.bits+(r.last?64:0)+(r.mode===F?128:0)+(r.mode===j||r.mode===U?256:0),(0===le&&0===fe||t===c)&&xe===p&&(xe=b),xe)},t.inflateEnd=function(e){if(!e||!e.state)return v;var t=e.state;return t.window&&(t.window=null),e.state=null,p},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?v:(r.head=t,t.done=!1,p):v},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&r.mode!==I?v:r.mode===I&&i(1,t,n,0)!==r.check?_:he(e,t,n,n)?(r.mode=J,y):(r.havedict=1,p):v},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,o,a,s,u,l,f,c,h,d,p,m,g,v,_,y,b,w,E,x,A,T,S;r=e.state,n=e.next_in,T=e.input,i=n+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,m=r.lencode,g=r.distcode,v=(1<<r.lenbits)-1,_=(1<<r.distbits)-1;e:do{p<15&&(d+=T[n++]<<p,p+=8,d+=T[n++]<<p,p+=8),y=m[d&v];t:for(;;){if(d>>>=b=y>>>24,p-=b,0===(b=y>>>16&255))S[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=m[(65535&y)+(d&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(b&=15)&&(p<b&&(d+=T[n++]<<p,p+=8),w+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=T[n++]<<p,p+=8,d+=T[n++]<<p,p+=8),y=g[d&_];r:for(;;){if(d>>>=b=y>>>24,p-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=g[(65535&y)+(d&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(E=65535&y,p<(b&=15)&&(d+=T[n++]<<p,(p+=8)<b&&(d+=T[n++]<<p,p+=8)),(E+=d&(1<<b)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=b,p-=b,E>(b=o-a)){if((b=E-b)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,A=h,0===c){if(x+=l-b,b<w){w-=b;do{S[o++]=h[x++]}while(--b);x=o-E,A=S}}else if(c<b){if(x+=l+c-b,(b-=c)<w){w-=b;do{S[o++]=h[x++]}while(--b);if(x=0,c<w){w-=b=c;do{S[o++]=h[x++]}while(--b);x=o-E,A=S}}}else if(x+=c-b,b<w){w-=b;do{S[o++]=h[x++]}while(--b);x=o-E,A=S}for(;w>2;)S[o++]=A[x++],S[o++]=A[x++],S[o++]=A[x++],w-=3;w&&(S[o++]=A[x++],w>1&&(S[o++]=A[x++]))}else{x=o-E;do{S[o++]=S[x++],S[o++]=S[x++],S[o++]=S[x++],w-=3}while(w>2);w&&(S[o++]=S[x++],w>1&&(S[o++]=S[x++]))}break}}break}}while(n<i&&o<s);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},function(e,t,r){"use strict";var n=r(4),i=[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],o=[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],a=[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],s=[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,u,l,f,c,h){var d,p,m,g,v,_,y,b,w,E=h.bits,x=0,A=0,T=0,S=0,R=0,k=0,P=0,B=0,C=0,I=0,F=null,O=0,M=new n.Buf16(16),U=new n.Buf16(16),D=null,N=0;for(x=0;x<=15;x++)M[x]=0;for(A=0;A<u;A++)M[t[r+A]]++;for(R=E,S=15;S>=1&&0===M[S];S--);if(R>S&&(R=S),0===S)return l[f++]=20971520,l[f++]=20971520,h.bits=1,0;for(T=1;T<S&&0===M[T];T++);for(R<T&&(R=T),B=1,x=1;x<=15;x++)if(B<<=1,(B-=M[x])<0)return-1;if(B>0&&(0===e||1!==S))return-1;for(U[1]=0,x=1;x<15;x++)U[x+1]=U[x]+M[x];for(A=0;A<u;A++)0!==t[r+A]&&(c[U[t[r+A]]++]=A);if(0===e?(F=D=c,_=19):1===e?(F=i,O-=257,D=o,N-=257,_=256):(F=a,D=s,_=-1),I=0,A=0,x=T,v=f,k=R,P=0,m=-1,g=(C=1<<R)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){y=x-P,c[A]<_?(b=0,w=c[A]):c[A]>_?(b=D[N+c[A]],w=F[O+c[A]]):(b=96,w=0),d=1<<x-P,T=p=1<<k;do{l[v+(I>>P)+(p-=d)]=y<<24|b<<16|w|0}while(0!==p);for(d=1<<x-1;I&d;)d>>=1;if(0!==d?(I&=d-1,I+=d):I=0,A++,0==--M[x]){if(x===S)break;x=t[r+c[A]]}if(x>R&&(I&g)!==m){for(0===P&&(P=R),v+=T,B=1<<(k=x-P);k+P<S&&!((B-=M[k+P])<=0);)k++,B<<=1;if(C+=1<<k,1===e&&C>852||2===e&&C>592)return 1;l[m=I&g]=R<<24|k<<16|v-f|0}}return 0!==I&&(l[v+I]=x-P<<24|64<<16|0),h.bits=R,0}},function(e,t,r){"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}},function(e,t,r){"use strict";var n=r(0),i=r(1),o=r(7),a=r(27),s=r(51),u=function(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n},l=function(e,t,r,i,l,f){var c,h,d=e.file,p=e.compression,m=f!==o.utf8encode,g=n.transformTo("string",f(d.name)),v=n.transformTo("string",o.utf8encode(d.name)),_=d.comment,y=n.transformTo("string",f(_)),b=n.transformTo("string",o.utf8encode(_)),w=v.length!==d.name.length,E=b.length!==_.length,x="",A="",T="",S=d.dir,R=d.date,k={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(k.crc32=e.crc32,k.compressedSize=e.compressedSize,k.uncompressedSize=e.uncompressedSize);var P=0;t&&(P|=8),m||!w&&!E||(P|=2048);var B=0,C=0;S&&(B|=16),"UNIX"===l?(C=798,B|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(d.unixPermissions,S)):(C=20,B|=function(e,t){return 63&(e||0)}(d.dosPermissions)),c=R.getUTCHours(),c<<=6,c|=R.getUTCMinutes(),c<<=5,c|=R.getUTCSeconds()/2,h=R.getUTCFullYear()-1980,h<<=4,h|=R.getUTCMonth()+1,h<<=5,h|=R.getUTCDate(),w&&(A=u(1,1)+u(a(g),4)+v,x+="up"+u(A.length,2)+A),E&&(T=u(1,1)+u(a(y),4)+b,x+="uc"+u(T.length,2)+T);var I="";return I+="\n\0",I+=u(P,2),I+=p.magic,I+=u(c,2),I+=u(h,2),I+=u(k.crc32,4),I+=u(k.compressedSize,4),I+=u(k.uncompressedSize,4),I+=u(g.length,2),I+=u(x.length,2),{fileRecord:s.LOCAL_FILE_HEADER+I+g+x,dirRecord:s.CENTRAL_FILE_HEADER+u(C,2)+I+u(y.length,2)+"\0\0\0\0"+u(B,4)+u(i,4)+g+x+y}};function f(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(f,i),f.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},f.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=l(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=l(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return s.DATA_DESCRIPTOR+u(e.crc32,4)+u(e.compressedSize,4)+u(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,o){var a=n.transformTo("string",o(i));return s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(e,2)+u(e,2)+u(t,4)+u(r,4)+u(a.length,2)+a}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},f.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},f.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},e.exports=f},function(e,t,r){"use strict";var n=r(0),i=r(1);function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},function(e,t,r){"use strict";var n=r(0),i=r(11),o=r(7),a=(n=r(0),r(110)),s=r(44),u=r(17);function l(e){return new i.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}e.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new a(t);return r.load(e),r}).then(function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(l(n[o]));return i.Promise.all(r)}).then(function(e){for(var n=e.shift(),i=n.files,o=0;o<i.length;o++){var a=i[o];r.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders})}return n.zipComment.length&&(r.comment=n.zipComment),r})}},function(e,t,r){"use strict";var n=r(52),i=r(0),o=r(51),a=r(113),s=(r(7),r(3));function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(n>0)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=u},function(e,t,r){"use strict";var n=r(54);function i(e){n.call(this,e)}r(0).inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=i},function(e,t,r){"use strict";var n=r(55);function i(e){n.call(this,e)}r(0).inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=i},function(e,t,r){"use strict";var n=r(52),i=r(0),o=r(26),a=r(27),s=r(7),u=r(45),l=r(3);function f(e,t){this.options=e,this.loadOptions=t}f.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(u.hasOwnProperty(t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n}},handleUTF8:function(){var e=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)?null:a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},e.exports=f},function(e,t,r){var n;!function(){var i=window.CustomEvent;function o(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement}return null}function a(e){e&&e.blur&&e!==document.body&&e.blur()}function s(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1}function u(e){return!(!e||!e.hasAttribute("method"))&&"dialog"===e.getAttribute("method").toLowerCase()}function l(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:["open"]})}else{var t,r=!1,n=function(){r?this.downgradeModal():this.maybeHideModal(),r=!1}.bind(this),i=function(i){if(i.target===e){var o="DOMNodeRemoved";r|=i.type.substr(0,o.length)===o,window.clearTimeout(t),t=window.setTimeout(n,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(t){e.addEventListener(t,i)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("click",this.backdropClick_.bind(this))}i&&"object"!=typeof i||((i=function(e,t){t=t||{};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),r}).prototype=window.Event.prototype),l.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),f.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropClick_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var r=document.createEvent("MouseEvents");r.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(r),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"].map(function(e){return e+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(t.join(", "))}a(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!document.body.contains(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!f.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");(function(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),r=function(e,r){return!(void 0===t[e]||t[e]===r)};if(t.opacity<1||r("zIndex","auto")||r("transform","none")||r("mixBlendMode","normal")||r("filter","none")||r("perspective","none")||"isolate"===t.isolation||"fixed"===t.position||"touch"===t.webkitOverflowScrolling)return!0;e=e.parentElement}return!1})(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,f.needsCentering(this.dialog_)?(f.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),void 0!==e&&(this.dialog_.returnValue=e);var t=new i("close",{bubbles:!1,cancelable:!1});this.dialog_.dispatchEvent(t)}};var f={reposition:function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,r=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,r)+"px"},isInlinePositionSetByStylesheet:function(e){for(var t=0;t<document.styleSheets.length;++t){var r=document.styleSheets[t],n=null;try{n=r.cssRules}catch(e){}if(n)for(var i=0;i<n.length;++i){var o=n[i],a=null;try{a=document.querySelectorAll(o.selectorText)}catch(e){}if(a&&s(a,e)){var u=o.style.getPropertyValue("top"),l=o.style.getPropertyValue("bottom");if(u&&"auto"!==u||l&&"auto"!==l)return!0}}}return!1},needsCentering:function(e){return"absolute"===window.getComputedStyle(e).position&&(!("auto"!==e.style.top&&""!==e.style.top||"auto"!==e.style.bottom&&""!==e.style.bottom)&&!f.isInlinePositionSetByStylesheet(e))},forceRegisterDialog:function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new l(e)},registerDialog:function(e){e.showModal||f.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var r=[];t.forEach(function(e){for(var t,n=0;t=e.removedNodes[n];++n)t instanceof Element&&("dialog"===t.localName&&r.push(t),r=r.concat(t.querySelectorAll("dialog")))}),r.length&&e(r)}))}};if(f.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},f.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},f.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,r=0;e=this.pendingDialogStack[r];++r)e.updateZIndex(--t,--t),0===r&&(this.overlay.style.zIndex=--t);var n=this.pendingDialogStack[0];n?(n.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},f.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=o(e);){for(var t,r=0;t=this.pendingDialogStack[r];++r)if(t.dialog===e)return 0===r;e=e.parentElement}return!1},f.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&(e.preventDefault(),e.stopPropagation(),a(e.target),void 0!==this.forwardTab_)){var t=this.pendingDialogStack[0];return t.dialog.compareDocumentPosition(e.target)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():document.documentElement.focus()),!1}},f.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var t=new i("cancel",{bubbles:!1,cancelable:!0}),r=this.pendingDialogStack[0];r&&r.dialog.dispatchEvent(t)&&r.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},f.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()})},f.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},f.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},f.dm=new f.DialogManager,f.formSubmitter=null,f.useValue=null,void 0===window.HTMLDialogElement){var c=document.createElement("form");if(c.setAttribute("method","dialog"),"dialog"!==c.method){var h=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(h){var d=h.get;h.get=function(){return u(this)?"dialog":d.call(this)};var p=h.set;h.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):p.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",h)}}document.addEventListener("click",function(e){if(f.formSubmitter=null,f.useValue=null,!e.defaultPrevented){var t=e.target;if(t&&u(t.form)){if(!("submit"===t.type&&["button","input"].indexOf(t.localName)>-1)){if("input"!==t.localName||"image"!==t.type)return;f.useValue=e.offsetX+","+e.offsetY}o(t)&&(f.formSubmitter=t)}}},!1);var m=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(!u(this))return m.call(this);var e=o(this);e&&e.close()},document.addEventListener("submit",function(e){var t=e.target;if(u(t)){e.preventDefault();var r=o(t);if(r){var n=f.formSubmitter;n&&n.form===t?r.close(f.useValue||n.value):r.close(),f.formSubmitter=null}}},!0)}f.forceRegisterDialog=f.forceRegisterDialog,f.registerDialog=f.registerDialog,"amd"in r(56)?void 0===(n=function(){return f}.call(t,r,t,e))||(e.exports=n):"object"==typeof e&&"object"==typeof e.exports?e.exports=f:window.dialogPolyfill=f}()},function(e,t,r){var n,i=i||function(e){"use strict";if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=function(){return e.URL||e.webkitURL||e},r=e.document.createElementNS("http://www.w3.org/1999/xhtml","a"),n="download"in r,i=/constructor/i.test(e.HTMLElement)||e.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),a=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s=function(e){setTimeout(function(){"string"==typeof e?t().revokeObjectURL(e):e.remove()},4e4)},u=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},l=function(l,f,c){c||(l=u(l));var h,d=this,p="application/octet-stream"===l.type,m=function(){!function(e,t,r){for(var n=(t=[].concat(t)).length;n--;){var i=e["on"+t[n]];if("function"==typeof i)try{i.call(e,r||e)}catch(e){a(e)}}}(d,"writestart progress write writeend".split(" "))};if(d.readyState=d.INIT,n)return h=t().createObjectURL(l),void setTimeout(function(){r.href=h,r.download=f,function(e){var t=new MouseEvent("click");e.dispatchEvent(t)}(r),m(),s(h),d.readyState=d.DONE});!function(){if((o||p&&i)&&e.FileReader){var r=new FileReader;return r.onloadend=function(){var t=o?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,d.readyState=d.DONE,m()},r.readAsDataURL(l),void(d.readyState=d.INIT)}h||(h=t().createObjectURL(l)),p?e.location.href=h:e.open(h,"_blank")||(e.location.href=h);d.readyState=d.DONE,m(),s(h)}()},f=l.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return t=t||e.name||"download",r||(e=u(e)),navigator.msSaveOrOpenBlob(e,t)}:(f.abort=function(){},f.readyState=f.INIT=0,f.WRITING=1,f.DONE=2,f.error=f.onwritestart=f.onprogress=f.onwrite=f.onabort=f.onerror=f.onwriteend=null,function(e,t,r){return new l(e,t||e.name||"download",r)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */void 0!==e&&e.exports?e.exports.saveAs=i:null!==r(56)&&null!==r(116)&&(void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n))},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){"use strict";!function(){for(var e,t=function(){},r=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeline","timelineEnd","timeStamp","trace","warn"],n=r.length,i=window.console=window.console||{};n--;)i[e=r[n]]||(i[e]=t)}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.vsSlice="#version 300 es\n// attributes\nin vec4 a_position;\n\n// uniforms\nuniform mat4 u_modelViewProjection;\n\nvoid main() {\n // compute vertex position\n gl_Position = u_modelViewProjection * a_position;\n}",t.fsSlice="#version 300 es\nprecision mediump float;\n\n// uniforms\nuniform float u_r;\nuniform float u_g;\nuniform float u_b;\n\n// output\nout vec4 outColor;\n\nvoid main() {\n outColor = vec4(u_r, u_g, u_b, 1);\n}",t.vs3d="#version 300 es\n// attributes\nin vec4 a_position;\nin vec3 a_normal;\n\n// uniforms\nuniform mat4 u_modelViewProjection;\nuniform mat4 u_modelInverseTranspose;\n\n// varyings\nout vec3 v_normal;\n\nvoid main() {\n // compute vertex position\n gl_Position = u_modelViewProjection * a_position;\n\n // transform normals with inverse-transpose of model matrix\n // https://webgl2fundamentals.org/webgl/lessons/webgl-3d-lighting-directional.html\n v_normal = mat3(u_modelInverseTranspose) * a_normal;\n}",t.fs3d="#version 300 es\nprecision mediump float;\n\n// inputs from vertex shader\nin vec3 v_normal;\n\n// uniforms\nuniform vec3 u_light; // vector from origin to light\nuniform float u_alpha;\n\n// output\nout vec4 outColor;\n\nvoid main() {\n // compute light intensity\n vec3 normal = normalize(v_normal);\n float light = abs(dot(normal, -1.0*u_light));\n\n // compute shade of gray\n vec3 color = vec3(1.0) * clamp(light, 0.1, 1.0);\n\n // output color of fragment\n outColor = vec4(color, u_alpha);\n}"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextmenuCallback=t.wheelCallback=t.mousemoveCallback=t.mouseleaveCallback=t.mouseupCallback=t.mousedownCallback=void 0;var n=r(29);let i=!1;t.mousedownCallback=function(e){0===e.button&&(i=!0),1===e.button&&n.camera.constructor()},t.mouseupCallback=function(e){0===e.button&&(i=!1)},t.mouseleaveCallback=function(e){i=!1},t.mousemoveCallback=function(e){if(i){const t=.333;n.camera.rotateTheta(-1*e.movementX*t),n.camera.rotatePhi(-1*e.movementY*t)}},t.wheelCallback=function(e){const t=e.deltaMode?8*e.deltaY:e.deltaY/5;return n.camera.changeRadius(t),!1},t.contextmenuCallback=function(){return!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Camera=void 0;var n=r(5),i=r(13);t.Camera=class{constructor(e,t=0,r=Math.PI/2,n=[0,1,0]){this.theta=t,this.phi=r,this.radius=e,this.up=n}vector(){const e=this.radius*Math.cos(this.phi);return[this.radius*Math.sin(this.phi)*Math.sin(this.theta),e,this.radius*Math.sin(this.phi)*Math.cos(this.theta)]}cameraMatrix(){const[e,t,r]=this.vector();return n.m4.lookAt([e,t,r],[0,0,0],this.up)}viewMatrix(){return n.m4.inverse(this.cameraMatrix())}rotateTheta(e){this.theta+=(0,i.degToRad)(e)}rotatePhi(e){this.phi+=(0,i.degToRad)(e),this.phi<.01&&(this.phi=.01),this.phi>3.14&&(this.phi=3.14)}changeRadius(e){this.radius+=e,this.radius<1&&(this.radius=1),this.radius>2e3&&(this.radius=2e3)}setRadius(e){this.radius=e,this.radius<1&&(this.radius=1),this.radius>2e3&&(this.radius=2e3)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.make3dModel=t.parseArrayBuffer=void 0;var n=r(5),i=u(r(12)),o=u(r(19)),a=u(r(20)),s=u(r(29));function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}let l=null;t.parseArrayBuffer=function(e){const t=[],r=[];(new TextDecoder).decode(e).split(/[\r\n]+/).forEach(e=>{const n=e.split(/\s+/);if("v"===n[0]){const e=Number(n[1]),r=Number(n[2]),i=Number(n[3]);t.push([e,r,i])}if("l"===n[0])for(let e=1;e<n.length-1;e++){const t=Number(n[e]),i=Number(n[e+1]);r.push([t,i])}if("curv"===n[0]){const e=Number(n[3]),t=Number(n[4]);r.push([e,t])}}),l=[],r.forEach(e=>{const r=t[e[0]-1],n=t[e[1]-1];l.push([r,n])})},t.make3dModel=function(){const e=i.lineWidthBottom/2,t=i.lineWidthTop/2,r=12*l.length*3,u={a_position:{numComponents:3,data:new Float32Array(3*r)},a_normal:{numComponents:3,data:new Float32Array(3*r)}};let f=0;function c(e,t,r,n){u.a_position.data[f+0]=e[0],u.a_position.data[f+1]=e[1],u.a_position.data[f+2]=e[2],u.a_position.data[f+3]=t[0],u.a_position.data[f+4]=t[1],u.a_position.data[f+5]=t[2],u.a_position.data[f+6]=r[0],u.a_position.data[f+7]=r[1],u.a_position.data[f+8]=r[2],u.a_normal.data[f+0]=n[0],u.a_normal.data[f+1]=n[1],u.a_normal.data[f+2]=n[2],u.a_normal.data[f+3]=n[0],u.a_normal.data[f+4]=n[1],u.a_normal.data[f+5]=n[2],u.a_normal.data[f+6]=n[0],u.a_normal.data[f+7]=n[1],u.a_normal.data[f+8]=n[2],f+=9}l.forEach(([r,i])=>{const o=n.v3.subtract(i,r),a=n.v3.normalize(o),s=n.v3.mulScalar(a,-1),u=n.v3.distanceSq(a,[1,0,0])<1e-5||n.v3.distanceSq(a,[-1,0,0])<1e-5?[0,1,0]:[1,0,0],l=n.v3.normalize(n.v3.cross(u,o)),f=n.v3.normalize(n.v3.cross(o,l)),h=n.v3.mulScalar(l,-1),d=n.v3.mulScalar(f,-1),p=n.v3.add(r,n.v3.mulScalar(n.v3.add(l,f),e)),m=n.v3.add(r,n.v3.mulScalar(n.v3.add(l,d),e)),g=n.v3.add(r,n.v3.mulScalar(n.v3.add(h,d),e)),v=n.v3.add(r,n.v3.mulScalar(n.v3.add(h,f),e)),_=n.v3.add(i,n.v3.mulScalar(n.v3.add(l,f),t)),y=n.v3.add(i,n.v3.mulScalar(n.v3.add(h,f),t)),b=n.v3.add(i,n.v3.mulScalar(n.v3.add(h,d),t)),w=n.v3.add(i,n.v3.mulScalar(n.v3.add(l,d),t));c(p,m,g,s),c(g,v,p,s),c(_,y,b,a),c(b,w,_,a),c(p,_,w,l),c(w,m,p,l),c(v,y,_,f),c(_,p,v,f),c(g,b,y,h),c(y,v,g,h),c(m,w,b,d),c(b,g,m,d)}),o.loadModel(u),s.loadModels(),a.update()}}]);