UNPKG

418 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Neon=e():t.Neon=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=11)}([function(t,e,r){window,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=94)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(25)),n(r(53)),n(r(117)),n(r(17)),n(r(119)),n(r(56))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ADDR_VERSION="17",e.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},e.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},e.ASSET_TYPE={CreditFlag:64,DutyFlag:128,GoverningToken:0,UtilityToken:1,Currency:8,Share:144,Invoice:152,Token:96},e.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654",TEST_NXT:"0b6c1f919e95fe61c17a7612aebfaf4fda3a2214",TEST_RHTT4:"f9572c5b119a6b5775a6af07f1cef5d310038f55"},e.DEFAULT_RPC={MAIN:"https://seed11.ngd.network:10331",TEST:"https://seed11.ngd.network:20331"},e.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},e.DEFAULT_SCRYPT={n:16384,r:8,p:8,size:64},e.DEFAULT_SYSFEE={enrollmentTransaction:1e3,issueTransaction:500,publishTransaction:500,registerTransaction:1e4},e.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:e.DEFAULT_SCRYPT,extra:null},e.DEFAULT_ACCOUNT_CONTRACT={script:"",parameters:[{name:"signature",type:"Signature"}],deployed:!1},e.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},e.NEP_HEADER="0142",e.NEP_FLAG="e0",e.RPC_VERSION="2.3.2",e.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1,ISSUE:0,STATE:0,MINER:0,ENROLLMENT:0,PUBLISH:0,REGISTER:0}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){var n=r(11),i=n.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(s(n,e),e.Buffer=o),s(i,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";var n=r(45),i=r(100),s=Object.prototype.toString;function o(t){return"[object Array]"===s.call(t)}function a(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===s.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===s.call(t)},isBuffer:i,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===s.call(t)},isFile:function(t){return"[object File]"===s.call(t)},isBlob:function(t){return"[object Blob]"===s.call(t)},isFunction:c,isStream:function(t){return a(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function t(){var e={};function r(r,n){"object"==typeof e[n]&&"object"==typeof r?e[n]=t(e[n],r):e[n]=r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return e},deepMerge:function t(){var e={};function r(r,n){"object"==typeof e[n]&&"object"==typeof r?e[n]=t(e[n],r):e[n]="object"==typeof r?t({},r):r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return e},extend:function(t,e,r){return u(e,(function(e,i){t[i]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,r){var n;t.exports=n=n||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},i=n.lib={},s=i.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var o=r[s>>>2]>>>24-s%4*8&255;e[n+s>>>2]|=o<<24-(n+s)%4*8}else for(s=0;s<i;s+=4)e[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){e=e;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},s=0;s<e;s+=4){var a=i(4294967296*(r||t.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,e)}}),a=n.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new o.init(r,e/2)}},u=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i<r;i++){var s=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new o.init(r,e)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,u=t.min(4*c,i);if(c){for(var f=0;f<c;f+=s)this._doProcessBlock(n,f);var h=n.splice(0,c);r.sigBytes-=u}return new o.init(h,u)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),d=(i.Hasher=h.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new d.HMAC.init(t,r).finalize(e)}}}),n.algo={});return n}(Math)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=n(r(10)),o=r(0),a=r(12),c=r(81),u=r(16),f=n(r(31)),h=r(40),d=s.default("tx");class l{constructor(t={}){this.type=0,this.version=t.version||i.TX_VERSION.CONTRACT,this.attributes=Array.isArray(t.attributes)?t.attributes.map(t=>new u.TransactionAttribute(t)):[],this.inputs=Array.isArray(t.inputs)?t.inputs.map(t=>new u.TransactionInput(t)):[],this.outputs=Array.isArray(t.outputs)?t.outputs.map(t=>new u.TransactionOutput(t)):[],this.scripts=Array.isArray(t.scripts)?t.scripts.map(t=>new u.Witness(t)):[]}get[Symbol.toStringTag](){return"Transaction"}get hash(){return o.reverseHex(o.hash256(this.serialize(!1)))}addOutput(t){return this.outputs.push(new u.TransactionOutput(t)),this}addIntent(t,e,r){return this.outputs.push(u.TransactionOutput.fromIntent(t,e,r)),this}addAttribute(t,e){if("string"!=typeof e)throw new TypeError("data should be formatted as string!");return this.attributes.push(new u.TransactionAttribute({usage:t,data:e})),this}addRemark(t){const e=o.str2hexstring(t);return this.addAttribute(f.default.Remark,e)}addWitness(t){if(""===t.scriptHash)throw new Error("Please define the scriptHash for this Witness!");return this.scripts.push(t),this.scripts=this.scripts.sort((t,e)=>parseInt(t.scriptHash,16)-parseInt(e.scriptHash,16)),this}calculate(t,e,r=0){const{inputs:n,change:i}=c.calculateInputs(t,this.outputs,new o.Fixed8(this.fees).add(r),e);return this.inputs=n,this.outputs=this.outputs.concat(i),d.info(`Calculated the inputs required for Transaction with Balance: ${t.address}`),this}serialize(t=!0){let e="";return e+=o.num2hexstring(this.type),e+=o.num2hexstring(this.version),e+=this.serializeExclusive(),e+=h.serializeArrayOf(this.attributes),e+=h.serializeArrayOf(this.inputs),e+=h.serializeArrayOf(this.outputs),t&&(e+=h.serializeArrayOf(this.scripts)),e}sign(t){"string"==typeof t&&(t=new a.Account(t));const e=a.sign(this.serialize(!1),t.privateKey);return d.info(`Signed Transaction with Account: ${t.label}`),this.addWitness(u.Witness.fromSignature(e,t.publicKey)),this}export(){return{type:this.type,version:this.version,attributes:this.attributes.map(t=>t.export()),inputs:this.inputs.map(t=>t.export()),outputs:this.outputs.map(t=>t.export()),scripts:this.scripts.map(t=>t.export())}}}e.BaseTransaction=l,e.default=l},function(t,e,r){"use strict";var n=e;n.version=r(151).version,n.utils=r(152),n.rand=r(153),n.curve=r(27),n.curves=r(159),n.ec=r(167),n.eddsa=r(171)},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o=r(150).Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),s=e;s<i;s++){var o=t.charCodeAt(s)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function c(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,s=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<s&67108863,this.words[n+1]|=i>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<s&67108863,this.words[n+1]|=i>>>26-s&4194303),this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,u=0,f=r;f<a;f+=n)u=c(t,f,f+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=c(t,f,t.length,e),f=0;f<o;f++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,c=o/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var f=c>>>26,h=67108863&c,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;f+=(o=(i=0|t.words[p])*(s=0|e.words[l])+h)/67108864|0,h=67108863&o}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<i|s)).toString(16);r=0!=(s=a>>>24-i&16777215)||o!==this.length-1?u[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:u[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var o,a,c="le"===e,u=new t(s),f=this.clone();if(c){for(a=0;!f.isZero();a++)o=f.andln(255),f.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-i;a++)u[a]=0;for(a=0;!f.isZero();a++)o=f.andln(255),f.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var s=0,o=0;o<n.length;o++)s=(e=(0|r.words[o])-(0|n.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var n,i,s,o=t.words,a=e.words,c=r.words,u=0,f=0|o[0],h=8191&f,d=f>>>13,l=0|o[1],p=8191&l,b=l>>>13,m=0|o[2],g=8191&m,v=m>>>13,y=0|o[3],w=8191&y,_=y>>>13,S=0|o[4],x=8191&S,A=S>>>13,M=0|o[5],E=8191&M,T=M>>>13,P=0|o[6],I=8191&P,k=P>>>13,O=0|o[7],R=8191&O,C=O>>>13,B=0|o[8],N=8191&B,L=B>>>13,j=0|o[9],H=8191&j,U=j>>>13,D=0|a[0],z=8191&D,F=D>>>13,q=0|a[1],V=8191&q,K=q>>>13,$=0|a[2],W=8191&$,Y=$>>>13,G=0|a[3],X=8191&G,J=G>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,ft=0|a[8],ht=8191&ft,dt=ft>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(u+(n=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(d,z)|0))<<13)|0;u=((s=Math.imul(d,F))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,F))+Math.imul(b,z)|0,s=Math.imul(b,F);var gt=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,z),i=(i=Math.imul(g,F))+Math.imul(v,z)|0,s=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(b,V)|0,s=s+Math.imul(b,K)|0;var vt=(u+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,W)|0))<<13)|0;u=((s=s+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,F))+Math.imul(_,z)|0,s=Math.imul(_,F),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,W)|0,s=s+Math.imul(b,Y)|0;var yt=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,X)|0))<<13)|0;u=((s=s+Math.imul(d,J)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,F))+Math.imul(A,z)|0,s=Math.imul(A,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,K)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,X)|0,s=s+Math.imul(b,J)|0;var wt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,z),i=(i=Math.imul(E,F))+Math.imul(T,z)|0,s=Math.imul(T,F),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(A,V)|0,s=s+Math.imul(A,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,Y)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,X)|0,s=s+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,tt)|0;var _t=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((s=s+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,z),i=(i=Math.imul(I,F))+Math.imul(k,z)|0,s=Math.imul(k,F),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,s=s+Math.imul(b,nt)|0;var St=(u+(n=n+Math.imul(h,st)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,F))+Math.imul(C,z)|0,s=Math.imul(C,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,Y)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,s=s+Math.imul(v,nt)|0,n=n+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0;var xt=(u+(n=n+Math.imul(h,ct)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,F))+Math.imul(L,z)|0,s=Math.imul(L,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(C,V)|0,s=s+Math.imul(C,K)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,s=s+Math.imul(k,Y)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,nt)|0,n=n+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(b,ct)|0,s=s+Math.imul(b,ut)|0;var At=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,F))+Math.imul(U,z)|0,s=Math.imul(U,F),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(L,V)|0,s=s+Math.imul(L,K)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,s=s+Math.imul(C,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,s=s+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,nt)|0,n=n+Math.imul(w,st)|0,i=(i=i+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,s=s+Math.imul(b,dt)|0;var Mt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(H,V),i=(i=Math.imul(H,K))+Math.imul(U,V)|0,s=Math.imul(U,K),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(L,W)|0,s=s+Math.imul(L,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(C,X)|0,s=s+Math.imul(C,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,nt)|0,n=n+Math.imul(x,st)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(v,ht)|0,s=s+Math.imul(v,dt)|0;var Et=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((s=s+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(H,W),i=(i=Math.imul(H,Y))+Math.imul(U,W)|0,s=Math.imul(U,Y),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,J)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(k,rt)|0,s=s+Math.imul(k,nt)|0,n=n+Math.imul(E,st)|0,i=(i=i+Math.imul(E,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,ut)|0)+Math.imul(A,ct)|0,s=s+Math.imul(A,ut)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,X),i=(i=Math.imul(H,J))+Math.imul(U,X)|0,s=Math.imul(U,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,Q)|0,s=s+Math.imul(L,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,s=s+Math.imul(C,nt)|0,n=n+Math.imul(I,st)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(k,st)|0,s=s+Math.imul(k,ot)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ut)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,ut)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(A,ht)|0,s=s+Math.imul(A,dt)|0;var Pt=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(U,Q)|0,s=Math.imul(U,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(L,rt)|0,s=s+Math.imul(L,nt)|0,n=n+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(k,ct)|0,s=s+Math.imul(k,ut)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,dt)|0;var It=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(U,rt)|0,s=Math.imul(U,nt),n=n+Math.imul(N,st)|0,i=(i=i+Math.imul(N,ot)|0)+Math.imul(L,st)|0,s=s+Math.imul(L,ot)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(C,ct)|0,s=s+Math.imul(C,ut)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(k,ht)|0,s=s+Math.imul(k,dt)|0;var kt=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,st),i=(i=Math.imul(H,ot))+Math.imul(U,st)|0,s=Math.imul(U,ot),n=n+Math.imul(N,ct)|0,i=(i=i+Math.imul(N,ut)|0)+Math.imul(L,ct)|0,s=s+Math.imul(L,ut)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,dt)|0;var Ot=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((s=s+Math.imul(k,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(H,ct),i=(i=Math.imul(H,ut))+Math.imul(U,ct)|0,s=Math.imul(U,ut),n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(L,ht)|0,s=s+Math.imul(L,dt)|0;var Rt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(H,ht),i=(i=Math.imul(H,dt))+Math.imul(U,ht)|0,s=Math.imul(U,dt);var Ct=(u+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((s=s+Math.imul(L,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Bt=(u+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,bt))+Math.imul(U,pt)|0))<<13)|0;return u=((s=Math.imul(U,bt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,c[0]=mt,c[1]=gt,c[2]=vt,c[3]=yt,c[4]=wt,c[5]=_t,c[6]=St,c[7]=xt,c[8]=At,c[9]=Mt,c[10]=Et,c[11]=Tt,c[12]=Pt,c[13]=It,c[14]=kt,c[15]=Ot,c[16]=Rt,c[17]=Ct,c[18]=Bt,0!==u&&(c[19]=u,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,c=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=c;u++){var f=s-u,h=(0|t.words[f])*(0|e.words[u]),d=67108863&h;a=67108863&(d=d+a|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},b.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var h=c,d=u,l=0;l<o;l++){var p=r[f+l],b=n[f+l],m=r[f+l+o],g=n[f+l+o],v=h*m-d*g;g=h*g+d*m,m=v,r[f+l]=p+m,n[f+l]=b+g,r[f+l+o]=p-m,n[f+l+o]=b-g,l!==a&&(v=c*h-u*d,d=c*d+u*h,h=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n(0==(-8192&s))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,c,n,i),this.transform(u,s,f,h,n,i);for(var l=0;l<n;l++){var p=a[l]*f[l]-c[l]*h[l];c[l]=a[l]*h[l]+c[l]*f[l],a[l]=p}return this.conjugate(a,c,n),this.transform(a,c,d,s,n,i),this.conjugate(d,s,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),p(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,c=(0|this.words[e])-a<<r;this.words[e]=c|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,c=r;if(i-=o,i=Math.max(0,i),c){for(var u=0;u<o;u++)c.words[u]=this.words[u];c.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-s|h>>>s,f=h&a}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var c=(0|t.words[i])*e;a=((s-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==e){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var f=n.clone()._ishlnsubmul(i,1,c);0===f.negative&&(n=f,a&&(a.words[c]=1));for(var h=c-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},s.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),c=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(f),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(f),c.isub(h)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(c)):(r.isub(e),a.isub(i),c.isub(o))}return{a:a,b:c,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new s(1),a=new s(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(i=0===e.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(t),i},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new S(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(v,g),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(y,g),i(w,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=o;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var g=this.pow(h,new s(1).iushln(p-m-1));d=d.redMul(g),h=g.redSqr(),l=l.redMul(h),p=m}return d},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],f=c-1;f>=0;f--){var h=u>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===n&&0===f)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}c=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},i(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(149)(t))},function(t,e,r){"use strict";var n=r(15),i=r(2);function s(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):s(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=c(i.toString(16))}return r},e.zero2=a,e.zero8=c,e.join32=function(t,e,r,i){var s=r-e;n(s%4==0);for(var o=new Array(s/4),a=0,c=e;a<o.length;a++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],o[a]=u>>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];"big"===e?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=255&s):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=255&s)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],s=n+t[e+1]>>>0,o=(s<n?1:0)+r+i;t[e]=o>>>0,t[e+1]=s},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,s,o,a){var c=0,u=e;return c+=(u=u+n>>>0)<e?1:0,c+=(u=u+s>>>0)<s?1:0,t+r+i+o+(c+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,s,o,a){return e+n+s+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,s,o,a,c,u){var f=0,h=e;return f+=(h=h+n>>>0)<e?1:0,f+=(h=h+s>>>0)<s?1:0,f+=(h=h+a>>>0)<a?1:0,t+r+i+o+c+(f+=(h=h+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,s,o,a,c,u){return e+n+s+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(95)),s=n(r(96));s.default.reg(i.default),i.default.setDefaultLevel("silent"),e.setAll=function(t){Object.keys(i.default.getLoggers()).map(e=>{i.default.getLogger(e).setLevel(t)})};const o=(t,e,r)=>`[${r||(new Date).toUTCString()}] (${e}) ${t=t.toUpperCase()}: `;e.default=t=>{const e=i.default.getLogger(t);return s.default.apply(e,{format:o}),e},e.logger=i.default},function(t,e,r){"use strict";(function(t){
2/*!
3 * The buffer module from node.js, for the browser.
4 *
5 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
6 * @license MIT
7 */
8var n=r(121),i=r(122),s=r(57);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=d(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|l(e.length);return 0===(t=a(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):d(t,e);if("Buffer"===e.type&&s(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(f(e),t=a(t,e<0?0:0|l(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|l(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function l(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.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:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var s,o=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var f=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===f?0:s-f)){if(-1===f&&(f=s),s-f+1===c)return f*o}else-1!==f&&(s-=s-f),f=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){for(var h=!0,d=0;d<c;d++)if(u(t,s+d)!==u(e,d)){h=!1;break}if(h)return s}return-1}function y(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))return o;t[r+o]=a}return o}function w(t,e,r,n){return q(z(e,t.length-r),t,r,n)}function _(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return _(t,e,r,n)}function x(t,e,r,n){return q(F(e),t,r,n)}function A(t,e,r,n){return q(function(t,e){for(var r,n,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var s,o,a,c,u=t[i],f=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(f=u);break;case 2:128==(192&(s=t[i+1]))&&(c=(31&u)<<6|63&s)>127&&(f=c);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(c=(15&u)<<12|(63&s)<<6|63&o)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(c=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&c<1114112&&(f=c)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=T));return r}(n)}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return u(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).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}},c.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):b.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),u=this.slice(n,i),f=t.slice(e,r),h=0;h<a;++h)if(u[h]!==f[h]){s=u[h],o=f[h];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=e;s<r;++s)i+=D(t[s]);return i}function O(t,e,r){for(var n=t.slice(e,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-r,2);i<s;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-r,4);i<s;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function L(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,s){return s||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,s){return s||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var i=e-t;r=new c(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);var i,s=n-r;if(this===t&&r<e&&e<n)for(i=s-1;i>=0;--i)t[i+e]=this[i+r];else if(s<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),e);return s},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var o=c.isBuffer(t)?t:z(new c(t,n).toString()),a=o.length;for(s=0;s<r-e;++s)this[s+e]=o[s%a]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){var r;e=e||1/0;for(var n=t.length,i=null,s=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(18))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(32)),n(r(185)),n(r(186)),n(r(19)),n(r(79)),n(r(28)),n(r(69)),n(r(187)),n(r(188)),n(r(74))},function(t,e){var r,n,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var c,u=[],f=!1,h=-1;function d(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&l())}function l(){if(!f){var t=a(d);f=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function b(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||f||a(l)},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=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";var n=r(26),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var s=r(22);s.inherits=r(2);var o=r(62),a=r(36);s.inherits(h,o);for(var c=i(a.prototype),u=0;u<c.length;u++){var f=c[u];h.prototype[f]||(h.prototype[f]=a.prototype[f])}function h(t){if(!(this instanceof h))return new h(t);o.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(l,this)}function l(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),h.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(115)),n(r(124)),n(r(125)),n(r(189)),n(r(190))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(116)),s=r(25),o=1e8,a=new i.default(2).pow(63).minus(1),c=new i.default(2).pow(63).negated(),u=new i.default(2).pow(64);class f extends i.default{constructor(t,e=10){if(t||(t="0"),"number"==typeof t&&(t=t.toFixed(8)),super(t,e),this.isGreaterThan(f.MAX_VALUE))throw new Error(`expected input to be less than ${f.MAX_VALUE}. Got input = ${this}`);if(this.isLessThan(f.MIN_VALUE))throw new Error(`expected input to be greater than ${f.MIN_VALUE}. Got input = ${this}`);Object.setPrototypeOf(this,f.prototype)}static fromHex(t){if(t.length>16)throw new Error(`expected hex string to have length less or equal than 16: got ${t.length} for hex = ${t}`);let e=new i.default(t,16);return e.isGreaterThan(a)&&(e=e.minus(u)),e=e.div(o),new f(e,10)}static fromReverseHex(t){return this.fromHex(s.reverseHex(t))}toHex(){let t="";const e=this.toRawNumber();return t=e.isLessThan(0)?u.plus(e).toString(16):e.toString(16),"0".repeat(16-t.length)+t}toReverseHex(){return s.reverseHex(this.toHex())}toRawNumber(){return super.times(o)}ceil(){return new f(super.decimalPlaces(0,i.default.ROUND_CEIL))}floor(){return new f(super.decimalPlaces(0,i.default.ROUND_FLOOR))}equals(t){return super.eq(t)}round(t=0,e){return new f(super.decimalPlaces(t,e))}dividedBy(t,e){return new f(super.dividedBy(t,e))}div(t,e){return this.dividedBy(t,e)}times(t,e){return new f(super.times(t,e))}mul(t,e){return this.times(t,e)}plus(t,e){return new f(super.plus(t,e))}add(t,e){return this.plus(t,e)}minus(t,e){return new f(super.minus(t,e))}sub(t,e){return this.minus(t,e)}}f.MAX_VALUE=new f(a.div(o)),f.MIN_VALUE=new f(c.div(o)),e.Fixed8=f,e.default=f},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(33)),s=r(11),o=n(r(128)),a=r(1),c=r(0),u=r(56),f=r(69);function h(t){const e=new Uint8Array(c.hexstring2ab(t));return e[64]%2==1?"03"+c.ab2hexstring(e.slice(1,33)):"02"+c.ab2hexstring(e.slice(1,33))}e.getPublicKeyEncoded=h,e.getPublicKeyUnencoded=function(t){const e=s.Buffer.from(t,"hex");return f.curve.keyFromPublic(e,"hex").getPublic().encode("hex",!1)},e.getPrivateKeyFromWIF=function(t){return c.ab2hexstring(o.default.decode(t,128).privateKey)},e.getWIFFromPrivateKey=function(t){return o.default.encode(128,s.Buffer.from(t,"hex"),!0)},e.getPublicKeyFromPrivateKey=function(t,e=!0){const r=s.Buffer.from(t,"hex"),n=f.curve.keyFromPrivate(r,"hex").getPublic().encode("hex",!1);return e?parseInt(n.substr(128,2),16)%2==1?"03"+n.substr(2,64):"02"+n.substr(2,64):n},e.getVerificationScriptFromPublicKey=t=>"21"+t+"ac",e.getScriptHashFromPublicKey=t=>{"04"===t.substring(0,2)&&(t=h(t));const r=e.getVerificationScriptFromPublicKey(t);return c.reverseHex(c.hash160(r))},e.getAddressFromScriptHash=t=>{t=c.reverseHex(t);const e=c.hash256(a.ADDR_VERSION+t).substr(0,8);return i.default.encode(s.Buffer.from(a.ADDR_VERSION+t+e,"hex"))},e.getScriptHashFromAddress=t=>{const e=c.ab2hexstring(i.default.decode(t));return c.reverseHex(e.substr(2,40))},e.generateSignature=(t,e)=>f.sign(t,e),e.generatePrivateKey=()=>c.ab2hexstring(u.generateRandomArray(32))},function(t,e,r){var n=r(3).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,s=t.length,o=this._len,a=0;a<s;){for(var c=o%i,u=Math.min(s-a,i-c),f=0;f<u;f++)r[c+f]=t[a+f];a+=u,(o+=u)%i==0&&this._update(r)}return this._len+=s,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.MinerTransaction=0]="MinerTransaction",t[t.IssueTransaction=1]="IssueTransaction",t[t.ClaimTransaction=2]="ClaimTransaction",t[t.EnrollmentTransaction=32]="EnrollmentTransaction",t[t.RegisterTransaction=64]="RegisterTransaction",t[t.ContractTransaction=128]="ContractTransaction",t[t.StateTransaction=144]="StateTransaction",t[t.PublishTransaction=208]="PublishTransaction",t[t.InvocationTransaction=209]="InvocationTransaction"}(n=e.TransactionType||(e.TransactionType={})),e.default=n},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(11).Buffer)},function(t,e,r){"use strict";var n=r(9),i=r(15);function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=s,s.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},s.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},s.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,s=8;s<this.padLength;s++)n[i++]=0;return n}},function(t,e,r){"use strict";function n(t,e){const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const n of r)if(void 0===e[n]||t[n]!==e[n])return!1;return!0}Object.defineProperty(e,"__esModule",{value:!0}),e.compareNeonObjectArray=function(t,e=[]){if(t.length!==e.length)return!1;for(const r of t)if(!e.find(t=>r.equals(r)))return!1;return!0},e.compareObject=n,e.compareUnsortedPlainArrays=function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},e.compareArray=function(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){if("object"==typeof t[r]&&"object"==typeof e[r]&&!n(t[r],e[r]))return!1;if(t[r]!==e[r])return!1}return!0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(53),i=/^([0-9A-Fa-f]{2})*$/;function s(t){try{return i.test(t)}catch(t){return!1}}function o(t){if(!s(t))throw new Error(`Expected a hexstring but got ${t}`)}e.isHex=s,e.ensureHex=o,e.hexXor=function(t,e){if(o(t),o(e),t.length!==e.length)throw new Error(`strings are disparate lengths. Inputs are of length ${t.length} and ${e.length}`);const r=[];for(let n=0;n<t.length;n+=2)r.push(parseInt(t.substr(n,2),16)^parseInt(e.substr(n,2),16));return n.ab2hexstring(r)},e.reverseArray=function(t){if("object"!=typeof t||!t.length)throw new Error("reverseArray expects an array");const e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[t.length-1-r];return e},e.reverseHex=function(t){o(t);let e="";for(let r=t.length-2;r>=0;r-=2)e+=t.substr(r,2);return e}},function(t,e,r){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var s,o,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(s=new Array(a-1),o=0;o<s.length;)s[o++]=arguments[o];return e.nextTick((function(){t.apply(null,s)}))}}}:t.exports=e}).call(this,r(13))},function(t,e,r){"use strict";var n=e;n.base=r(155),n.short=r(156),n.mont=r(157),n.edwards=r(158)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(33)),s=r(0),o=r(19);e.isNEP2=function(t){try{if(58!==t.length)return!1;const e=s.ab2hexstring(i.default.decode(t));return!(!e||86!==e.length)&&"01"===e.substr(0,2)&&"42"===e.substr(2,2)&&"e0"===e.substr(4,2)}catch(t){return!1}},e.isWIF=function(t){try{if(52!==t.length)return!1;const e=s.ab2hexstring(i.default.decode(t));return s.hash256(e.substr(0,e.length-8)).substr(0,8)===e.substr(e.length-8,8)}catch(t){return!1}},e.isPrivateKey=function(t){return/^[0-9A-Fa-f]{64}$/.test(t)},e.isPublicKey=function(t,e){try{let r;switch(t.substr(0,2)){case"04":if(!0===e)return!1;r=o.getPublicKeyEncoded(t);break;case"02":case"03":if(!1===e)return!1;r=t;break;default:return!1}const n=o.getPublicKeyUnencoded(r),i=parseInt(n.substr(n.length-2,2),16);return"02"===r.substr(0,2)&&i%2==0||"03"===r.substr(0,2)&&i%2==1}catch(t){return!1}},e.isScriptHash=function(t){return s.isHex(t)&&40===t.length},e.isAddress=function(t){try{const e=s.ab2hexstring(i.default.decode(t));if(s.hash256(e.slice(0,42)).substr(0,8)!==e.substr(42,8))return!1;const r=s.reverseHex(e.slice(2,42));return o.getAddressFromScriptHash(r)===t}catch(t){return!1}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(30);e.defaultCalculationStrategy=n.defaultCalculationStrategy,e.networks={},e.timeout={ping:2e3,rpc:3e4}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(16)),n(r(191)),n(r(82)),n(r(31));var i=r(81);e.defaultCalculationStrategy=i.defaultCalculationStrategy},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ContractHash=0]="ContractHash",t[t.ECDH02=2]="ECDH02",t[t.ECDH03=3]="ECDH03",t[t.Script=32]="Script",t[t.Vote=48]="Vote",t[t.DescriptionUrl=129]="DescriptionUrl",t[t.Description=144]="Description",t[t.Hash1=161]="Hash1",t[t.Hash2=162]="Hash2",t[t.Hash3=163]="Hash3",t[t.Hash4=164]="Hash4",t[t.Hash5=165]="Hash5",t[t.Hash6=166]="Hash6",t[t.Hash7=167]="Hash7",t[t.Hash8=168]="Hash8",t[t.Hash9=169]="Hash9",t[t.Hash10=170]="Hash10",t[t.Hash11=171]="Hash11",t[t.Hash12=172]="Hash12",t[t.Hash13=173]="Hash13",t[t.Hash14=174]="Hash14",t[t.Hash15=175]="Hash15",t[t.Remark=240]="Remark",t[t.Remark1=241]="Remark1",t[t.Remark2=242]="Remark2",t[t.Remark3=243]="Remark3",t[t.Remark4=244]="Remark4",t[t.Remark5=245]="Remark5",t[t.Remark6=246]="Remark6",t[t.Remark7=247]="Remark7",t[t.Remark8=248]="Remark8",t[t.Remark9=249]="Remark9",t[t.Remark10=250]="Remark10",t[t.Remark11=251]="Remark11",t[t.Remark12=252]="Remark12",t[t.Remark13=253]="Remark13",t[t.Remark14=254]="Remark14",t[t.Remark15=255]="Remark15"}(n=e.TxAttrUsage||(e.TxAttrUsage={})),e.default=n},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const s=n(r(58)),o=r(1),a=n(r(10)),c=r(0),u=i(r(19)),f=r(74),h=r(79),d=r(28),l=a.default("wallet"),p=s.default.inspect.custom;class b{static createMultiSig(t,e){const r=f.constructMultiSigVerificationScript(t,e);return new b({contract:{script:r,parameters:Array(t).map((t,e)=>({name:`signature${e}`,type:"Signature"})),deployed:!1}})}constructor(t=""){if(this.extra={},this.label="",this.isDefault=!1,this.lock=!1,this.contract=Object.assign({},o.DEFAULT_ACCOUNT_CONTRACT),t)if("object"==typeof t)this._encrypted=t.key,this._address=t.address,this.label=t.label||"",this.extra=t.extra||{},this.isDefault=t.isDefault||!1,this.lock=t.lock||!1,this.contract=t.contract||Object.assign({},o.DEFAULT_ACCOUNT_CONTRACT);else if(d.isPrivateKey(t))this._privateKey=t;else if(d.isPublicKey(t,!1))this._publicKey=u.getPublicKeyEncoded(t);else if(d.isPublicKey(t,!0))this._publicKey=t;else if(d.isScriptHash(t))this._scriptHash=t;else if(d.isAddress(t))this._address=t;else if(d.isWIF(t))this._privateKey=u.getPrivateKeyFromWIF(t),this._WIF=t;else{if(!d.isNEP2(t))throw new ReferenceError(`Invalid input: ${t}`);this._encrypted=t}else this._privateKey=u.generatePrivateKey();if(this._updateContractScript(),!this.label)try{this.label=this.address}catch(t){this.label=""}}get[Symbol.toStringTag](){return"Account"}[p](){return`[Account: ${this.label}]`}get isMultiSig(){return this.contract&&this.contract.script&&"ae"===this.contract.script.slice(this.contract.script.length-2)}get encrypted(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}get WIF(){return this._WIF?this._WIF:(this._WIF=u.getWIFFromPrivateKey(this.privateKey),this._WIF)}get privateKey(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=u.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}get publicKey(){return this._publicKey?this._publicKey:(this._publicKey=u.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}getPublicKey(t=!0){return t?this.publicKey:u.getPublicKeyUnencoded(this.publicKey)}get scriptHash(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=u.getScriptHashFromAddress(this.address),this._scriptHash):this.contract.script?(this._scriptHash=this._getScriptHashFromVerificationScript(),this._scriptHash):(this._scriptHash=u.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}get address(){return this._address?this._address:(this._address=u.getAddressFromScriptHash(this.scriptHash),this._address)}tryGet(t){switch(t){case"encrypted":return this._encrypted||"";case"WIF":return this._WIF||"";case"privateKey":return this._privateKey||"";case"publicKey":return this._publicKey||"";case"scriptHash":return this._scriptHash||"";case"address":return this._address||""}}encrypt(t,e=o.DEFAULT_SCRYPT){return Promise.resolve().then(r=>h.encrypt(this.privateKey,t,e)).then(t=>(this._encrypted=t,this))}decrypt(t,e=o.DEFAULT_SCRYPT){return Promise.resolve().then(r=>h.decrypt(this.encrypted,t,e)).then(t=>(this._WIF=t,this._updateContractScript(),this))}export(){let t="";if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(t=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:t,contract:this.contract,extra:this.extra}}equals(t){return this.address===t.address}_updateContractScript(){try{if(""===this.contract.script){const t=this.publicKey;this.contract.script=u.getVerificationScriptFromPublicKey(t),this._scriptHash=this._getScriptHashFromVerificationScript(),l.debug(`Updated ContractScript for Account: ${this.address}`)}}catch(t){return}}_getScriptHashFromVerificationScript(){return c.reverseHex(c.hash160(this.contract.script))}}e.Account=b,e.default=b},function(t,e,r){var n=r(127);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var i,s,o,a;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=u(t))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return t}function h(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,t))}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function l(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)s(c,this,e);else{var u=c.length,f=b(c,u);for(r=0;r<u;++r)s(f[r],this,e)}return!0},a.prototype.addListener=function(t,e){return f(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return f(this,t,e,!0)},a.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,i,s,o;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return l(this,t,!0)},a.prototype.rawListeners=function(t){return l(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){(e=t.exports=r(62)).Stream=e,e.Readable=e,e.Writable=r(36),e.Duplex=r(14),e.Transform=r(66),e.PassThrough=r(136)},function(t,e,r){"use strict";(function(e,n,i){var s=r(26);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(void 0),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var a,c=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:s.nextTick;v.WritableState=g;var u=r(22);u.inherits=r(2);var f,h={deprecate:r(135)},d=r(63),l=r(3).Buffer,p=i.Uint8Array||function(){},b=r(64);function m(){}function g(t,e){a=a||r(14),t=t||{};var n=e instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,u=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(s.nextTick(i,n),s.nextTick(A,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),A(t,e))}(t,r,n,e,i);else{var o=S(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?c(w,t,r,o,i):w(t,r,o,i)}}(e,t)},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 o(this)}function v(t){if(a=a||r(14),!(f.call(v,this)||this instanceof a))return new v(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),d.call(this)}function y(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),A(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,y(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,h=r.callback;if(y(t,e,!1,e.objectMode?1:u.length,u,f,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),A(t,e)}))}function A(t,e){var r=S(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,s.nextTick(x,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(v,d),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===v&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,a=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof p);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),s.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),s.nextTick(n,o),i=!1),i}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,s){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=e.objectMode?1:n.length;e.length+=a;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else y(t,e,!1,a,n,i,s);return c}(this,i,a,t,e,r)),o},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},v.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,A(t,e),r&&(e.finished?s.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(13),r(65).setImmediate,r(18))},function(t,e,r){"use strict";var n=r(3).Buffer,i=n.isEncoding||function(t){switch((t=""+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}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=h,e=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}e.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=o(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){var n=e;n.utils=r(9),n.common=r(23),n.sha=r(160),n.ripemd=r(164),n.hmac=r(165),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){var n;t.exports=(n=r(5),r(80),void(n.lib.Cipher||function(t){var e=n,r=e.lib,i=r.Base,s=r.WordArray,o=r.BufferedBlockAlgorithm,a=e.enc,c=(a.Utf8,a.Base64),u=e.algo.EvpKDF,f=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?y:g}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),h=(r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),d=r.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),l=h.CBC=function(){var e=d.extend();function r(e,r,n){var i=this._iv;if(i){var s=i;this._iv=t}else s=this._prevBlock;for(var o=0;o<n;o++)e[r+o]^=s[o]}return e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize;r.call(this,t,e,i),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),e.Decryptor=e.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,s=t.slice(e,e+i);n.decryptBlock(t,e),r.call(this,t,e,i),this._prevBlock=s}}),e}(),p=(e.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(i);var c=s.create(o,n);t.concat(c)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},b=(r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:l,padding:p}),reset:function(){f.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,e&&e.words):(this._mode=n.call(r,this,e&&e.words),this._mode.__creator=n)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4}),r.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),m=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var n=s.create([1398893684,1701076831]).concat(r).concat(e);else n=e;return n.toString(c)},parse:function(t){var e=c.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var n=s.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return b.create({ciphertext:e,salt:n})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),s=i.finalize(e),o=i.cfg;return b.create({ciphertext:s,key:r,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),v=(e.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=s.random(8));var i=u.create({keySize:e+r}).compute(t,n),o=s.create(i.words.slice(e),4*r);return i.sigBytes=4*e,b.create({key:i,iv:o,salt:n})}},y=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var s=g.encrypt.call(this,t,e,i.key,n);return s.mixIn(i),s},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);return n.iv=i.iv,g.decrypt.call(this,t,e,i.key,n)}})}()))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(16);function s(t,e){const r=[],n=e.readVarInt();for(let i=0;i<n;i++)r.push(t(e));return r}e.deserializeArrayOf=s,e.serializeArrayOf=function(t){return n.num2VarInt(t.length)+t.map(t=>t.serialize()).join("")},e.deserializeType=function(t,e={}){const r=t.read();return Object.assign(e,{type:parseInt(r,16)})},e.deserializeVersion=function(t,e={}){const r=t.read();return Object.assign({version:parseInt(r,16)})},e.deserializeAttributes=function(t,e){const r=s(i.TransactionAttribute.fromStream,t).map(t=>t.export());return Object.assign(e,{attributes:r})},e.deserializeInputs=function(t,e){const r=s(i.TransactionInput.fromStream,t).map(t=>t.export());return Object.assign(e,{inputs:r})},e.deserializeOutputs=function(t,e){const r=s(i.TransactionOutput.fromStream,t).map(t=>t.export());return Object.assign(e,{outputs:r})},e.deserializeWitnesses=function(t,e){const r=s(i.Witness.fromStream,t).map(t=>t.export());return Object.assign(e,{scripts:r})}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(17));class s{constructor(t={}){this.index=t.index||0,this.txid=t.txid||"",this.value=new i.default(t.value)}export(){return{index:this.index,txid:this.txid,value:this.value.toNumber()}}equals(t){return this.index===t.index&&this.txid===t.txid&&this.value.equals(t.value||0)}}e.Coin=s,e.default=s},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(97)),n(r(43)),n(r(44)),n(r(193)),n(r(194))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=r(24);function o(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}n(r(10)).default("protocol");class a{constructor(t={}){this.magic=t.magic||t.Magic||0,this.addressVersion=t.addressVersion||t.AddressVersion||23,this.standbyValidators=t.standbyValidators||t.StandbyValidators||[],this.seedList=t.seedList||t.SeedList||[],this.systemFee=Object.assign({},t.systemFee||t.SystemFee||i.DEFAULT_SYSFEE)}get[Symbol.toStringTag](){return"Protocol"}export(){return{Magic:this.magic,AddressVersion:this.addressVersion,StandbyValidators:this.standbyValidators,SeedList:this.seedList,SystemFee:this.systemFee}}equals(t){return this.magic===(t.magic||t.Magic)&&this.addressVersion===(t.addressVersion||t.AddressVersion)&&o(this.seedList,t.seedList||t.SeedList||[])&&o(this.standbyValidators,t.standbyValidators||t.StandbyValidators||[])&&s.compareObject(this.systemFee,t.systemFee||t.SystemFee||{})}}e.Protocol=a,e.default=a},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(r(98)),o=r(1),a=r(24),c=i(r(10)),u=r(29),f=r(6),h=c.default("rpc");function d(t,e,r={}){return n(this,void 0,void 0,(function*(){const n=Object.assign({},o.DEFAULT_REQ,e),i=Object.assign({headers:{"Content-Type":"application/json"},timeout:u.timeout.rpc},r);return(yield s.default.post(t,n,i)).data}))}e.queryRPC=d;class l{static getAccountState(t){return new l({method:"getaccountstate",params:[t]})}static getAssetState(t){return new l({method:"getassetstate",params:[t]})}static getBlock(t,e=1){return new l({method:"getblock",params:[t,e]})}static getBlockHash(t){return new l({method:"getblockhash",params:[t]})}static getBestBlockHash(){return new l({method:"getbestblockhash"})}static getBlockCount(){return new l({method:"getblockcount"})}static getBlockSysFee(t){return new l({method:"getblocksysfee",params:[t]})}static getConnectionCount(){return new l({method:"getconnectioncount"})}static getContractState(t){return new l({method:"getcontractstate",params:[t]})}static getPeers(){return new l({method:"getpeers"})}static getRawMemPool(){return new l({method:"getrawmempool"})}static getRawTransaction(t,e=1){return new l({method:"getrawtransaction",params:[t,e]})}static getStorage(t,e){return new l({method:"getstorage",params:[t,e]})}static getTxOut(t,e){return new l({method:"gettxout",params:[t,e]})}static getValidators(){return new l({method:"getvalidators"})}static getVersion(){return new l({method:"getversion"})}static invoke(t,...e){return new l({method:"invoke",params:[t,e]})}static invokeFunction(t,e,...r){return new l({method:"invokefunction",params:[t,e,r]})}static invokeScript(t){return new l({method:"invokescript",params:[t]})}static sendRawTransaction(t){const e=t instanceof f.BaseTransaction?t.serialize(!0):t;return new l({method:"sendrawtransaction",params:[e]})}static submitBlock(t){return new l({method:"submitblock",params:[t]})}static validateAddress(t){return new l({method:"validateaddress",params:[t]})}static getUnspents(t){return new l({method:"getunspents",params:[t]})}static getUnclaimed(t){return new l({method:"getunclaimed",params:[t]})}static getClaimable(t){return new l({method:"getclaimable",params:[t]})}get id(){return this.req.id}get method(){return this.req.method}get params(){return this.req.params}constructor(t){this.req=Object.assign({},o.DEFAULT_REQ,t),this.completed=!1}get[Symbol.toStringTag](){return"Query"}parseWith(t){return this.parse=t,this}execute(t,e={}){return n(this,void 0,void 0,(function*(){if(this.completed)throw new Error("This request has been sent");const r=yield d(t,this.req,e);if(this.res=r,this.completed=!0,r.error)throw new Error(`${t}: ${r.error.message}`);return this.parse?(h.info(`Query[${this.req.method}] successful`),this.parse(r.result)):r}))}export(){return Object.assign({},this.req,{params:this.req.params.map(t=>"object"==typeof t?JSON.parse(JSON.stringify(t)):t)})}equals(t){return this.req.id===t.id&&this.req.method===t.method&&a.compareArray(this.req.params,t.params||[])}}e.Query=l,e.default=l},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";var n=r(4);function i(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var s;if(r)s=r(e);else if(n.isURLSearchParams(e))s=e.toString();else{var o=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),o.push(i(e)+"="+i(t))})))})),s=o.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";(function(e){var n=r(4),i=r(105),s={"Content-Type":"application/x-www-form-urlencoded"};function o(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,c={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=r(49):"undefined"!=typeof XMLHttpRequest&&(a=r(49)),a),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(o(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(o(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){c.headers[t]=n.merge(s)})),t.exports=c}).call(this,r(13))},function(t,e,r){"use strict";var n=r(4),i=r(106),s=r(46),o=r(108),a=r(109),c=r(50);t.exports=function(t){return new Promise((function(e,u){var f=t.data,h=t.headers;n.isFormData(f)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(t.auth){var l=t.auth.username||"",p=t.auth.password||"";h.Authorization="Basic "+btoa(l+":"+p)}if(d.open(t.method.toUpperCase(),s(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?o(d.getAllResponseHeaders()):null,n={data:t.responseType&&"text"!==t.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:t,request:d};i(e,u,n),d=null}},d.onabort=function(){d&&(u(c("Request aborted",t,"ECONNABORTED",d)),d=null)},d.onerror=function(){u(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){u(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var b=r(110),m=(t.withCredentials||a(t.url))&&t.xsrfCookieName?b.read(t.xsrfCookieName):void 0;m&&(h[t.xsrfHeaderName]=m)}if("setRequestHeader"in d&&n.forEach(h,(function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete h[e]:d.setRequestHeader(e,t)})),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){d&&(d.abort(),u(t),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e,r,i,s){var o=new Error(t);return n(o,e,r,i,s)}},function(t,e,r){"use strict";var n=r(4);t.exports=function(t,e){e=e||{};var r={};return n.forEach(["url","method","params","data"],(function(t){void 0!==e[t]&&(r[t]=e[t])})),n.forEach(["headers","auth","proxy"],(function(i){n.isObject(e[i])?r[i]=n.deepMerge(t[i],e[i]):void 0!==e[i]?r[i]=e[i]:n.isObject(t[i])?r[i]=n.deepMerge(t[i]):void 0!==t[i]&&(r[i]=t[i])})),n.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==e[n]?r[n]=e[n]:void 0!==t[n]&&(r[n]=t[n])})),r}},function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(17)),s=r(25);function o(t){return String.fromCharCode.apply(null,Array.from(new Uint8Array(t)))}function a(t){if("string"!=typeof t)throw new Error(`str2ab expected a string but got ${typeof t} instead.`);const e=new Uint8Array(t.length);for(let r=0,n=t.length;r<n;r++)e[r]=t.charCodeAt(r);return e}function c(t){if(s.ensureHex(t),!t.length)return new Uint8Array(0);const e=t.length/2,r=new Uint8Array(e);for(let n=0;n<e;n++)r[n]=parseInt(t.substring(0,2),16),t=t.substring(2);return r}function u(t){if("object"!=typeof t)throw new Error(`ab2hexstring expects an array. Input was ${t}`);let e="";const r=new Uint8Array(t);for(const t of r){let r=t.toString(16);e+=r=0===r.length?"00":1===r.length?"0"+r:r}return e}function f(t,e=1,r=!1){if("number"!=typeof t)throw new Error(`num2hexstring expected a number but got ${typeof t} instead.`);if(t<0)throw new RangeError(`num2hexstring expected a positive integer but got ${t} instead.`);if(e%1!=0)throw new Error(`num2hexstring expected a positive integer but got ${t} instead.`);if(!Number.isSafeInteger(t))throw new RangeError(`num2hexstring expected a safe integer but got ${t} instead.`);e*=2;let n=t.toString(16);return n=n.length%e==0?n:("0".repeat(e)+n).substring(n.length),r&&(n=s.reverseHex(n)),n}e.ab2str=o,e.str2ab=a,e.hexstring2ab=c,e.ab2hexstring=u,e.str2hexstring=function(t){return u(a(t))},e.hexstring2str=function(t){return o(c(t))},e.int2hex=function(t){if("number"!=typeof t)throw new Error(`int2hex expected a number but got ${typeof t} instead.`);const e=t.toString(16);return e.length%2?"0"+e:e},e.num2hexstring=f,e.num2fixed8=function(t,e=8){if("number"!=typeof t)throw new Error(`num2fixed8 expected a number but got ${typeof t} instead.`);if(e%1!=0)throw new Error(`num2fixed expected an integer for argument size but got ${e} instead.`);return new i.default(t),new i.default(t).toReverseHex().slice(0,2*e)},e.fixed82num=function(t){return s.ensureHex(t),""===t?0:i.default.fromReverseHex(t).toNumber()},e.num2VarInt=function(t){return t<253?f(t):t<=65535?"fd"+f(t,2,!0):t<=4294967295?"fe"+f(t,4,!0):"ff"+f(t,8,!0)}},function(t,e,r){t.exports=r(5).enc.Hex},function(t,e,r){var n;t.exports=(n=r(5),function(t){var e=n,r=e.lib,i=r.WordArray,s=r.Hasher,o=e.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(a[i]=r(t.pow(n,.5))),c[i]=r(t.pow(n,1/3)),i++),n++}();var u=[],f=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],f=r[5],h=r[6],d=r[7],l=0;l<64;l++){if(l<16)u[l]=0|t[e+l];else{var p=u[l-15],b=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=u[l-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[l]=b+u[l-7]+g+u[l-16]}var v=n&i^n&s^i&s,y=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&h)+c[l]+u[l];d=h,h=f,f=a,a=o+w|0,o=s,s=i,i=n,n=w+(y+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+a|0,r[5]=r[5]+f|0,r[6]=r[6]+h|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=s._createHelper(f),e.HmacSHA256=s._createHmacHelper(f)}(Math),n.SHA256)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(120));e.generateRandomArray=t=>i.default(t)},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,s=n.length,o=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=s)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),c=n[r];r<s;c=n[++r])b(c)||!w(c)?o+=" "+c:o+=" "+a(c);return o},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var s,o={};function a(t,r){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,t,n.depth)}function c(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function u(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=f(t,i,n)),i}var s=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(s)return s;var o=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),S(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(x(r)){var c=r.name?": "+r.name:"";return t.stylize("[Function"+c+"]","special")}if(y(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return h(r)}var u,w="",A=!1,M=["{","}"];return l(r)&&(A=!0,M=["[","]"]),x(r)&&(w=" [Function"+(r.name?": "+r.name:"")+"]"),y(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),S(r)&&(w=" "+h(r)),0!==o.length||A&&0!=r.length?n<0?y(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=A?function(t,e,r,n,i){for(var s=[],o=0,a=e.length;o<a;++o)P(e,String(o))?s.push(d(t,e,r,n,String(o),!0)):s.push("");return i.forEach((function(i){i.match(/^\d+$/)||s.push(d(t,e,r,n,i,!0))})),s}(t,r,n,a,o):o.map((function(e){return d(t,r,n,a,e,A)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,w,M)):M[0]+w+M[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,s){var o,a,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),P(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=b(r)?f(t,c.value,null):f(t,c.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),v(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function l(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function v(t){return void 0===t}function y(t){return w(t)&&"[object RegExp]"===A(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===A(t)}function S(t){return w(t)&&("[object Error]"===A(t)||t instanceof Error)}function x(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(s)&&(s=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(s)){var n=t.pid;o[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else o[r]=function(){};return o[r]},e.inspect=a,a.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]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=l,e.isBoolean=p,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=y,e.isObject=w,e.isDate=_,e.isError=S,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(126);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),E[t.getMonth()],e].join(" ")}function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",T(),e.format.apply(e,arguments))},e.inherits=r(2),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),I&&Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=I,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var s=this,o=function(){return i.apply(s,arguments)};e.apply(this,r).then((function(e){t.nextTick(o,null,e)}),(function(e){t.nextTick(k,e,o)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(13))},function(t,e,r){"use strict";var n=r(129),i=r(148);t.exports=i((function(t){var e=n("sha256").update(t).digest();return n("sha256").update(e).digest()}))},function(t,e,r){"use strict";var n=r(3).Buffer,i=r(61).Transform;function s(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(2)(s,i),s.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},s.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},s.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)r[s++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},function(t,e,r){t.exports=i;var n=r(34).EventEmitter;function i(){n.call(this)}r(2)(i,n),i.Readable=r(35),i.Writable=r(137),i.Duplex=r(138),i.Transform=r(139),i.PassThrough=r(140),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",s),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,t.end())}function c(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e,r){"use strict";(function(e,n){var i=r(26);t.exports=y;var s,o=r(57);y.ReadableState=v,r(34).EventEmitter;var a=function(t,e){return t.listeners(e).length},c=r(63),u=r(3).Buffer,f=e.Uint8Array||function(){},h=r(22);h.inherits=r(2);var d=r(131),l=void 0;l=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(132),m=r(64);h.inherits(y,c);var g=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var n=e instanceof(s=s||r(14));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(37).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function y(t){if(s=s||r(14),!(this instanceof y))return new y(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function w(t,e,r,n,i){var s,o=t._readableState;return null===e?(o.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,A(t)}}(t,o)):(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(o,e)),s?t.emit("error",s):o.objectMode||e&&e.length>0?("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n?o.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,o,e,!0):o.ended?t.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?_(t,o,e,!1):E(t,o)):_(t,o,e,!1))):n||(o.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(o)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&A(t)),E(t,e)}Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.push(null),e(t)},y.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},y.prototype.unshift=function(t){return w(this,t,null,!0,!1)},y.prototype.isPaused=function(){return!1===this._readableState.flowing},y.prototype.setEncoding=function(t){return p||(p=r(37).StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};var S=8388608;function x(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(M,t):M(t))}function M(t){l("emit readable"),t.emit("readable"),k(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(T,t,e))}function T(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(l("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function P(t){l("readable nexttick read 0"),t.read(0)}function I(t,e){e.reading||(l("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),k(t),e.flowing&&!e.reading&&t.read(0)}function k(t){var e=t._readableState;for(l("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;for(t-=i.length;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(o===s.length?i+=s:i+=s.slice(0,t),0==(t-=o)){o===s.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var s=n.data,o=t>s.length?s.length:t;if(s.copy(r,r.length-t,0,o),0==(t-=o)){o===s.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=s.slice(o));break}++i}return e.length-=i,r}(t,e),n}(t,e.buffer,e.decoder),r);var r}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(C,e,t))}function C(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function B(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}y.prototype.read=function(t){l("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):A(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&R(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&l("length less than watermark",i=!0),e.ended||e.reading?l("reading or ended",i=!1):i&&(l("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=x(r,e))),null===(n=t>0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&R(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,l("pipe count=%d opts=%j",s.pipesCount,e);var c=e&&!1===e.end||t===n.stdout||t===n.stderr?v:u;function u(){l("onend"),t.end()}s.endEmitted?i.nextTick(c):r.once("end",c),t.on("unpipe",(function e(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),t.removeListener("close",m),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",b),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",p),h=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,k(t))}}(r);t.on("drain",f);var h=!1,d=!1;function p(e){l("ondata"),d=!1,!1!==t.write(e)||d||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==B(s.pipes,t))&&!h&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function b(e){l("onerror",e),v(),t.removeListener("error",b),0===a(t,"error")&&t.emit("error",e)}function m(){t.removeListener("finish",g),v()}function g(){l("onfinish"),t.removeListener("close",m),v()}function v(){l("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?o(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",m),t.once("finish",g),t.emit("pipe",r),s.flowing||(l("pipe resume"),r.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,r);return this}var o=B(e.pipes,t);return-1===o?this:(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},y.prototype.on=function(t,e){var r=c.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&A(this):i.nextTick(P,this))}return r},y.prototype.addListener=y.prototype.on,y.prototype.resume=function(){var t=this._readableState;return t.flowing||(l("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(I,t,e))}(this,t)),this},y.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},y.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(l("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<g.length;s++)t.on(g[s],this.emit.bind(this,g[s]));return this._read=function(e){l("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),y._fromList=O}).call(this,r(18),r(13))},function(t,e,r){t.exports=r(34).EventEmitter},function(t,e,r){"use strict";var n=r(26);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function s(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new s(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new s(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(134),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(18))},function(t,e,r){"use strict";t.exports=o;var n=r(14),i=r(22);function s(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(t){if(!(this instanceof o))return new o(t);n.call(this,t),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){c(t,e,r)})):c(this,null,null)}function c(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=r(2),i.inherits(o,n),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},function(t,e,r){var n=r(2),i=r(20),s=r(3).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+l(r[g-15])+r[g-16];for(var v=0;v<64;++v){var y=m+d(c)+u(c,p,b)+o[v]+r[v]|0,w=h(n)+f(n,i,s)|0;m=b,b=p,p=c,c=a+y|0,a=s,s=i,i=n,n=y+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},c.prototype._hash=function(){var t=s.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=c},function(t,e,r){var n=r(2),i=r(20),s=r(3).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,i.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0<e>>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,s=0|this._dh,a=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,x=0|this._dl,A=0|this._el,M=0|this._fl,E=0|this._gl,T=0|this._hl,P=0;P<32;P+=2)e[P]=t.readInt32BE(4*P),e[P+1]=t.readInt32BE(4*P+4);for(;P<160;P+=2){var I=e[P-30],k=e[P-30+1],O=l(I,k),R=p(k,I),C=b(I=e[P-4],k=e[P-4+1]),B=m(k,I),N=e[P-14],L=e[P-14+1],j=e[P-32],H=e[P-32+1],U=R+L|0,D=O+N+g(U,R)|0;D=(D=D+C+g(U=U+B|0,B)|0)+j+g(U=U+H|0,H)|0,e[P]=D,e[P+1]=U}for(var z=0;z<160;z+=2){D=e[z],U=e[z+1];var F=f(r,n,i),q=f(w,_,S),V=h(r,w),K=h(w,r),$=d(a,A),W=d(A,a),Y=o[z],G=o[z+1],X=u(a,c,v),J=u(A,M,E),Z=T+W|0,Q=y+$+g(Z,T)|0;Q=(Q=(Q=Q+X+g(Z=Z+J|0,J)|0)+Y+g(Z=Z+G|0,G)|0)+D+g(Z=Z+U|0,U)|0;var tt=K+q|0,et=V+F+g(tt,K)|0;y=v,T=E,v=c,E=M,c=a,M=A,a=s+Q+g(A=x+Z|0,x)|0,s=i,x=S,i=n,S=_,n=r,_=w,r=Q+et+g(w=Z+tt|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+x|0,this._el=this._el+A|0,this._fl=this._fl+M|0,this._gl=this._gl+E|0,this._hl=this._hl+T|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+s+g(this._dl,x)|0,this._eh=this._eh+a+g(this._el,A)|0,this._fh=this._fh+c+g(this._fl,M)|0,this._gh=this._gh+v+g(this._gl,E)|0,this._hh=this._hh+y+g(this._hl,T)|0},c.prototype._hash=function(){var t=s.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=c},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(8)),s=r(7),o=r(0),a=r(19),c=r(28);e.curve=new s.ec("p256"),e.sign=function(r,n){c.isWIF(n)&&(n=a.getPrivateKeyFromWIF(n));const i=o.sha256(r),s=t.from(i,"hex"),u=t.from(n,"hex"),f=e.curve.sign(s,u);return f.r.toString("hex",32)+f.s.toString("hex",32)},e.verify=function(r,n,s){if(!c.isPublicKey(s))throw new Error("Invalid public key");c.isPublicKey(s,!0)||(s=a.getPublicKeyUnencoded(s));const u=function(e){const r=t.from(e,"hex");return{r:new i.default(r.slice(0,32).toString("hex"),16,"be"),s:new i.default(r.slice(32).toString("hex"),16,"be")}}(n),f=o.sha256(r),h=t.from(s,"hex");return e.curve.verify(f,u,h,"hex")}}).call(this,r(11).Buffer)},function(t,e,r){"use strict";var n=e;function i(t){return 1===t.length?"0"+t:t}function s(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),s=i>>8,o=255&i;s?r.push(s,o):r.push(o)}return r},n.zero2=i,n.toHex=s,n.encode=function(t,e){return"hex"===e?s(t):t}},function(t,e,r){"use strict";var n=r(9).rotr32;function i(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?o(e,r,n):2===t?s(e,r,n):void 0},e.ch32=i,e.maj32=s,e.p32=o,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(9),i=r(23),s=r(71),o=r(15),a=n.sum32,c=n.sum32_4,u=n.sum32_5,f=s.ch32,h=s.maj32,d=s.s0_256,l=s.s1_256,p=s.g0_256,b=s.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=c(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],s=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],_=this.h[7];for(o(this.k.length===r.length),n=0;n<r.length;n++){var S=u(_,l(v),f(v,y,w),this.k[n],r[n]),x=a(d(i),h(i,s,m));_=w,w=y,y=v,v=a(g,S),g=m,m=s,s=i,i=a(S,x)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(9),i=r(23),s=r(15),o=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,f=n.sum64,h=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,n,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function _(t,e,r,n,i,s){var o=e&n^~e&s;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function x(t,e,r,n,i,s){var o=e&n^e&s^n&s;return o<0&&(o+=4294967296),o}function A(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function P(t,e){var r=o(t,e,1)^o(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=o(t,e,19)^o(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(y,g),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=k(r[n-4],r[n-3]),s=O(r[n-4],r[n-3]),o=r[n-14],a=r[n-13],c=P(r[n-30],r[n-29]),u=I(r[n-30],r[n-29]),f=r[n-32],h=r[n-31];r[n]=l(i,s,o,a,c,u,f,h),r[n+1]=p(i,s,o,a,c,u,f,h)}},y.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],p=this.h[7],g=this.h[8],v=this.h[9],y=this.h[10],P=this.h[11],I=this.h[12],k=this.h[13],O=this.h[14],R=this.h[15];s(this.k.length===r.length);for(var C=0;C<r.length;C+=2){var B=O,N=R,L=E(g,v),j=T(g,v),H=w(g,0,y,0,I),U=_(0,v,0,P,0,k),D=this.k[C],z=this.k[C+1],F=r[C],q=r[C+1],V=b(B,N,L,j,H,U,D,z,F,q),K=m(B,N,L,j,H,U,D,z,F,q);B=A(n,i),N=M(n,i),L=S(n,0,o,0,c),j=x(0,i,0,a,0,u);var $=h(B,N,L,j),W=d(B,N,L,j);O=I,R=k,I=y,k=P,y=g,P=v,g=h(l,p,V,K),v=d(p,p,V,K),l=c,p=u,c=o,u=a,o=n,a=i,n=h(V,K,$,W),i=d(V,K,$,W)}f(this.h,0,n,i),f(this.h,2,o,a),f(this.h,4,c,u),f(this.h,6,l,p),f(this.h,8,g,v),f(this.h,10,y,P),f(this.h,12,I,k),f(this.h,14,O,R)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(75),i=r(0),s=r(28);e.constructMultiSigVerificationScript=function(t,e){if(t>e.length)throw new Error("signingThreshold must be smaller than or equal to number of keys");const r=new n.ScriptBuilder;return r.emitPush(t),e.forEach(t=>{if(!s.isPublicKey(t,!0))throw new Error(`${t} is not a valid encoded public key`);r.emitPush(t)}),r.emitPush(e.length),r.emit(n.OpCode.CHECKMULTISIG),r.str},e.getPublicKeysFromVerificationScript=function(t){const e=new i.StringStream(t),r=[];for(;!e.isEmpty();)"21"===e.read()&&r.push(e.read(33));return r},e.getSigningThresholdFromVerificationScript=function(t){const e=t.slice(t.length-2);if("ac"===e)return 1;if("ae"===e){const e=new i.StringStream(t);if(parseInt(e.peek(),16)<80){const t=i.reverseHex(e.readVarBytes());return parseInt(t,16)}return parseInt(e.read(),16)-80}throw new Error("VerificationScript does not call CHECKSIG or CHECKMULTISIG.")},e.getSignaturesFromInvocationScript=function(t){const e=new i.StringStream(t),r=[];for(;!e.isEmpty();){const t=parseInt(e.peek(),16);t>80||64===t&&r.push(e.readVarBytes())}return r}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(76)),n(r(174)),n(r(77)),n(r(175)),n(r(78))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(12);var s;function o(t){if("string"==typeof t){if(t in s)return s[t];throw new Error(`${t} not found in ContractParamType!`)}return t}!function(t){t[t.Signature=0]="Signature",t[t.Boolean=1]="Boolean",t[t.Integer=2]="Integer",t[t.Hash160=3]="Hash160",t[t.Hash256=4]="Hash256",t[t.ByteArray=5]="ByteArray",t[t.PublicKey=6]="PublicKey",t[t.String=7]="String",t[t.Array=16]="Array",t[t.InteropInterface=240]="InteropInterface",t[t.Void=255]="Void"}(s=e.ContractParamType||(e.ContractParamType={}));class a{static string(t){return new a(s.String,t)}static boolean(t){return new a(s.Boolean,!!t)}static hash160(t){if("string"!=typeof t)throw new Error(`hash160 expected a string but got ${typeof t} instead.`);if(i.isAddress(t)&&(t=i.getScriptHashFromAddress(t)),40!==t.length)throw new Error(`hash160 expected a 40 character string but got ${t.length} chars instead.`);return new a(s.Hash160,t)}static integer(t){const e="string"==typeof t?t.split(".")[0]:Math.round(t).toString();return new a(s.Integer,e)}static byteArray(t,e,...r){if(e&&(e=e.toLowerCase()),"address"===e)return new a(s.ByteArray,n.reverseHex(i.getScriptHashFromAddress(t)));if("fixed8"===e){let e=8;if(1===r.length&&(e=r[0]),!isFinite(t))throw new Error("Input should be number!");const i=new n.Fixed8(Math.pow(10,8-e)),o=new n.Fixed8(t);if(!o.times(Math.pow(10,e)).mod(1).isZero())throw new Error(`wrong precision: expected ${e}`);return t=o.div(i),new a(s.ByteArray,t.toReverseHex().slice(0,16))}return new a(s.ByteArray,t)}static array(...t){return new a(s.Array,t)}constructor(t,e){if("object"==typeof t)this.type=o(t.type),this.value=t.value;else{if(void 0===t)throw new Error("No constructor arguments provided!");this.type=o(t),this.value=e}}get[Symbol.toStringTag](){return"ContractParam:"+s[this.type]}export(){return Array.isArray(this.value)?this.value.map(t=>t.export()):this.value,{type:s[this.type],value:this.value}}equal(t){return!(this.type!==o(t.type)||!Array.isArray(this.value)||!Array.isArray(t.value)||this.value.length!==t.value.length)&&this.value.every((e,r)=>e.equal(t.value[r]))}}e.ContractParam=a,e.default=a,e.likeContractParam=function(t){return null!=t&&(t instanceof a||t.type in s&&null!==t.value&&void 0!==t.value)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const s=n(r(8)),o=r(0),a=i(r(76)),c=n(r(78));function u(t){const e={scriptHash:"",args:[]};for(;!t.isEmpty();){const r=t.read(),n=parseInt(r,16);switch(!0){case 0===n:e.args.unshift(0);break;case n<75:e.args.unshift(t.read(n));break;case n>=81&&n<=96:e.args.unshift(n-80);break;case 193===n:const i=e.args.shift(),s=[];for(let t=0;t<i;t++)s.unshift(e.args.shift());e.args.unshift(s);break;case 102===n:t.pter=t.str.length;break;case 103===n:return e.scriptHash=o.reverseHex(t.read(20)),e.useTailCall=!1,e;case 105===n:return e.scriptHash=o.reverseHex(t.read(20)),e.useTailCall=!0,e;case 241===n:break;default:throw new Error(`Encounter unknown byte: ${r}`)}}return""===e.scriptHash?null:e}class f extends o.StringStream{emit(t,e){return this.str+=o.num2hexstring(t),e&&(this.str+=e),this}emitAppCall(t,e=null,r,n=!1){if(this.emitPush(r),e){let t="";for(let r=0;r<e.length;r++)t+=o.num2hexstring(e.charCodeAt(r));this.emitPush(t)}return this._emitAppCall(t,n),this}emitSysCall(t){if(!t)throw new Error("Invalid SysCall API");const e=o.str2hexstring(t),r=o.int2hex(e.length/2);if(2!==r.length)throw new Error("Invalid length for SysCall API");const n=r+e;return this.emit(c.default.SYSCALL,n)}emitPush(t){switch(typeof t){case"boolean":return this.emit(t?c.default.PUSHT:c.default.PUSHF);case"string":return this._emitString(t);case"number":return this._emitNum(t);case"undefined":return this.emitPush(!1);case"object":if(Array.isArray(t))return this._emitArray(t);if(a.likeContractParam(t))return this._emitParam(new a.default(t));if(null===t)return this.emitPush(!1);throw new Error(`Unidentified object: ${t}`);default:throw new Error}}toScriptParams(){this.reset();const t=[];for(;!this.isEmpty();){const e=u(this);e&&t.push(e)}return t}_emitAppCall(t,e=!1){if(o.ensureHex(t),40!==t.length)throw new Error("ScriptHash should be 20 bytes long!");return this.emit(e?c.default.TAILCALL:c.default.APPCALL,o.reverseHex(t))}_emitArray(t){for(let e=t.length-1;e>=0;e--)this.emitPush(t[e]);return this.emitPush(t.length).emit(c.default.PACK)}_emitString(t){o.ensureHex(t);const e=t.length/2;if(e<=c.default.PUSHBYTES75)this.str+=o.num2hexstring(e),this.str+=t;else if(e<256)this.emit(c.default.PUSHDATA1),this.str+=o.num2hexstring(e),this.str+=t;else if(e<65536)this.emit(c.default.PUSHDATA2),this.str+=o.num2hexstring(e,2,!0),this.str+=t;else{if(!(e<4294967296))throw new Error("String too big to emit!");this.emit(c.default.PUSHDATA4),this.str+=o.num2hexstring(e,4,!0),this.str+=t}return this}_emitNum(t){const e=new s.default(t);if(e.eqn(-1))return this.emit(c.default.PUSHM1);if(e.eqn(0))return this.emit(c.default.PUSH0);if(e.gtn(0)&&e.lten(16))return this.emit(c.default.PUSH1-1+e.toNumber());const r=e.testn(8*e.byteLength()-1),n=e.toTwos(8*e.byteLength()).toString(16,2*e.byteLength()),i=!e.isNeg()&&r?"00"+n:n;return this.emitPush(o.reverseHex(i))}_emitParam(t){if(!t.type)throw new Error("No type available!");if(!(e=t.value)&&0!==e&&""!==e)throw new Error("Invalid value provided!");var e;switch(t.type){case a.ContractParamType.String:return this._emitString(o.str2hexstring(t.value));case a.ContractParamType.Boolean:return this.emit(t.value?c.default.PUSHT:c.default.PUSHF);case a.ContractParamType.Integer:return this._emitNum(t.value);case a.ContractParamType.ByteArray:return this._emitString(t.value);case a.ContractParamType.Array:return this._emitArray(t.value);case a.ContractParamType.Hash160:return this._emitString(o.reverseHex(t.value));default:throw new Error(`Unaccounted ContractParamType!: ${t.type}`)}}}e.ScriptBuilder=f,e.default=f},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.PUSH0=0]="PUSH0",t[t.PUSHF=0]="PUSHF",t[t.PUSHBYTES1=1]="PUSHBYTES1",t[t.PUSHBYTES75=75]="PUSHBYTES75",t[t.PUSHDATA1=76]="PUSHDATA1",t[t.PUSHDATA2=77]="PUSHDATA2",t[t.PUSHDATA4=78]="PUSHDATA4",t[t.PUSHM1=79]="PUSHM1",t[t.PUSH1=81]="PUSH1",t[t.PUSHT=81]="PUSHT",t[t.PUSH2=82]="PUSH2",t[t.PUSH3=83]="PUSH3",t[t.PUSH4=84]="PUSH4",t[t.PUSH5=85]="PUSH5",t[t.PUSH6=86]="PUSH6",t[t.PUSH7=87]="PUSH7",t[t.PUSH8=88]="PUSH8",t[t.PUSH9=89]="PUSH9",t[t.PUSH10=90]="PUSH10",t[t.PUSH11=91]="PUSH11",t[t.PUSH12=92]="PUSH12",t[t.PUSH13=93]="PUSH13",t[t.PUSH14=94]="PUSH14",t[t.PUSH15=95]="PUSH15",t[t.PUSH16=96]="PUSH16",t[t.NOP=97]="NOP",t[t.JMP=98]="JMP",t[t.JMPIF=99]="JMPIF",t[t.JMPIFNOT=100]="JMPIFNOT",t[t.CALL=101]="CALL",t[t.RET=102]="RET",t[t.APPCALL=103]="APPCALL",t[t.SYSCALL=104]="SYSCALL",t[t.TAILCALL=105]="TAILCALL",t[t.DUPFROMALTSTACK=106]="DUPFROMALTSTACK",t[t.TOALTSTACK=107]="TOALTSTACK",t[t.FROMALTSTACK=108]="FROMALTSTACK",t[t.XDROP=109]="XDROP",t[t.XSWAP=114]="XSWAP",t[t.XTUCK=115]="XTUCK",t[t.DEPTH=116]="DEPTH",t[t.DROP=117]="DROP",t[t.DUP=118]="DUP",t[t.NIP=119]="NIP",t[t.OVER=120]="OVER",t[t.PICK=121]="PICK",t[t.ROLL=122]="ROLL",t[t.ROT=123]="ROT",t[t.SWAP=124]="SWAP",t[t.TUCK=125]="TUCK",t[t.CAT=126]="CAT",t[t.SUBSTR=127]="SUBSTR",t[t.LEFT=128]="LEFT",t[t.RIGHT=129]="RIGHT",t[t.SIZE=130]="SIZE",t[t.INVERT=131]="INVERT",t[t.AND=132]="AND",t[t.OR=133]="OR",t[t.XOR=134]="XOR",t[t.EQUAL=135]="EQUAL",t[t.INC=139]="INC",t[t.DEC=140]="DEC",t[t.SIGN=141]="SIGN",t[t.NEGATE=143]="NEGATE",t[t.ABS=144]="ABS",t[t.NOT=145]="NOT",t[t.NZ=146]="NZ",t[t.ADD=147]="ADD",t[t.SUB=148]="SUB",t[t.MUL=149]="MUL",t[t.DIV=150]="DIV",t[t.MOD=151]="MOD",t[t.SHL=152]="SHL",t[t.SHR=153]="SHR",t[t.BOOLAND=154]="BOOLAND",t[t.BOOLOR=155]="BOOLOR",t[t.NUMEQUAL=156]="NUMEQUAL",t[t.NUMNOTEQUAL=158]="NUMNOTEQUAL",t[t.LT=159]="LT",t[t.GT=160]="GT",t[t.LTE=161]="LTE",t[t.GTE=162]="GTE",t[t.MIN=163]="MIN",t[t.MAX=164]="MAX",t[t.WITHIN=165]="WITHIN",t[t.SHA1=167]="SHA1",t[t.SHA256=168]="SHA256",t[t.HASH160=169]="HASH160",t[t.HASH256=170]="HASH256",t[t.CHECKSIG=172]="CHECKSIG",t[t.VERIFY=173]="VERIFY",t[t.CHECKMULTISIG=174]="CHECKMULTISIG",t[t.ARRAYSIZE=192]="ARRAYSIZE",t[t.PACK=193]="PACK",t[t.UNPACK=194]="UNPACK",t[t.PICKITEM=195]="PICKITEM",t[t.SETITEM=196]="SETITEM",t[t.NEWARRAY=197]="NEWARRAY",t[t.NEWSTRUCT=198]="NEWSTRUCT",t[t.NEWMAP=199]="NEWMAP",t[t.APPEND=200]="APPEND",t[t.REVERSE=201]="REVERSE",t[t.REMOVE=202]="REMOVE",t[t.HASKEY=203]="HASKEY",t[t.KEYS=204]="KEYS",t[t.VALUES=205]="VALUES",t[t.CALL_I=224]="CALL_I",t[t.CALL_E=225]="CALL_E",t[t.CALL_ED=226]="CALL_ED",t[t.CALL_ET=227]="CALL_ET",t[t.CALL_EDT=228]="CALL_EDT",t[t.THROW=240]="THROW",t[t.THROWIFNOT=241]="THROWIFNOT"}(n=e.OpCode||(e.OpCode={})),e.default=n},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(59)),s=n(r(176)),o=n(r(54)),a=n(r(181)),c=n(r(182)),u=n(r(183)),f=n(r(55)),h=n(r(184)),d=r(1),l=n(r(10)),p=r(0),b=n(r(32)),m={Latin1:a.default,Hex:o.default},g={mode:c.default,padding:u.default},v=l.default("wallet");e.encrypt=function(e,r,n=d.DEFAULT_SCRYPT){return new Promise((o,a)=>{const{n:c,r:u,p:l}=n,y=new b.default(e),w=f.default(m.Latin1.parse(y.address)),_=f.default(w).toString().slice(0,8);h.default(t.from(r.normalize("NFC"),"utf8"),t.from(_,"hex"),c,u,l,64,(e,r,n)=>{if(null!=e)a(e);else if(n){const e=t.from(n).toString("hex"),r=e.slice(0,64),a=e.slice(64),c=p.hexXor(y.privateKey,r),u=s.default.encrypt(m.Hex.parse(c),m.Hex.parse(a),g),f=d.NEP_HEADER+d.NEP_FLAG+_+u.ciphertext.toString(),h=i.default.encode(t.from(f,"hex"));v.info(`Successfully encrypted key to ${h}`),o(h)}})})},e.decrypt=function(e,r,n=d.DEFAULT_SCRYPT){return new Promise((o,a)=>{const{n:c,r:u,p:d}=n,l=p.ab2hexstring(i.default.decode(e)),y=l.substr(6,8),w=l.substr(-64);h.default(t.from(r.normalize("NFC"),"utf8"),t.from(y,"hex"),c,u,d,64,(r,n,i)=>{if(null!=r)a(r);else if(i){const r=t.from(i).toString("hex"),n=r.slice(0,64),c=r.slice(64),u={ciphertext:m.Hex.parse(w),salt:"",iv:""},h=s.default.decrypt(u,m.Hex.parse(c),g),d=p.hexXor(h.toString(),n),l=new b.default(d),_=f.default(f.default(m.Latin1.parse(l.address))).toString().slice(0,8);y!==_&&a(new Error("Wrong password or scrypt parameters!")),v.info(`Successfully decrypted ${e}`),o(l.WIF)}})})}}).call(this,r(11).Buffer)},function(t,e,r){var n,i,s,o,a,c,u,f;t.exports=(f=r(5),r(179),r(180),s=(i=(n=f).lib).Base,o=i.WordArray,c=(a=n.algo).MD5,u=a.EvpKDF=s.extend({cfg:s.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,n=r.hasher.create(),i=o.create(),s=i.words,a=r.keySize,c=r.iterations;s.length<a;){u&&n.update(u);var u=n.update(t).finalize(e);n.reset();for(var f=1;f<c;f++)u=n.finalize(u),n.reset();i.concat(u)}return i.sigBytes=4*a,i}}),n.EvpKDF=function(t,e,r){return u.create(r).compute(t,e)},f.EvpKDF)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),s=r(12),o=r(16),a=r(82);function c(t){return t.reduce((t,e)=>(t[e.assetId]?t[e.assetId]=t[e.assetId].add(e.value):t[e.assetId]=e.value,t),{})}function u(t,e,r,n,a){const c=a(t,e),u=c.reduce((t,e)=>t.add(e.value),new i.Fixed8(0)),f=[];return u.gt(e)&&f.push(new o.TransactionOutput({assetId:r,value:u.sub(e),scriptHash:s.getScriptHashFromAddress(n)})),{inputs:c.map(t=>new o.TransactionInput({prevHash:t.txid,prevIndex:t.index})),change:f}}e.defaultCalculationStrategy=a.balancedApproach,e.combineIntents=c,e.calculateInputsForAsset=u,e.calculateInputs=function(t,r=[],a=0,f){const h=f||e.defaultCalculationStrategy;new i.Fixed8(a).gt(0)&&(r=r.slice()).push(new o.TransactionOutput({assetId:n.ASSET_ID.GAS,value:a,scriptHash:s.getScriptHashFromAddress(t.address)}));const d=c(r);return Object.keys(d).map(e=>{const r=d[e],i=n.ASSETS[e];if(-1===t.assetSymbols.indexOf(i))throw new Error(`This balance does not contain any ${i}!`);const o=t.assets[i];if(o.balance.lt(r))throw new Error(`Insufficient ${n.ASSETS[e]}! Need ${r.toString()} but only found ${o.balance.toString()}`);return u(new s.AssetBalance(o),r,e,t.address,h)}).reduce((t,e)=>({inputs:t.inputs.concat(e.inputs),change:t.change.concat(e.change)}),{inputs:[],change:[]})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);function i(t,e){let r=0,i=new n.Fixed8(0);for(;i.lt(t);){if((r+=1)>e.length)throw new Error(`Insufficient assets! Reached end of unspent coins! ${e.length}`);i=i.add(e[r-1].value)}return e.slice(0,r)}e.smallestFirst=function(t,e){return t.unspent.sort((t,e)=>t.value.sub(e.value).toNumber()),i(e,t.unspent)},e.biggestFirst=function(t,e){return t.unspent.sort((t,e)=>e.value.sub(t.value).toNumber()),i(e,t.unspent)},e.balancedApproach=function(t,e){t.unspent.sort((t,e)=>t.value.sub(e.value).toNumber());const r=t.unspent.filter(t=>t.value.lte(e));if(0===r.length)return[t.unspent[0]];const n=r.findIndex(t=>e.eq(t.value));if(n>=0)return[r[n]];const s=t.unspent.slice(r.length),o=[];r.length>0&&o.push(r.pop());const a=i(e.minus(o.length>0?o[0].value:0),r.concat(s));return o.concat(a)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(24),s=n(r(17)),o=n(r(41));class a{constructor(t={}){this.unspent=t.unspent?t.unspent.map(t=>new o.default(t)):[],this.spent=t.spent?t.spent.map(t=>new o.default(t)):[],this.unconfirmed=t.unconfirmed?t.unconfirmed.map(t=>new o.default(t)):[]}get balance(){return this.unspent.reduce((t,e)=>t.add(e.value),new s.default(0))}export(){return{balance:this.balance.toNumber(),unspent:this.unspent.map(t=>t.export()),spent:this.spent.map(t=>t.export()),unconfirmed:this.unconfirmed.map(t=>t.export())}}equals(t){return i.compareNeonObjectArray(this.unspent,t.unspent)&&i.compareNeonObjectArray(this.spent,t.spent)&&i.compareNeonObjectArray(this.unconfirmed,t.unconfirmed)}}e.AssetBalance=a,e.default=a},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(17));class s{constructor(t={}){this.claim=new i.default(t.claim),this.txid=t.txid||"",this.index=t.index||0,this.value=t.value||0,this.start=t.start,this.end=t.end}export(){return{claim:this.claim.toNumber(),txid:this.txid,index:this.index,value:this.value,start:this.start,end:this.end}}equals(t){return this.claim.equals(t.claim||0)&&this.txid===t.txid&&this.index===t.index&&this.value===t.value&&this.start===t.start&&this.end===t.end}}e.ClaimItem=s,e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),s=r(12),o=r(16),a=r(6),c=r(40),u=255;class f extends a.BaseTransaction{constructor(t={}){super(Object.assign({version:n.TX_VERSION.CLAIM},t)),this.type=2,this.claims=Array.isArray(t.claims)?t.claims.slice(0,u).map(t=>new o.TransactionInput(t)):[]}static deserializeExclusive(t,e){const r={claims:[]},n=t.readVarInt();for(let e=0;e<n;e++)r.claims.push(o.TransactionInput.fromStream(t));return Object.assign(e,r)}static fromClaims(t){const e=t.claims.reduce((t,e)=>t.add(e.claim),new i.Fixed8(0)),r=[new o.TransactionOutput({assetId:n.ASSET_ID.GAS,value:e,scriptHash:s.getScriptHashFromAddress(t.address)})],a=t.claims.map(t=>({prevHash:t.txid,prevIndex:t.index}));return new f({outputs:r,claims:a})}get exclusiveData(){return{claims:this.claims}}get fees(){return 0}addClaims(t){if(0!==this.claims.length)throw new Error("This transaction already has claims!");const e=t.claims.reduce((t,e)=>t.add(e.claim),new i.Fixed8(0));return this.outputs.push(new o.TransactionOutput({assetId:n.ASSET_ID.GAS,value:e,scriptHash:s.getScriptHashFromAddress(t.address)})),this.claims=t.claims.map(t=>new o.TransactionInput({prevHash:t.txid,prevIndex:t.index})),this}serializeExclusive(){return c.serializeArrayOf(this.claims)}equals(t){return this.type===t.type&&(t instanceof f?this.hash===t.hash:this.hash===new f(t).hash)}export(){return Object.assign(super.export(),{claims:this.claims.map(t=>t.export())})}}e.ClaimTransaction=f,e.default=f},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(6));class s extends i.default{constructor(t={}){super(t),this.type=128}static deserializeExclusive(t,e){return{}}get exclusiveData(){return{}}get fees(){return 0}serializeExclusive(){return""}equals(t){return this.type===t.type&&(t instanceof s?this.hash===t.hash:this.hash===new s(t).hash)}}e.ContractTransaction=s,e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),s=r(6);class o extends s.BaseTransaction{constructor(t={}){super(Object.assign({version:n.TX_VERSION.INVOCATION},t)),this.type=209,this.script=t.script||"",this.gas=new i.Fixed8(t.gas)}static deserializeExclusive(t,e){const r=t.readVarBytes(),n=parseInt(t.str.substr(2,2),16)>=1?i.fixed82num(t.read(8)):0;return Object.assign(e,{script:r,gas:n})}get exclusiveData(){return{gas:this.gas,script:this.script}}get fees(){return this.gas.toNumber()}serializeExclusive(){let t=i.num2VarInt(this.script.length/2);return t+=this.script,this.version>=1&&(t+=this.gas.toReverseHex()),t}equals(t){return this.type===t.type&&(t instanceof o?this.hash===t.hash:this.hash===new o(t).hash)}export(){return Object.assign(super.export(),{script:this.script,gas:this.gas.toNumber()})}}e.InvocationTransaction=o,e.default=o},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=r(0),o=r(16),a=r(6),c=n(r(21));class u extends a.BaseTransaction{constructor(t={}){super(Object.assign({version:i.TX_VERSION.STATE},t)),this.type=c.default.StateTransaction,this.descriptors=t.descriptors?t.descriptors.map(t=>new o.StateDescriptor(t)):[]}static deserializeExclusive(t,e){const r={descriptors:[]},n=t.readVarInt();for(let e=0;e<n;e++)r.descriptors.push(o.StateDescriptor.fromStream(t));return Object.assign(e,r)}get exclusiveData(){return{descriptors:this.descriptors}}get fees(){return 0}serializeExclusive(){return s.num2VarInt(this.descriptors.length)+this.descriptors.map(t=>t.serialize()).join("")}equals(t){return this.type===t.type&&(t instanceof u?this.hash===t.hash:this.hash===new u(t).hash)}export(){return Object.assign(super.export(),{descriptors:this.descriptors.map(t=>t.export())})}}e.StateTransaction=u,e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),s=r(6);class o extends s.BaseTransaction{constructor(t={}){super(Object.assign({version:n.TX_VERSION.MINER},t)),this.type=0,this.nonce=t.nonce||0}static deserializeExclusive(t,e){const r=parseInt(i.reverseHex(t.read(4)),16);return Object.assign(e,{nonce:r})}get exclusiveData(){return{nonce:this.nonce}}get fees(){return 0}serializeExclusive(){return i.num2hexstring(this.nonce,4,!0)}export(){return Object.assign(super.export(),{nonce:this.nonce})}equals(t){return this.type===t.type&&(t instanceof o?this.hash===t.hash:this.hash===new o(t).hash)}}e.MinerTransaction=o,e.default=o},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=r(1),o=r(19),a=r(6),c=n(r(21));class u extends a.BaseTransaction{constructor(t={}){super(Object.assign({version:i.TX_VERSION.ENROLLMENT},t)),this.type=c.default.EnrollmentTransaction,this.publicKey=t.publicKey||""}static deserializeExclusive(t,e){const r=t.read(1),n=parseInt(r,16);let i="";if(2===n||3===n)i=t.read(32);else{if(4!==n){if(0===n)return Object.assign(e,{publicKey:""});throw new Error("Prefix not recognised for public key")}i=t.read(64)}i=r+i;const s=o.getPublicKeyUnencoded(i);return Object.assign(e,{publicKey:s})}get exclusiveData(){return{publicKey:this.publicKey}}get fees(){return s.DEFAULT_SYSFEE.enrollmentTransaction}serializeExclusive(){return""===this.publicKey?"00":o.getPublicKeyEncoded(this.publicKey)}export(){return Object.assign(super.export(),{publicKey:this.publicKey})}equals(t){return this.type===t.type&&(t instanceof u?this.hash===t.hash:this.hash===new u(t).hash)}}e.EnrollmentTransaction=u,e.default=u},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=r(1),o=r(6),a=n(r(21));class c extends o.BaseTransaction{constructor(t={}){super(Object.assign({version:i.TX_VERSION.ISSUE},t)),this.type=a.default.IssueTransaction}static deserializeExclusive(t,e){return{}}get exclusiveData(){return{}}get fees(){return this.version>=1?0:this.outputs.every(t=>t.assetId===s.ASSET_ID.NEO||t.assetId===s.ASSET_ID.GAS)?0:s.DEFAULT_SYSFEE.issueTransaction}serializeExclusive(){return""}equals(t){return this.type===t.type&&(t instanceof c?this.hash===t.hash:this.hash===new c(t).hash)}}e.IssueTransaction=c,e.default=c},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=r(0),o=r(19),a=r(6),c=n(r(21));class u extends a.BaseTransaction{constructor(t={}){super(Object.assign({version:i.TX_VERSION.REGISTER},t)),this.type=c.default.RegisterTransaction,this.assetType=t.assetType||0,this.name=t.name||"",this.amount=new s.Fixed8(t.amount),this.precision=t.precision||0,this.owner=t.owner||"",this.admin=t.admin||""}static deserializeExclusive(t,e){const r=parseInt(s.reverseHex(t.read(1)),16),n=s.hexstring2str(t.readVarBytes()),i=s.fixed82num(t.read(8)),a=parseInt(s.reverseHex(t.read(1)),16),c=t.read(1),u=parseInt(c,16);let f="",h="";if(2===u||3===u)f=t.read(32);else if(4===u)f=t.read(64);else if(0!==u)throw new Error("Prefix not recognised for public key");""!==f&&(f=c+f,h=o.getPublicKeyUnencoded(f));const d=s.reverseHex(t.read(20));return Object.assign(e,{assetType:r,name:n,amount:i,precision:a,owner:h,admin:d})}get exclusiveData(){return{assetType:this.assetType,name:this.name,amount:this.amount,precision:this.precision,owner:this.owner,admin:this.admin}}get fees(){return this.assetType===i.ASSET_TYPE.GoverningToken||this.assetType===i.ASSET_TYPE.UtilityToken?0:i.DEFAULT_SYSFEE.registerTransaction}serializeExclusive(){let t=s.num2hexstring(this.assetType,1,!0);return t+=s.num2VarInt(this.name.length),t+=s.str2hexstring(this.name),t+=this.amount.toReverseHex(),t+=s.num2hexstring(this.precision,1,!0),(t+=o.getPublicKeyEncoded(this.owner))+s.reverseHex(this.admin)}export(){return Object.assign(super.export(),{assetType:this.assetType,name:this.name,amount:this.amount.toNumber(),precision:this.precision,owner:this.owner,admin:this.admin})}equals(t){return this.type===t.type&&(t instanceof u?this.hash===t.hash:this.hash===new u(t).hash)}}e.RegisterTransaction=u,e.default=u},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),s=r(0),o=r(6),a=n(r(21));class c extends o.BaseTransaction{constructor(t={}){super(Object.assign({version:i.TX_VERSION.PUBLISH},t)),this.type=a.default.PublishTransaction,this.script=t.script||"",this.parameterList=t.parameterList||[0],this.returnType=t.returnType||0,this.needStorage=t.needStorage||!1,this.name=t.name||"",this.codeVersion=t.codeVersion||"",this.author=t.author||"",this.email=t.email||"",this.description=t.description||""}static deserializeExclusive(t,e){if(void 0===e.version&&(e.version=0),e.version>1)throw new Error(`version need to be less or equal than 1. Got ${e.version}`);const r=t.readVarBytes(),n=t.readVarBytes(),i=[];for(let t=0;t+2<=n.length;t+=2)i.push(parseInt(n.substring(t,t+2),16));const o=parseInt(t.read(1),16);if(e.version>=1)throw new Error(`version need to be less or equal than 1. Got ${e.version}`);let a=!1;e.version>=1&&(a=!!parseInt(t.read(1),16));const c=s.hexstring2str(t.readVarBytes()),u=s.hexstring2str(t.readVarBytes()),f=s.hexstring2str(t.readVarBytes()),h=s.hexstring2str(t.readVarBytes()),d=s.hexstring2str(t.readVarBytes());return Object.assign(e,{script:r,parameterList:i,returnType:o,NeedStorage:a,name:c,codeVersion:u,author:f,email:h,description:d})}get exclusiveData(){return{script:this.script,parameterList:this.parameterList,returnType:this.returnType,needStorage:this.needStorage,name:this.name,codeVersion:this.codeVersion,author:this.author,email:this.email,description:this.description}}get fees(){return 0}serializeExclusive(){let t=s.num2VarInt(this.script.length/2);return t+=this.script,t+=s.num2VarInt(this.parameterList.length),t+=s.ab2hexstring(this.parameterList),this.version>=1&&(t+=s.num2hexstring(this.needStorage,1)),t+=s.num2VarInt(this.returnType),t+=s.num2VarInt(this.name.length),t+=s.str2hexstring(this.name),t+=s.num2VarInt(this.codeVersion.length),t+=s.str2hexstring(this.codeVersion),t+=s.num2VarInt(this.author.length),t+=s.str2hexstring(this.author),t+=s.num2VarInt(this.email.length),t+=s.str2hexstring(this.email),(t+=s.num2VarInt(this.description.length))+s.str2hexstring(this.description)}equals(t){return this.type===t.type&&(t instanceof c?this.hash===t.hash:this.hash===new c(t).hash)}export(){return Object.assign(super.export(),{script:this.script,parameterList:this.parameterList,returnType:this.returnType,needStorage:this.needStorage,name:this.name,codeVersion:this.codeVersion,author:this.author,email:this.email,description:this.description})}}e.PublishTransaction=c,e.default=c},function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(1));e.CONST=i;const s=n(r(10));e.logging=s;const o=n(r(42));e.rpc=o;const a=n(r(75));e.sc=a;const c=n(r(29));e.settings=c;const u=n(r(30));e.tx=u;const f=n(r(0));e.u=f;const h=n(r(12));e.wallet=h},function(t,e,r){var n,i;!function(s,o){"use strict";void 0===(i="function"==typeof(n=function(){var t=function(){},e="undefined",r=["trace","debug","info","warn","error"];function n(t,e){var r=t[e];if("function"==typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function i(e,n){for(var i=0;i<r.length;i++){var s=r[i];this[s]=i<e?t:this.methodFactory(s,e,n)}this.log=this.debug}function s(t,r,n){return function(){typeof console!==e&&(i.call(this,r,n),this[t].apply(this,arguments))}}function o(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&(void 0!==console[r]?n(console,r):void 0!==console.log?n(console,"log"):t)}(r)||s.apply(this,arguments)}function a(t,n,s){var a,c=this,u="loglevel";function f(){var t;if(typeof window!==e){try{t=window.localStorage[u]}catch(t){}if(typeof t===e)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(u)+"=");-1!==n&&(t=/^([^;]+)/.exec(r.slice(n))[1])}catch(t){}return void 0===c.levels[t]&&(t=void 0),t}}t&&(u+=":"+t),c.name=t,c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=s||o,c.getLevel=function(){return a},c.setLevel=function(n,s){if("string"==typeof n&&void 0!==c.levels[n.toUpperCase()]&&(n=c.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(a=n,!1!==s&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e){try{return void(window.localStorage[u]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(u)+"="+n+";"}catch(t){}}}(n),i.call(c,n,t),typeof console===e&&n<c.levels.SILENT)return"No console available for logging"},c.setDefaultLevel=function(t){f()||c.setLevel(t,!1)},c.enableAll=function(t){c.setLevel(c.levels.TRACE,t)},c.disableAll=function(t){c.setLevel(c.levels.SILENT,t)};var h=f();null==h&&(h=null==n?"WARN":n),c.setLevel(h,!1)}var c=new a,u={};c.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=u[t];return e||(e=u[t]=new a(t,c.getLevel(),c.methodFactory)),e};var f=typeof window!==e?window.log:void 0;return c.noConflict=function(){return typeof window!==e&&window.log===c&&(window.log=f),c},c.getLoggers=function(){return u},c})?n.call(e,r,e,t):n)||(t.exports=i)}()},function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(t){"use strict";var e,r,n={template:"[%t] %l:",levelFormatter:function(t){return t.toUpperCase()},nameFormatter:function(t){return t||"root"},timestampFormatter:function(t){return t.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},i={},s={reg:function(t){if(!t||!t.getLogger)throw new TypeError("Argument is not a root logger");e=t},apply:function(t,r){if(!t||!t.setLevel)throw new TypeError("Argument is not a logger");var s=t.methodFactory,o=t.name||"",a=i[o]||i[""]||n;return i[o]||(t.methodFactory=function(t,e,r){var n=s(t,e,r),a=i[r]||i[""],c=-1!==a.template.indexOf("%t"),u=-1!==a.template.indexOf("%l"),f=-1!==a.template.indexOf("%n");return function(){for(var e="",s=arguments.length,h=Array(s),d=0;d<s;d++)h[d]=arguments[d];if(o||!i[r]){var l=a.timestampFormatter(new Date),p=a.levelFormatter(t),b=a.nameFormatter(r);a.format?e+=a.format(p,b,l):(e+=a.template,c&&(e=e.replace(/%t/,l)),u&&(e=e.replace(/%l/,p)),f&&(e=e.replace(/%n/,b))),h.length&&"string"==typeof h[0]?h[0]=e+" "+h[0]:h.unshift(e)}n.apply(void 0,h)}}),(r=r||{}).template&&(r.format=void 0),i[o]=function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(e in arguments[r])Object.prototype.hasOwnProperty.call(arguments[r],e)&&(t[e]=arguments[r][e]);return t}({},a,r),t.setLevel(t.getLevel()),e||t.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),t}};return t&&(r=t.prefix,s.noConflict=function(){return t.prefix===s&&(t.prefix=r),s}),s})?n.call(e,r,e,t):n)||(t.exports=i)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(24),s=n(r(10)),o=n(r(43));s.default("protocol");class a{constructor(t={},e=null){this.name=t.Name||t.name||e||"RandomNet";const r=Object.assign({},t.protocol||t.ProtocolConfiguration||{});this.protocol=new o.default(r),this.nodes=t.Nodes||t.nodes||[],this.extra=Object.assign({},t.ExtraConfiguration||t.extra||{})}export(){return{ProtocolConfiguration:this.protocol.export(),Name:this.name,ExtraConfiguration:this.extra,Nodes:this.nodes}}equals(t){return this.name===t.name&&this.protocol.equals(t.protocol||{})&&i.compareUnsortedPlainArrays(this.nodes,t.nodes||[])&&i.compareObject(this.extra,t.extra||{})}}e.Network=a,e.default=a},function(t,e,r){t.exports=r(99)},function(t,e,r){"use strict";var n=r(4),i=r(45),s=r(101),o=r(51);function a(t){var e=new s(t),r=i(s.prototype.request,e);return n.extend(r,s.prototype,e),n.extend(r,e),r}var c=a(r(48));c.Axios=s,c.create=function(t){return a(o(c.defaults,t))},c.Cancel=r(52),c.CancelToken=r(113),c.isCancel=r(47),c.all=function(t){return Promise.all(t)},c.spread=r(114),t.exports=c,t.exports.default=c},function(t,e){
9/*!
10 * Determine if an object is a Buffer
11 *
12 * @author Feross Aboukhadijeh <https://feross.org>
13 * @license MIT
14 */
15t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,r){"use strict";var n=r(4),i=r(46),s=r(102),o=r(103),a=r(51);function c(t){this.defaults=t,this.interceptors={request:new s,response:new s}}c.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method=t.method?t.method.toLowerCase():"get";var e=[o,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},c.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){c.prototype[t]=function(e,r){return this.request(n.merge(r||{},{method:t,url:e}))}})),n.forEach(["post","put","patch"],(function(t){c.prototype[t]=function(e,r,i){return this.request(n.merge(i||{},{method:t,url:e,data:r}))}})),t.exports=c},function(t,e,r){"use strict";var n=r(4);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,r){"use strict";var n=r(4),i=r(104),s=r(47),o=r(48),a=r(111),c=r(112);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.baseURL&&!a(t.url)&&(t.url=c(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return u(t),e.data=i(e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(u(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var n=r(4);t.exports=function(t,e,r){return n.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e,r){"use strict";var n=r(4);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},function(t,e,r){"use strict";var n=r(50);t.exports=function(t,e,r){var i=r.config.validateStatus;!i||i(r.status)?t(r):e(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,i){return t.config=e,r&&(t.code=r),t.request=n,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,r){"use strict";var n=r(4),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,s,o={};return t?(n.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=n.trim(t.substr(0,s)).toLowerCase(),r=n.trim(t.substr(s+1)),e){if(o[e]&&i.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([r]):o[e]?o[e]+", "+r:r}})),o):o}},function(t,e,r){"use strict";var n=r(4);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(4);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,i,s,o){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(52);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(31),s=65535;function o(t){if("string"==typeof t){if(t in i.TxAttrUsage)return i.TxAttrUsage[t];throw new Error(`${t} not found in TxAttrUsage!`)}return t}class a{static deserialize(t){const e=new n.StringStream(t);return this.fromStream(e)}static fromStream(t){const e=parseInt(t.read(1),16);let r;if(0===e||48===e||e>=161&&e<=175)r=t.read(32);else if(2===e||3===e)r=n.num2hexstring(e)+t.read(32);else if(32===e)r=t.read(20);else if(129===e)r=t.read(parseInt(t.read(1),16));else{if(!(144===e||e>=240))throw new Error(`Unknown usage type: ${e}. Context: ${t.context()}`);r=t.readVarBytes()}return new a({usage:e,data:r})}constructor(t){if(!t||void 0===t.usage||void 0===t.data)throw new Error("TransactionAttribute requires usage and data fields");this.usage=o(t.usage),this.data=t.data}get[Symbol.toStringTag](){return"TransactionAttribute"}serialize(){if(this.data.length>s)throw new Error("Data size too big!");let t=n.num2hexstring(this.usage);return 129===this.usage?t+=n.num2hexstring(this.data.length/2):(144===this.usage||this.usage>=240)&&(t+=n.num2VarInt(this.data.length/2)),2===this.usage||3===this.usage?t+=this.data.substr(2,64):t+=this.data,t}export(){return{usage:this.usage,data:this.data}}equals(t){return this.usage===o(t.usage)&&this.data===t.data}}e.TransactionAttribute=a,e.default=a},function(t,e,r){var n;!function(i){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",f=u+"Number primitive has more than 15 significant digits: ",h=1e14,d=14,l=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,m=1e9;function g(t){var e=0|t;return t>0||t===e?e:e-1}function v(t){for(var e,r,n=1,i=t.length,s=t[0]+"";n<i;){for(e=t[n++]+"",r=d-e.length;r--;e="0"+e);s+=e}for(i=s.length;48===s.charCodeAt(--i););return s.slice(0,i+1||1)}function y(t,e){var r,n,i=t.c,s=e.c,o=t.s,a=e.s,c=t.e,u=e.e;if(!o||!a)return null;if(r=i&&!i[0],n=s&&!s[0],r||n)return r?n?0:-a:o;if(o!=a)return o;if(r=o<0,n=c==u,!i||!s)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=s.length)?c:u,o=0;o<a;o++)if(i[o]!=s[o])return i[o]>s[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function w(t,e,r,n){if(t<e||t>r||t!==(t<0?a(t):c(t)))throw Error(u+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+t)}function _(t){return"[object Array]"==Object.prototype.toString.call(t)}function S(t){var e=t.c.length-1;return g(t.e/d)==e&&t.c[e]%2!=0}function x(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function A(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(s=function t(e){var r,n,i,s,M,E,T,P,I,k=q.prototype={constructor:q,toString:null,valueOf:null},O=new q(1),R=20,C=4,B=-7,N=21,L=-1e7,j=1e7,H=!1,U=1,D=0,z={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0},F="0123456789abcdefghijklmnopqrstuvwxyz";function q(t,e){var r,s,a,u,h,p,b,m,g=this;if(!(g instanceof q))return new q(t,e);if(null==e){if(t instanceof q)return g.s=t.s,g.e=t.e,void(g.c=(t=t.c)?t.slice():t);if((p="number"==typeof t)&&0*t==0){if(g.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,h=t;h>=10;h/=10,u++);return g.e=u,void(g.c=[t])}m=t+""}else{if(!o.test(m=t+""))return i(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(u=m.indexOf("."))>-1&&(m=m.replace(".","")),(h=m.search(/e/i))>0?(u<0&&(u=h),u+=+m.slice(h+1),m=m.substring(0,h)):u<0&&(u=m.length)}else{if(w(e,2,F.length,"Base"),m=t+"",10==e)return W(g=new q(t instanceof q?t:m),R+g.e+1,C);if(p="number"==typeof t){if(0*t!=0)return i(g,m,p,e);if(g.s=1/t<0?(m=m.slice(1),-1):1,q.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(f+t);p=!1}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=F.slice(0,e),u=h=0,b=m.length;h<b;h++)if(r.indexOf(s=m.charAt(h))<0){if("."==s){if(h>u){u=b;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,h=-1,u=0;continue}return i(g,t+"",p,e)}(u=(m=n(m,e,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):u=m.length}for(h=0;48===m.charCodeAt(h);h++);for(b=m.length;48===m.charCodeAt(--b););if(m=m.slice(h,++b)){if(b-=h,p&&q.DEBUG&&b>15&&(t>l||t!==c(t)))throw Error(f+g.s*t);if((u=u-h-1)>j)g.c=g.e=null;else if(u<L)g.c=[g.e=0];else{if(g.e=u,g.c=[],h=(u+1)%d,u<0&&(h+=d),h<b){for(h&&g.c.push(+m.slice(0,h)),b-=d;h<b;)g.c.push(+m.slice(h,h+=d));m=m.slice(h),h=d-m.length}else h-=b;for(;h--;m+="0");g.c.push(+m)}}else g.c=[g.e=0]}function V(t,e,r,n){var i,s,o,a,c;if(null==r?r=C:w(r,0,8),!t.c)return t.toString();if(i=t.c[0],o=t.e,null==e)c=v(t.c),c=1==n||2==n&&o<=B?x(c,o):A(c,o,"0");else if(s=(t=W(new q(t),e,r)).e,a=(c=v(t.c)).length,1==n||2==n&&(e<=s||s<=B)){for(;a<e;c+="0",a++);c=x(c,s)}else if(e-=o,c=A(c,s,"0"),s+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=s-a)>0)for(s+1==a&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function K(t,e){var r,n,i=0;for(_(t[0])&&(t=t[0]),r=new q(t[0]);++i<t.length;){if(!(n=new q(t[i])).s){r=n;break}e.call(r,n)&&(r=n)}return r}function $(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+r*d-1)>j?t.c=t.e=null:r<L?t.c=[t.e=0]:(t.e=r,t.c=e),t}function W(t,e,r,n){var i,s,o,u,f,l,b,m=t.c,g=p;if(m){t:{for(i=1,u=m[0];u>=10;u/=10,i++);if((s=e-i)<0)s+=d,o=e,b=(f=m[l=0])/g[i-o-1]%10|0;else if((l=a((s+1)/d))>=m.length){if(!n)break t;for(;m.length<=l;m.push(0));f=b=0,i=1,o=(s%=d)-d+1}else{for(f=u=m[l],i=1;u>=10;u/=10,i++);b=(o=(s%=d)-d+i)<0?0:f/g[i-o-1]%10|0}if(n=n||e<0||null!=m[l+1]||(o<0?f:f%g[i-o-1]),n=r<4?(b||n)&&(0==r||r==(t.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(s>0?o>0?f/g[i-o]:0:m[l-1])%10&1||r==(t.s<0?8:7)),e<1||!m[0])return m.length=0,n?(e-=t.e+1,m[0]=g[(d-e%d)%d],t.e=-e||0):m[0]=t.e=0,t;if(0==s?(m.length=l,u=1,l--):(m.length=l+1,u=g[d-s],m[l]=o>0?c(f/g[i-o]%g[o])*u:0),n)for(;;){if(0==l){for(s=1,o=m[0];o>=10;o/=10,s++);for(o=m[0]+=u,u=1;o>=10;o/=10,u++);s!=u&&(t.e++,m[0]==h&&(m[0]=1));break}if(m[l]+=u,m[l]!=h)break;m[l--]=0,u=1}for(s=m.length;0===m[--s];m.pop());}t.e>j?t.c=t.e=null:t.e<L&&(t.c=[t.e=0])}return t}return q.clone=t,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.EUCLID=9,q.config=q.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(u+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,m,e),R=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),C=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&(_(r=t[e])?(w(r[0],-m,0,e),w(r[1],0,m,e),B=r[0],N=r[1]):(w(r,-m,m,e),B=-(N=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if(_(r=t[e]))w(r[0],-m,-1,e),w(r[1],1,m,e),L=r[0],j=r[1];else{if(w(r,-m,m,e),!r)throw Error(u+e+" cannot be zero: "+r);L=-(j=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(u+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw H=!r,Error(u+"crypto unavailable");H=r}else H=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),U=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,m,e),D=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(u+e+" not an object: "+r);z=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|\.|(.).*\1/.test(r))throw Error(u+e+" invalid: "+r);F=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:C,EXPONENTIAL_AT:[B,N],RANGE:[L,j],CRYPTO:H,MODULO_MODE:U,POW_PRECISION:D,FORMAT:z,ALPHABET:F}},q.isBigNumber=function(t){return t instanceof q||t&&!0===t._isBigNumber||!1},q.maximum=q.max=function(){return K(arguments,k.lt)},q.minimum=q.min=function(){return K(arguments,k.gt)},q.random=(s=9007199254740992*Math.random()&2097151?function(){return c(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,o,f=0,h=[],l=new q(O);if(null==t?t=R:w(t,0,m),i=a(t/d),H)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)(o=131072*e[f]+(e[f+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[f]=r[0],e[f+1]=r[1]):(h.push(o%1e14),f+=2);f=i/2}else{if(!crypto.randomBytes)throw H=!1,Error(u+"crypto unavailable");for(e=crypto.randomBytes(i*=7);f<i;)(o=281474976710656*(31&e[f])+1099511627776*e[f+1]+4294967296*e[f+2]+16777216*e[f+3]+(e[f+4]<<16)+(e[f+5]<<8)+e[f+6])>=9e15?crypto.randomBytes(7).copy(e,f):(h.push(o%1e14),f+=7);f=i/7}if(!H)for(;f<i;)(o=s())<9e15&&(h[f++]=o%1e14);for(i=h[--f],t%=d,i&&t&&(o=p[d-t],h[f]=c(i/o)*o);0===h[f];h.pop(),f--);if(f<0)h=[n=0];else{for(n=-1;0===h[0];h.splice(0,1),n-=d);for(f=1,o=h[0];o>=10;o/=10,f++);f<d&&(n-=d-f)}return l.e=n,l.c=h,l}),n=function(){function t(t,e,r,n){for(var i,s,o=[0],a=0,c=t.length;a<c;){for(s=o.length;s--;o[s]*=e);for(o[0]+=n.indexOf(t.charAt(a++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(e,n,i,s,o){var a,c,u,f,h,d,l,p,b=e.indexOf("."),m=R,g=C;for(b>=0&&(f=D,D=0,e=e.replace(".",""),d=(p=new q(n)).pow(e.length-b),D=f,p.c=t(A(v(d.c),d.e,"0"),10,i,"0123456789"),p.e=p.c.length),u=f=(l=t(e,n,i,o?(a=F,"0123456789"):(a="0123456789",F))).length;0==l[--f];l.pop());if(!l[0])return a.charAt(0);if(b<0?--u:(d.c=l,d.e=u,d.s=s,l=(d=r(d,p,m,g,i)).c,h=d.r,u=d.e),b=l[c=u+m+1],f=i/2,h=h||c<0||null!=l[c+1],h=g<4?(null!=b||h)&&(0==g||g==(d.s<0?3:2)):b>f||b==f&&(4==g||h||6==g&&1&l[c-1]||g==(d.s<0?8:7)),c<1||!l[0])e=h?A(a.charAt(1),-m,a.charAt(0)):a.charAt(0);else{if(l.length=c,h)for(--i;++l[--c]>i;)l[c]=0,c||(++u,l=[1].concat(l));for(f=l.length;!l[--f];);for(b=0,e="";b<=f;e+=a.charAt(l[b++]));e=A(e,u,a.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,i,s,o,a=0,c=t.length,u=e%b,f=e/b|0;for(t=t.slice();c--;)a=((i=u*(s=t[c]%b)+(n=f*s+(o=t[c]/b|0)*u)%b*b+a)/r|0)+(n/b|0)+f*o,t[c]=i%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;i<r;i++)if(t[i]!=e[i]){s=t[i]>e[i]?1:-1;break}return s}function r(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.splice(0,1));}return function(n,i,s,o,a){var u,f,l,p,b,m,v,y,w,_,S,x,A,M,E,T,P,I=n.s==i.s?1:-1,k=n.c,O=i.c;if(!(k&&k[0]&&O&&O[0]))return new q(n.s&&i.s&&(k?!O||k[0]!=O[0]:O)?k&&0==k[0]||!O?0*I:I/0:NaN);for(w=(y=new q(I)).c=[],I=s+(f=n.e-i.e)+1,a||(a=h,f=g(n.e/d)-g(i.e/d),I=I/d|0),l=0;O[l]==(k[l]||0);l++);if(O[l]>(k[l]||0)&&f--,I<0)w.push(1),p=!0;else{for(M=k.length,T=O.length,l=0,I+=2,(b=c(a/(O[0]+1)))>1&&(O=t(O,b,a),k=t(k,b,a),T=O.length,M=k.length),A=T,S=(_=k.slice(0,T)).length;S<T;_[S++]=0);P=O.slice(),P=[0].concat(P),E=O[0],O[1]>=a/2&&E++;do{if(b=0,(u=e(O,_,T,S))<0){if(x=_[0],T!=S&&(x=x*a+(_[1]||0)),(b=c(x/E))>1)for(b>=a&&(b=a-1),v=(m=t(O,b,a)).length,S=_.length;1==e(m,_,v,S);)b--,r(m,T<v?P:O,v,a),v=m.length,u=1;else 0==b&&(u=b=1),v=(m=O.slice()).length;if(v<S&&(m=[0].concat(m)),r(_,m,S,a),S=_.length,-1==u)for(;e(O,_,T,S)<1;)b++,r(_,T<S?P:O,S,a),S=_.length}else 0===u&&(b++,_=[0]);w[l++]=b,_[0]?_[S++]=k[A]||0:(_=[k[A]],S=1)}while((A++<M||null!=_[0])&&I--);p=null!=_[0],w[0]||w.splice(0,1)}if(a==h){for(l=1,I=w[0];I>=10;I/=10,l++);W(y,s+(y.e=l+f*d-1)+1,o,p)}else y.e=f,y.r=+p;return y}}(),M=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,T=/^\.([^.]+)$/,P=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var i,s=r?e:e.replace(I,"");if(P.test(s))t.s=isNaN(s)?null:s<0?-1:1,t.c=t.e=null;else{if(!r&&(s=s.replace(M,(function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e})),n&&(i=n,s=s.replace(E,"$1").replace(T,"0.$1")),e!=s))return new q(s,i);if(q.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+e);t.c=t.e=t.s=null}},k.absoluteValue=k.abs=function(){var t=new q(this);return t.s<0&&(t.s=1),t},k.comparedTo=function(t,e){return y(this,new q(t,e))},k.decimalPlaces=k.dp=function(t,e){var r,n,i,s=this;if(null!=t)return w(t,0,m),null==e?e=C:w(e,0,8),W(new q(s),t+s.e+1,e);if(!(r=s.c))return null;if(n=((i=r.length-1)-g(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},k.dividedBy=k.div=function(t,e){return r(this,new q(t,e),R,C)},k.dividedToIntegerBy=k.idiv=function(t,e){return r(this,new q(t,e),0,1)},k.exponentiatedBy=k.pow=function(t,e){var r,n,i,s,o,f,h,l=this;if((t=new q(t)).c&&!t.isInteger())throw Error(u+"Exponent not an integer: "+t);if(null!=e&&(e=new q(e)),s=t.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!t.c||!t.c[0])return h=new q(Math.pow(+l.valueOf(),s?2-S(t):+t)),e?h.mod(e):h;if(o=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new q(NaN);(n=!o&&l.isInteger()&&e.isInteger())&&(l=l.mod(e))}else{if(t.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||s&&l.c[1]>=24e7:l.c[0]<8e13||s&&l.c[0]<=9999975e7)))return i=l.s<0&&S(t)?-0:0,l.e>-1&&(i=1/i),new q(o?1/i:i);D&&(i=a(D/d+2))}for(s?(r=new q(.5),f=S(t)):f=t%2,o&&(t.s=1),h=new q(O);;){if(f){if(!(h=h.times(l)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(e))}if(s){if(W(t=t.times(r),t.e+1,1),!t.c[0])break;s=t.e>14,f=S(t)}else{if(!(t=c(t/2)))break;f=t%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(e))}return n?h:(o&&(h=O.div(h)),e?h.mod(e):i?W(h,D,C,void 0):h)},k.integerValue=function(t){var e=new q(this);return null==t?t=C:w(t,0,8),W(e,e.e+1,t)},k.isEqualTo=k.eq=function(t,e){return 0===y(this,new q(t,e))},k.isFinite=function(){return!!this.c},k.isGreaterThan=k.gt=function(t,e){return y(this,new q(t,e))>0},k.isGreaterThanOrEqualTo=k.gte=function(t,e){return 1===(e=y(this,new q(t,e)))||0===e},k.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},k.isLessThan=k.lt=function(t,e){return y(this,new q(t,e))<0},k.isLessThanOrEqualTo=k.lte=function(t,e){return-1===(e=y(this,new q(t,e)))||0===e},k.isNaN=function(){return!this.s},k.isNegative=function(){return this.s<0},k.isPositive=function(){return this.s>0},k.isZero=function(){return!!this.c&&0==this.c[0]},k.minus=function(t,e){var r,n,i,s,o=this,a=o.s;if(e=(t=new q(t,e)).s,!a||!e)return new q(NaN);if(a!=e)return t.s=-e,o.plus(t);var c=o.e/d,u=t.e/d,f=o.c,l=t.c;if(!c||!u){if(!f||!l)return f?(t.s=-e,t):new q(l?o:NaN);if(!f[0]||!l[0])return l[0]?(t.s=-e,t):new q(f[0]?o:3==C?-0:0)}if(c=g(c),u=g(u),f=f.slice(),a=c-u){for((s=a<0)?(a=-a,i=f):(u=c,i=l),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(n=(s=(a=f.length)<(e=l.length))?a:e,a=e=0;e<n;e++)if(f[e]!=l[e]){s=f[e]<l[e];break}if(s&&(i=f,f=l,l=i,t.s=-t.s),(e=(n=l.length)-(r=f.length))>0)for(;e--;f[r++]=0);for(e=h-1;n>a;){if(f[--n]<l[n]){for(r=n;r&&!f[--r];f[r]=e);--f[r],f[n]+=h}f[n]-=l[n]}for(;0==f[0];f.splice(0,1),--u);return f[0]?$(t,f,u):(t.s=3==C?-1:1,t.c=[t.e=0],t)},k.modulo=k.mod=function(t,e){var n,i,s=this;return t=new q(t,e),!s.c||!t.s||t.c&&!t.c[0]?new q(NaN):!t.c||s.c&&!s.c[0]?new q(s):(9==U?(i=t.s,t.s=1,n=r(s,t,0,3),t.s=i,n.s*=i):n=r(s,t,0,U),(t=s.minus(n.times(t))).c[0]||1!=U||(t.s=s.s),t)},k.multipliedBy=k.times=function(t,e){var r,n,i,s,o,a,c,u,f,l,p,m,v,y,w,_=this,S=_.c,x=(t=new q(t,e)).c;if(!(S&&x&&S[0]&&x[0]))return!_.s||!t.s||S&&!S[0]&&!x||x&&!x[0]&&!S?t.c=t.e=t.s=null:(t.s*=_.s,S&&x?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=g(_.e/d)+g(t.e/d),t.s*=_.s,(c=S.length)<(l=x.length)&&(v=S,S=x,x=v,i=c,c=l,l=i),i=c+l,v=[];i--;v.push(0));for(y=h,w=b,i=l;--i>=0;){for(r=0,p=x[i]%w,m=x[i]/w|0,s=i+(o=c);s>i;)r=((u=p*(u=S[--o]%w)+(a=m*u+(f=S[o]/w|0)*p)%w*w+v[s]+r)/y|0)+(a/w|0)+m*f,v[s--]=u%y;v[s]=r}return r?++n:v.splice(0,1),$(t,v,n)},k.negated=function(){var t=new q(this);return t.s=-t.s||null,t},k.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new q(t,e)).s,!i||!e)return new q(NaN);if(i!=e)return t.s=-e,n.minus(t);var s=n.e/d,o=t.e/d,a=n.c,c=t.c;if(!s||!o){if(!a||!c)return new q(i/0);if(!a[0]||!c[0])return c[0]?t:new q(a[0]?n:0*i)}if(s=g(s),o=g(o),a=a.slice(),i=s-o){for(i>0?(o=s,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(e=c.length)<0&&(r=c,c=a,a=r,e=i),i=0;e;)i=(a[--e]=a[e]+c[e]+i)/h|0,a[e]=h===a[e]?0:a[e]%h;return i&&(a=[i].concat(a),++o),$(t,a,o)},k.precision=k.sd=function(t,e){var r,n,i,s=this;if(null!=t&&t!==!!t)return w(t,1,m),null==e?e=C:w(e,0,8),W(new q(s),t,e);if(!(r=s.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&s.e+1>n&&(n=s.e+1),n},k.shiftedBy=function(t){return w(t,-l,l),this.times("1e"+t)},k.squareRoot=k.sqrt=function(){var t,e,n,i,s,o=this,a=o.c,c=o.s,u=o.e,f=R+4,h=new q("0.5");if(1!==c||!a||!a[0])return new q(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(c=Math.sqrt(+o))||c==1/0?(((e=v(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=g((u+1)/2)-(u<0||u%2),n=new q(e=c==1/0?"1e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):n=new q(c+""),n.c[0])for((c=(u=n.e)+f)<3&&(c=0);;)if(s=n,n=h.times(s.plus(r(o,s,f,1))),v(s.c).slice(0,c)===(e=v(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(W(n,n.e+R+2,1),t=!n.times(n).eq(o));break}if(!i&&(W(s,s.e+R+2,0),s.times(s).eq(o))){n=s;break}f+=4,c+=4,i=1}return W(n,n.e+R+1,C,t)},k.toExponential=function(t,e){return null!=t&&(w(t,0,m),t++),V(this,t,e,1)},k.toFixed=function(t,e){return null!=t&&(w(t,0,m),t=t+this.e+1),V(this,t,e)},k.toFormat=function(t,e){var r=this.toFixed(t,e);if(this.c){var n,i=r.split("."),s=+z.groupSize,o=+z.secondaryGroupSize,a=z.groupSeparator,c=i[0],u=i[1],f=this.s<0,h=f?c.slice(1):c,d=h.length;if(o&&(n=s,s=o,o=n,d-=n),s>0&&d>0){for(n=d%s||s,c=h.substr(0,n);n<d;n+=s)c+=a+h.substr(n,s);o>0&&(c+=a+h.slice(n)),f&&(c="-"+c)}r=u?c+z.decimalSeparator+((o=+z.fractionGroupSize)?u.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+z.fractionGroupSeparator):u):c}return r},k.toFraction=function(t){var e,n,i,s,o,a,c,f,h,l,b,m,g=this,y=g.c;if(null!=t&&(!(f=new q(t)).isInteger()&&(f.c||1!==f.s)||f.lt(O)))throw Error(u+"Argument "+(f.isInteger()?"out of range: ":"not an integer: ")+t);if(!y)return g.toString();for(n=new q(O),l=i=new q(O),s=h=new q(O),m=v(y),a=n.e=m.length-g.e-1,n.c[0]=p[(c=a%d)<0?d+c:c],t=!t||f.comparedTo(n)>0?a>0?n:l:f,c=j,j=1/0,f=new q(m),h.c[0]=0;b=r(f,n,0,1),1!=(o=i.plus(b.times(s))).comparedTo(t);)i=s,s=o,l=h.plus(b.times(o=l)),h=o,n=f.minus(b.times(o=n)),f=o;return o=r(t.minus(i),s,0,1),h=h.plus(o.times(l)),i=i.plus(o.times(s)),h.s=l.s=g.s,e=r(l,s,a*=2,C).minus(g).abs().comparedTo(r(h,i,a,C).minus(g).abs())<1?[l.toString(),s.toString()]:[h.toString(),i.toString()],j=c,e},k.toNumber=function(){return+this},k.toPrecision=function(t,e){return null!=t&&w(t,1,m),V(this,t,e,2)},k.toString=function(t){var e,r=this,i=r.s,s=r.e;return null===s?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(e=v(r.c),null==t?e=s<=B||s>=N?x(e,s):A(e,s,"0"):(w(t,2,F.length,"Base"),e=n(A(e,s,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},k.valueOf=k.toJSON=function(){var t,e=this,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=B||r>=N?x(t,r):A(t,r,"0"),e.s<0?"-"+t:t)},k._isBigNumber=!0,null!=e&&q.set(e),q}()).default=s.BigNumber=s,void 0===(n=function(){return s}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(54)),s=n(r(118)),o=n(r(55));function a(t,e){return e(i.default.parse(t)).toString(i.default)}function c(t){return a(t,o.default)}function u(t){return a(t,s.default)}e.sha256=c,e.ripemd160=u,e.hash160=function(t){return u(c(t))},e.hash256=function(t){const e=c(t);return c(e)}},function(t,e,r){var n;t.exports=(n=r(5),
16/** @preserve
17 (c) 2012 by Cédric Mesnil. All rights reserved.
18
19 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
20
21 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
22 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26function(t){var e=n,r=e.lib,i=r.WordArray,s=r.Hasher,o=e.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),l=o.RIPEMD160=s.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s,o,l,w,_,S,x,A,M,E,T,P=this._hash.words,I=h.words,k=d.words,O=a.words,R=c.words,C=u.words,B=f.words;for(S=s=P[0],x=o=P[1],A=l=P[2],M=w=P[3],E=_=P[4],r=0;r<80;r+=1)T=s+t[e+O[r]]|0,T+=r<16?p(o,l,w)+I[0]:r<32?b(o,l,w)+I[1]:r<48?m(o,l,w)+I[2]:r<64?g(o,l,w)+I[3]:v(o,l,w)+I[4],T=(T=y(T|=0,C[r]))+_|0,s=_,_=w,w=y(l,10),l=o,o=T,T=S+t[e+R[r]]|0,T+=r<16?v(x,A,M)+k[0]:r<32?g(x,A,M)+k[1]:r<48?m(x,A,M)+k[2]:r<64?b(x,A,M)+k[3]:p(x,A,M)+k[4],T=(T=y(T|=0,B[r]))+E|0,S=E,E=M,M=y(A,10),A=x,x=T;T=P[1]+l+M|0,P[1]=P[2]+w+E|0,P[2]=P[3]+_+S|0,P[3]=P[4]+s+x|0,P[4]=P[0]+o+A|0,P[0]=T},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,s=i.words,o=0;o<5;o++){var a=s[o];s[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function b(t,e,r){return t&e|~t&r}function m(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function v(t,e,r){return t^(e|~r)}function y(t,e){return t<<e|t>>>32-e}e.RIPEMD160=s._createHelper(l),e.HmacRIPEMD160=s._createHmacHelper(l)}(Math),n.RIPEMD160)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(25);class i{constructor(t=""){this.str=t,this.pter=0}isEmpty(){return this.pter>=this.str.length}peek(t=1){return this.isEmpty()?"":this.str.substr(this.pter,2*t)}read(t=1){if(this.isEmpty())throw new Error("Reached the end of the stream!");const e=this.str.substr(this.pter,2*t);return this.pter+=2*t,e}readVarBytes(){return this.read(this.readVarInt())}readVarInt(){let t=parseInt(this.read(1),16);return 253===t?t=parseInt(n.reverseHex(this.read(2)),16):254===t?t=parseInt(n.reverseHex(this.read(4)),16):255===t&&(t=parseInt(n.reverseHex(this.read(8)),16)),t}reset(){this.pter=0}context(){const t=this.pter>10?this.str.slice(this.pter-10,this.pter):this.str.slice(0,this.pter),e=this.read(1),r=this.peek(5);return this.pter-=2,`${t}|${e}|${r}`}}e.StringStream=i,e.default=i},function(t,e,r){(function(n,i){var s;!function(o){"use strict";function a(t,e){if(e=e||{type:"Array"},void 0!==n&&"number"==typeof n.pid)return function(t,e){var n=r(123).randomBytes(t);switch(e.type){case"Array":return[].slice.call(n);case"Buffer":return n;case"Uint8Array":for(var i=new Uint8Array(t),s=0;s<t;++s)i[s]=n.readUInt8(s);return i;default:throw new Error(e.type+" is unsupported.")}}(t,e);if(!window.crypto&&!window.msCrypto)throw new Error("Your browser does not support window.crypto.");return function(t,e){var r=new Uint8Array(t);switch((window.crypto||window.msCrypto).getRandomValues(r),e.type){case"Array":return[].slice.call(r);case"Buffer":try{new i(1)}catch(t){throw new Error("Buffer not supported in this environment. Use Node.js or Browserify for browser support.")}return new i(r);case"Uint8Array":return r;default:throw new Error(e.type+" is unsupported.")}}(t,e)}void 0===(s=function(){return a}.apply(e,[]))||(t.exports=s),a.randomArray=function(t){return a(t,{type:"Array"})},a.randomUint8Array=function(t){return a(t,{type:"Uint8Array"})},a.randomBuffer=function(t){return a(t,{type:"Buffer"})}}()}).call(this,r(13),r(11).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){for(var e,r=u(t),n=r[0],o=r[1],a=new s(function(t,e,r){return 3*(e+r)/4-r}(0,n,o)),c=0,f=o>0?n-4:n,h=0;h<f;h+=4)e=i[t.charCodeAt(h)]<<18|i[t.charCodeAt(h+1)]<<12|i[t.charCodeAt(h+2)]<<6|i[t.charCodeAt(h+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=255&e;return 2===o&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,a[c++]=255&e),1===o&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,a[c++]=e>>8&255,a[c++]=255&e),a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(t,o,o+16383>a?a:o+16383));return 1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,s,o=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,s=l&(1<<-f)-1,l>>=-f,f+=a;f>0;s=256*s+t[e+h],h+=d,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=n;f>0;o=256*o+t[e+h],h+=d,f-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,n),s-=u}return(l?-1:1)*o*Math.pow(2,s-n)},e.write=function(t,e,r,n,i,s){var o,a,c,u=8*s-i-1,f=(1<<u)-1,h=f>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:s-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(o++,c/=2),o+h>=f?(a=0,o=f):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+l]=255&a,l+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+l]=255&o,l+=p,o/=256,u-=8);t[r+l-p]|=128*b}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);class i{static deserialize(t){const e=new n.StringStream(t);return this.fromStream(e)}static fromStream(t){const e=n.reverseHex(t.read(32)),r=parseInt(n.reverseHex(t.read(2)),16);return new i({prevHash:e,prevIndex:r})}constructor(t){if(!t||void 0===t.prevHash||void 0===t.prevIndex)throw new Error("TransactionInput requires prevHash and prevIndex fields");this.prevHash=t.prevHash,this.prevIndex=t.prevIndex}serialize(){return n.reverseHex(this.prevHash)+n.reverseHex(n.num2hexstring(this.prevIndex,2))}export(){return{prevHash:this.prevHash,prevIndex:this.prevIndex}}equals(t){return this.prevHash===t.prevHash&&this.prevIndex===t.prevIndex}}e.TransactionInput=i,e.default=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),s=r(12);class o{static deserialize(t){const e=new i.StringStream(t);return this.fromStream(e)}static fromStream(t){const e=i.reverseHex(t.read(32)),r=i.Fixed8.fromReverseHex(t.read(8)),n=i.reverseHex(t.read(20));return new o({assetId:e,value:r,scriptHash:n})}static fromIntent(t,e,r){const i=n.ASSET_ID[t],a=s.getScriptHashFromAddress(r);return new o({assetId:i,value:e,scriptHash:a})}constructor(t){if(!(t&&t.assetId&&t.value&&t.scriptHash))throw new Error("TransactionOutput requires assetId, value and scriptHash fields");this.assetId=t.assetId,this.value=new i.Fixed8(t.value),this.scriptHash=t.scriptHash}serialize(){return i.reverseHex(this.assetId)+this.value.toReverseHex()+i.reverseHex(this.scriptHash)}equals(t){return this.assetId===t.assetId&&this.value.equals(t.value)&&this.scriptHash===t.scriptHash}export(){return{assetId:this.assetId,value:this.value.toNumber(),scriptHash:this.scriptHash}}}e.TransactionOutput=o,e.default=o},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e,r){const n=r(3).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);e.fill(255);for(let r=0;r<t.length;r++){const n=t.charAt(r),i=n.charCodeAt(0);if(255!==e[i])throw new TypeError(n+" is ambiguous");e[i]=r}const r=t.length,i=t.charAt(0),s=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function a(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);let o=0;if(" "===t[o])return;let a=0,c=0;for(;t[o]===i;)a++,o++;const u=(t.length-o)*s+1>>>0,f=new Uint8Array(u);for(;t[o];){let n=e[t.charCodeAt(o)];if(255===n)return;let i=0;for(let t=u-1;(0!==n||i<c)&&-1!==t;t--,i++)n+=r*f[t]>>>0,f[t]=n%256>>>0,n=n/256>>>0;if(0!==n)throw new Error("Non-zero carry");c=i,o++}if(" "===t[o])return;let h=u-c;for(;h!==u&&0===f[h];)h++;const d=n.allocUnsafe(a+(u-h));d.fill(0,0,a);let l=a;for(;h!==u;)d[l++]=f[h++];return d}return{encode:function(e){if(!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";let s=0,a=0,c=0;const u=e.length;for(;c!==u&&0===e[c];)c++,s++;const f=(u-c)*o+1>>>0,h=new Uint8Array(f);for(;c!==u;){let t=e[c],n=0;for(let e=f-1;(0!==t||n<a)&&-1!==e;e--,n++)t+=256*h[e]>>>0,h[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw new Error("Non-zero carry");a=n,c++}let d=f-a;for(;d!==f&&0===h[d];)d++;let l=i.repeat(s);for(;d<f;++d)l+=t.charAt(h[d]);return l},decodeUnsafe:a,decode:function(t){const e=a(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}},function(t,e,r){(function(e){var n=r(59);function i(t,e){if(void 0!==e&&t[0]!==e)throw new Error("Invalid network version");if(33===t.length)return{version:t[0],privateKey:t.slice(1,33),compressed:!1};if(34!==t.length)throw new Error("Invalid WIF length");if(1!==t[33])throw new Error("Invalid compression flag");return{version:t[0],privateKey:t.slice(1,33),compressed:!0}}function s(t,r,n){var i=new e(n?34:33);return i.writeUInt8(t,0),r.copy(i,1),n&&(i[33]=1),i}t.exports={decode:function(t,e){return i(n.decode(t),e)},decodeRaw:i,encode:function(t,e,r){return"number"==typeof t?n.encode(s(t,e,r)):n.encode(s(t.version,t.privateKey,t.compressed))},encodeRaw:s}}).call(this,r(11).Buffer)},function(t,e,r){"use strict";var n=r(2),i=r(130),s=r(141),o=r(142),a=r(147);function c(t){a.call(this,"digest"),this._hash=t}n(c,a),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new s:new c(o(t))}},function(t,e,r){"use strict";var n=r(2),i=r(60),s=r(3).Buffer,o=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,s,o){return c(t+(e&r|~e&n)+i+s|0,o)+e|0}function f(t,e,r,n,i,s,o){return c(t+(e&n|r&~n)+i+s|0,o)+e|0}function h(t,e,r,n,i,s,o){return c(t+(e^r^n)+i+s|0,o)+e|0}function d(t,e,r,n,i,s,o){return c(t+(r^(e|~n))+i+s|0,o)+e|0}n(a,i),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,s=this._d;r=u(r,n,i,s,t[0],3614090360,7),s=u(s,r,n,i,t[1],3905402710,12),i=u(i,s,r,n,t[2],606105819,17),n=u(n,i,s,r,t[3],3250441966,22),r=u(r,n,i,s,t[4],4118548399,7),s=u(s,r,n,i,t[5],1200080426,12),i=u(i,s,r,n,t[6],2821735955,17),n=u(n,i,s,r,t[7],4249261313,22),r=u(r,n,i,s,t[8],1770035416,7),s=u(s,r,n,i,t[9],2336552879,12),i=u(i,s,r,n,t[10],4294925233,17),n=u(n,i,s,r,t[11],2304563134,22),r=u(r,n,i,s,t[12],1804603682,7),s=u(s,r,n,i,t[13],4254626195,12),i=u(i,s,r,n,t[14],2792965006,17),r=f(r,n=u(n,i,s,r,t[15],1236535329,22),i,s,t[1],4129170786,5),s=f(s,r,n,i,t[6],3225465664,9),i=f(i,s,r,n,t[11],643717713,14),n=f(n,i,s,r,t[0],3921069994,20),r=f(r,n,i,s,t[5],3593408605,5),s=f(s,r,n,i,t[10],38016083,9),i=f(i,s,r,n,t[15],3634488961,14),n=f(n,i,s,r,t[4],3889429448,20),r=f(r,n,i,s,t[9],568446438,5),s=f(s,r,n,i,t[14],3275163606,9),i=f(i,s,r,n,t[3],4107603335,14),n=f(n,i,s,r,t[8],1163531501,20),r=f(r,n,i,s,t[13],2850285829,5),s=f(s,r,n,i,t[2],4243563512,9),i=f(i,s,r,n,t[7],1735328473,14),r=h(r,n=f(n,i,s,r,t[12],2368359562,20),i,s,t[5],4294588738,4),s=h(s,r,n,i,t[8],2272392833,11),i=h(i,s,r,n,t[11],1839030562,16),n=h(n,i,s,r,t[14],4259657740,23),r=h(r,n,i,s,t[1],2763975236,4),s=h(s,r,n,i,t[4],1272893353,11),i=h(i,s,r,n,t[7],4139469664,16),n=h(n,i,s,r,t[10],3200236656,23),r=h(r,n,i,s,t[13],681279174,4),s=h(s,r,n,i,t[0],3936430074,11),i=h(i,s,r,n,t[3],3572445317,16),n=h(n,i,s,r,t[6],76029189,23),r=h(r,n,i,s,t[9],3654602809,4),s=h(s,r,n,i,t[12],3873151461,11),i=h(i,s,r,n,t[15],530742520,16),r=d(r,n=h(n,i,s,r,t[2],3299628645,23),i,s,t[0],4096336452,6),s=d(s,r,n,i,t[7],1126891415,10),i=d(i,s,r,n,t[14],2878612391,15),n=d(n,i,s,r,t[5],4237533241,21),r=d(r,n,i,s,t[12],1700485571,6),s=d(s,r,n,i,t[3],2399980690,10),i=d(i,s,r,n,t[10],4293915773,15),n=d(n,i,s,r,t[1],2240044497,21),r=d(r,n,i,s,t[8],1873313359,6),s=d(s,r,n,i,t[15],4264355552,10),i=d(i,s,r,n,t[6],2734768916,15),n=d(n,i,s,r,t[13],1309151649,21),r=d(r,n,i,s,t[4],4149444226,6),s=d(s,r,n,i,t[11],3174756917,10),i=d(i,s,r,n,t[2],718787259,15),n=d(n,i,s,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=s.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},function(t,e){},function(t,e,r){"use strict";var n=r(3).Buffer,i=r(133);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i=n.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=i,r=o,s.data.copy(e,r),o+=s.data.length,s=s.next;return i},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,s,o,a,c=1,u={},f=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(o="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&p(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(o+e,"*")}):t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){s.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)},d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return u[c]=i,n(c),c++},d.clearImmediate=l}function l(t){delete u[t]}function p(t){if(f)setTimeout(p,0,t);else{var e=u[t];if(e){f=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(r,n)}}(e)}finally{l(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(18),r(13))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(18))},function(t,e,r){"use strict";t.exports=s;var n=r(66),i=r(22);function s(t){if(!(this instanceof s))return new s(t);n.call(this,t)}i.inherits=r(2),i.inherits(s,n),s.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(36)},function(t,e,r){t.exports=r(14)},function(t,e,r){t.exports=r(35).Transform},function(t,e,r){t.exports=r(35).PassThrough},function(t,e,r){"use strict";var n=r(11).Buffer,i=r(2),s=r(60),o=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function l(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function b(t,e,r,n,i,s,o,a){return p(t+(e^r^n)+s+o|0,a)+i|0}function m(t,e,r,n,i,s,o,a){return p(t+(e&r|~e&n)+s+o|0,a)+i|0}function g(t,e,r,n,i,s,o,a){return p(t+((e|~r)^n)+s+o|0,a)+i|0}function v(t,e,r,n,i,s,o,a){return p(t+(e&n|r&~n)+s+o|0,a)+i|0}function y(t,e,r,n,i,s,o,a){return p(t+(e^(r|~n))+s+o|0,a)+i|0}i(l,s),l.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,l=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,x=0|this._d,A=0|this._e,M=0;M<80;M+=1){var E,T;M<16?(E=b(r,n,i,s,l,t[a[M]],h[0],u[M]),T=y(w,_,S,x,A,t[c[M]],d[0],f[M])):M<32?(E=m(r,n,i,s,l,t[a[M]],h[1],u[M]),T=v(w,_,S,x,A,t[c[M]],d[1],f[M])):M<48?(E=g(r,n,i,s,l,t[a[M]],h[2],u[M]),T=g(w,_,S,x,A,t[c[M]],d[2],f[M])):M<64?(E=v(r,n,i,s,l,t[a[M]],h[3],u[M]),T=m(w,_,S,x,A,t[c[M]],d[3],f[M])):(E=y(r,n,i,s,l,t[a[M]],h[4],u[M]),T=b(w,_,S,x,A,t[c[M]],d[4],f[M])),r=l,l=s,s=p(i,10),i=n,n=E,w=A,A=x,x=p(S,10),S=_,_=T}var P=this._b+i+x|0;this._b=this._c+s+A|0,this._c=this._d+l+w|0,this._d=this._e+r+_|0,this._e=this._a+n+S|0,this._a=P},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=l},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(143),e.sha1=r(144),e.sha224=r(145),e.sha256=r(67),e.sha384=r(146),e.sha512=r(68)},function(t,e,r){var n=r(2),i=r(20),s=r(3).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var d=0;d<80;++d){var l=~~(d/20),p=0|((e=n)<<5|e>>>27)+f(l,i,s,a)+c+r[d]+o[l];c=a,a=s,s=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,r){var n=r(2),i=r(20),s=r(3).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=(e=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=u(n)+h(p,i,s,a)+c+r[l]+o[p]|0;c=a,a=s,s=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,r){var n=r(2),i=r(67),s=r(20),o=r(3).Buffer,a=new Array(64);function c(){this.init(),this._w=a,s.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},function(t,e,r){var n=r(2),i=r(68),s=r(20),o=r(3).Buffer,a=new Array(160);function c(){this.init(),this._w=a,s.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=o.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},function(t,e,r){var n=r(3).Buffer,i=r(61).Transform,s=r(37).StringDecoder;function o(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(2)(o,i),o.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},o.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},o.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},o.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new s(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=o},function(t,e,r){"use strict";var n=r(33),i=r(3).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=t(e);return n.encode(i.concat([e,r],e.length+4))},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t){t.exports=JSON.parse('{"name":"elliptic","version":"6.4.1","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^1.4.3","coveralls":"^2.11.3","grunt":"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2","istanbul":"^0.4.2","jscs":"^2.9.0","jshint":"^2.6.0","mocha":"^2.1.0"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}')},function(t,e,r){"use strict";var n=e,i=r(8),s=r(15),o=r(70);n.assert=s,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(t,e){for(var r=[],n=1<<e+1,i=t.clone();i.cmpn(1)>=0;){var s;if(i.isOdd()){var o=i.andln(n-1);s=o>(n>>1)-1?(n>>1)-o:o,i.isubn(s)}else s=0;r.push(s);for(var a=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,c=1;c<a;c++)r.push(0);i.iushrn(a)}return r},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var s,o,a,c=t.andln(3)+n&3,u=e.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!=(a=t.andln(7)+n&7)&&5!==a||2!==u?c:-c,r[0].push(s),o=0==(1&u)?0:3!=(a=e.andln(7)+i&7)&&5!==a||2!==c?u:-u,r[1].push(o),2*n===s+1&&(n=1-n),2*i===o+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(154);if("function"!=typeof s.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},function(t,e){},function(t,e,r){"use strict";var n=r(8),i=r(7).utils,s=i.getNAF,o=i.getJSF,a=i.assert;function c(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=s(e,1),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var o=[],c=0;c<n.length;c+=r.step){var u=0;for(e=c+r.step-1;e>=c;e--)u=(u<<1)+n[e];o.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(c=0;c<o.length;c++)(u=o[c])===d?h=h.mixedAdd(r.points[c]):u===-d&&(h=h.mixedAdd(r.points[c].neg()));f=f.add(h)}return f.toP()},c.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=s(e,r),c=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(e=0;u>=0&&0===o[u];u--)e++;if(u>=0&&e++,c=c.dblp(e),u<0)break;var f=o[u];a(0!==f),c="affine"===t.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,c=this._wnafT2,u=this._wnafT3,f=0,h=0;h<n;h++){var d=(M=e[h])._getNAFPoints(t);a[h]=d.wnd,c[h]=d.points}for(h=n-1;h>=1;h-=2){var l=h-1,p=h;if(1===a[l]&&1===a[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=o(r[l],r[p]);f=Math.max(g[0].length,f),u[l]=new Array(f),u[p]=new Array(f);for(var v=0;v<f;v++){var y=0|g[0][v],w=0|g[1][v];u[l][v]=m[3*(y+1)+(w+1)],u[p][v]=0,c[l]=b}}else u[l]=s(r[l],a[l]),u[p]=s(r[p],a[p]),f=Math.max(u[l].length,f),f=Math.max(u[p].length,f)}var _=this.jpoint(null,null,null),S=this._wnafT4;for(h=f;h>=0;h--){for(var x=0;h>=0;){var A=!0;for(v=0;v<n;v++)S[v]=0|u[v][h],0!==S[v]&&(A=!1);if(!A)break;x++,h--}if(h>=0&&x++,_=_.dblp(x),h<0)break;for(v=0;v<n;v++){var M,E=S[v];0!==E&&(E>0?M=c[v][E-1>>1]:E<0&&(M=c[v][-E-1>>1].neg()),_="affine"===M.type?_.mixedAdd(M):_.add(M))}}for(h=0;h<n;h++)c[h]=null;return i?_:_.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var s=0;s<t;s++)n=n.dbl();r.push(n)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},function(t,e,r){"use strict";var n=r(27),i=r(7),s=r(8),o=r(2),a=n.base,c=i.utils.assert;function u(t){a.call(this,"short",t),this.a=new s(t.a,16).toRed(this.red),this.b=new s(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new s(e,16),this.y=new s(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new s(0)):(this.x=new s(e,16),this.y=new s(r,16),this.z=new s(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new s(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new s(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new s(t.a,16),b:new s(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:s.mont(t),r=new s(2).toRed(e).redInvm(),n=r.redNeg(),i=new s(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,a,c,u,f,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new s(1),b=new s(0),m=new s(0),g=new s(1),v=0;0!==d.cmpn(0);){var y=l.div(d);u=l.sub(y.mul(d)),f=m.sub(y.mul(p));var w=g.sub(y.mul(b));if(!n&&u.cmp(h)<0)e=c.neg(),r=p,n=u.neg(),i=f;else if(n&&2==++v)break;c=u,l=d,d=u,m=p,p=f,g=b,b=w}o=u.neg(),a=f;var _=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),c=i.mul(r.b),u=s.mul(n.b);return{k1:t.sub(o).sub(a),k2:c.add(u).neg()}},u.prototype.pointFromX=function(t,e){(t=new s(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],c=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),n[2*s]=a,n[2*s+1]=c,i[2*s]=o.k1,i[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,n,i,2*s,r),f=0;f<2*s;f++)n[f]=null,i[f]=null;return u},o(f,a.BasePoint),u.prototype.point=function(t,e,r){return new f(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return f.fromJSON(this,t,e)},f.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},f.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},f.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var s=e[2];return n.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[n].concat(s.doubles.points.map(i))},naf:s.naf&&{wnd:s.naf.wnd,points:[n].concat(s.naf.points.map(i))}},n},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new s(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),h=n.redMul(u),d=c.redSqr().redIAdd(f).redISub(h).redISub(h),l=c.redMul(h.redISub(d)).redISub(s.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),h=a.redSqr().redIAdd(u).redISub(f).redISub(f),d=a.redMul(f.redISub(h)).redISub(i.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(h,d,l)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,s=this.x,o=this.y,a=this.z,c=a.redSqr().redSqr(),u=o.redAdd(o);for(r=0;r<t;r++){var f=s.redSqr(),h=u.redSqr(),d=h.redSqr(),l=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(c)),p=s.redMul(h),b=l.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=l.redMul(m);g=g.redIAdd(g).redISub(d);var v=u.redMul(a);r+1<t&&(c=c.redMul(d)),s=b,a=v,u=g}return this.curve.jpoint(s,u.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=c,e=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),l=this.x.redAdd(h).redSqr().redISub(f).redISub(d);l=l.redIAdd(l);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(o).redISub(o);t=c;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),l=this.x.redSub(f).redMul(this.x.redAdd(f));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(f);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=l.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(i)),c=e.redAdd(e),u=(c=c.redIAdd(c)).redMul(o),f=a.redSqr().redISub(u.redAdd(u)),h=u.redISub(f),d=o.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,l,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),s=i.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),f=e.redMul(u);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.x.redMul(a).redISub(f);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(o.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,d,l)},h.prototype.mul=function(t,e){return t=new s(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(27),i=r(8),s=r(2),o=n.base,a=r(7).utils;function c(t){o.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}s(c,o),t.exports=c,c.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},s(u,o.BasePoint),c.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},c.prototype.point=function(t,e){return new u(this,t,e)},c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(r),o=i.redMul(n),a=e.z.redMul(s.redAdd(o).redSqr()),c=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,c)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var s=i.length-1;s>=0;s--)0===i[s]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(27),i=r(7),s=r(8),o=r(2),a=n.base,c=i.utils.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new s(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function f(t,e,r,n,i){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(e,16),this.y=new s(r,16),this.z=n?new s(n,16):this.curve.one,this.t=i&&new s(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new s(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(e&&!c||!e&&c)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new s(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new f(this,t,e,r,n)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=n.redAdd(e),o=s.redSub(r),a=n.redSub(e),c=i.redMul(o),u=s.redMul(a),f=i.redMul(a),h=o.redMul(s);return this.curve.point(c,u,h,f)},f.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(i)).redAdd(s);if(this.zOne)t=n.redSub(i).redSub(s).redMul(o.redSub(this.curve.two)),e=o.redMul(u.redSub(s)),r=o.redSqr().redSub(o).redSub(o);else{var a=this.z.redSqr(),c=o.redSub(a).redISub(a);t=n.redSub(i).redISub(s).redMul(c),e=o.redMul(u.redSub(s)),r=o.redMul(c)}}else{var u=i.redAdd(s);a=this.curve._mulC(this.z).redSqr(),c=u.redSub(a).redSub(a),t=this.curve._mulC(n.redISub(u)).redMul(c),e=this.curve._mulC(u).redMul(i.redISub(s)),r=u.redMul(c)}return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=i.redSub(n),a=i.redAdd(n),c=r.redAdd(e),u=s.redMul(o),f=a.redMul(c),h=s.redMul(c),d=o.redMul(a);return this.curve.point(u,f,d,h)},f.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),c=i.redSub(a),u=i.redAdd(a),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),h=n.redMul(c).redMul(f);return this.curve.twisted?(e=n.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=c.redMul(u)):(e=n.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(t,e,r){"use strict";var n,i=e,s=r(38),o=r(7),a=o.utils.assert;function c(t){"short"===t.type?this.curve=new o.curve.short(t):"edwards"===t.type?this.curve=new o.curve.edwards(t):this.curve=new o.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(166)}catch(t){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(t,e,r){"use strict";e.sha1=r(161),e.sha224=r(162),e.sha256=r(72),e.sha384=r(163),e.sha512=r(73)},function(t,e,r){"use strict";var n=r(9),i=r(23),s=r(71),o=n.rotl32,a=n.sum32,c=n.sum32_5,u=s.ft_1,f=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],s=this.h[1],f=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=c(o(i,5),u(p,s,f,d),l,r[n],h[p]);l=d,d=f,f=o(s,30),s=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(9),i=r(72);function s(){if(!(this instanceof s))return new s;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(s,i),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(9),i=r(73);function s(){if(!(this instanceof s))return new s;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(s,i),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(9),i=r(23),s=n.rotl32,o=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,u),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],v=r,y=n,w=i,_=u,S=f,x=0;x<80;x++){var A=o(s(c(r,h(x,n,i,u),t[p[x]+e],d(x)),m[x]),f);r=f,f=u,u=s(i,10),i=n,n=A,A=o(s(c(v,h(79-x,y,w,_),t[b[x]+e],l(x)),g[x]),S),v=S,S=_,_=s(w,10),w=y,y=A}A=a(this.h[1],i,_),this.h[1]=a(this.h[2],u,S),this.h[2]=a(this.h[3],f,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],n,w),this.h[0]=A},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(9),i=r(15);function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},s.prototype.update=function(t,e){return this.inner.update(t,e),this},s.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";var n=r(8),i=r(168),s=r(7),o=s.utils.assert,a=r(169),c=r(170);function u(t){if(!(this instanceof u))return new u(t);"string"==typeof t&&(o(s.curves.hasOwnProperty(t),"Unknown curve "+t),t=s.curves[t]),t instanceof s.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=u,u.prototype.keyPair=function(t){return new a(this,t)},u.prototype.keyFromPrivate=function(t,e){return a.fromPrivate(this,t,e)},u.prototype.keyFromPublic=function(t,e){return a.fromPublic(this,t,e)},u.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||s.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(e.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},u.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},u.prototype.sign=function(t,e,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),u=t.toArray("be",o),f=new i({hash:this.hash,entropy:a,nonce:u,pers:s.pers,persEnc:s.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=s.k?s.k(d):new n(f.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=l.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return s.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new c({r:m,s:g,recoveryParam:v})}}}}}},u.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var s=(e=new c(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,u=o.invm(this.n),f=u.mul(t).umod(this.n),h=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},u.prototype.recoverPubKey=function(t,e,r,i){o((3&r)===r,"The recovery param is more than two bits"),e=new c(e,i);var s=this.n,a=new n(t),u=e.r,f=e.s,h=1&r,d=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");u=d?this.curve.pointFromX(u.add(this.curve.n),h):this.curve.pointFromX(u,h);var l=e.r.invm(s),p=s.sub(a).mul(l).umod(s),b=f.mul(l).umod(s);return this.g.mulAdd(p,u,b)},u.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch(t){continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(38),i=r(70),s=r(15);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=o,o.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,t);return this._update(r),this._reseed++,i.encode(o,e)}},function(t,e,r){"use strict";var n=r(8),i=r(7).utils.assert;function s(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=s,s.fromPublic=function(t,e,r){return e instanceof s?e:new s(t,{pub:e,pubEnc:r})},s.fromPrivate=function(t,e,r){return e instanceof s?e:new s(t,{priv:e,privEnc:r})},s.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},s.prototype.derive=function(t){return t.mul(this.priv).getX()},s.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},s.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var n=r(8),i=r(7).utils,s=i.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,s=0,o=e.place;s<n;s++,o++)i<<=8,i|=t[o];return e.place=o,i}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(c(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=c(t,r),o=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var u=c(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(o),this.s=new n(f),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var s=n.concat(r),o=[48];return f(o,s.length),o=o.concat(s),i.encode(o,t)}},function(t,e,r){"use strict";var n=r(38),i=r(7),s=i.utils,o=s.assert,a=s.parseBytes,c=r(172),u=r(173);function f(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=i.curves[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),s=this.encodePoint(i),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),c=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:s})},f.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(s)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},f.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},f.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},f.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},f.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=s.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(t){return s.intFromLE(t)},f.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var n=r(7).utils,i=n.assert,s=n.parseBytes,o=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},function(t,e,r){"use strict";var n=r(8),i=r(7).utils,s=i.assert,o=i.cachedProperty,a=i.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),s=n(r(77));e.createScript=function(...t){const e=new s.default;for(const r of t){if("string"==typeof r){e.str+=r;continue}if(!r.scriptHash)throw new Error("No scriptHash found!");const{scriptHash:t,operation:n,args:i,useTailCall:s}=Object.assign({operation:null,args:void 0,useTailCall:!1},r);e.emitAppCall(t,n,i,s)}return e.str},e.generateDeployScript=function(t){const e=new s.default;return e.emitPush(i.str2hexstring(t.description)).emitPush(i.str2hexstring(t.email)).emitPush(i.str2hexstring(t.author)).emitPush(i.str2hexstring(t.version)).emitPush(i.str2hexstring(t.name)).emitPush(t.needsStorage||!1).emitPush(t.returnType||"ff00").emitPush(t.parameterList).emitPush(t.script).emitSysCall("Neo.Contract.Create"),e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);var i;function s(t){switch(t){case i.Array:case i.Struct:case i.Map:return[];case i.Boolean:return!1;default:return""}}!function(t){t[t.ByteArray=0]="ByteArray",t[t.Boolean=1]="Boolean",t[t.Integer=2]="Integer",t[t.InteropInterface=4]="InteropInterface",t[t.Array=128]="Array",t[t.Struct=129]="Struct",t[t.Map=130]="Map"}(i=e.StackItemType||(e.StackItemType={})),e.hasChildren=function(t){return t===i.Array||t===i.Struct||t===i.Map};class o{static deserialize(t){const e=new n.StringStream(t);return this._deserialize(e)}static _deserialize(t){const e=new o({type:parseInt(t.read(),16)}),r=t.readVarInt();if(0===r)return e.value=s(e.type),e;switch(e.type){case i.Array:case i.Struct:e.value=[];for(let n=0;n<r;n++)e.value.push(this._deserialize(t));break;case i.Map:e.value=[];for(let n=0;n<r;n++)e.value.push({key:this._deserialize(t),value:this._deserialize(t)});break;case i.Boolean:e.value=parseInt(t.read(),16)>0;break;default:e.value=t.read(r)}return e}constructor(t){if(void 0===t.type)throw new Error(`Invalid type provided: ${t.type}`);var e;if(this.type="string"==typeof(e=t.type)?i[e]:e,void 0===t.value)this.value=s(this.type);else{if(Array.isArray(t.value))throw this.type===i.Array?this.value=t.value.map(t=>new o(t)):this.type===i.Map&&(this.value=t.value.map(t=>({key:new o(t.key),value:new o(t.value)}))),new Error("Encountered array for value but invalid type");this.value=t.value}}export(){const t=i[this.type];switch(this.type){case i.Array:case i.Struct:return{type:t,value:this.value.map(t=>t.export())};case i.Map:return{type:t,value:this.value.map(t=>({key:t.key.export(),value:t.value.export()}))};default:return{type:t,value:this.value}}}}e.StackItem=o,e.default=o},function(t,e,r){var n;t.exports=(n=r(5),r(177),r(178),r(80),r(39),function(){var t=n,e=t.lib.BlockCipher,r=t.algo,i=[],s=[],o=[],a=[],c=[],u=[],f=[],h=[],d=[],l=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,s[p]=r;var b=t[r],m=t[b],g=t[m],v=257*t[p]^16843008*p;o[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,c[r]=v<<8|v>>>24,u[r]=v,v=16843009*g^65537*m^257*b^16843008*r,f[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,l[p]=v,r?(r=b^t[t[t[g^b]]],n^=t[t[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],b=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),s=this._keySchedule=[],o=0;o<n;o++)if(o<r)s[o]=e[o];else{var a=s[o-1];o%r?r>6&&o%r==4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=p[o/r|0]<<24),s[o]=s[o-r]^a}for(var c=this._invKeySchedule=[],u=0;u<n;u++)o=n-u,a=u%4?s[o]:s[o-4],c[u]=u<4||o<=4?a:f[i[a>>>24]]^h[i[a>>>16&255]]^d[i[a>>>8&255]]^l[i[255&a]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,a,c,u,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,h,d,l,s),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,s,o,a){for(var c=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],l=4,p=1;p<c;p++){var b=n[u>>>24]^i[f>>>16&255]^s[h>>>8&255]^o[255&d]^r[l++],m=n[f>>>24]^i[h>>>16&255]^s[d>>>8&255]^o[255&u]^r[l++],g=n[h>>>24]^i[d>>>16&255]^s[u>>>8&255]^o[255&f]^r[l++],v=n[d>>>24]^i[u>>>16&255]^s[f>>>8&255]^o[255&h]^r[l++];u=b,f=m,h=g,d=v}b=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[l++],m=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[l++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[l++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[l++],t[e]=b,t[e+1]=m,t[e+2]=g,t[e+3]=v},keySize:8});t.AES=e._createHelper(b)}(),n.AES)},function(t,e,r){var n,i,s;t.exports=(s=r(5),i=(n=s).lib.WordArray,n.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],s=0;s<r;s+=3)for(var o=(e[s>>>2]>>>24-s%4*8&255)<<16|(e[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|e[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<r;a++)i.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var s=0;s<r.length;s++)n[r.charCodeAt(s)]=s}var o=r.charAt(64);if(o){var a=t.indexOf(o);-1!==a&&(e=a)}return function(t,e,r){for(var n=[],s=0,o=0;o<e;o++)if(o%4){var a=r[t.charCodeAt(o-1)]<<o%4*2,c=r[t.charCodeAt(o)]>>>6-o%4*2;n[s>>>2]|=(a|c)<<24-s%4*8,s++}return i.create(n,s)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},s.enc.Base64)},function(t,e,r){var n;t.exports=(n=r(5),function(t){var e=n,r=e.lib,i=r.WordArray,s=r.Hasher,o=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s=this._hash.words,o=t[e+0],c=t[e+1],l=t[e+2],p=t[e+3],b=t[e+4],m=t[e+5],g=t[e+6],v=t[e+7],y=t[e+8],w=t[e+9],_=t[e+10],S=t[e+11],x=t[e+12],A=t[e+13],M=t[e+14],E=t[e+15],T=s[0],P=s[1],I=s[2],k=s[3];T=u(T,P,I,k,o,7,a[0]),k=u(k,T,P,I,c,12,a[1]),I=u(I,k,T,P,l,17,a[2]),P=u(P,I,k,T,p,22,a[3]),T=u(T,P,I,k,b,7,a[4]),k=u(k,T,P,I,m,12,a[5]),I=u(I,k,T,P,g,17,a[6]),P=u(P,I,k,T,v,22,a[7]),T=u(T,P,I,k,y,7,a[8]),k=u(k,T,P,I,w,12,a[9]),I=u(I,k,T,P,_,17,a[10]),P=u(P,I,k,T,S,22,a[11]),T=u(T,P,I,k,x,7,a[12]),k=u(k,T,P,I,A,12,a[13]),I=u(I,k,T,P,M,17,a[14]),T=f(T,P=u(P,I,k,T,E,22,a[15]),I,k,c,5,a[16]),k=f(k,T,P,I,g,9,a[17]),I=f(I,k,T,P,S,14,a[18]),P=f(P,I,k,T,o,20,a[19]),T=f(T,P,I,k,m,5,a[20]),k=f(k,T,P,I,_,9,a[21]),I=f(I,k,T,P,E,14,a[22]),P=f(P,I,k,T,b,20,a[23]),T=f(T,P,I,k,w,5,a[24]),k=f(k,T,P,I,M,9,a[25]),I=f(I,k,T,P,p,14,a[26]),P=f(P,I,k,T,y,20,a[27]),T=f(T,P,I,k,A,5,a[28]),k=f(k,T,P,I,l,9,a[29]),I=f(I,k,T,P,v,14,a[30]),T=h(T,P=f(P,I,k,T,x,20,a[31]),I,k,m,4,a[32]),k=h(k,T,P,I,y,11,a[33]),I=h(I,k,T,P,S,16,a[34]),P=h(P,I,k,T,M,23,a[35]),T=h(T,P,I,k,c,4,a[36]),k=h(k,T,P,I,b,11,a[37]),I=h(I,k,T,P,v,16,a[38]),P=h(P,I,k,T,_,23,a[39]),T=h(T,P,I,k,A,4,a[40]),k=h(k,T,P,I,o,11,a[41]),I=h(I,k,T,P,p,16,a[42]),P=h(P,I,k,T,g,23,a[43]),T=h(T,P,I,k,w,4,a[44]),k=h(k,T,P,I,x,11,a[45]),I=h(I,k,T,P,E,16,a[46]),T=d(T,P=h(P,I,k,T,l,23,a[47]),I,k,o,6,a[48]),k=d(k,T,P,I,v,10,a[49]),I=d(I,k,T,P,M,15,a[50]),P=d(P,I,k,T,m,21,a[51]),T=d(T,P,I,k,x,6,a[52]),k=d(k,T,P,I,p,10,a[53]),I=d(I,k,T,P,_,15,a[54]),P=d(P,I,k,T,c,21,a[55]),T=d(T,P,I,k,y,6,a[56]),k=d(k,T,P,I,E,10,a[57]),I=d(I,k,T,P,g,15,a[58]),P=d(P,I,k,T,A,21,a[59]),T=d(T,P,I,k,b,6,a[60]),k=d(k,T,P,I,S,10,a[61]),I=d(I,k,T,P,l,15,a[62]),P=d(P,I,k,T,w,21,a[63]),s[0]=s[0]+T|0,s[1]=s[1]+P|0,s[2]=s[2]+I|0,s[3]=s[3]+k|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var s=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,n,i,s,o){var a=t+(e&r|~e&n)+i+o;return(a<<s|a>>>32-s)+e}function f(t,e,r,n,i,s,o){var a=t+(e&n|r&~n)+i+o;return(a<<s|a>>>32-s)+e}function h(t,e,r,n,i,s,o){var a=t+(e^r^n)+i+o;return(a<<s|a>>>32-s)+e}function d(t,e,r,n,i,s,o){var a=t+(r^(e|~n))+i+o;return(a<<s|a>>>32-s)+e}e.MD5=s._createHelper(c),e.HmacMD5=s._createHmacHelper(c)}(Math),n.MD5)},function(t,e,r){var n,i,s,o,a,c,u,f;t.exports=(i=(n=f=r(5)).lib,s=i.WordArray,o=i.Hasher,a=n.algo,c=[],u=a.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],u=0;u<80;u++){if(u<16)c[u]=0|t[e+u];else{var f=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=f<<1|f>>>31}var h=(n<<5|n>>>27)+a+c[u];h+=u<20?1518500249+(i&s|~i&o):u<40?1859775393+(i^s^o):u<60?(i&s|i&o|s&o)-1894007588:(i^s^o)-899497514,a=o,o=s,s=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(n+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u),f.SHA1)},function(t,e,r){var n,i,s;t.exports=(i=(n=r(5)).lib.Base,s=n.enc.Utf8,void(n.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=s.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),o=this._iKey=e.clone(),a=i.words,c=o.words,u=0;u<r;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})))},function(t,e,r){t.exports=r(5).enc.Latin1},function(t,e,r){var n,i;t.exports=(i=r(5),r(39),i.mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),n.Decryptor=n.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),n),i.mode.ECB)},function(t,e,r){var n;t.exports=(n=r(5),r(39),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},function(t,e,r){"use strict";(function(e){!function(r){var n=2147483647;function i(t){var e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=1779033703,n=3144134277,i=1013904242,s=2773480762,o=1359893119,a=2600822924,c=528734635,u=1541459225,f=new Array(64);function h(t){for(var h=0,d=t.length;d>=64;){var l,p,b,m,g,v=r,y=n,w=i,_=s,S=o,x=a,A=c,M=u;for(p=0;p<16;p++)b=h+4*p,f[p]=(255&t[b])<<24|(255&t[b+1])<<16|(255&t[b+2])<<8|255&t[b+3];for(p=16;p<64;p++)m=((l=f[p-2])>>>17|l<<15)^(l>>>19|l<<13)^l>>>10,g=((l=f[p-15])>>>7|l<<25)^(l>>>18|l<<14)^l>>>3,f[p]=(m+f[p-7]|0)+(g+f[p-16]|0)|0;for(p=0;p<64;p++)m=(((S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&x^~S&A)|0)+(M+(e[p]+f[p]|0)|0)|0,g=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&y^v&w^y&w)|0,M=A,A=x,x=S,S=_+m|0,_=w,w=y,y=v,v=m+g|0;r=r+v|0,n=n+y|0,i=i+w|0,s=s+_|0,o=o+S|0,a=a+x|0,c=c+A|0,u=u+M|0,h+=64,d-=64}}h(t);var d,l=t.length%64,p=t.length/536870912|0,b=t.length<<3,m=l<56?56:120,g=t.slice(t.length-l,t.length);for(g.push(128),d=l+1;d<m;d++)g.push(0);return g.push(p>>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(b>>>24&255),g.push(b>>>16&255),g.push(b>>>8&255),g.push(b>>>0&255),h(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function s(t,e,r){var n;t=t.length<=64?t:i(t);var s=64+e.length+4,o=new Array(s),a=new Array(64),c=[];for(n=0;n<64;n++)o[n]=54;for(n=0;n<t.length;n++)o[n]^=t[n];for(n=0;n<e.length;n++)o[64+n]=e[n];for(n=s-4;n<s;n++)o[n]=0;for(n=0;n<64;n++)a[n]=92;for(n=0;n<t.length;n++)a[n]^=t[n];function u(){for(var t=s-1;t>=s-4;t--){if(o[t]++,o[t]<=255)return;o[t]=0}}for(;r>=32;)u(),c=c.concat(i(a.concat(i(o)))),r-=32;return r>0&&(u(),c=c.concat(i(a.concat(i(o))).slice(0,r))),c}function o(t,e,r,n,i){var s;for(f(t,16*(2*r-1),i,0,16),s=0;s<2*r;s++)u(t,16*s,i,16),c(i,n),f(i,0,t,e+16*s,16);for(s=0;s<r;s++)f(t,e+2*s*16,t,16*s,16);for(s=0;s<r;s++)f(t,e+16*(2*s+1),t,16*(s+r),16)}function a(t,e){return t<<e|t>>>32-e}function c(t,e){f(t,0,e,0,16);for(var r=8;r>0;r-=2)e[4]^=a(e[0]+e[12],7),e[8]^=a(e[4]+e[0],9),e[12]^=a(e[8]+e[4],13),e[0]^=a(e[12]+e[8],18),e[9]^=a(e[5]+e[1],7),e[13]^=a(e[9]+e[5],9),e[1]^=a(e[13]+e[9],13),e[5]^=a(e[1]+e[13],18),e[14]^=a(e[10]+e[6],7),e[2]^=a(e[14]+e[10],9),e[6]^=a(e[2]+e[14],13),e[10]^=a(e[6]+e[2],18),e[3]^=a(e[15]+e[11],7),e[7]^=a(e[3]+e[15],9),e[11]^=a(e[7]+e[3],13),e[15]^=a(e[11]+e[7],18),e[1]^=a(e[0]+e[3],7),e[2]^=a(e[1]+e[0],9),e[3]^=a(e[2]+e[1],13),e[0]^=a(e[3]+e[2],18),e[6]^=a(e[5]+e[4],7),e[7]^=a(e[6]+e[5],9),e[4]^=a(e[7]+e[6],13),e[5]^=a(e[4]+e[7],18),e[11]^=a(e[10]+e[9],7),e[8]^=a(e[11]+e[10],9),e[9]^=a(e[8]+e[11],13),e[10]^=a(e[9]+e[8],18),e[12]^=a(e[15]+e[14],7),e[13]^=a(e[12]+e[15],9),e[14]^=a(e[13]+e[12],13),e[15]^=a(e[14]+e[13],18);for(r=0;r<16;++r)t[r]+=e[r]}function u(t,e,r,n){for(var i=0;i<n;i++)r[i]^=t[e+i]}function f(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}function h(t){if(!t||"number"!=typeof t.length)return!1;for(var e=0;e<t.length;e++){if("number"!=typeof t[e])return!1;var r=parseInt(t[e]);if(r!=t[e]||r<0||r>=256)return!1}return!0}function d(t,e){var r=parseInt(t);if(t!=r)throw new Error("invalid "+e);return r}t.exports=function(t,r,i,a,c,l,p){if(!p)throw new Error("missing callback");if(i=d(i,"N"),a=d(a,"r"),c=d(c,"p"),l=d(l,"dkLen"),0===i||0!=(i&i-1))throw new Error("N must be power of 2");if(i>n/128/a)throw new Error("N too large");if(a>n/128/c)throw new Error("r too large");if(!h(t))throw new Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!h(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var b=s(t,r,128*c*a),m=new Uint32Array(32*c*a),g=0;g<m.length;g++){var v=4*g;m[g]=(255&b[v+3])<<24|(255&b[v+2])<<16|(255&b[v+1])<<8|(255&b[v+0])<<0}var y,w,_=new Uint32Array(64*a),S=new Uint32Array(32*a*i),x=32*a,A=new Uint32Array(16),M=new Uint32Array(16),E=c*i*2,T=0,P=null,I=!1,k=0,O=0,R=parseInt(1e3/a),C=void 0!==e?e:setTimeout,B=function(){if(I)return p(new Error("cancelled"),T/E);switch(k){case 0:f(m,w=32*O*a,_,0,x),k=1,y=0;case 1:(r=i-y)>R&&(r=R);for(var e=0;e<r;e++)f(_,0,S,(y+e)*x,x),o(_,x,a,A,M);if(y+=r,T+=r,(n=parseInt(1e3*T/E))!==P){if(I=p(null,T/E))break;P=n}if(y<i)break;y=0,k=2;case 2:var r,n;for((r=i-y)>R&&(r=R),e=0;e<r;e++){var h=_[16*(2*a-1)]&i-1;u(S,h*x,_,x),o(_,x,a,A,M)}if(y+=r,T+=r,(n=parseInt(1e3*T/E))!==P){if(I=p(null,T/E))break;P=n}if(y<i)break;if(f(_,0,m,w,x),++O<c){k=0;break}for(b=[],e=0;e<m.length;e++)b.push(m[e]>>0&255),b.push(m[e]>>8&255),b.push(m[e]>>16&255),b.push(m[e]>>24&255);var d=s(t,b,l);return p(null,1,d)}C(B)};B()}}()}).call(this,r(65).setImmediate)},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(1),o=r(42),a=r(30),c=r(6),u=i(r(17)),f=i(r(83)),h=i(r(41));function d(t){const e={},r=Object.keys(t);for(const n of r)e[n]=t[n].export();return e}function l(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r].toNumber()}),e}class p{constructor(t={}){if(this.address=t.address||"",this.net=t.net||"NoNet",this.assetSymbols=[],this.assets={},"object"==typeof t.assets){const e=Object.keys(t.assets);for(const r of e)"object"==typeof t.assets[r]&&this.addAsset(r,t.assets[r])}if(this.tokenSymbols=[],this.tokens={},"object"==typeof t.tokens){const e=Object.keys(t.tokens);for(const r of e)this.addToken(r,t.tokens[r])}}get[Symbol.toStringTag](){return"Balance"}addAsset(t,e){t=t.toUpperCase(),this.assetSymbols.push(t),this.assetSymbols.sort();const r=new f.default(e);return this.assets[t]=r,this}addToken(t,e=0){return t=t.toUpperCase(),this.tokenSymbols.push(t),this.tokens[t]=new u.default(e),this}applyTx(t,e=!1){t=t instanceof c.BaseTransaction?t:a.Transaction.deserialize(t);const r=this.assetSymbols;for(const e of t.inputs){const t=t=>t.txid===e.prevHash&&t.index===e.prevIndex;for(const e of r){const r=this.assets[e],n=r.unspent.findIndex(t);if(n>=0){const t=r.unspent.splice(n,1);r.spent=r.spent.concat(t);break}}}const n=t.hash;for(let r=0;r<t.outputs.length;r++){const i=t.outputs[r],o=s.ASSETS[i.assetId],a=this.assets[o];a||this.addAsset(o);const c=new h.default({index:r,txid:n,value:i.value});if(e){const t=t=>t.txid===c.txid&&t.index===c.index,e=a.unconfirmed.findIndex(t);e>=0&&a.unconfirmed.splice(e,1),a.unspent||(a.unspent=[]),a.unspent.push(c)}else a.unconfirmed||(a.unconfirmed=[]),a.unconfirmed.push(c);this.assets[o]=a}return this}confirm(){for(const t of this.assetSymbols){const e=this.assets[t];e.unspent=e.unspent.concat(e.unconfirmed),e.unconfirmed=[]}return this}export(){return{net:this.net,address:this.address,assetSymbols:this.assetSymbols,assets:d(this.assets),tokenSymbols:this.tokenSymbols,tokens:l(this.tokens)}}verifyAssets(t){const e=[],r=this.assetSymbols;return r.map(r=>{const i=this.assets[r];e.push(function(t,e){return n(this,void 0,void 0,(function*(){const r={balance:new u.default(0),spent:[],unspent:[],unconfirmed:[]};return(yield function(t,e){return n(this,void 0,void 0,(function*(){const r=e.map(e=>(function(t,e){return n(this,void 0,void 0,(function*(){const r=yield o.Query.getTxOut(e.txid,e.index).execute(t);return!!r.result&&e.index===r.result.n&&e.value.equals(r.result.value)}))})(t,e));return yield Promise.all(r)}))}(t,e.unspent)).forEach((t,n)=>{const i=e.unspent[n];t?(r.unspent.push(i),r.balance=r.balance.add(i.value)):r.spent.push(i)}),new f.default(r)}))}(t,i))}),Promise.all(e).then(t=>(r.map((e,r)=>{this.assets[e]=t[r]}),this))}}e.Balance=p,e.default=p},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(58)),s=n(r(84)),o=i.default.inspect.custom;class a{constructor(t={}){this.address=t.address||"",this.net=t.net||"NoNet",this.claims=t.claims?t.claims.map(t=>new s.default(t)):[]}get[Symbol.toStringTag](){return"Claims"}[o](){const t=this.claims.map(t=>`${t.txid} <${t.index}>: ${t.claim.toString()}`);return`[Claims(${this.net}): ${this.address}]\n${JSON.stringify(t,null,2)}`}export(){return{address:this.address,net:this.net,claims:this.claims.map(t=>t.export())}}slice(t,e){return new a({address:this.address,net:this.net,claims:this.claims.slice(t,e)})}}e.Claims=a,e.default=a},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(83)),n(r(84)),n(r(41))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(1),o=i(r(10)),a=r(32),c=o.default("wallet");class u{constructor(t=s.DEFAULT_WALLET){if(this.name=t.name||"myWallet",this.version=t.version||s.DEFAULT_WALLET.version,this.scrypt=Object.assign({},s.DEFAULT_SCRYPT,t.scrypt),this.accounts=[],t.accounts)for(const e of t.accounts)this.addAccount(e);this.extra=t.extra||{},c.info(`New Wallet created: ${this.name}`)}get[Symbol.toStringTag](){return"Wallet"}get defaultAccount(){if(0===this.accounts.length)throw new Error("No accounts available in this Wallet!");for(const t of this.accounts)if(t.isDefault)return t;for(const t of this.accounts)if(t.tryGet("privateKey")||t.tryGet("WIF"))return t;for(const t of this.accounts)if(t.encrypted)return t;return this.accounts[0]}addAccount(t){const e=this.accounts.length;t instanceof a.Account||(t=new a.Account(t)),this.accounts.push(t);try{const e=t.address;c.info(`Added Account: ${e} to Wallet ${this.name}`)}catch(t){c.warn(`Encrypted account added to Wallet ${this.name}. You will not be able to export this wallet without first decrypting this account`)}return e}decrypt(t,e){return n(this,void 0,void 0,(function*(){return t<0?Promise.reject(`Index cannot be negative! index: ${t}`):t>=this.accounts.length?Promise.reject(`Index cannot larger than Accounts array! index: ${t}`):(yield this.accounts[t].decrypt(e,this.scrypt),!0)}))}decryptAll(t){return Promise.all(this.accounts.map((e,r)=>this.decrypt(r,t)))}encrypt(t,e){return n(this,void 0,void 0,(function*(){return t<0?Promise.reject("Index cannot be negative!"):t>=this.accounts.length?Promise.reject("Index cannot larger than Accounts array!"):(yield this.accounts[t].encrypt(e,this.scrypt),!0)}))}encryptAll(t){return Promise.all(this.accounts.map((e,r)=>this.encrypt(r,t)))}export(){return{name:this.name,version:this.version,scrypt:this.scrypt,accounts:this.accounts.map(t=>t.export()),extra:this.extra}}setDefault(t){for(let e=0;e<this.accounts.length;e++)this.accounts[e].isDefault=e===t;return c.info(`Set Account: ${this.accounts[t]} as default for Wallet ${this.name}`),this}}e.Wallet=u,e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(12);class s{constructor(t){if(this._scriptHash="",!t||void 0===t.invocationScript||void 0===t.verificationScript)throw new Error("Witness requires invocationScript and verificationScript fields");this.invocationScript=t.invocationScript,this.verificationScript=t.verificationScript}static deserialize(t){const e=new n.StringStream(t);return this.fromStream(e)}static fromStream(t){const e=t.readVarBytes(),r=t.readVarBytes();return new s({invocationScript:e,verificationScript:r})}static fromSignature(t,e){const r="40"+t,n=i.getVerificationScriptFromPublicKey(e);return new s({invocationScript:r,verificationScript:n})}static buildMultiSig(t,e,r){const n="string"==typeof r?r:r.contract.script,o=i.getPublicKeysFromVerificationScript(n),a=Array(o.length).fill("");e.forEach(e=>{if("string"==typeof e){const r=o.findIndex(r=>i.verify(t,e,r));if(-1===r)throw new Error(`Invalid signature given: ${e}`);a[r]=e}else{if(!(e instanceof s))throw new Error("Unable to process given signature");{const t=i.getPublicKeysFromVerificationScript(e.verificationScript);if(1!==t.length)throw new Error("Given witness contains more than 1 public key!");const r=o.indexOf(t[0]);a[r]=i.getSignaturesFromInvocationScript(e.invocationScript)[0]}}});const c=i.getSigningThresholdFromVerificationScript(n),u=a.filter(t=>""!==t);if(u.length<c)throw new Error(`Insufficient signatures: expected ${c} but got ${u.length} instead`);return new s({invocationScript:u.slice(0,c).map(t=>"40"+t).join(""),verificationScript:n})}get scriptHash(){if(this._scriptHash)return this._scriptHash;if(this.verificationScript)return this._scriptHash=n.reverseHex(n.hash160(this.verificationScript)),this._scriptHash;throw new Error("Unable to produce scriptHash from empty verificationScript")}set scriptHash(t){if(this.verificationScript)throw new Error("Unable to set scriptHash when verificationScript is not empty");this._scriptHash=t}serialize(){const t=n.num2VarInt(this.invocationScript.length/2),e=n.num2VarInt(this.verificationScript.length/2);return t+this.invocationScript+e+this.verificationScript}export(){return{invocationScript:this.invocationScript,verificationScript:this.verificationScript}}equals(t){return this.invocationScript===t.invocationScript&&this.verificationScript===t.verificationScript}generateScriptHash(){this._scriptHash=n.reverseHex(n.hash160(this.verificationScript))}}e.Witness=s,e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);var i;function s(t){if("string"==typeof t){if(t in i)return i[t];throw new Error(`${t} not found in StateType!`)}return t}!function(t){t[t.Account=64]="Account",t[t.Validator=72]="Validator"}(i=e.StateType||(e.StateType={}));class o{static deserialize(t){const e=new n.StringStream(t);return this.fromStream(e)}static fromStream(t){const e=parseInt(t.read(),16),r=t.readVarBytes(),i=n.hexstring2str(t.readVarBytes()),s=t.readVarBytes();return new o({type:e,key:r,field:i,value:s})}constructor(t={}){this.type=t.type?s(t.type):i.Account,this.key=t.key||"",this.field=t.field||"",this.value=t.value||""}get[Symbol.toStringTag](){return"StateDescriptor"}serialize(){let t=n.num2hexstring(this.type);t+=n.num2VarInt(this.key.length/2),t+=this.key;const e=n.str2hexstring(this.field);return t+=n.num2VarInt(e.length/2),t+=e,(t+=n.num2VarInt(this.value.length/2))+this.value}export(){return{type:this.type,key:this.key,field:this.field,value:this.value}}equals(t){return this.type===s(t.type)&&this.key===t.key&&this.field===t.field&&this.value===t.value}}e.StateDescriptor=o,e.default=o},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(6)),n(r(192)),n(r(85)),n(r(86)),n(r(87)),n(r(88)),n(r(89)),n(r(91)),n(r(92)),n(r(21)),n(r(90)),n(r(93))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(6),s=r(85),o=r(86),a=r(87),c=r(88),u=r(89),f=r(90),h=r(91),d=r(92),l=r(93),p=r(40);class b extends i.BaseTransaction{static deserialize(t){const e=new n.StringStream(t);let r=p.deserializeType(e);const i=function(t){switch(t){case 0:return u.MinerTransaction;case 1:return h.IssueTransaction;case 2:return s.ClaimTransaction;case 32:return f.EnrollmentTransaction;case 64:return d.RegisterTransaction;case 128:return o.ContractTransaction;case 208:return l.PublishTransaction;case 209:return a.InvocationTransaction;case 144:return c.StateTransaction;default:throw new Error(`Unknown TransactionType: ${t}`)}}(r.type);return r=p.deserializeVersion(e,r),r=i.deserializeExclusive(e,r),r=p.deserializeAttributes(e,r),r=p.deserializeInputs(e,r),r=p.deserializeOutputs(e,r),e.isEmpty()||(r=p.deserializeWitnesses(e,r)),new i(r)}static deserializeExclusive(t,e){throw new Error("Method not implemented.")}constructor(t={}){super(t)}get[Symbol.toStringTag](){return"Transaction"}get exclusiveData(){throw new Error("Not Implemented!")}get fees(){return 0}serializeExclusive(){throw new Error("Method not implemented.")}}e.Transaction=b,e.default=b},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=r(1),o=i(r(10)),a=r(29),c=r(12),u=i(r(44)),f=o.default("rpc");class h{constructor(t,e=s.RPC_VERSION){t===s.NEO_NETWORK.MAIN?this.net=s.DEFAULT_RPC.MAIN:t===s.NEO_NETWORK.TEST?this.net=s.DEFAULT_RPC.TEST:this.net=t,this.history=[],this.lastSeenHeight=0,this._latencies=[],this.version=e}get[Symbol.toStringTag](){return"RPC Client"}get latency(){return 0===this._latencies.length?99999:Math.floor(this._latencies.reduce((t,e)=>t+e,0)/this._latencies.length)}set latency(t){this._latencies.length>4&&this._latencies.shift(),this._latencies.push(t)}ping(){return n(this,void 0,void 0,(function*(){const t=Date.now(),e=u.default.getBlockCount();try{const r=yield this.execute(e,{timeout:a.timeout.ping});this.lastSeenHeight=r.result;const n=Date.now()-t;return this.latency=n,n}catch(t){return this.latency=a.timeout.ping,a.timeout.ping}}))}execute(t,e){return this.history.push(t),f.info(`RPC: ${this.net} executing Query[${t.req.method}]`),t.execute(this.net,e)}query(t,e){const r=new u.default(t);return this.execute(r,e)}getAccountState(t){return n(this,void 0,void 0,(function*(){if(!c.isAddress(t))throw new Error(`Invalid address given: ${t}`);return(yield this.execute(u.default.getAccountState(t))).result}))}getAssetState(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getAssetState(t))).result}))}getBlock(t,e=1){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getBlock(t,e))).result}))}getBlockHash(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getBlockHash(t))).result}))}getBestBlockHash(){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getBestBlockHash())).result}))}getBlockCount(){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getBlockCount())).result}))}getBlockSysFee(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getBlockSysFee(t))).result}))}getConnectionCount(){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getConnectionCount())).result}))}getContractState(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getContractState(t))).result}))}getPeers(){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getPeers())).result}))}getRawMemPool(){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getRawMemPool())).result}))}getRawTransaction(t,e=1){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getRawTransaction(t,e))).result}))}getStorage(t,e){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getStorage(t,e))).result}))}getTxOut(t,e){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getTxOut(t,e))).result}))}getValidators(){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getValidators())).result}))}getVersion(){return n(this,void 0,void 0,(function*(){try{const t=yield this.execute(u.default.getVersion());if(!(t&&t.result&&t.result.useragent))throw new Error("Empty or unexpected version pattern");{const e=t.result.useragent,r=e.length,n=e.substring(1,r-1),[i,s]=n.split(":");this.version=s}return this.version}catch(t){if(t.message.includes("Method not found"))return this.version=s.RPC_VERSION,this.version;throw t}}))}invoke(t,...e){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.invoke(t,...e))).result}))}invokeFunction(t,e,...r){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.invokeFunction(t,e,...r))).result}))}invokeScript(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.invokeScript(t))).result}))}sendRawTransaction(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.sendRawTransaction(t))).result}))}submitBlock(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.submitBlock(t))).result}))}validateAddress(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.validateAddress(t))).result.isvalid}))}getUnspents(t){return n(this,void 0,void 0,(function*(){const e=yield this.execute(u.default.getUnspents(t));return this.parseUnspentsToBalance(e.result)}))}getUnclaimed(t){return n(this,void 0,void 0,(function*(){return(yield this.execute(u.default.getUnclaimed(t))).result}))}getClaimable(t){return n(this,void 0,void 0,(function*(){const e=yield this.execute(u.default.getClaimable(t));return new c.Claims({net:this.net,address:e.result.address,claims:e.result.claimable.map(t=>new Object({claim:t.unclaimed,txid:t.txid,index:t.n,value:t.value,start:t.start_height,end:t.end_height}))})}))}parseUnspentsToBalance(t){const e=new c.Balance({address:t.address});for(const r of t.balance)0!==r.amount&&(r.unspent.length>0?e.addAsset(r.asset_symbol,{unspent:r.unspent.map(t=>new c.Coin({index:t.n,txid:t.txid,value:t.value}))}):e.addToken(r.asset_symbol,r.amount));return e}}e.RPCClient=h,e.default=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0);function i(t){return parseInt(t.value||"0",10)}function s(t){return n.hexstring2str(t.value)}e.buildParser=function(...t){return e=>{if(e.stack.length!==t.length)throw new Error(`Wrong number of items to parse! Expected ${t.length} but got ${e.stack.length}!`);return e.stack.map((e,r)=>t[r](e))}},e.NoOpParser=function(t){return t.value},e.IntegerParser=i,e.StringParser=s,e.Fixed8Parser=function(t){return n.Fixed8.fromReverseHex(t.value)},e.SimpleParser=function(t){return t.stack.map(t=>{switch(t.type){case"ByteArray":return s(t);case"Integer":return i(t);default:throw Error(`Unknown type: ${t.type}`)}})}}])},function(t,e,r){t.exports=r(12)},function(t,e,r){"use strict";var n=r(3),i=r(13),s=Object.prototype.toString;function o(t){return"[object Array]"===s.call(t)}function a(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===s.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===s.call(t)},isBuffer:i,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===s.call(t)},isFile:function(t){return"[object File]"===s.call(t)},isBlob:function(t){return"[object Blob]"===s.call(t)},isFunction:c,isStream:function(t){return a(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function t(){var e={};function r(r,n){"object"==typeof e[n]&&"object"==typeof r?e[n]=t(e[n],r):e[n]=r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return e},deepMerge:function t(){var e={};function r(r,n){"object"==typeof e[n]&&"object"==typeof r?e[n]=t(e[n],r):e[n]="object"==typeof r?t({},r):r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return e},extend:function(t,e,r){return u(e,(function(e,i){t[i]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";var n=r(2);function i(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var s;if(r)s=r(e);else if(n.isURLSearchParams(e))s=e.toString();else{var o=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),o.push(i(e)+"="+i(t))})))})),s=o.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";(function(e){var n=r(2),i=r(19),s={"Content-Type":"application/x-www-form-urlencoded"};function o(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,c={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=r(7):"undefined"!=typeof XMLHttpRequest&&(a=r(7)),a),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(o(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(o(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){c.headers[t]=n.merge(s)})),t.exports=c}).call(this,r(18))},function(t,e,r){"use strict";var n=r(2),i=r(20),s=r(4),o=r(22),a=r(23),c=r(8);t.exports=function(t){return new Promise((function(e,u){var f=t.data,h=t.headers;n.isFormData(f)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(t.auth){var l=t.auth.username||"",p=t.auth.password||"";h.Authorization="Basic "+btoa(l+":"+p)}if(d.open(t.method.toUpperCase(),s(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?o(d.getAllResponseHeaders()):null,n={data:t.responseType&&"text"!==t.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:t,request:d};i(e,u,n),d=null}},d.onabort=function(){d&&(u(c("Request aborted",t,"ECONNABORTED",d)),d=null)},d.onerror=function(){u(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){u(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var b=r(24),m=(t.withCredentials||a(t.url))&&t.xsrfCookieName?b.read(t.xsrfCookieName):void 0;m&&(h[t.xsrfHeaderName]=m)}if("setRequestHeader"in d&&n.forEach(h,(function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete h[e]:d.setRequestHeader(e,t)})),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){d&&(d.abort(),u(t),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(t,e,r){"use strict";var n=r(21);t.exports=function(t,e,r,i,s){var o=new Error(t);return n(o,e,r,i,s)}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){e=e||{};var r={};return n.forEach(["url","method","params","data"],(function(t){void 0!==e[t]&&(r[t]=e[t])})),n.forEach(["headers","auth","proxy"],(function(i){n.isObject(e[i])?r[i]=n.deepMerge(t[i],e[i]):void 0!==e[i]?r[i]=e[i]:n.isObject(t[i])?r[i]=n.deepMerge(t[i]):void 0!==t[i]&&(r[i]=t[i])})),n.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==e[n]?r[n]=e[n]:void 0!==t[n]&&(r[n]=t[n])})),r}},function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const s=n(r(30)),o=i(r(0)),a=n(r(31)),c=s.default(o),u=a.default(c);e.api=u.api,e.nep5=u.nep5,e.settings=u.settings,e.sc=u.sc,e.rpc=u.rpc,e.wallet=u.wallet,e.CONST=u.CONST,e.u=u.u,e.tx=u.tx,e.logging=u.logging;const f=n(r(29)).default;Object.keys(f).map(t=>{e.settings.networks[t]=new e.rpc.Network(f[t])});const h={account:t=>new e.wallet.Account(t),privateKey:e.wallet.generatePrivateKey,signature:e.wallet.generateSignature,wallet:t=>new e.wallet.Wallet(t),claimTx:()=>new e.tx.ClaimTransaction,contractTx:()=>new e.tx.ContractTransaction,invocationTx:()=>new e.tx.InvocationTransaction,stateTx:()=>new e.tx.StateTransaction,contractParam:(t,r)=>new e.sc.ContractParam(t,r),script:e.sc.createScript,scriptBuilder:()=>new e.sc.ScriptBuilder,deployScript:t=>e.sc.generateDeployScript(t),rpcClient:(t,r)=>new e.rpc.RPCClient(t,r),query:t=>new e.rpc.Query(t),network:t=>new e.rpc.Network(t),stringStream:t=>new e.u.StringStream(t),fixed8:t=>new e.u.Fixed8(t)},d={address:e.wallet.isAddress,publicKey:e.wallet.isPublicKey,encryptedKey:e.wallet.isNEP2,privateKey:e.wallet.isPrivateKey,wif:e.wallet.isWIF,scriptHash:e.wallet.isScriptHash},l={attribute:e.tx.TransactionAttribute.deserialize,input:e.tx.TransactionInput.deserialize,output:e.tx.TransactionOutput.deserialize,script:e.tx.Witness.deserialize,tx:e.tx.Transaction.deserialize},p={hex:e.wallet.sign,message:(t,r)=>{const n=e.u.str2hexstring(t);return e.wallet.sign(n,r)}},b={hex:e.wallet.verify,message:(t,r,n)=>{const i=e.u.str2hexstring(t);return e.wallet.verify(i,r,n)}};e.default={sendAsset:e.api.sendAsset,claimGas:e.api.claimGas,doInvoke:e.api.doInvoke,setupVote:e.api.setupVote,create:h,deserialize:l,is:d,sign:p,verify:b,encrypt:{privateKey:e.wallet.encrypt},decrypt:{privateKey:e.wallet.decrypt},add:{network:(t,r=!1)=>(!r||!e.settings.networks[t.name])&&(e.settings.networks[t.name]=t,!0)},remove:{network:t=>!!e.settings.networks[t]&&(delete e.settings.networks[t],!0)},u:e.u,CONST:e.CONST}},function(t,e,r){"use strict";var n=r(2),i=r(3),s=r(14),o=r(9);function a(t){var e=new s(t),r=i(s.prototype.request,e);return n.extend(r,s.prototype,e),n.extend(r,e),r}var c=a(r(6));c.Axios=s,c.create=function(t){return a(o(c.defaults,t))},c.Cancel=r(10),c.CancelToken=r(27),c.isCancel=r(5),c.all=function(t){return Promise.all(t)},c.spread=r(28),t.exports=c,t.exports.default=c},function(t,e){
27/*!
28 * Determine if an object is a Buffer
29 *
30 * @author Feross Aboukhadijeh <https://feross.org>
31 * @license MIT
32 */
33t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,r){"use strict";var n=r(2),i=r(4),s=r(15),o=r(16),a=r(9);function c(t){this.defaults=t,this.interceptors={request:new s,response:new s}}c.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method=t.method?t.method.toLowerCase():"get";var e=[o,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},c.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){c.prototype[t]=function(e,r){return this.request(n.merge(r||{},{method:t,url:e}))}})),n.forEach(["post","put","patch"],(function(t){c.prototype[t]=function(e,r,i){return this.request(n.merge(i||{},{method:t,url:e,data:r}))}})),t.exports=c},function(t,e,r){"use strict";var n=r(2);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,r){"use strict";var n=r(2),i=r(17),s=r(5),o=r(6),a=r(25),c=r(26);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.baseURL&&!a(t.url)&&(t.url=c(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return u(t),e.data=i(e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(u(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e,r){return n.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e){var r,n,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var c,u=[],f=!1,h=-1;function d(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&l())}function l(){if(!f){var t=a(d);f=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function b(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||f||a(l)},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=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},function(t,e,r){"use strict";var n=r(8);t.exports=function(t,e,r){var i=r.config.validateStatus;!i||i(r.status)?t(r):e(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,i){return t.config=e,r&&(t.code=r),t.request=n,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,r){"use strict";var n=r(2),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,s,o={};return t?(n.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=n.trim(t.substr(0,s)).toLowerCase(),r=n.trim(t.substr(s+1)),e){if(o[e]&&i.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([r]):o[e]?o[e]+", "+r:r}})),o):o}},function(t,e,r){"use strict";var n=r(2);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(2);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,i,s,o){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(10);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={MainNet:{Name:"MainNet",ProtocolConfiguration:{Magic:7630401,AddressVersion:23,StandbyValidators:["03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c","02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093","03b8d9d5771d8f513aa0869b9cc8d50986403b78c6da36890638c3d46a5adce04a","02ca0e27697b9c248f6f16e085fd0061e26f44da85b58ee835c110caa5ec3ba554","024c7b7fb6c310fccf1ba33b082519d82964ea93868d676662d4a59ad548df0e7d","02aaec38470f6aad0042c6e877cfd8087d2676b0f516fddd362801b9bd3936399e","02486fd15702c4490a26703112a5cc1d0923fd697a33406bd5a1c00e0013b09a70"],SeedList:["seed1.neo.org:10333","seed2.neo.org:10333","seed3.neo.org:10333","seed4.neo.org:10333","seed5.neo.org:10333"],SystemFee:{EnrollmentTransaction:1e3,IssueTransaction:500,PublishTransaction:500,RegisterTransaction:1e4}},ExtraConfiguration:{neonDB:"http://api.wallet.cityofzion.io",neoscan:"https://api.neoscan.io/api/main_net"}},TestNet:{Name:"TestNet",ProtocolConfiguration:{Magic:1953787457,AddressVersion:23,StandbyValidators:["0327da12b5c40200e9f65569476bbff2218da4f32548ff43b6387ec1416a231ee8","026ce35b29147ad09e4afe4ec4a7319095f08198fa8babbe3c56e970b143528d22","0209e7fd41dfb5c2f8dc72eb30358ac100ea8c72da18847befe06eade68cebfcb9","039dafd8571a641058ccc832c5e2111ea39b09c0bde36050914384f7a48bce9bf9","038dddc06ce687677a53d54f096d2591ba2302068cf123c1f2d75c2dddc5425579","02d02b1873a0863cd042cc717da31cea0d7cf9db32b74d4c72c01b0011503e2e22","034ff5ceeac41acf22cd5ed2da17a6df4dd8358fcb2bfb1a43208ad0feaab2746b"],SeedList:["seed1.neo.org:20333","seed2.neo.org:20333","seed3.neo.org:20333","seed4.neo.org:20333","seed5.neo.org:20333"],SystemFee:{EnrollmentTransaction:10,IssueTransaction:5,PublishTransaction:5,RegisterTransaction:100}},ExtraConfiguration:{neonDB:"http://testnet-api.wallet.cityofzion.io",neoscan:"https://neoscan-testnet.io/api/test_net"}},CozNet:{Name:"CozNet",ProtocolConfiguration:{Magic:1010102,AddressVersion:23,StandbyValidators:["032d9e51c7d48b0f5cc63d63deb89767685832cf69eb7113900290f217ae0504ee","022a5b7ccf03166a95e1750f0c350c734c34fe7aac66622eecdb5a529d2e69b1df","03c478d43271c297696ee3ab5a7946ee60287015c7dca6cba867819c7f271bc4ea","0393ef777d01fb60eef1da3474b975c6a393b464bcfe588e2ad7dbc4dbdfa2c244"],SeedList:["188.68.34.29:10330","188.68.34.29:10332","188.68.34.29:10334","188.68.34.29:10336"],SystemFee:{EnrollmentTransaction:1e3,IssueTransaction:500,PublishTransaction:500,RegisterTransaction:1e4}},ExtraConfiguration:{neoscan:"https://coz.neoscan-testnet.io/api/main_net"}}}},function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"instance",(function(){return _})),r.d(n,"getRPCEndpoint",(function(){return p})),r.d(n,"getBalance",(function(){return g})),r.d(n,"getClaims",(function(){return v})),r.d(n,"getMaxClaimAmount",(function(){return y}));var i={};r.r(i),r.d(i,"instance",(function(){return H})),r.d(i,"getRPCEndpoint",(function(){return k})),r.d(i,"getBalance",(function(){return O})),r.d(i,"getClaims",(function(){return R})),r.d(i,"getMaxClaimAmount",(function(){return C})),r.d(i,"getTransactionHistory",(function(){return B})),r.d(i,"getHeight",(function(){return N}));var s={};r.r(s),r.d(s,"instance",(function(){return X})),r.d(s,"getRPCEndpoint",(function(){return F})),r.d(s,"getBalance",(function(){return q})),r.d(s,"getClaims",(function(){return V})),r.d(s,"getMaxClaimAmount",(function(){return K})),r.d(s,"getHeight",(function(){return $})),r.d(s,"getTransactionHistory",(function(){return W}));var o={};r.r(o),r.d(o,"neoCli",(function(){return n})),r.d(o,"neoscan",(function(){return s})),r.d(o,"neonDB",(function(){return i})),r.d(o,"checkProperty",(function(){return Z})),r.d(o,"modifyTransactionForEmptyTransaction",(function(){return Q})),r.d(o,"extractDump",(function(){return et})),r.d(o,"getVerificationSignatureForSmartContract",(function(){return rt})),r.d(o,"createClaimTx",(function(){return it})),r.d(o,"createContractTx",(function(){return st})),r.d(o,"createInvocationTx",(function(){return ot})),r.d(o,"createStateTx",(function(){return at})),r.d(o,"fillUrl",(function(){return lt})),r.d(o,"fillBalance",(function(){return pt})),r.d(o,"fillSigningFunction",(function(){return bt})),r.d(o,"fillClaims",(function(){return mt})),r.d(o,"addAttributeForMintToken",(function(){return vt})),r.d(o,"addSignatureForMintToken",(function(){return yt})),r.d(o,"sendTx",(function(){return St})),r.d(o,"applyTxToBalance",(function(){return xt})),r.d(o,"signTx",(function(){return ft})),r.d(o,"signWithPrivateKey",(function(){return ht})),r.d(o,"addAttributeIfExecutingAsSmartContract",(function(){return Mt})),r.d(o,"addSignatureIfExecutingAsSmartContract",(function(){return Et})),r.d(o,"sendAsset",(function(){return It})),r.d(o,"claimGas",(function(){return kt})),r.d(o,"doInvoke",(function(){return Ot})),r.d(o,"setupVote",(function(){return Rt})),r.d(o,"makeIntent",(function(){return Ct}));var a=r(0),c=r(1),u=r.n(c),f=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const h=a.logging.default("api"),d=a.CONST.DEFAULT_REQ;function l(t){throw new Error(`Encounter error code ${t.code}: ${t.message}`)}function p(t){return t}function b(t){return{index:t.n,txid:t.txid,value:t.value}}function m(t){return{claim:t.unclaimed,txid:t.txid,index:t.n,value:t.value,start:t.start_height,end:t.end_height}}function g(t,e){return f(this,void 0,void 0,(function*(){const r=(yield u.a.post(t,Object.assign({},d,{method:"getunspents",params:[e]}))).data;r.error&&l(r.error);const n=new a.wallet.Balance({net:t,address:r.result.address});for(const t of r.result.balance)0!==t.amount&&(t.unspent.length>0?n.addAsset(t.asset_symbol,{unspent:t.unspent.map(b)}):n.addToken(t.asset_symbol,t.amount));return h.info(`Retrieved Balance for ${e} from neonDB ${t}`),n}))}function v(t,e){return f(this,void 0,void 0,(function*(){const r=(yield u.a.post(t,Object.assign({},d,{method:"getclaimable",params:[e]}))).data;return r.error&&l(r.error),new a.wallet.Claims({net:t,address:r.result.address,claims:r.result.claimable.map(m)})}))}function y(t,e){return f(this,void 0,void 0,(function*(){const r=(yield u.a.post(t,Object.assign({},d,{method:"getunclaimed",params:[e]}))).data;return r.error&&l(r.error),new a.u.Fixed8(r.result.unclaimed).div(1e8)}))}const w=a.logging.default("api");var _=class{get name(){return`NeoCli[${this.url}]`}constructor(t){this.url=t,this.rpc=new a.rpc.RPCClient(t),w.info(`Created NeoCli Provider: ${this.url}`)}getRPCEndpoint(t){return Promise.resolve(this.url)}getBalance(t){return g(this.url,t)}getClaims(t){return v(this.url,t)}getMaxClaimAmount(t){return y(this.url,t)}getHeight(){return this.rpc.getBlockCount()}getTransactionHistory(t){throw new Error("Method not implemented.")}};const S={httpsOnly:!1};var x=S,A=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function M(t){return t.filter(t=>t.url.includes("https://"))}function E(t){return A(this,void 0,void 0,(function*(){const e=t.map(t=>new a.rpc.RPCClient(t.url));return yield function(t){return A(this,void 0,void 0,(function*(){try{const e=yield Promise.all(t.map(t=>t.then(t=>Promise.reject(t),t=>t)));return yield Promise.reject(e)}catch(t){return t}}))}(e.map(t=>t.ping().then(e=>t.net)))}))}function T(t,e=1){if(0===t.length)throw new Error("No eligible nodes found!");const r=t.slice().sort((t,e)=>e.height-t.height),n=r[0].height-e;return r.filter(t=>t.height>=n)}var P=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const I=a.logging.default("api");function k(t){return P(this,void 0,void 0,(function*(){let e=(yield u.a.get(t+"/v2/network/nodes")).data.nodes.filter(t=>t.status).map(t=>({height:t.block_height,url:t.url}));S.httpsOnly&&(e=M(e));const r=T(e);return yield E(r)}))}function O(t,e){return P(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v2/address/balance/"+e)).data,n=new a.wallet.Balance({net:t,address:e});return r.NEO.balance>0&&n.addAsset("NEO",r.NEO),r.GAS.balance>0&&n.addAsset("GAS",r.GAS),I.info(`Retrieved Balance for ${e} from neonDB ${t}`),n}))}function R(t,e){return P(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v2/address/claims/"+e)).data.claims.map(t=>({claim:new a.u.Fixed8(t.claim||0).div(1e8),index:t.index,txid:t.txid,start:t.start||0,end:t.end||0,value:t.value}));return I.info(`Retrieved Claims for ${e} from neonDB ${t}`),new a.wallet.Claims({net:t,address:e,claims:r})}))}function C(t,e){return P(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v2/address/claims/"+e)).data;return I.info(`Retrieved maximum amount of gas claimable after spending all NEO for ${e} from neonDB ${t}`),new a.u.Fixed8(r.total_claim+r.total_unspent_claim).div(1e8)}))}function B(t,e){return P(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v2/address/history/"+e)).data;return I.info(`Retrieved History for ${e} from neonDB ${t}`),r.history.map(t=>({change:{NEO:new a.u.Fixed8(t.NEO||0),GAS:new a.u.Fixed8(t.GAS||0)},blockHeight:t.block_index,txid:t.txid}))}))}function N(t){return P(this,void 0,void 0,(function*(){const e=yield u.a.get(t+"/v2/block/height");return parseInt(e.data.block_height,10)}))}var L=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const j=a.logging.default("api");var H=class{constructor(t){this.rpc=null,this.cacheExpiry=null,a.settings.networks[t]&&a.settings.networks[t].extra.neonDB?this.url=a.settings.networks[t].extra.neonDB:this.url=t,j.info(`Created NeonDB Provider: ${this.url}`)}get name(){return`NeonDB[${this.url}]`}getRPCEndpoint(t=!1){return L(this,void 0,void 0,(function*(){if(!t&&this.rpc&&this.cacheExpiry&&this.cacheExpiry<new Date){if((yield this.rpc.ping())<=1e3)return this.rpc.net}const e=yield k(this.url);return this.rpc=new a.rpc.RPCClient(e),this.cacheExpiry=new Date((new Date).getTime()+3e5),this.rpc.net}))}getBalance(t){return O(this.url,t)}getClaims(t){return R(this.url,t)}getMaxClaimAmount(t){return C(this.url,t)}getHeight(){return N(this.url)}getTransactionHistory(t){return B(this.url,t)}},U=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const D=a.logging.default("api");function z(t,e,r){const n=t.filter(t=>t.asset===r).reduce((t,e)=>t.add(e.value),new a.u.Fixed8(0));return e.filter(t=>t.asset===r).reduce((t,e)=>t.add(e.value),new a.u.Fixed8(0)).minus(n)}function F(t){return U(this,void 0,void 0,(function*(){let e=(yield u.a.get(t+"/v1/get_all_nodes")).data;S.httpsOnly&&(e=M(e));const r=T(e);return yield E(r)}))}function q(t,e){return U(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v1/get_balance/"+e)).data;if("not found"===r.address&&null===r.balance)return new a.wallet.Balance({net:t,address:e});const n=new a.wallet.Balance({net:t,address:r.address}),i=r.balance;for(const t of i)t.amount>0&&t.unspent.length>0?n.addAsset(t.asset,{unspent:(s=t.unspent,s.map(t=>({index:t.n,txid:t.txid,value:t.value})))}):n.addToken(t.asset,t.amount);var s;return D.info(`Retrieved Balance for ${e} from neoscan ${t}`),n}))}function V(t,e){return U(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v1/get_claimable/"+e)).data;if("not found"===r.address&&null===r.claimable)return new a.wallet.Claims({address:r.address});const n=r.claimable.map(t=>({start:t.start_height,end:t.end_height,index:t.n,claim:t.unclaimed,txid:t.txid,value:t.value}));return D.info(`Retrieved Claims for ${e} from neoscan ${t}`),new a.wallet.Claims({net:t,address:r.address,claims:n})}))}function K(t,e){return U(this,void 0,void 0,(function*(){const r=(yield u.a.get(t+"/v1/get_unclaimed/"+e)).data;return D.info(`Retrieved maximum amount of gas claimable after spending all NEO for ${e} from neoscan ${t}`),new a.u.Fixed8(r.unclaimed||0)}))}function $(t){return U(this,void 0,void 0,(function*(){return(yield u.a.get(t+"/v1/get_height")).data.height}))}function W(t,e){return U(this,void 0,void 0,(function*(){const r=yield u.a.get(t+"/v1/get_last_transactions_by_address/"+e);r.data;return D.info(`Retrieved History for ${e} from neoscan ${t}`),function(t,e){return t.map(t=>{const r=t.vin.filter(t=>t.address_hash===e).map(t=>({asset:t.asset,value:t.value})),n=t.vouts.filter(t=>t.address_hash===e).map(t=>({asset:t.asset,value:t.value})),i={NEO:z(r,n,a.CONST.ASSET_ID.NEO),GAS:z(r,n,a.CONST.ASSET_ID.GAS)};return{txid:t.txid,blockHeight:t.block_height,change:i}})}(r.data,e)}))}var Y=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const G=a.logging.default("api");var X=class{constructor(t){this.rpc=null,this.cacheExpiry=null,a.settings.networks[t]&&a.settings.networks[t].extra.neoscan?this.url=a.settings.networks[t].extra.neoscan:this.url=t,G.info(`Created Neoscan Provider: ${this.url}`)}get name(){return`Neoscan[${this.url}]`}getRPCEndpoint(){return Y(this,void 0,void 0,(function*(){if(this.rpc&&this.cacheExpiry&&this.cacheExpiry<new Date){if((yield this.rpc.ping())<=1e3)return this.rpc.net}const t=yield F(this.url);return this.rpc=new a.rpc.RPCClient(t),this.cacheExpiry=new Date((new Date).getTime()+3e5),this.rpc.net}))}getBalance(t){return q(this.url,t)}getClaims(t){return V(this.url,t)}getMaxClaimAmount(t){return K(this.url,t)}getHeight(){return $(this.url)}getTransactionHistory(t){return W(this.url,t)}},J=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function Z(t,...e){for(const r of e)if(!t.hasOwnProperty(r)||null===t[r]||void 0===t[r])throw new ReferenceError(`Property not found: ${r}`)}function Q(t){return J(this,void 0,void 0,(function*(){return 0===t.tx.inputs.length&&0===t.tx.outputs.length&&(t.tx.addAttribute(a.tx.TxAttrUsage.Script,a.u.reverseHex(a.wallet.getScriptHashFromAddress(t.account.address))),t.tx.addRemark(Date.now().toString()+a.u.ab2hexstring(a.u.generateRandomArray(4)))),t}))}const tt=["privateKey"];function et(t){const e=Object.assign({},t);for(const r of Object.keys(t))tt.indexOf(r)>=0&&delete e[r];return e}function rt(t,e){return J(this,void 0,void 0,(function*(){const r=yield a.rpc.Query.getContractState(e).execute(t),{parameters:n}=r.result,i=new a.tx.Witness({invocationScript:"00".repeat(n.length),verificationScript:""});return i.scriptHash=e,i}))}var nt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function it(t){return nt(this,void 0,void 0,(function*(){return Z(t,"claims"),t.tx=new a.tx.ClaimTransaction(t.override),t.tx.addClaims(t.claims),t}))}function st(t){return nt(this,void 0,void 0,(function*(){return Z(t,"balance","intents"),t.tx=new a.tx.ContractTransaction(Object.assign({outputs:t.intents},t.override)),t.tx.calculate(t.balance,void 0,t.fees),t}))}function ot(t){return nt(this,void 0,void 0,(function*(){Z(t,"script");const e="object"==typeof t.script?a.sc.createScript(t.script):t.script;return t.tx=new a.tx.InvocationTransaction(Object.assign({outputs:t.intents||[],script:e,gas:t.gas||0},t.override)),t.tx.calculate(t.balance||new a.wallet.Balance,void 0,t.fees),t}))}function at(t){return nt(this,void 0,void 0,(function*(){const e=[new a.tx.StateDescriptor({type:a.tx.StateType.Account,key:a.u.reverseHex(t.account.scriptHash),field:"Votes",value:a.u.int2hex(t.candidateKeys.length)+t.candidateKeys.join("")})];return t.tx=new a.tx.StateTransaction({descriptors:e}),t}))}var ct=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function ut(t,e){t.scripts.push(a.tx.Witness.deserialize(e))}function ft(t){return ct(this,void 0,void 0,(function*(){Z(t,"signingFunction","tx");const e=yield t.signingFunction(t.tx.serialize(!1),t.account.publicKey);return e instanceof Array?e.forEach(e=>{ut(t.tx,e)}):ut(t.tx,e),t}))}function ht(t){const e=new a.wallet.Account(t).publicKey;return(r,n)=>ct(this,void 0,void 0,(function*(){const i=a.wallet.sign(r,t);return a.tx.Witness.fromSignature(i,n||e).serialize()}))}var dt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function lt(t){return dt(this,void 0,void 0,(function*(){return t.url?t:(t.url=yield t.api.getRPCEndpoint(),t)}))}function pt(t){return dt(this,void 0,void 0,(function*(){return t.balance instanceof a.wallet.Balance||(t.balance=yield t.api.getBalance(t.account.address)),t}))}function bt(t){return dt(this,void 0,void 0,(function*(){if(!t.signingFunction){if(!t.account)throw new Error("No account found!");t.signingFunction=ht(t.account.privateKey)}return t}))}function mt(t){return dt(this,void 0,void 0,(function*(){if(t.claims instanceof a.wallet.Claims||(t.claims=yield t.api.getClaims(t.account.address)),!t.claims.claims||0===t.claims.claims.length)throw new Error("No Claims found");return t}))}var gt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function vt(t){return gt(this,void 0,void 0,(function*(){return"object"==typeof t.script&&"mintTokens"===t.script.operation&&t.script.scriptHash&&t.tx.addAttribute(a.tx.TxAttrUsage.Script,a.u.reverseHex(t.script.scriptHash)),t}))}function yt(t){return gt(this,void 0,void 0,(function*(){if("object"==typeof t.script&&"mintTokens"===t.script.operation&&t.script.scriptHash){const e=yield rt(t.url,t.script.scriptHash);t.tx.addWitness(e)}return t}))}var wt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const _t=a.logging.default("api");function St(t){return wt(this,void 0,void 0,(function*(){Z(t,"tx","url");const e=yield a.rpc.Query.sendRawTransaction(t.tx).execute(t.url);return!0===e.result?e.txid=t.tx.hash:_t.error(`Transaction failed for ${t.account.address}: ${t.tx.serialize()}`),Object.assign(t,{response:e})}))}function xt(t){return wt(this,void 0,void 0,(function*(){return t.response&&t.response.result&&t.balance&&t.balance.applyTx(t.tx,!1),t}))}var At=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};function Mt(t){return At(this,void 0,void 0,(function*(){return t.sendingFromSmartContract?(t.tx.addAttribute(a.tx.TxAttrUsage.Script,a.u.reverseHex(t.sendingFromSmartContract)),t):t}))}function Et(t){return At(this,void 0,void 0,(function*(){if(!t.sendingFromSmartContract)return t;const e=yield rt(t.url,t.sendingFromSmartContract);return t.tx.addWitness(e),t}))}var Tt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const Pt=a.logging.default("api");function It(t){return Tt(this,void 0,void 0,(function*(){return bt(t).then(lt).then(pt).then(st).then(Mt).then(ft).then(Et).then(St).then(xt).catch(e=>{const r=et(t);throw Pt.error(`sendAsset failed with: ${e.message}. Dumping config`,r),e})}))}function kt(t){return Tt(this,void 0,void 0,(function*(){return bt(t).then(lt).then(mt).then(it).then(Mt).then(ft).then(Et).then(St).catch(e=>{const r=et(t);throw Pt.error(`claimGas failed with: ${e.message}. Dumping config`,r),e})}))}function Ot(t){return Tt(this,void 0,void 0,(function*(){return bt(t).then(lt).then(pt).then(ot).then(Mt).then(vt).then(Q).then(ft).then(Et).then(yt).then(St).then(xt).catch(e=>{const r=et(t);throw Pt.error(`doinvoke failed with: ${e.message}. Dumping config`,r),e})}))}function Rt(t){return Tt(this,void 0,void 0,(function*(){return bt(t).then(lt).then(pt).then(at).then(Mt).then(Q).then(ft).then(Et).then(St).then(xt).catch(e=>{const r=et(t);throw Pt.error(`setupVote failed with: ${e.message}. Dumping config`,r),e})}))}function Ct(t,e){const r=new a.wallet.Account(e);return Object.keys(t).map(e=>new a.tx.TransactionOutput({assetId:a.CONST.ASSET_ID[e],value:t[e],scriptHash:r.scriptHash}))}r.d(e,"neoCli",(function(){return n})),r.d(e,"neoscan",(function(){return s})),r.d(e,"neonDB",(function(){return i})),r.d(e,"checkProperty",(function(){return Z})),r.d(e,"modifyTransactionForEmptyTransaction",(function(){return Q})),r.d(e,"extractDump",(function(){return et})),r.d(e,"getVerificationSignatureForSmartContract",(function(){return rt})),r.d(e,"createClaimTx",(function(){return it})),r.d(e,"createContractTx",(function(){return st})),r.d(e,"createInvocationTx",(function(){return ot})),r.d(e,"createStateTx",(function(){return at})),r.d(e,"fillUrl",(function(){return lt})),r.d(e,"fillBalance",(function(){return pt})),r.d(e,"fillSigningFunction",(function(){return bt})),r.d(e,"fillClaims",(function(){return mt})),r.d(e,"addAttributeForMintToken",(function(){return vt})),r.d(e,"addSignatureForMintToken",(function(){return yt})),r.d(e,"sendTx",(function(){return St})),r.d(e,"applyTxToBalance",(function(){return xt})),r.d(e,"signTx",(function(){return ft})),r.d(e,"signWithPrivateKey",(function(){return ht})),r.d(e,"addAttributeIfExecutingAsSmartContract",(function(){return Mt})),r.d(e,"addSignatureIfExecutingAsSmartContract",(function(){return Et})),r.d(e,"sendAsset",(function(){return It})),r.d(e,"claimGas",(function(){return kt})),r.d(e,"doInvoke",(function(){return Ot})),r.d(e,"setupVote",(function(){return Rt})),r.d(e,"makeIntent",(function(){return Ct}));e.default=function(t){return function(t,e){for(const r in e)r in t||Object.defineProperty(t,r,{get:()=>e[r],set(t){e[r]=t}})}(t.settings,x),Object.assign({},t,{api:o})}},function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"name",(function(){return a})),r.d(n,"symbol",(function(){return c})),r.d(n,"decimals",(function(){return u})),r.d(n,"totalSupply",(function(){return f})),r.d(n,"balanceOf",(function(){return h})),r.d(n,"transfer",(function(){return d}));var i={};r.r(i),r.d(i,"abi",(function(){return n})),r.d(i,"getToken",(function(){return y})),r.d(i,"getTokens",(function(){return w})),r.d(i,"getTokenBalance",(function(){return g})),r.d(i,"getTokenBalances",(function(){return v}));var s=r(0);function o(t){return s.u.reverseHex(s.wallet.getScriptHashFromAddress(t))}function a(t){return(e=new s.sc.ScriptBuilder)=>e.emitAppCall(t,"name")}function c(t){return(e=new s.sc.ScriptBuilder)=>e.emitAppCall(t,"symbol")}function u(t){return(e=new s.sc.ScriptBuilder)=>e.emitAppCall(t,"decimals")}function f(t){return(e=new s.sc.ScriptBuilder)=>e.emitAppCall(t,"totalSupply")}function h(t,e){return(r=new s.sc.ScriptBuilder)=>{const n=o(e);return r.emitAppCall(t,"balanceOf",[n])}}function d(t,e,r,n){return(i=new s.sc.ScriptBuilder)=>{const a=o(e),c=o(r),u=new s.u.Fixed8(n).toRawNumber();return i.emitAppCall(t,"transfer",[a,c,s.sc.ContractParam.integer(u.toString())])}}var l=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const p=s.logging.default("nep5"),b=s.rpc.buildParser(s.rpc.StringParser,s.rpc.StringParser,s.rpc.IntegerParser,s.rpc.Fixed8Parser),m=s.rpc.buildParser(s.rpc.StringParser,s.rpc.StringParser,s.rpc.IntegerParser,s.rpc.Fixed8Parser,s.rpc.Fixed8Parser);function g(t,e,r){return l(this,void 0,void 0,(function*(){const n=new s.sc.ScriptBuilder;u(e)(n),h(e,r)(n);const i=n.str;try{const e=yield s.rpc.Query.invokeScript(i).execute(t),r=s.rpc.IntegerParser(e.result.stack[0]);return s.rpc.Fixed8Parser(e.result.stack[1]).mul(Math.pow(10,8-r))}catch(t){throw p.error(`getTokenBalance failed with : ${t.message}`),t}}))}function v(t,e,r){return l(this,void 0,void 0,(function*(){const n=s.u.reverseHex(s.wallet.getScriptHashFromAddress(r)),i=new s.sc.ScriptBuilder;e.forEach(t=>{i.emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"balanceOf",[n])});const o=yield s.rpc.Query.invokeScript(i.str).execute(t),a={};if(!o||!o.result||!o.result.stack||o.result.stack.length!==3*e.length)throw new Error("Stack returned was invalid");try{for(let t=0;t<o.result.stack.length;t+=3)try{const e=s.rpc.StringParser(o.result.stack[t]),r=s.rpc.IntegerParser(o.result.stack[t+1]);a[e]=s.rpc.Fixed8Parser(o.result.stack[t+2]).mul(Math.pow(10,8-r))}catch(t){throw p.error(`single call in getTokenBalances failed with : ${t.message}`),t}return a}catch(t){throw p.error(`getTokenBalances failed with : ${t.message}`),t}}))}function y(t,e,r){return l(this,void 0,void 0,(function*(){const n=r?m:b,i=new s.sc.ScriptBuilder;a(e)(i),c(e)(i),u(e)(i),f(e)(i),r&&h(e,r)(i);const o=i.str;try{const e=yield s.rpc.Query.invokeScript(o).parseWith(n).execute(t),i={name:e[0],symbol:e[1],decimals:e[2],totalSupply:e[3].div(Math.pow(10,8-e[2])).toNumber()};return r&&(i.balance=e[4].div(Math.pow(10,8-e[2]))),i}catch(t){throw p.error(`getToken failed with : ${t.message}`),t}}))}function w(t,e,r){return l(this,void 0,void 0,(function*(){try{const n=new s.sc.ScriptBuilder;e.forEach(t=>{if(r){const e=s.u.reverseHex(s.wallet.getScriptHashFromAddress(r));n.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply").emitAppCall(t,"balanceOf",[e])}else n.emitAppCall(t,"name").emitAppCall(t,"symbol").emitAppCall(t,"decimals").emitAppCall(t,"totalSupply")});const i=yield s.rpc.Query.invokeScript(n.str).execute(t),o=[],a=r?5:4;for(let t=0;t<i.result.stack.length;t+=a){const e=s.rpc.StringParser(i.result.stack[t]),n=s.rpc.StringParser(i.result.stack[t+1]),a=s.rpc.IntegerParser(i.result.stack[t+2]),c={name:e,symbol:n,decimals:a,totalSupply:s.rpc.Fixed8Parser(i.result.stack[t+3]).dividedBy(Math.pow(10,a-s.rpc.IntegerParser(i.result.stack[t+2]))).toNumber(),balance:r?s.rpc.Fixed8Parser(i.result.stack[t+4]).dividedBy(Math.pow(10,a-s.rpc.IntegerParser(i.result.stack[t+2]))):void 0};c.balance||delete c.balance,o.push(c)}return o}catch(t){throw p.error(`getTokens failed with : ${t.message}`),t}}))}r.d(e,"abi",(function(){return n})),r.d(e,"getToken",(function(){return y})),r.d(e,"getTokens",(function(){return w})),r.d(e,"getTokenBalance",(function(){return g})),r.d(e,"getTokenBalances",(function(){return v}));e.default=function(t){return Object.assign({},t,{nep5:i})}}])}));
34//# sourceMappingURL=browser.js.map
\No newline at end of file