web3.js/dist/web3.min.js

8 lines
140 KiB
JavaScript
Raw Normal View History

require=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){var n=t("bignumber.js"),i=t("../utils/utils"),o=t("./formatters"),s=t("./param"),a=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(i.isArray(t)&&e){var r=this;return t.map(function(t){return r._inputFormatter(t)}).reduce(function(t,e){return t.combine(e)},o.formatInputInt(t.length)).withOffset(32)}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var r=[],i=new n(t.dynamicPart().slice(0,64),16),o=0;64*i>o;o+=64)r.push(this._outputFormatter(new s(t.dynamicPart().substr(o+64,64))));return r}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,r){return"bytes"===this._mode?s.decodeBytes(t,e):a(r)?s.decodeArray(t,e):s.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,a(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var r=this,n=t.map(function(t,n){return r._formatInput(t,e[n])});return s.encodeList(n)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var r=this;return t.map(function(t,n){var i=r._requireType(t),o=i.sliceParam(e,n,t);return i.formatOutput(o,a(t))})};var h=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:o.formatInputBool,outputFormatter:o.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:o.formatInputDynamicBytes,outputFormatter:o.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:o.formatInputBytes,outputFormatter:o.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:o.formatInputReal,outputFormatter:o.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:o.formatInputReal,outputFormatter:o.formatOutputUReal})]);e.exports=h},{"../utils/utils":6,"./formatters":2,"./param":3,"bignumber.js":"bignumber.js"}],2:[function(t,e,r){var n=t("bignumber.js"),i=t("../utils/utils"),o=t("../utils/config"),s=t("./param"),a=function(t){var e=2*o.ETH_PADDING;n.config(o.ETH_BIGNUMBER_ROUNDING_MODE);var r=i.padLeft(i.toTwosComplement(t).round().toString(16),e);return new s(r)},u=function(t){var e=i.fromAscii(t,o.ETH_PADDING).substr(2);return new s(e)},c=function(t){var e=i.fromAscii(t,o.ETH_PADDING).substr(2);return new s(a(t.length).value+e,32)},h=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new s(e)},f=function(t){return a(new n(t).times(new n(2).pow(128)))},l=function(t){return"1"===new n(t.substr(0,1),16).toString(2).substr(0,1)},p=function(t){var e=t.staticPart()||"0";return l(e)?new n(e,16).minus(new n("fffffffffffffffffffffffffffffff
2015-06-24 06:50:19 +00:00
},s.prototype.attachToObject=function(t){var e=this.send.bind(this);e.request=this.request.bind(this),e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},s.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);return this.validateArgs(n),{method:e,params:n,callback:r}},s.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},s.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return n.getInstance().sendAsync(t,function(r,n){t.callback(r,e.formatOutput(n))})}return this.formatOutput(n.getInstance().send(t))},e.exports=s},{"../utils/utils":6,"./errors":13,"./requestmanager":27}],23:[function(t,e,r){var n=t("./contract"),i="0xc6d9d2cd449a754c494264e1809c50e34d64562b",o=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"name",outputs:[{name:"o_name",type:"bytes32"}],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"owner",outputs:[{name:"",type:"address"}],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"content",outputs:[{name:"",type:"bytes32"}],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"addr",outputs:[{name:"",type:"address"}],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"}],name:"reserve",outputs:[],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"subRegistrar",outputs:[{name:"o_subRegistrar",type:"address"}],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_newOwner",type:"address"}],name:"transfer",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_registrar",type:"address"}],name:"setSubRegistrar",outputs:[],type:"function"},{constant:!1,inputs:[],name:"Registrar",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_a",type:"address"},{name:"_primary",type:"bool"}],name:"setAddress",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_content",type:"bytes32"}],name:"setContent",outputs:[],type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"}],name:"disown",outputs:[],type:"function"},{constant:!0,inputs:[{name:"_name",type:"bytes32"}],name:"register",outputs:[{name:"",type:"address"}],type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"name",type:"bytes32"}],name:"Changed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"name",type:"bytes32"},{indexed:!0,name:"addr",type:"address"}],name:"PrimaryChanged",type:"event"}];e.exports=n(o).at(i)},{"./contract":11}],24:[function(t,e,r){var n=t("../utils/utils"),i=t("./property"),o=[],s=[new i({name:"listening",getter:"net_listening"}),new i({name:"peerCount",getter:"net_peerCount",outputFormatter:n.toDecimal})];e.exports={methods:o,properties:s}},{"../utils/utils":6,"./property":25}],25:[function(t,e,r){var n=t("./requestmanager"),i=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};i.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},i.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},i.prototype.attachToObject=function(t){var e={get:this.get.bind(this)},r=this.name.split("."),n=r[0];r.length>1&&(t[r[0]]=t[r[0]]||{},t=t[r[0]],n=r[1]),Object.defineProperty(t,n,e);var i=function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)};t[i("get",n)]=this.getAsync.bind(this)},i.prototype.get=function(){return this.formatOutput(n.getInstance().send({method:this.getter}))},i.prototype.getAsync=function(t){var e=this;n.getInstance().sendAsync({method:this.getter},function(r,n){return r?t(r):void t(r,e.formatOutput(n))})},e.exports=i},{"./requestmanager":27}],26:[function(t,e,r){var n=function(){};n.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return
2015-06-24 06:50:19 +00:00
}},{}],38:[function(t,e,r){var n=e.exports,i=(t("events").EventEmitter,t("./lib/request")),o=t("url");n.request=function(t,e){"string"==typeof t&&(t=o.parse(t)),t||(t={}),t.host||t.port||(t.port=parseInt(window.location.port,10)),!t.host&&t.hostname&&(t.host=t.hostname),t.protocol||(t.protocol=t.scheme?t.scheme+":":window.location.protocol),t.host||(t.host=window.location.hostname||window.location.host),/:/.test(t.host)&&(t.port||(t.port=t.host.split(":")[1]),t.host=t.host.split(":")[0]),t.port||(t.port="https:"==t.protocol?443:80);var r=new i(new s,t);return e&&r.on("response",e),r},n.get=function(t,e){t.method="GET";var r=n.request(t,e);return r.end(),r},n.Agent=function(){},n.Agent.defaultMaxSockets=4;var s=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var t=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],e=0;e<t.length;e++)try{var r=new window.ActiveXObject(t[e]);return function(){if(r){var n=r;return r=null,n}return new window.ActiveXObject(t[e])}}catch(n){}throw new Error("ajax not supported in this browser")}throw new Error("ajax not supported in this browser")}();n.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{"./lib/request":39,events:37,url:62}],39:[function(t,e,r){var n=t("stream"),i=t("./response"),o=t("Base64"),s=t("inherits"),a=e.exports=function(t,e){var r=this;r.writable=!0,r.xhr=t,r.body=[],r.uri=(e.protocol||"http:")+"//"+e.host+(e.port?":"+e.port:"")+(e.path||"/"),"undefined"==typeof e.withCredentials&&(e.withCredentials=!0);try{t.withCredentials=e.withCredentials}catch(n){}if(e.responseType)try{t.responseType=e.responseType}catch(n){}if(t.open(e.method||"GET",r.uri,!0),t.onerror=function(t){r.emit("error",new Error("Network error"))},r._headers={},e.headers)for(var s=u(e.headers),a=0;a<s.length;a++){var c=s[a];if(r.isSafeRequestHeader(c)){var h=e.headers[c];r.setHeader(c,h)}}e.auth&&this.setHeader("Authorization","Basic "+o.btoa(e.auth));var f=new i;f.on("close",function(){r.emit("close")}),f.on("ready",function(){r.emit("response",f)}),f.on("error",function(t){r.emit("error",t)}),t.onreadystatechange=function(){t.__aborted||f.handle(t)}};s(a,n),a.prototype.setHeader=function(t,e){this._headers[t.toLowerCase()]=e},a.prototype.getHeader=function(t){return this._headers[t.toLowerCase()]},a.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},a.prototype.write=function(t){this.body.push(t)},a.prototype.destroy=function(t){this.xhr.__aborted=!0,this.xhr.abort(),this.emit("close")},a.prototype.end=function(t){void 0!==t&&this.body.push(t);for(var e=u(this._headers),r=0;r<e.length;r++){var n=e[r],i=this._headers[n];if(c(i))for(var o=0;o<i.length;o++)this.xhr.setRequestHeader(n,i[o]);else this.xhr.setRequest
c.removeListener("end",u),c.removeListener("close",u),t.removeListener("close",u)}var c=this;c.on("data",r),t.on("drain",n),t._isStdio||e&&e.end===!1||(c.on("end",o),c.on("close",s));var h=!1;return c.on("error",a),t.on("error",a),c.on("end",u),c.on("close",u),t.on("close",u),t.emit("pipe",c),t}},{events:37,inherits:43,"readable-stream/duplex.js":49,"readable-stream/passthrough.js":56,"readable-stream/readable.js":57,"readable-stream/transform.js":58,"readable-stream/writable.js":59}],61:[function(t,e,r){function n(t){if(t&&!u(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function s(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=t("buffer").Buffer,u=a.isEncoding||function(t){switch(t&&t.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}},c=r.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";t=t.slice(r,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=e.charCodeAt(e.length-1);if(!(n>=55296&&56319>=n)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&56319>=n){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(2>=e&&r>>4==14){this.charLength=3;break}if(3>=e&&r>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:33}],62:[function(t,e,r){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&c(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function o(t){return u(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function s(t,e){return i(t,!1,!0).resolve(e)}function a(t,e){return t?i(t,!1,!0).resolveObject(e):e}function u(t){return"string"==typeof t}function c(t){return"object"==typeof t&&null!==t}function h(t){return null===t}function f(t){return null==t}var l=t("punycode");r.parse=i,r.resolve=s,r.resolveObject=a,r.format=o,r.Url=n;var p=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,m=["<",">",'"',"`"," ","\r","\n"," "],g=["{","}","|","\\","^","`"].concat(m),y=["'"].concat(g),v=["%","/","?",";","#"].concat(y),b=["/","?","#"],w=255,_=/^[a-z0-9A-Z_-]{0,63}$/,E=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},A={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},I=t("querystring");n.prototype.parse=function(t,e,r){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t
throw n.name="BigNumber Error",C=0,n}function L(t,e,r,n){var i,o,s,a,u,c,h,f=t.c,l=I;if(f){t:{for(i=1,a=f[0];a>=10;a/=10,i++);if(o=e-i,0>o)o+=S,s=e,u=f[c=0],h=u/l[i-s-1]%10|0;else if(c=y((o+1)/S),c>=f.length){if(!n)break t;for(;f.length<=c;f.push(0));u=h=0,i=1,o%=S,s=o-S+1}else{for(u=a=f[c],i=1;a>=10;a/=10,i++);o%=S,s=o-S+i,h=0>s?0:u/l[i-s-1]%10|0}if(n=n||0>e||null!=f[c+1]||(0>s?u:u%l[i-s-1]),n=4>r?(h||n)&&(0==r||r==(t.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(o>0?s>0?u/l[i-s]:0:f[c-1])%10&1||r==(t.s<0?8:7)),1>e||!f[0])return f.length=0,n?(e-=t.e+1,f[0]=l[e%S],t.e=-e||0):f[0]=t.e=0,t;if(0==o?(f.length=c,a=1,c--):(f.length=c+1,a=l[S-o],f[c]=s>0?v(u/l[i-s]%l[s])*a:0),n)for(;;){if(0==c){for(o=1,s=f[0];s>=10;s/=10,o++);for(s=f[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(t.e++,f[0]==x&&(f[0]=1));break}if(f[c]+=a,f[c]!=x)break;f[c--]=0,a=1}for(o=f.length;0===f[--o];f.pop());}t.e>z?t.c=t.e=null:t.e<H&&(t.c=[t.e=0])}return t}var P,C=0,D=e.prototype,F=new e(1),j=20,U=4,M=-7,q=21,H=-1e7,z=1e7,G=!0,W=R,Y=!1,J=1,V=100,$={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};return e.another=n,e.ROUND_UP=0,e.ROUND_DOWN=1,e.ROUND_CEIL=2,e.ROUND_FLOOR=3,e.ROUND_HALF_UP=4,e.ROUND_HALF_DOWN=5,e.ROUND_HALF_EVEN=6,e.ROUND_HALF_CEIL=7,e.ROUND_HALF_FLOOR=8,e.EUCLID=9,e.config=function(){var t,e,r=0,n={},i=arguments,o=i[0],s=o&&"object"==typeof o?function(){return o.hasOwnProperty(e)?null!=(t=o[e]):void 0}:function(){return i.length>r?null!=(t=i[r++]):void 0};return s(e="DECIMAL_PLACES")&&W(t,0,B,2,e)&&(j=0|t),n[e]=j,s(e="ROUNDING_MODE")&&W(t,0,8,2,e)&&(U=0|t),n[e]=U,s(e="EXPONENTIAL_AT")&&(u(t)?W(t[0],-B,0,2,e)&&W(t[1],0,B,2,e)&&(M=0|t[0],q=0|t[1]):W(t,-B,B,2,e)&&(M=-(q=0|(0>t?-t:t)))),n[e]=[M,q],s(e="RANGE")&&(u(t)?W(t[0],-B,-1,2,e)&&W(t[1],1,B,2,e)&&(H=0|t[0],z=0|t[1]):W(t,-B,B,2,e)&&(0|t?H=-(z=0|(0>t?-t:t)):G&&N(2,e+" cannot be zero",t))),n[e]=[H,z],s(e="ERRORS")&&(t===!!t||1===t||0===t?(C=0,W=(G=!!t)?R:a):G&&N(2,e+b,t)),n[e]=G,s(e="CRYPTO")&&(t===!!t||1===t||0===t?(Y=!(!t||!d||"object"!=typeof d),t&&!Y&&G&&N(2,"crypto unavailable",d)):G&&N(2,e+b,t)),n[e]=Y,s(e="MODULO_MODE")&&W(t,0,9,2,e)&&(J=0|t),n[e]=J,s(e="POW_PRECISION")&&W(t,0,B,2,e)&&(V=0|t),n[e]=V,s(e="FORMAT")&&("object"==typeof t?$=t:G&&N(2,e+" not an object",t)),n[e]=$,n},e.max=function(){return T(arguments,D.lt)},e.min=function(){return T(arguments,D.gt)},e.random=function(){var t=9007199254740992,r=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var n,i,o,s,a,u=0,c=[],h=new e(F);if(t=null!=t&&W(t,0,B,14)?0|t:j,s=y(t/S),Y)if(d&&d.getRandomValues){for(n=d.getRandomValues(new Uint32Array(s*=2));s>u;)a=131072*n[u]+(n[u+1]>>>11),a>=9e15?(i=d.getRandomValues(new Uint32Array(2)),n[u]=i[0],n[u+1]=i[1]):(c.push(a%1e14),u+=2);u=s/2}else if(d&&d.randomBytes){for(n=d.randomBytes(s*=7);s>u;)a=281474976710656*(31&n[u])+1099511627776*n[u+1]+4294967296*n[u+2]+16777216*n[u+3]+(n[u+4]<<16)+(n[u+5]<<8)+n[u+6],a>=9e15?d.randomBytes(7).copy(n,u):(c.push(a%1e14),u+=7);u=s/7}else G&&N(14,"crypto unavailable",d);if(!u)for(;s>u;)a=r(),9e15>a&&(c[u++]=a%1e14);for(s=c[--u],t%=S,s&&t&&(a=I[S-t],c[u]=v(s/a)*a);0===c[u];c.pop(),u--);if(0>u)c=[o=0];else{for(o=-1;0===c[0];c.shift(),o-=S);for(u=1,a=c[0];a>=10;a/=10,u++);S>u&&(o-=S-u)}return h.e=o,h.c=c,h}}(),P=function(){function t(t,e,r){var n,i,o,s,a=0,u=t.length,c=e%O,h=e/O|0;for(t=t.slice();u--;)o=t[u]%O,s=t[u]/O|0,n=h*o+s*c,i=c*o+n%O*O+a,a=(i/r|0)+(n/O|0)+h*s,t[u]=i%r;return a&&t.unshift(a),t}function r(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;r>i;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.shift());}return function(o,s,a,u,c){var h,f,l,p,d,m,g,y,b,w,_,E,A,I,O,B,T,R=o.s==s.s?1:-1,k=o.c,N=s.c;if(!(k&&k[0]&&N&&N[0]))return new e(o.s&&s.s&&(k?!N||k[0]!=N[0]:N)?k&&0==k[0]||!N?0*R:R/0:0/0);for(y=new e(R),b=y.c=[],f=o.e-s.e,R=a+f+1,c||(c=x,f=i(o.e/S)-i(s.e/S),R=R/S|0),l=0;