@ethers-ancillary/exchain
Version:
An ethers-compatible provider for OKExChain.
1 lines • 5.26 MB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ethers")):"function"==typeof define&&define.amd?define(["exports","ethers"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)._ethers_exchain={},e.ethers)}(this,(function(e,t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}var i="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}var s=o,$=a;function l(e){if(s===setTimeout)return setTimeout(e,0);if((s===o||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}"function"==typeof i.setTimeout&&(s=setTimeout),"function"==typeof i.clearTimeout&&($=clearTimeout);var p,c=[],u=!1,d=-1;function f(){u&&p&&(u=!1,p.length?c=p.concat(c):d=-1,c.length&&h())}function h(){if(!u){var e=l(f);u=!0;for(var t=c.length;t;){for(p=c,c=[];++d<t;)p&&p[d].run();d=-1,t=c.length}p=null,u=!1,function(e){if($===clearTimeout)return clearTimeout(e);if(($===a||!$)&&clearTimeout)return $=clearTimeout,clearTimeout(e);try{$(e)}catch(t){try{return $.call(null,e)}catch(t){return $.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}b.prototype.run=function(){this.fun.apply(null,this.array)};function g(){}var k=g,v=g,m=g,w=g,y=g,_=g,x=g;var S=i.performance||{},P=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return(new Date).getTime()};var B=new Date;var M={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];c.push(new b(e,t)),1!==c.length||u||l(h)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:k,addListener:v,once:m,off:w,removeListener:y,removeAllListeners:_,emit:x,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*P.call(S),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-B)/1e3}},I={exports:{}},R=[],E=[],A="undefined"!=typeof Uint8Array?Uint8Array:Array,T=!1;function C(){T=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)R[t]=e[t],E[e.charCodeAt(t)]=t;E["-".charCodeAt(0)]=62,E["_".charCodeAt(0)]=63}function V(e,t,r){for(var n,i,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(R[(i=n)>>18&63]+R[i>>12&63]+R[i>>6&63]+R[63&i]);return o.join("")}function N(e){var t;T||C();for(var r=e.length,n=r%3,i="",o=[],a=16383,s=0,$=r-n;s<$;s+=a)o.push(V(e,s,s+a>$?$:s+a));return 1===n?(t=e[r-1],i+=R[t>>2],i+=R[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=R[t>>10],i+=R[t>>4&63],i+=R[t<<2&63],i+="="),o.push(i),o.join("")}function z(e,t,r,n,i){var o,a,s=8*i-n-1,$=(1<<s)-1,l=$>>1,p=-7,c=r?i-1:0,u=r?-1:1,d=e[t+c];for(c+=u,o=d&(1<<-p)-1,d>>=-p,p+=s;p>0;o=256*o+e[t+c],c+=u,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+e[t+c],c+=u,p-=8);if(0===o)o=1-l;else{if(o===$)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)}function O(e,t,r,n,i,o){var a,s,$,l=8*o-i-1,p=(1<<l)-1,c=p>>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,h=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=p):(a=Math.floor(Math.log(t)/Math.LN2),t*($=Math.pow(2,-a))<1&&(a--,$*=2),(t+=a+c>=1?u/$:u*Math.pow(2,1-c))*$>=2&&(a++,$/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(t*$-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+=f,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+d]=255&a,d+=f,a/=256,l-=8);e[r+d-f]|=128*h}var U={}.toString,D=Array.isArray||function(e){return"[object Array]"==U.call(e)};W.TYPED_ARRAY_SUPPORT=void 0===i.TYPED_ARRAY_SUPPORT||i.TYPED_ARRAY_SUPPORT;var F=j();function j(){return W.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function L(e,t){if(j()<t)throw new RangeError("Invalid typed array length");return W.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=W.prototype:(null===e&&(e=new W(t)),e.length=t),e}function W(e,t,r){if(!(W.TYPED_ARRAY_SUPPORT||this instanceof W))return new W(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 q(this,e)}return K(this,e,t,r)}function K(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);W.TYPED_ARRAY_SUPPORT?(e=t).__proto__=W.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(!W.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Q(t,r),i=(e=L(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(X(t)){var r=0|G(t.length);return 0===(e=L(e,r)).length||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||(n=t.length)!=n?L(e,0):H(e,t);if("Buffer"===t.type&&D(t.data))return H(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function J(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 q(e,t){if(J(t),e=L(e,t<0?0:0|G(t)),!W.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|G(t.length);e=L(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function G(e){if(e>=j())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+j().toString(16)+" bytes");return 0|e}function X(e){return!(null==e||!e._isBuffer)}function Q(e,t){if(X(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 xe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Se(e).length;default:if(n)return xe(e).length;t=(""+t).toLowerCase(),n=!0}}function Z(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 de(this,t,r);case"utf8":case"utf-8":return le(this,t,r);case"ascii":return ce(this,t,r);case"latin1":case"binary":return ue(this,t,r);case"base64":return $e(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function ee(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=W.from(t,n)),X(t))return 0===t.length?-1:te(e,t,r,n,i);if("number"==typeof t)return t&=255,W.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):te(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function te(e,t,r,n,i){var o,a=1,s=e.length,$=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,$/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var p=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===p?0:o-p)){if(-1===p&&(p=o),o-p+1===$)return p*a}else-1!==p&&(o-=o-p),p=-1}else for(r+$>s&&(r=s-$),o=r;o>=0;o--){for(var c=!0,u=0;u<$;u++)if(l(e,o+u)!==l(t,u)){c=!1;break}if(c)return o}return-1}function re(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 ne(e,t,r,n){return Pe(xe(t,e.length-r),e,r,n)}function ie(e,t,r,n){return Pe(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function oe(e,t,r,n){return ie(e,t,r,n)}function ae(e,t,r,n){return Pe(Se(t),e,r,n)}function se(e,t,r,n){return Pe(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function $e(e,t,r){return 0===t&&r===e.length?N(e):N(e.slice(t,r))}function le(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,$,l=e[i],p=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(p=l);break;case 2:128==(192&(o=e[i+1]))&&($=(31&l)<<6|63&o)>127&&(p=$);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&($=(15&l)<<12|(63&o)<<6|63&a)>2047&&($<55296||$>57343)&&(p=$);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&($=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&$<1114112&&(p=$)}null===p?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),i+=c}return function(e){var t=e.length;if(t<=pe)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=pe));return r}(n)}W.poolSize=8192,W._augment=function(e){return e.__proto__=W.prototype,e},W.from=function(e,t,r){return K(null,e,t,r)},W.TYPED_ARRAY_SUPPORT&&(W.prototype.__proto__=Uint8Array.prototype,W.__proto__=Uint8Array),W.alloc=function(e,t,r){return function(e,t,r,n){return J(t),t<=0?L(e,t):void 0!==r?"string"==typeof n?L(e,t).fill(r,n):L(e,t).fill(r):L(e,t)}(null,e,t,r)},W.allocUnsafe=function(e){return q(null,e)},W.allocUnsafeSlow=function(e){return q(null,e)},W.isBuffer=Be,W.compare=function(e,t){if(!X(e)||!X(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},W.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}},W.concat=function(e,t){if(!D(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return W.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=W.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!X(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},W.byteLength=Q,W.prototype._isBuffer=!0,W.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)Y(this,t,t+1);return this},W.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)Y(this,t,t+3),Y(this,t+1,t+2);return this},W.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)Y(this,t,t+7),Y(this,t+1,t+6),Y(this,t+2,t+5),Y(this,t+3,t+4);return this},W.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?le(this,0,e):Z.apply(this,arguments)},W.prototype.equals=function(e){if(!X(e))throw new TypeError("Argument must be a Buffer");return this===e||0===W.compare(this,e)},W.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},W.prototype.compare=function(e,t,r,n,i){if(!X(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(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),$=this.slice(n,i),l=e.slice(t,r),p=0;p<s;++p)if($[p]!==l[p]){o=$[p],a=l[p];break}return o<a?-1:a<o?1:0},W.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},W.prototype.indexOf=function(e,t,r){return ee(this,e,t,r,!0)},W.prototype.lastIndexOf=function(e,t,r){return ee(this,e,t,r,!1)},W.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 re(this,e,t,r);case"utf8":case"utf-8":return ne(this,e,t,r);case"ascii":return ie(this,e,t,r);case"latin1":case"binary":return oe(this,e,t,r);case"base64":return ae(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},W.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var pe=4096;function ce(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 ue(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 de(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+=_e(e[o]);return i}function fe(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 he(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 be(e,t,r,n,i,o){if(!X(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 ge(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 ke(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 ve(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 me(e,t,r,n,i){return i||ve(e,0,r,4),O(e,t,r,n,23,4),r+4}function we(e,t,r,n,i){return i||ve(e,0,r,8),O(e,t,r,n,52,8),r+8}W.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),W.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=W.prototype;else{var i=t-e;r=new W(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},W.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||he(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},W.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||he(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},W.prototype.readUInt8=function(e,t){return t||he(e,1,this.length),this[e]},W.prototype.readUInt16LE=function(e,t){return t||he(e,2,this.length),this[e]|this[e+1]<<8},W.prototype.readUInt16BE=function(e,t){return t||he(e,2,this.length),this[e]<<8|this[e+1]},W.prototype.readUInt32LE=function(e,t){return t||he(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},W.prototype.readUInt32BE=function(e,t){return t||he(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},W.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||he(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},W.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||he(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},W.prototype.readInt8=function(e,t){return t||he(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},W.prototype.readInt16LE=function(e,t){t||he(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},W.prototype.readInt16BE=function(e,t){t||he(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},W.prototype.readInt32LE=function(e,t){return t||he(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},W.prototype.readInt32BE=function(e,t){return t||he(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},W.prototype.readFloatLE=function(e,t){return t||he(e,4,this.length),z(this,e,!0,23,4)},W.prototype.readFloatBE=function(e,t){return t||he(e,4,this.length),z(this,e,!1,23,4)},W.prototype.readDoubleLE=function(e,t){return t||he(e,8,this.length),z(this,e,!0,52,8)},W.prototype.readDoubleBE=function(e,t){return t||he(e,8,this.length),z(this,e,!1,52,8)},W.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||be(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},W.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||be(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},W.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,1,255,0),W.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},W.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,2,65535,0),W.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ge(this,e,t,!0),t+2},W.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,2,65535,0),W.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ge(this,e,t,!1),t+2},W.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,4,4294967295,0),W.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):ke(this,e,t,!0),t+4},W.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,4,4294967295,0),W.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ke(this,e,t,!1),t+4},W.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);be(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},W.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);be(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},W.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,1,127,-128),W.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},W.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,2,32767,-32768),W.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ge(this,e,t,!0),t+2},W.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,2,32767,-32768),W.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ge(this,e,t,!1),t+2},W.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,4,2147483647,-2147483648),W.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):ke(this,e,t,!0),t+4},W.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||be(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),W.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ke(this,e,t,!1),t+4},W.prototype.writeFloatLE=function(e,t,r){return me(this,e,t,!0,r)},W.prototype.writeFloatBE=function(e,t,r){return me(this,e,t,!1,r)},W.prototype.writeDoubleLE=function(e,t,r){return we(this,e,t,!0,r)},W.prototype.writeDoubleBE=function(e,t,r){return we(this,e,t,!1,r)},W.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||!W.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},W.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&&!W.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=X(e)?e:xe(new W(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var ye=/[^+\/0-9A-Za-z-_]/g;function _e(e){return e<16?"0"+e.toString(16):e.toString(16)}function xe(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 Se(e){return function(e){var t,r,n,i,o,a;T||C();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new A(3*s/4-o),n=o>0?s-4:s;var $=0;for(t=0,r=0;t<n;t+=4,r+=3)i=E[e.charCodeAt(t)]<<18|E[e.charCodeAt(t+1)]<<12|E[e.charCodeAt(t+2)]<<6|E[e.charCodeAt(t+3)],a[$++]=i>>16&255,a[$++]=i>>8&255,a[$++]=255&i;return 2===o?(i=E[e.charCodeAt(t)]<<2|E[e.charCodeAt(t+1)]>>4,a[$++]=255&i):1===o&&(i=E[e.charCodeAt(t)]<<10|E[e.charCodeAt(t+1)]<<4|E[e.charCodeAt(t+2)]>>2,a[$++]=i>>8&255,a[$++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ye,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Pe(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}function Be(e){return null!=e&&(!!e._isBuffer||Me(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Me(e.slice(0,0))}(e))}function Me(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Ie=n(Object.freeze({__proto__:null,Buffer:W,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),W.alloc(+e)},isBuffer:Be,kMaxLength:F})),Re="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},Ee=/%[sdj%]/g;function Ae(e){if(!He(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(ze(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(Ee,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])Ke(a)||!Ze(a)?o+=" "+a:o+=" "+ze(a);return o}function Te(e,t){if(Xe(i.process))return function(){return Te(e,t).apply(this,arguments)};if(!0===M.noDeprecation)return e;var r=!1;return function(){if(!r){if(M.throwDeprecation)throw new Error(t);M.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}}var Ce,Ve={};function Ne(e){if(Xe(Ce)&&(Ce=M.env.NODE_DEBUG||""),e=e.toUpperCase(),!Ve[e])if(new RegExp("\\b"+e+"\\b","i").test(Ce)){Ve[e]=function(){var t=Ae.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Ve[e]=function(){};return Ve[e]}function ze(e,t){var r={seen:[],stylize:Ue};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),We(t)?r.showHidden=t:t&<(r,t),Xe(r.showHidden)&&(r.showHidden=!1),Xe(r.depth)&&(r.depth=2),Xe(r.colors)&&(r.colors=!1),Xe(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Oe),De(r,e,r.depth)}function Oe(e,t){var r=ze.styles[t];return r?"["+ze.colors[r][0]+"m"+e+"["+ze.colors[r][1]+"m":e}function Ue(e,t){return e}function De(e,t,r){if(e.customInspect&&t&&tt(t.inspect)&&t.inspect!==ze&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return He(n)||(n=De(e,n,r)),n}var i=function(e,t){if(Xe(t))return e.stylize("undefined","undefined");if(He(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(qe(t))return e.stylize(""+t,"number");if(We(t))return e.stylize(""+t,"boolean");if(Ke(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),et(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Fe(t);if(0===o.length){if(tt(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(Qe(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ye(t))return e.stylize(Date.prototype.toString.call(t),"date");if(et(t))return Fe(t)}var $,l="",p=!1,c=["{","}"];(Le(t)&&(p=!0,c=["[","]"]),tt(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return Qe(t)&&(l=" "+RegExp.prototype.toString.call(t)),Ye(t)&&(l=" "+Date.prototype.toUTCString.call(t)),et(t)&&(l=" "+Fe(t)),0!==o.length||p&&0!=t.length?r<0?Qe(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),$=p?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)pt(t,String(a))?o.push(je(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(je(e,t,r,n,i,!0))})),o}(e,t,r,a,o):o.map((function(n){return je(e,t,r,a,n,p)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}($,l,c)):c[0]+l+c[1]}function Fe(e){return"["+Error.prototype.toString.call(e)+"]"}function je(e,t,r,n,i,o){var a,s,$;if(($=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=$.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):$.set&&(s=e.stylize("[Setter]","special")),pt(n,i)||(a="["+i+"]"),s||(e.seen.indexOf($.value)<0?(s=Ke(r)?De(e,$.value,null):De(e,$.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),Xe(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Le(e){return Array.isArray(e)}function We(e){return"boolean"==typeof e}function Ke(e){return null===e}function Je(e){return null==e}function qe(e){return"number"==typeof e}function He(e){return"string"==typeof e}function Ge(e){return"symbol"==typeof e}function Xe(e){return void 0===e}function Qe(e){return Ze(e)&&"[object RegExp]"===it(e)}function Ze(e){return"object"==typeof e&&null!==e}function Ye(e){return Ze(e)&&"[object Date]"===it(e)}function et(e){return Ze(e)&&("[object Error]"===it(e)||e instanceof Error)}function tt(e){return"function"==typeof e}function rt(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function nt(e){return W.isBuffer(e)}function it(e){return Object.prototype.toString.call(e)}function ot(e){return e<10?"0"+e.toString(10):e.toString(10)}ze.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ze.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var at=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function st(){var e=new Date,t=[ot(e.getHours()),ot(e.getMinutes()),ot(e.getSeconds())].join(":");return[e.getDate(),at[e.getMonth()],t].join(" ")}function $t(){console.log("%s - %s",st(),Ae.apply(null,arguments))}function lt(e,t){if(!t||!Ze(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function pt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ct={inherits:Re,_extend:lt,log:$t,isBuffer:nt,isPrimitive:rt,isFunction:tt,isError:et,isDate:Ye,isObject:Ze,isRegExp:Qe,isUndefined:Xe,isSymbol:Ge,isString:He,isNumber:qe,isNullOrUndefined:Je,isNull:Ke,isBoolean:We,isArray:Le,inspect:ze,deprecate:Te,format:Ae,debuglog:Ne},ut=n(Object.freeze({__proto__:null,format:Ae,deprecate:Te,debuglog:Ne,inspect:ze,isArray:Le,isBoolean:We,isNull:Ke,isNullOrUndefined:Je,isNumber:qe,isString:He,isSymbol:Ge,isUndefined:Xe,isRegExp:Qe,isObject:Ze,isDate:Ye,isError:et,isFunction:tt,isPrimitive:rt,isBuffer:nt,log:$t,inherits:Re,_extend:lt,default:ct}));!function(e,t){e.exports=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,{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=34)}([function(e,t,n){(function(e){(function(){var t,i;if(Error.stackTraceLimit=1/0,"undefined"!=typeof window?t=window:"undefined"!=typeof self?t=self:void 0!==r?(t=r).require=n(36):t=this,void 0===t||void 0===t.Array)throw new Error("no global object found");i=e;var o,a={},s=0,$=function(e){return e?Object.keys(e):[]},l=function(){},p=function(){o("invalid memory address or nil pointer dereference")},c=function(e,t,r){return e.apply(t,r)},u=function(e,t){for(var r=new e.constructor(e.length),n=0;n<e.length;n++)r[n]=t(e[n]);return r},d=function(e,t){var r=e.$methodVals||{};e.$methodVals=r;var n=r[t];if(void 0!==n)return n;var i=e[t];return n=function(){Ze--;try{return i.apply(e,arguments)}finally{Ze++}},r[t]=n,n},f=function(e,t,r,n){if(void 0===r&&(r=e.$length),void 0===n&&(n=e.$capacity),(t<0||r<t||n<r||r>e.$capacity||n>e.$capacity)&&o("slice bounds out of range"),e===e.constructor.nil)return e;var i=new e.constructor(e.$array);return i.$offset=e.$offset+t,i.$length=r-t,i.$capacity=n-t,i},h=function(e,t,r){return(t<0||r<t||r>e.length)&&o("slice bounds out of range"),e.substring(t,r)},b=function(e){return e.$array.constructor!==Array?e.$array.subarray(e.$offset,e.$offset+e.$length):e.$array.slice(e.$offset,e.$offset+e.$length)},g=function(e,t){var r=e.charCodeAt(t);if(r<128)return[r,1];if(r!=r||r<192)return[65533,1];var n=e.charCodeAt(t+1);if(n!=n||n<128||192<=n)return[65533,1];if(r<224)return(o=(31&r)<<6|63&n)<=127?[65533,1]:[o,2];var i=e.charCodeAt(t+2);if(i!=i||i<128||192<=i)return[65533,1];if(r<240)return(o=(15&r)<<12|(63&n)<<6|63&i)<=2047||55296<=o&&o<=57343?[65533,1]:[o,3];var o,a=e.charCodeAt(t+3);return a!=a||a<128||192<=a?[65533,1]:r<248?(o=(7&r)<<18|(63&n)<<12|(63&i)<<6|63&a)<=65535||1114111<o?[65533,1]:[o,4]:[65533,1]},k=function(e){return(e<0||e>1114111||55296<=e&&e<=57343)&&(e=65533),e<=127?String.fromCharCode(e):e<=2047?String.fromCharCode(192|e>>6,128|63&e):e<=65535?String.fromCharCode(224|e>>12,128|e>>6&63,128|63&e):String.fromCharCode(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e)},v=function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t},m=function(e){if(0===e.$length)return"";for(var t="",r=0;r<e.$length;r+=1e4)t+=String.fromCharCode.apply(void 0,e.$array.subarray(e.$offset+r,e.$offset+Math.min(e.$length,r+1e4)));return t},w=function(e){for(var t,r=new Int32Array(e.length),n=0,i=0;i<e.length;i+=t[1],n++)t=g(e,i),r[n]=t[0];return r.subarray(0,n)},y=function(e){if(0===e.$length)return"";for(var t="",r=0;r<e.$length;r++)t+=k(e.$array[e.$offset+r]);return t},_=function(e,t){for(var r=Math.min(t.length,e.$length),n=0;n<r;n++)e.$array[e.$offset+n]=t.charCodeAt(n);return r},x=function(e,t){var r=Math.min(t.$length,e.$length);return S(e.$array,t.$array,e.$offset,t.$offset,r,e.constructor.elem),r},S=function(e,t,r,n,i,o){if(0!==i&&(e!==t||r!==n))if(t.subarray)e.set(t.subarray(n,n+i),r);else{switch(o.kind){case G:case Q:if(e===t&&r>n){for(var a=i-1;a>=0;a--)o.copy(e[r+a],t[n+a]);return}for(a=0;a<i;a++)o.copy(e[r+a],t[n+a]);return}if(e===t&&r>n)for(a=i-1;a>=0;a--)e[r+a]=t[n+a];else for(a=0;a<i;a++)e[r+a]=t[n+a]}},P=function(e,t){var r=t.zero();return t.copy(r,e),r},B=function(e,t){void 0===e.$proxies&&(e.$proxies={},e.$proxies[e.constructor.string]=e);var r=e.$proxies[t.string];if(void 0===r){for(var n={},i=0;i<t.elem.fields.length;i++)!function(t){n[t]={get:function(){return e[t]},set:function(r){e[t]=r}}}(t.elem.fields[i].prop);(r=Object.create(t.prototype,n)).$val=r,e.$proxies[t.string]=r,r.$proxies=e.$proxies}return r},M=function(e){return R(e,arguments,1,arguments.length-1)},I=function(e,t){if(t.constructor===String){var r=v(t);return R(e,r,0,r.length)}return R(e,t.$array,t.$offset,t.$length)},R=function(e,t,r,n){if(0===n)return e;var i=e.$array,o=e.$offset,a=e.$length+n,s=e.$capacity;if(a>s)if(o=0,s=Math.max(a,e.$capacity<1024?2*e.$capacity:Math.floor(5*e.$capacity/4)),e.$array.constructor===Array){(i=e.$array.slice(e.$offset,e.$offset+e.$length)).length=s;for(var $=e.constructor.elem.zero,l=e.$length;l<s;l++)i[l]=$()}else(i=new e.$array.constructor(s)).set(e.$array.subarray(e.$offset,e.$offset+e.$length));S(i,t,o+e.$length,r,n,e.constructor.elem);var p=new e.constructor(i);return p.$offset=o,p.$length=a,p.$capacity=s,p},E=function(e,t,r){if(r===ze)return e===t;switch(r.kind){case q:case H:return e.$real===t.$real&&e.$imag===t.$imag;case K:case J:return e.$high===t.$high&&e.$low===t.$low;case G:if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!E(e[n],t[n],r.elem))return!1;return!0;case Q:for(n=0;n<r.fields.length;n++){var i=r.fields[n];if(!E(e[i.prop],t[i.prop],i.typ))return!1}return!0;case X:return A(e,t);default:return e===t}},A=function(e,t){return e===Ce||t===Ce?e===t:e.constructor===t.constructor&&(e.constructor===ze?e.object===t.object:(e.constructor.comparable||o("comparing uncomparable type "+e.constructor.string),E(e.$val,t.$val,e.constructor)))},T=Math.min,C=parseInt,V=function(e){return null!=e&&e.constructor===Number?e:parseFloat(e)},N=new Float32Array(1),z=Math.fround||function(e){return N[0]=e,N[0]},O=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)>>0},U=function(e){return 4294967296*e.$high+e.$low},D=function(e,t){return 0===t?e:t<32?new e.constructor(e.$high<<t|e.$low>>>32-t,e.$low<<t>>>0):t<64?new e.constructor(e.$low<<t-32,0):new e.constructor(0,0)},F=function(e,t){return 0===t?e:t<32?new e.constructor(e.$high>>t,(e.$low>>>t|e.$high<<32-t)>>>0):t<64?new e.constructor(e.$high>>31,e.$high>>t-32>>>0):e.$high<0?new e.constructor(-1,4294967295):new e.constructor(0,0)},j=function(e,t){return 0===t?e:t<32?new e.constructor(e.$high>>>t,(e.$low>>>t|e.$high<<32-t)>>>0):t<64?new e.constructor(0,e.$high>>>t-32):new e.constructor(0,0)},L=function(e,t){var r=0,n=0;0!=(1&t.$low)&&(r=e.$high,n=e.$low);for(var i=1;i<32;i++)0!=(t.$low&1<<i)&&(r+=e.$high<<i|e.$low>>>32-i,n+=e.$low<<i>>>0);for(i=0;i<32;i++)0!=(t.$high&1<<i)&&(r+=e.$low<<i);return new e.constructor(r,n)},W=function(e,t,r){0===t.$high&&0===t.$low&&o("integer divide by zero");var n=1,i=1,a=e.$high,s=e.$low;a<0&&(n=-1,i=-1,a=-a,0!==s&&(a--,s=4294967296-s));var $=t.$high,l=t.$low;t.$high<0&&(n*=-1,$=-$,0!==l&&($--,l=4294967296-l));for(var p=0,c=0,u=0;$<2147483648&&(a>$||a===$&&s>l);)$=($<<1|l>>>31)>>>0,l=l<<1>>>0,u++;for(var d=0;d<=u;d++)p=p<<1|c>>>31,c=c<<1>>>0,(a>$||a===$&&s>=l)&&(a-=$,(s-=l)<0&&(a--,s+=4294967296),4294967296==++c&&(p++,c=0)),l=(l>>>1|$<<31)>>>0,$>>>=1;return r?new e.constructor(a*i,s*i):new e.constructor(p*n,c*n)},K=6,J=11,q=15,H=16,G=17,X=20,Q=25,Z=[],Y=function(e){if(e===Ce)return"nil";var t=e.constructor;return t.string+"$"+t.keyFor(e.$val)},ee=function(e){return e},te=0,re=function(e){return void 0===e.$id&&(s++,e.$id=s),String(e.$id)},ne=function(e,t,r,n,i,o,a){var $;switch(t){case 1:case 2:case 3:case 4:case 5:case 7:case 8:case 9:case 10:case 12:case 26:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=ee;break;case 24:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=function(e){return"$"+e};break;case 13:case 14:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=function(e){return function(e){return e!=e?"NaN$"+ ++s:String(e)}(e)};break;case K:($=function(e,t){this.$high=e+Math.floor(Math.ceil(t)/4294967296)>>0,this.$low=t>>>0,this.$val=this}).keyFor=function(e){return e.$high+"$"+e.$low};break;case J:($=function(e,t){this.$high=e+Math.floor(Math.ceil(t)/4294967296)>>>0,this.$low=t>>>0,this.$val=this}).keyFor=function(e){return e.$high+"$"+e.$low};break;case q:($=function(e,t){this.$real=z(e),this.$imag=z(t),this.$val=this}).keyFor=function(e){return e.$real+"$"+e.$imag};break;case H:($=function(e,t){this.$real=e,this.$imag=t,this.$val=this}).keyFor=function(e){return e.$real+"$"+e.$imag};break;case G:($=function(e){this.$val=e}).wrapped=!0,$.ptr=ne(4,22,"*"+r,!1,"",!1,(function(e){this.$get=function(){return e},this.$set=function(e){$.copy(this,e)},this.$val=e})),$.init=function(e,t){$.elem=e,$.len=t,$.comparable=e.comparable,$.keyFor=function(t){return Array.prototype.join.call(u(t,(function(t){return String(e.keyFor(t)).replace(/\\/g,"\\\\").replace(/\$/g,"\\$")})),"$")},$.copy=function(t,r){S(t,r,0,0,r.length,e)},$.ptr.init($),Object.defineProperty($.ptr.nil,"nilCheck",{get:p})};break;case 18:($=function(e){this.$val=e}).wrapped=!0,$.keyFor=re,$.init=function(e,t,r){$.elem=e,$.sendOnly=t,$.recvOnly=r};break;case 19:($=function(e){this.$val=e}).wrapped=!0,$.init=function(e,t,r){$.params=e,$.results=t,$.variadic=r,$.comparable=!1};break;case X:($={implementedBy:{},missingMethodFor:{}}).keyFor=Y,$.init=function(e){$.methods=e,e.forEach((function(e){Ce[e.prop]=p}))};break;case 21:($=function(e){this.$val=e}).wrapped=!0,$.init=function(e,t){$.key=e,$.elem=t,$.comparable=!1};break;case 22:($=a||function(e,t,r){this.$get=e,this.$set=t,this.$target=r,this.$val=this}).keyFor=re,$.init=function(e){$.elem=e,$.wrapped=e.kind===G,$.nil=new $(p,p)};break;case 23:($=function(e){e.constructor!==$.nativeArray&&(e=new $.nativeArray(e)),this.$array=e,this.$offset=0,this.$length=e.length,this.$capacity=e.length,this.$val=this}).init=function(e){$.elem=e,$.comparable=!1,$.nativeArray=_e(e.kind),$.nil=new $([])};break;case Q:($=function(e){this.$val=e}).wrapped=!0,$.ptr=ne(4,22,"*"+r,!1,i,o,a),$.ptr.elem=$,$.ptr.prototype.$get=function(){return this},$.ptr.prototype.$set=function(e){$.copy(this,e)},$.init=function(e,t){$.pkgPath=e,$.fields=t,t.forEach((function(e){e.typ.comparable||($.comparable=!1)})),$.keyFor=function(e){var r=e.$val;return u(t,(function(e){return String(e.typ.keyFor(r[e.prop])).replace(/\\/g,"\\\\").replace(/\$/g,"\\$")})).join("$")},$.copy=function(e,r){for(var n=0;n<t.length;n++){var i=t[n];switch(i.typ.kind){case G:case Q:i.typ.copy(e[i.prop],r[i.prop]);continue;default:e[i.prop]=r[i.prop];continue}}};var r={};t.forEach((function(e){r[e.prop]={get:p,set:p}})),$.ptr.nil=Object.create(a.prototype,r),$.ptr.nil.$val=$.ptr.nil,function(e){null!==Z?Z.push(e):e()}((function(){var e=function(e,t,r){void 0===e.prototype[t.prop]&&(e.prototype[t.prop]=function(){var e=this.$val[r.prop];return r.typ===ze&&(e=new ze(e)),void 0===e.$val&&(e=new r.typ(e)),e[t.prop].apply(e,arguments)})};t.forEach((function(t){t.embedded&&(ie(t.typ).forEach((function(r){e($,r,t),e($.ptr,r,t)})),ie(We(t.typ)).forEach((function(r){e($.ptr,r,t)})))}))}))};break;default:rt(new we("invalid kind: "+t))}switch(t){case 1:case 21:$.zero=function(){return!1};break;case 2:case 3:case 4:case 5:case 7:case 8:case 9:case 10:case 12:case 26:case 13:case 14:$.zero=function(){return 0};break;case 24:$.zero=function(){return""};break;case K:case J:case q:case H:var l=new $(0,0);$.zero=function(){return l};break;case 22:case 23:$.zero=function(){return $.nil};break;case 18:$.zero=function(){return Ie};break;case 19:$.zero=function(){return p};break;case X:$.zero=function(){return Ce};break;case G:$.zero=function(){var e=_e($.elem.kind);if(e!==Array)return new e($.len);for(var t=new Array($.len),r=0;r<$.len;r++)t[r]=$.elem.zero();return t};break;case Q:$.zero=function(){return new $.ptr};break;default:rt(new we("invalid kind: "+t))}return $.id=te,te++,$.size=e,$.kind=t,$.string=r,$.named=n,$.pkg=i,$.exported=o,$.methods=[],$.methodSetCache=null,$.comparable=!0,$},ie=function(e){if(null!==e.methodSetCache)return e.methodSetCache;var t={},r=22===e.kind;if(r&&e.elem.kind===X)return e.methodSetCache=[],[];for(var n=[{typ:r?e.elem:e,indirect:r}],i={};n.length>0;){var o=[],a=[];n.forEach((function(e){if(!i[e.typ.string])switch(i[e.typ.string]=!0,e.typ.named&&(a=a.concat(e.typ.methods),e.indirect&&(a=a.concat(We(e.typ).methods))),e.typ.kind){case Q:e.typ.fields.forEach((function(t){if(t.embedded){var r=t.typ,n=22===r.kind;o.push({typ:n?r.elem:r,indirect:e.indirect||n})}}));break;case X:a=a.concat(e.typ.methods)}})),a.forEach((function(e){void 0===t[e.name]&&(t[e.name]=e)})),n=o}return e.methodSetCache=[],Object.keys(t).sort().forEach((function(r){e.methodSetCache.push(t[r])})),e.methodSetCache},oe=ne(1,1,"bool",!0,"",!1,null),ae=ne(4,2,"int",!0,"",!1,null),se=ne(1,3,"int8",!0,"",!1,null),$e=ne(2,4,"int16",!0,"",!1,null),le=ne(4,5,"int32",!0,"",!1,null),pe=ne(8,K,"int64",!0,"",!1,null),ce=ne(4,7,"uint",!0,"",!1,null),ue=ne(1,8,"uint8",!0,"",!1,null),de=ne(2,9,"uint16",!0,"",!1,null),fe=ne(4,10,"uint32",!0,"",!1,null),he=ne(8,J,"uint64",!0,"",!1,null),be=ne(4,12,"uintptr",!0,"",!1,null),ge=ne(4,13,"float32",!0,"",!1,null),ke=ne(8,14,"float64",!0,"",!1,null),ve=ne(8,q,"complex64",!0,"",!1,null),me=ne(16,H,"complex128",!0,"",!1,null),we=ne(8,24,"string",!0,"",!1,null),ye=ne(4,26,"unsafe.Pointer",!0,"",!1,null),_e=function(e){switch(e){case 2:return Int32Array;case 3:return Int8Array;case 4:return Int16Array;case 5:return Int32Array;case 7:return Uint32Array;case 8:return Uint8Array;case 9:return Uint16Array;case 10:case 12:return Uint32Array;case 13:return Float32Array;case 14:return Float64Array;default:return Array}},xe=function(e,t){var r=_e(e);return r===Array?t:new r(t)},Se={},Pe=function(e,t){var r=e.id+"$"+t,n=Se[r];return void 0===n&&(n=ne(12,G,"["+t+"]"+e.string,!1,"",!1,null),Se[r]=n,n.init(e,t)),n},Be=function(e,t,r){var n=(r?"<-":"")+"chan"+(t?"<- ":" ")+e.string,i=t?"SendChan":r?"RecvChan":"Chan",o=e[i];return void 0===o&&(o=ne(4,18,n,!1,"",!1,null),e[i]=o,o.init(e,t,r)),o},Me=function(e,t){(t<0||t>2147483647)&&o("makechan: size out of range"),this.$elem=e,this.$capacity=t,this.$buffer=[],this.$sendQueue=[],this.$recvQueue=[],this.$closed=!1},Ie=new Me(null,0);Ie.$sendQueue=Ie.$recvQueue={length:0,push:function(){},shift:function(){},indexOf:function(){return-1}};var Re={},Ee=function(e,t,r){var n=u(e,(function(e){return e.id})).join(",")+"$"+u(t,(function(e){return e.id})).join(",")+"$"+r,i=Re[n];if(void 0===i){var o=u(e,(function(e){return e.string}));r&&(o[o.length-1]="..."+o[o.length-1].substr(2));var a="func("+o.join(", ")+")";1===t.length?a+=" "+t[0].string:t.length>1&&(a+=" ("+u(t,(function(e){return e.string})).join(", ")+")"),i=ne(4,19,a,!1,"",!1,null),Re[n]=i,i.init(e,t,r)}return i},Ae={},Te=function(e){var t=u(e,(function(e){return e.pkg+","+e.name+","+e.typ.id})).join("$"),r=Ae[t];if(void 0===r){var n="interface {}";0!==e.length&&(n="interface { "+u(e,(function(e){return(""!==e.pkg?e.pkg+".":"")+e.name+e.typ.string.substr(4)})).join("; ")+" }"),r=ne(8,X,n,!1,"",!1,null),Ae[t]=r,r.init(e)}return r}([]),Ce={},Ve=ne(8,X,"error",!0,"",!1,null);Ve.init([{prop:"Error",name:"Error",pkg:"",typ:Ee([],[we],!1)}]);var Ne,ze,Oe,Ue,De,Fe={},je=function(e,t){var r=e.id+"$"+t.id,n=Fe[r];return void 0===n&&(n=ne(4,21,"map["+e.string+"]"+t.string,!1,"",!1,null),Fe[r]=n,n.init(e,t)),n},Le=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n];r[e(i.k)]=i}return r},We=function(e){var t=e.ptr;return void 0===t&&(t=ne(4,22,"*"+e.string,!1,"",e.exported,null),e.ptr=t,t.init(e)),t},Ke=function(e,t){return t.elem.kind===Q?e:new t((function(){return e}),(function(t){e=t}))},Je=function(e,t,r){return e.$ptr=e.$ptr||{},e.$ptr[t]||(e.$ptr[t]=new r((function(){return e[t]}),(function(r){e[t]=r})))},qe=function(e){var t=e.slice;return void 0===t&&(t=ne(12,23,"[]"+e.string,!1,"",!1,null),e.slice=t,t.init(e)),t},He=function(e,t,r){r=r||t,(t<0||t>2147483647)&&o("makeslice: len out of range"),(r<0||r<t||r>2147483647)&&o("makeslice: cap out of range");var n=new e.nativeArray(r);if(e.nativeArray===Array)for(var i=0;i<r;i++)n[i]=e.elem.zero();var a=new e(n);return a.$length=t,a},Ge={},Xe=function(e,t){var r=u(t,(function(e){return e.name+","+e.typ.id+","+e.tag})).join("$"),n=Ge[r];if(void 0===n){var i="struct { "+u(t,(function(e){return e.name+" "+e.typ.string+(""!==e.tag?' "'+e.tag.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"':"")})).join("; ")+" }";0===t.length&&(i="struct {}"),n=ne(0,Q,i,!1,"",!1,(function(){this.$val=this;for(var e=0;e<t.length;e++){var r=t[e],n=arguments[e];this[r.prop]=void 0!==n?n:r.typ.zero()}})),Ge[r]=n,n.init(e,t)}return n},Qe=function(e,t,r){var n,i=t.kind===X,o="";if(e===Ce)n=!1;else if(i){var s=e.constructor.string;if(void 0===(n=t.implementedBy[s])){n=!0;for(var $=ie(e.constructor),l=t.methods,p=0;p<l.length;p++){for(var c=l[p],u=!1,d=0;d<$.length;d++){var f=$[d];if(f.name===c.name&&f.pkg===c.pkg&&f.typ===c.typ){u=!0;break}}if(!u){n=!1,t.missingMethodFor[s]=c.name;break}}t.implementedBy[s]=n}n||(o=t.missingMethodFor[s])}else n=e.constructor===t;if(!n){if(r)return[t.zero(),!1];rt(new a.runtime.TypeAssertionError.ptr(a.runtime._type.ptr.nil,e===Ce?a.runtime._type.ptr.nil:new a.runtime._type.ptr(e.constructor.string),new a.runtime._type.ptr(t.string),o))}return i||(e=e.$val),t===ze&&(e=e.object),r?[e,!0]:e},Ze=0,Ye=function(){var e=new Error;if(void 0!==e.stack)return Ze+e.stack.split("\n").length},et=null,tt=function(e,t,r){if(!r&&null!==e&&e.index>=ot.deferStack.length)throw t;if(null!==t){var n=null;try{ot.deferStack.push(e),rt(new Oe(t))}catch(e){n=e}return ot.deferStack.pop(),void tt(e,n)}if(!ot.asleep){Ze--;var i=et,o=Ne,a=ot.panicStack.pop();void 0!==a&&(et=Ye(),Ne=a);try{for(;;){if(null===e&&void 0===(e=ot.deferStack[ot.deferStack.length-1])){if(et=null,a.Object instanceof Error)throw a.Object;var s;throw s=a.constructor===we?a.$val:void 0!==a.Error?a.Error():void 0!==a.String?a.String():a,new Error(s)}var $=e.pop();if(void 0===$){if(ot.deferStack.pop(),void 0!==a){e=null;continue}return}var l=$[0].apply($[2],$[1]);if(l&&void 0!==l.$blk){if(e.push([l.$blk,[],l]),r)throw null;return}if(void 0!==a&&null===et)throw null}}finally{void 0!==a&&(null!==et&&ot.panicStack.push(a),et=i,Ne=o),Ze++}}},rt=function(e){ot.panicStack.push(e),tt(null,null,!0)},nt=function(){return null===et||void 0!==et&&et!==Ye()-2?Ce:(et=null,Ne)},it={asleep:!1,exit:!1,deferStack:[],panicStack:[]},ot=it,at=0,st=!0,$t=!1,lt=[],pt=function(){try{for(var e;void 0!==(e=lt.shift());)e()}finally{lt.length>0&&setTimeout(pt,0)}},ct=function(e){e.asleep&&(e.asleep=!1,at++),lt.push(e),ot===it&&pt()},ut=function(){ot===it&&o("cannot block in JavaScript callback, fix by wrapping code in goroutine"),ot.asleep=!0},dt=fu