From 8e04f9b41e090d3b8266e577f5561e03ce95c4b2 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 2 Sep 2016 13:52:53 -0300 Subject: [PATCH] v4.2 --- bitcore-wallet-client.js | 21 ++++++++++++++++++++- bitcore-wallet-client.min.js | 16 ++++++++-------- package.json | 2 +- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/bitcore-wallet-client.js b/bitcore-wallet-client.js index b9f85849..425c3077 100644 --- a/bitcore-wallet-client.js +++ b/bitcore-wallet-client.js @@ -1076,6 +1076,25 @@ API.prototype.getKeys = function(password) { return this.credentials.getKeys(password); }; + +/** + * Checks is password is valid + * Returns null (keys not encrypted), true or false. + * + * @param password + */ +API.prototype.checkPassword = function(password) { + if (!this.isPrivKeyEncrypted()) return; + + try { + var keys = this.getKeys(password); + return !!keys.xPrivKey; + } catch (e) { + return false; + }; +}; + + /** * Can this credentials sign a transaction? * (Only returns fail on a 'proxy' setup for airgapped operation) @@ -123395,7 +123414,7 @@ module.exports={ "name": "bitcore-wallet-client", "description": "Client for bitcore-wallet-service", "author": "BitPay Inc", - "version": "4.1.0", + "version": "4.2.0", "license": "MIT", "keywords": [ "bitcoin", diff --git a/bitcore-wallet-client.min.js b/bitcore-wallet-client.min.js index 8285ab3a..ae96ac1f 100644 --- a/bitcore-wallet-client.min.js +++ b/bitcore-wallet-client.min.js @@ -1,10 +1,10 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0&&(c.lastNotificationId=g.last(d).id),g.each(d,function(a){c.emit("notification",a)}),b())})},e.prototype._initNotifications=function(a){var b=this;a=a||{};var c=a.notificationIntervalSeconds||5;b.notificationsIntervalId=setInterval(function(){b._fetchLatestNotifications(c,function(a){a&&(a instanceof y.NOT_FOUND||a instanceof y.NOT_AUTHORIZED)&&b._disposeNotifications()})},1e3*c)},e.prototype._disposeNotifications=function(){var a=this;a.notificationsIntervalId&&(clearInterval(a.notificationsIntervalId),a.notificationsIntervalId=null)},e.prototype.setNotificationsInterval=function(a){var b=this;b._disposeNotifications(),a>0&&b._initNotifications({notificationIntervalSeconds:a})},e._encryptMessage=function(a,b){return a?s.encryptMessage(a,b):null},e._decryptMessage=function(a,b){if(!a)return"";try{return s.decryptMessage(a,b)}catch(c){return""}},e.prototype._processTxNotes=function(a){var b=this;if(a){var c=b.credentials.sharedEncryptingKey;g.each([].concat(a),function(a){a.encryptedBody=a.body,a.body=e._decryptMessage(a.body,c),a.encryptedEditedByName=a.editedByName,a.editedByName=e._decryptMessage(a.editedByName,c)})}},e.prototype._processTxps=function(a){var b=this;if(a){var c=b.credentials.sharedEncryptingKey;g.each([].concat(a),function(a){a.encryptedMessage=a.message,a.message=e._decryptMessage(a.message,c)||null,a.creatorName=e._decryptMessage(a.creatorName,c),g.each(a.actions,function(a){a.copayerName=e._decryptMessage(a.copayerName,c),a.comment=e._decryptMessage(a.comment,c)}),g.each(a.outputs,function(a){a.encryptedMessage=a.message,a.message=e._decryptMessage(a.message,c)||null}),a.hasUnconfirmedInputs=g.any(a.inputs,function(a){return 0==a.confirmations}),b._processTxNotes(a.note)})}},e._parseError=function(a){if(a){if(g.isString(a))try{a=JSON.parse(a)}catch(b){a={error:a}}var c;return a.code?y[a.code]?(c=new y[a.code],a.message&&(c.message=a.message)):c=new Error(a.code+": "+a.message):c=new Error(a.error||a),u.error(c),c}},e._signRequest=function(a,b,c,d){var e=[a.toLowerCase(),b,JSON.stringify(c)].join("|");return s.signMessage(e,d)},e.prototype.seedFromRandom=function(a){h.checkArgument(arguments.length<=1,"DEPRECATED: only 1 argument accepted."),h.checkArgument(g.isUndefined(a)||g.isObject(a),"DEPRECATED: argument should be an options object."),a=a||{},this.credentials=v.create(a.network||"livenet")};var A;e.prototype.validateKeyDerivation=function(a,b){function c(a,b){var c="m/0/0",d="Lorem ipsum dolor sit amet, ne amet urbanitas percipitur vim, libris disputando his ne, et facer suavitate qui. Ei quidam laoreet sea. Cu pro dico aliquip gubergren, in mundi postea usu. Ad labitur posidonium interesset duo, est et doctus molestie adipiscing.",e=a.derive(c).privateKey,f=s.signMessage(d,e),g=b.derive(c).publicKey;return s.verifyMessage(d,f,g)}function d(){var a="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",b=m(a).toHDPrivateKey();if("xprv9s21ZrQH143K3GJpoapnV8SFfukcVBSfeCficPSGfubmSFDxo1kuHnLisriDvSnRRuL2Qrg5ggqHKNVpxR86QEC8w35uxmGoggxtQTPvfUu"!=b.toString())return!1;if(b=b.derive("m/44'/0'/0'"),"xprv9xpXFhFpqdQK3TmytPBqXtGSwS3DLjojFhTGht8gwAAii8py5X6pxeBnQ6ehJiyJ6nDjWGJfZ95WxByFXVkDxHXrqu53WCRGypk2ttuqncb"!=b.toString())return!1;var d=l.HDPublicKey.fromString("xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj");return c(b,d)}function e(){var b;try{b=g.getMnemonic()}catch(d){}var e;if(b&&(!g.mnemonicHasPassphrase||a.passphrase)){var f=new m(b);e=f.toHDPrivateKey(a.passphrase,g.network)}e||(e=new l.HDPrivateKey(g.xPrivKey)),e=e.derive(g.getBaseAddressDerivationPath());var h=new l.HDPublicKey(g.xPubKey);return c(e,h)}var f=this;a=a||{};var g=f.credentials,h=!0;A||a.skipDeviceValidation||(h=d(),A=!0);var i=g.canSign()&&!g.isPrivKeyEncrypted()?e():!0;return f.keyDerivationOk=h&&i,b(null,f.keyDerivationOk)},e.prototype.seedFromRandomWithMnemonic=function(a){h.checkArgument(arguments.length<=1,"DEPRECATED: only 1 argument accepted."),h.checkArgument(g.isUndefined(a)||g.isObject(a),"DEPRECATED: argument should be an options object."),a=a||{},this.credentials=v.createWithMnemonic(a.network||"livenet",a.passphrase,a.language||"en",a.account||0)},e.prototype.getMnemonic=function(){return this.credentials.getMnemonic()},e.prototype.mnemonicHasPassphrase=function(){return this.credentials.mnemonicHasPassphrase},e.prototype.clearMnemonic=function(){return this.credentials.clearMnemonic()},e.prototype.seedFromExtendedPrivateKey=function(a,b){b=b||{},this.credentials=v.fromExtendedPrivateKey(a,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)},e.prototype.seedFromMnemonic=function(a,b){h.checkArgument(g.isUndefined(b)||g.isObject(b),"DEPRECATED: second argument should be an options object."),b=b||{},this.credentials=v.fromMnemonic(b.network||"livenet",a,b.passphrase,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)},e.prototype.seedFromExtendedPublicKey=function(a,b,c,d){h.checkArgument(g.isUndefined(d)||g.isObject(d)),d=d||{},this.credentials=v.fromExtendedPublicKey(a,b,c,d.account||0,d.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)},e.prototype["export"]=function(a){h.checkState(this.credentials),a=a||{};var b,c=v.fromObj(this.credentials);return a.noSign&&c.setNoSign(),b=JSON.stringify(c.toObj())},e.prototype["import"]=function(a){try{var b=v.fromObj(JSON.parse(a));this.credentials=b}catch(c){throw new y.INVALID_BACKUP}},e.prototype._import=function(a){h.checkState(this.credentials);var b=this;b.openWallet(function(c,d){return c?c instanceof y.NOT_AUTHORIZED||b.isPrivKeyExternal()?a(c):(u.info("Copayer not found, trying to add access"),void b.addAccess({},function(c){return c?a(new y.WALLET_DOES_NOT_EXIST):void b.openWallet(a)})):a(null,d)})},e.prototype.importFromMnemonic=function(a,b,c){u.debug("Importing from 12 Words"),b=b||{};try{this.credentials=v.fromMnemonic(b.network||"livenet",a,b.passphrase,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)}catch(d){return u.info("Mnemonic error:",d),c(new y.INVALID_BACKUP)}this._import(c)},e.prototype.importFromExtendedPrivateKey=function(a,b,c){u.debug("Importing from Extended Private Key"),c||(c=b,b={},u.warn("DEPRECATED WARN: importFromExtendedPrivateKey should receive 3 parameters."));try{this.credentials=v.fromExtendedPrivateKey(a,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)}catch(d){return u.info("xPriv error:",d),c(new y.INVALID_BACKUP)}this._import(c)},e.prototype.importFromExtendedPublicKey=function(a,b,c,d,e){h.checkArgument(5==arguments.length,"DEPRECATED: should receive 5 arguments"),h.checkArgument(g.isUndefined(d)||g.isObject(d)),h.shouldBeFunction(e),d=d||{},u.debug("Importing from Extended Private Key");try{this.credentials=v.fromExtendedPublicKey(a,b,c,d.account||0,d.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)}catch(f){return u.info("xPriv error:",f),e(new y.INVALID_BACKUP)}this._import(e)},e.prototype.decryptBIP38PrivateKey=function(b,c,e,f){var g,h=a("bip38"),i=new h;try{g=i.decrypt(b,c)}catch(j){return f(new Error("Could not decrypt BIP38 private key",j))}var k=new l.PrivateKey(g),m=k.publicKey.toAddress().toString(),n=new d(m,"ascii"),o=l.crypto.Hash.sha256sha256(n).toString("hex").substring(0,8),p=l.encoding.Base58Check.decode(b).toString("hex").substring(6,14);return o!=p?f(new Error("Incorrect passphrase")):f(null,g)},e.prototype.getBalanceFromPrivateKey=function(a,b){var c=this,a=new l.PrivateKey(a),d=a.publicKey.toAddress();c.getUtxos({addresses:d.toString()},function(a,c){return a?b(a):b(null,g.sum(c,"satoshis"))})},e.prototype.buildTxFromPrivateKey=function(a,b,c,d){var e=this;c=c||{};var a=new l.PrivateKey(a),f=a.publicKey.toAddress();j.waterfall([function(a){e.getUtxos({addresses:f.toString()},function(b,c){return a(b,c)})},function(d,e){if(!g.isArray(d)||0==d.length)return e(new Error("No utxos found"));var f=c.fee||1e4,h=g.sum(d,"satoshis")-f;if(0>=h)return e(new y.INSUFFICIENT_FUNDS);var i;try{var j=l.Address.fromString(b);i=(new l.Transaction).from(d).to(j,h).fee(f).sign(a),i.serialize()}catch(k){return u.error("Could not build transaction from private key",k),e(new y.COULD_NOT_BUILD_TRANSACTION)}return e(null,i)}],d)},e.prototype.openWallet=function(a){h.checkState(this.credentials);var b=this;return b.credentials.isComplete()&&b.credentials.hasWalletInfo()?a(null,!0):void b._doGetRequest("/v2/wallets/?includeExtendedInfo=1",function(c,d){if(c)return a(c);var f=d.wallet;if(b._processStatus(d),!b.credentials.hasWalletInfo()){var h=g.find(f.copayers,{id:b.credentials.copayerId});b.credentials.addWalletInfo(f.id,f.name,f.m,f.n,h.name)}if("complete"!=f.status)return a();if(b.credentials.walletPrivKey){if(!w.checkCopayers(b.credentials,f.copayers))return a(new y.SERVER_COMPROMISED)}else u.warn("Could not verify copayers key (missing wallet Private Key)");return b.credentials.addPublicKeyRing(e._extractPublicKeyRing(f.copayers)),b.emit("walletCompleted",f),a(null,d)})},e.prototype._getHeaders=function(a,b,c){var d={"x-client-version":"bwc-"+x.version};if(this.credentials){var f,g=c._requestPrivKey||this.credentials.requestPrivKey;g&&(delete c._requestPrivKey,f=e._signRequest(a,b,c,g)),d["x-identity"]=this.credentials.copayerId,d["x-signature"]=f}return d},e.prototype._doRequest=function(a,b,c,d){var f=this.baseUrl+b,g={relUrl:this.basePath+b,headers:this._getHeaders(a,b,c),method:a,url:f,body:c,json:!0,withCredentials:!1,timeout:this.timeout};u.debug("Request Args",i.inspect(c,{depth:10})),this.request(g,function(a,b,c){return u.debug(i.inspect(c,{depth:10})),b?200!==b.statusCode?404===b.statusCode?d(new y.NOT_FOUND):b.statusCode?(u.error("HTTP Error:"+b.statusCode),d(c?e._parseError(c):new Error(b.statusCode))):d(new y.CONNECTION_ERROR):'{"error":"read ECONNRESET"}'===c?d(new y.ECONNRESET_ERROR(JSON.parse(c))):d(null,c,b.header):d(new y.CONNECTION_ERROR)})},e.prototype._doPostRequest=function(a,b,c){return this._doRequest("post",a,b,c)},e.prototype._doPutRequest=function(a,b,c){return this._doRequest("put",a,b,c)},e.prototype._doGetRequest=function(a,b){return a+=a.indexOf("?")>0?"&":"?",a+="r="+g.random(1e4,99999),this._doRequest("get",a,{},b)},e.prototype._doDeleteRequest=function(a,b){return this._doRequest("delete",a,{},b)},e._buildSecret=function(a,b,c){g.isString(b)&&(b=l.PrivateKey.fromString(b));var e=new d(a.replace(/-/g,""),"hex"),f=new l.encoding.Base58(e).toString();return g.padRight(f,22,"0")+b.toWIF()+("testnet"==c?"T":"L")},e.parseSecret=function(a){function b(a,b){var c=[];b.push(a.length);for(var d=0;d1?k:null)})})},e.prototype.joinWallet=function(a,b,c,d){var f=this;if(d||(d=c,c={},u.warn("DEPRECATED WARN: joinWallet should receive 4 parameters.")),!f._checkKeyDerivation())return d(new Error("Cannot join wallet"));c=c||{};try{var g=e.parseSecret(a)}catch(h){return d(h)}f.credentials||f.seedFromRandom({network:g.network}),f.credentials.addWalletPrivateKey(g.walletPrivKey.toString()),f._doJoinWallet(g.walletId,g.walletPrivKey,f.credentials.xPubKey,f.credentials.requestPubKey,b,{dryRun:!!c.dryRun},function(a,e){return a?d(a):(c.dryRun||f.credentials.addWalletInfo(e.id,e.name,e.m,e.n,b),d(null,e))})},e.prototype.recreateWallet=function(a){h.checkState(this.credentials),h.checkState(this.credentials.isComplete()),h.checkState(this.credentials.walletPrivKey);var b=this;this.getStatus({includeExtendedInfo:!0},function(c){if(!c)return u.info("Wallet is already created"),a();var d=b.credentials,e=l.PrivateKey.fromString(d.walletPrivKey),f=d.walletId,g=d.derivationStrategy!=r.DERIVATION_STRATEGIES.BIP45,h=s.encryptMessage(d.walletName||"recovered wallet",d.sharedEncryptingKey),i={name:h,m:d.m,n:d.n,pubKey:e.toPublicKey().toString(),network:d.network,id:f,supportBIP44AndP2PKH:g};b._doPostRequest("/v2/wallets/",i,function(c,d){if(c)return c instanceof y.WALLET_ALREADY_EXISTS?b.addAccess({},function(c){return c?a(c):void b.openWallet(function(b){return a(b)})}):a(c);f||(f=d.walletId);var h=1;j.each(b.credentials.publicKeyRing,function(a,c){var d=a.copayerName||"copayer "+h++;b._doJoinWallet(f,e,a.xPubKey,a.requestPubKey,d,{supportBIP44AndP2PKH:g},function(a){return a&&a instanceof y.COPAYER_IN_WALLET?c():c(a)})},a)})})},e.prototype._processWallet=function(a){var b=this,c=b.credentials.sharedEncryptingKey,d=s.decryptMessage(a.name,c);d!=a.name&&(a.encryptedName=a.name),a.name=d,g.each(a.copayers,function(a){var b=s.decryptMessage(a.name,c);b!=a.name&&(a.encryptedName=a.name),a.name=b,g.each(a.requestPubKeys,function(a){if(a.name){var b=s.decryptMessage(a.name,c);b!=a.name&&(a.encryptedName=a.name),a.name=b}})})},e.prototype._processStatus=function(a){function b(a){var b=a.wallet.copayers;if(b){var d=g.find(b,{id:c.credentials.copayerId});if(d&&d.customData){var e;try{e=JSON.parse(s.decryptMessage(d.customData,c.credentials.personalEncryptingKey))}catch(f){u.warn("Could not decrypt customData:",d.customData)}e&&(a.customData=e,!c.credentials.walletPrivKey&&e.walletPrivKey&&c.credentials.addWalletPrivateKey(e.walletPrivKey))}}}var c=this;b(a),c._processWallet(a.wallet),c._processTxps(a.pendingTxps)},e.prototype.getNotifications=function(a,b){h.checkState(this.credentials);var c=this;a=a||{};var d="/v1/notifications/";a.lastNotificationId?d+="?notificationId="+a.lastNotificationId:a.timeSpan&&(d+="?timeSpan="+a.timeSpan),c._doGetRequest(d,function(d,e){if(d)return b(d);var f=g.filter(e,function(b){return a.includeOwn||b.creatorId!=c.credentials.copayerId});return b(null,f)})},e.prototype.getStatus=function(a,b){h.checkState(this.credentials),b||(b=a,a={},u.warn("DEPRECATED WARN: getStatus should receive 2 parameters."));var c=this;a=a||{};var d=[];d.push("includeExtendedInfo="+(a.includeExtendedInfo?"1":"0")),d.push("twoStep="+(a.twoStep?"1":"0")),c._doGetRequest("/v2/wallets/?"+d.join("&"),function(a,d){if(a)return b(a);if("pending"==d.wallet.status){var f=c.credentials;d.wallet.secret=e._buildSecret(f.walletId,f.walletPrivKey,f.network)}return c._processStatus(d),b(a,d)})},e.prototype.getPreferences=function(a){h.checkState(this.credentials),h.checkArgument(a);var b=this;b._doGetRequest("/v1/preferences/",function(b,c){return b?a(b):a(null,c)})},e.prototype.savePreferences=function(a,b){h.checkState(this.credentials),h.checkArgument(b);var c=this;c._doPutRequest("/v1/preferences/",a,b)},e.prototype.fetchPayPro=function(a,b){h.checkArgument(a).checkArgument(a.payProUrl),t.get({url:a.payProUrl,http:this.payProHttp},function(a,c){return a?b(a):b(null,c)})},e.prototype.getUtxos=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete()),a=a||{};var c="/v1/utxos/";a.addresses&&(c+="?"+p.stringify({addresses:[].concat(a.addresses).join(",")})),this._doGetRequest(c,b)},e.prototype._getCreateTxProposalArgs=function(a){var b=this,c=g.cloneDeep(a);return c.message=e._encryptMessage(a.message,this.credentials.sharedEncryptingKey)||null,c.payProUrl=a.payProUrl||null,g.each(c.outputs,function(a){a.message=e._encryptMessage(a.message,b.credentials.sharedEncryptingKey)||null}),c},e.prototype.createTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkState(this.credentials.sharedEncryptingKey),h.checkArgument(a);var c=this,d=c._getCreateTxProposalArgs(a);c._doPostRequest("/v2/txproposals/",d,function(a,e){return a?b(a):(c._processTxps(e),w.checkProposalCreation(d,e,c.credentials.sharedEncryptingKey)?b(null,e):b(new y.SERVER_COMPROMISED))})},e.prototype.publishTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkArgument(a).checkArgument(a.txp),h.checkState(parseInt(a.txp.version)>=3);var c=this,d=s.buildTx(a.txp),e=d.uncheckedSerialize(),f={proposalSignature:s.signMessage(e,c.credentials.requestPrivKey)},g="/v1/txproposals/"+a.txp.id+"/publish/";c._doPostRequest(g,f,function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.createAddress=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;return b||(b=a,a={},u.warn("DEPRECATED WARN: createAddress should receive 2 parameters.")),c._checkKeyDerivation()?(a=a||{},void c._doPostRequest("/v3/addresses/",a,function(a,d){return a?b(a):w.checkAddress(c.credentials,d)?b(null,d):b(new y.SERVER_COMPROMISED)})):b(new Error("Cannot create new address for this wallet"))},e.prototype.getMainAddresses=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;a=a||{};var d=[];a.limit&&d.push("limit="+a.limit),a.reverse&&d.push("reverse=1");var e="";d.length>0&&(e="?"+d.join("&"));var f="/v1/addresses/"+e;c._doGetRequest(f,function(d,e){if(d)return b(d);if(!a.doNotVerify){var f=g.any(e,function(a){return!w.checkAddress(c.credentials,a)});if(f)return b(new y.SERVER_COMPROMISED)}return b(null,e)})},e.prototype.getBalance=function(a,b){b||(b=a,a={},u.warn("DEPRECATED WARN: getBalance should receive 2 parameters."));a=a||{},h.checkState(this.credentials&&this.credentials.isComplete());var c="/v1/balance/";a.twoStep&&(c+="?twoStep=1"),this._doGetRequest(c,b)},e.prototype.getTxProposals=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;c._doGetRequest("/v1/txproposals/",function(d,e){return d?b(d):(c._processTxps(e),void j.every(e,function(b,d){return a.doNotVerify?d(!0):void c.getPayPro(b,function(a,e){var f=w.checkTxProposal(c.credentials,b,{paypro:e});return d(f)})},function(d){if(!d)return b(new y.SERVER_COMPROMISED);var f;return f=a.forAirGapped?{txps:JSON.parse(JSON.stringify(e)),encryptedPkr:a.doNotEncryptPkr?null:s.encryptMessage(JSON.stringify(c.credentials.publicKeyRing),c.credentials.personalEncryptingKey),unencryptedPkr:a.doNotEncryptPkr?JSON.stringify(c.credentials.publicKeyRing):null,m:c.credentials.m,n:c.credentials.n}:e,b(null,f)}))})},e.prototype.getPayPro=function(a,b){var c=this;return!a.payProUrl||this.doNotVerifyPayPro?b():void t.get({url:a.payProUrl,http:c.payProHttp},function(a,c){return a?b(new Error("Cannot check transaction now:"+a)):b(null,c)})},e.prototype.signTxProposal=function(a,b,c){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkArgument(a.creatorId),g.isFunction(b)&&(c=b,b=null);var d=this;if(!a.signatures){if(!d.canSign())return c(new y.MISSING_PRIVATE_KEY);if(d.isPrivKeyEncrypted()&&!b)return c(new y.ENCRYPTED_PRIVATE_KEY)}d.getPayPro(a,function(e,f){if(e)return c(e);var h=w.checkTxProposal(d.credentials,a,{paypro:f});if(!h)return c(new y.SERVER_COMPROMISED);var i=a.signatures;if(g.isEmpty(i))try{i=d._signTxp(a,b)}catch(j){return u.error("Error signing tx",j),c(j)}var k="/v1/txproposals/"+a.id+"/signatures/",l={signatures:i};d._doPostRequest(k,l,function(a,b){return a?c(a):(d._processTxps(b),c(null,b))})})},e.prototype.signTxProposalFromAirGapped=function(a,b,c,d,e){h.checkState(this.credentials);var f=this;if(!f.canSign())throw new y.MISSING_PRIVATE_KEY;if(f.isPrivKeyEncrypted()&&!e)throw new y.ENCRYPTED_PRIVATE_KEY;var i;try{i=JSON.parse(s.decryptMessage(b,f.credentials.personalEncryptingKey))}catch(j){throw new Error("Could not decrypt public key ring")}if(!g.isArray(i)||i.length!=d)throw new Error("Invalid public key ring");if(f.credentials.m=c,f.credentials.n=d,f.credentials.addressType=a.addressType,f.credentials.addPublicKeyRing(i),!w.checkTxProposalSignature(f.credentials,a))throw new Error("Fake transaction proposal");return f._signTxp(a,e)},e.signTxProposalFromAirGapped=function(a,b,c,d,f,h){h=h||{};var i=JSON.parse(c);if(!g.isArray(i)||i.length!=f)throw new Error("Invalid public key ring");var j=new e({baseUrl:"https://bws.example.com/bws/api",verbose:!1});if("xprv"===a.slice(0,4)||"tprv"===a.slice(0,4)){if("xprv"===a.slice(0,4)&&"testnet"==b.network)throw new Error("testnet HD keys must start with tprv");if("tprv"===a.slice(0,4)&&"livenet"==b.network)throw new Error("livenet HD keys must start with xprv");j.seedFromExtendedPrivateKey(a,{account:h.account,derivationStrategy:h.derivationStrategy})}else j.seedFromMnemonic(a,{network:b.network,passphrase:h.passphrase,account:h.account,derivationStrategy:h.derivationStrategy});if(j.credentials.m=d,j.credentials.n=f,j.credentials.addressType=b.addressType,j.credentials.addPublicKeyRing(i),!w.checkTxProposalSignature(j.credentials,b))throw new Error("Fake transaction proposal");return j._signTxp(b)},e.prototype.rejectTxProposal=function(a,b,c){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkArgument(c);var d=this,f="/v1/txproposals/"+a.id+"/rejections/",g={reason:e._encryptMessage(b,d.credentials.sharedEncryptingKey)||""};d._doPostRequest(f,g,function(a,b){return a?c(a):(d._processTxps(b),c(null,b))})},e.prototype.broadcastRawTx=function(a,b){h.checkState(this.credentials),h.checkArgument(b);var c=this;a=a||{};var d="/v1/broadcast_raw/";c._doPostRequest(d,a,function(a,c){return a?b(a):b(null,c)})},e.prototype._doBroadcast=function(a,b){var c=this,d="/v1/txproposals/"+a.id+"/broadcast/";c._doPostRequest(d,{},function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.broadcastTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;c.getPayPro(a,function(d,e){if(e){var f=s.buildTx(a);c._applyAllSignatures(a,f),t.send({http:c.payProHttp,url:a.payProUrl,amountSat:a.amount,refundAddr:a.changeAddress.address,merchant_data:e.merchant_data,rawTx:f.serialize({disableSmallFees:!0,disableLargeFees:!0,disableDustOutputs:!0})},function(d,e,f){return d?b(d):void c._doBroadcast(a,function(a,c){return b(a,c,f)})})}else c._doBroadcast(a,b)})},e.prototype.removeTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d="/v1/txproposals/"+a.id;c._doDeleteRequest(d,function(a){return b(a)})},e.prototype.getTxHistory=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d=[];a&&(a.skip&&d.push("skip="+a.skip),a.limit&&d.push("limit="+a.limit),a.includeExtendedInfo&&d.push("includeExtendedInfo=1"));var e="";d.length>0&&(e="?"+d.join("&"));var f="/v1/txhistory/"+e;c._doGetRequest(f,function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.getTx=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d="/v1/txproposals/"+a;this._doGetRequest(d,function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.startScan=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d={includeCopayerBranches:a.includeCopayerBranches};c._doPostRequest("/v1/addresses/scan",d,function(a){return b(a)})},e.prototype.addAccess=function(a,b){h.checkState(this.credentials&&this.credentials.canSign()),a=a||{};var c=new l.PrivateKey(a.generateNewKey?null:this.credentials.requestPrivKey),d=c.toPublicKey().toString(),e=new l.HDPrivateKey(this.credentials.xPrivKey).derive(this.credentials.getBaseAddressDerivationPath()),f=s.signRequestPubKey(d,e),g=this.credentials.copayerId,i=a.name?s.encryptMessage(a.name,this.credentials.sharedEncryptingKey):null,a={copayerId:g,requestPubKey:d,signature:f,name:i,restrictions:a.restrictions};this._doPutRequest("/v1/copayers/"+g+"/",a,function(a,d){return a?b(a):b(null,d.wallet,c)})},e.prototype.getTxNote=function(a,b){h.checkState(this.credentials);var c=this;a=a||{},c._doGetRequest("/v1/txnotes/"+a.txid+"/",function(a,d){return a?b(a):(c._processTxNotes(d),b(null,d))})},e.prototype.editTxNote=function(a,b){h.checkState(this.credentials),a=a||{},a.body&&(a.body=e._encryptMessage(a.body,this.credentials.sharedEncryptingKey)),this._doPutRequest("/v1/txnotes/"+a.txid+"/",a,function(a,c){return b(a)})},e.prototype.getTxNotes=function(a,b){h.checkState(this.credentials);var c=this;a=a||{};var d=[];g.isNumber(a.minTs)&&d.push("minTs="+a.minTs);var e="";d.length>0&&(e="?"+d.join("&")),c._doGetRequest("/v1/txnotes/"+e,function(a,d){return a?b(a):(c._processTxNotes(d),b(null,d))})},e.prototype.getFiatRate=function(a,b){h.checkState(this.credentials),h.checkArgument(b);var c=this,a=a||{},d=[];a.ts&&d.push("ts="+a.ts),a.provider&&d.push("provider="+a.provider);var e="";d.length>0&&(e="?"+d.join("&")),c._doGetRequest("/v1/fiatrates/"+a.code+"/"+e,function(a,c){return a?b(a):b(null,c)})},e.prototype.pushNotificationsSubscribe=function(a,b){var c="/v1/pushnotifications/subscriptions/";this._doPostRequest(c,a,function(a,c){return a?b(a):b(null,c)})},e.prototype.pushNotificationsUnsubscribe=function(a){var b="/v1/pushnotifications/subscriptions/";this._doDeleteRequest(b,function(b){return a(b?b:null)})},e.prototype.getSendMaxInfo=function(a,b){var c=this,d=[];a=a||{},a.feeLevel&&d.push("feeLevel="+a.feeLevel),a.feePerKb&&d.push("feePerKb="+a.feePerKb),a.excludeUnconfirmedUtxos&&d.push("excludeUnconfirmedUtxos=1"),a.returnInputs&&d.push("returnInputs=1");var e="";d.length>0&&(e="?"+d.join("&"));var f="/v1/sendmaxinfo/"+e;c._doGetRequest(f,function(a,c){return a?b(a):b(null,c)})},e.prototype._oldCopayDecrypt=function(a,b,c){var d,e="@#$",f="%^#@";try{var g=a+e+b;d=n.decrypt(g,c)}catch(h){g=a+f+b;try{d=n.decrypt(g,c)}catch(h){ -u.debug(h)}}if(!d)return null;var i;try{i=JSON.parse(d)}catch(h){}return i},e.prototype.getWalletIdsFromOldCopay=function(a,b,c){var d=this._oldCopayDecrypt(a,b,c);if(!d)return null;var e=d.walletIds.concat(g.keys(d.focusedTimestamps));return g.uniq(e)},e.prototype.createWalletFromOldCopay=function(a,b,c,d){var e=this._oldCopayDecrypt(a,b,c);return e?e.publicKeyRing.copayersExtPubKeys.length!=e.opts.totalCopayers?d(new Error("Wallet is incomplete, cannot be imported")):(this.credentials=v.fromOldCopayWallet(e),void this.recreateWallet(d)):d(new Error("Could not decrypt"))},b.exports=e}).call(this,a("_process"),a("buffer").Buffer)},{"../package.json":572,"./common":5,"./credentials":7,"./errors":8,"./log":11,"./paypro":12,"./verifier":13,_process:392,async:14,bip38:15,"bitcore-lib":64,"bitcore-mnemonic":136,"browser-request":174,buffer:191,events:387,"json-stable-stringify":428,lodash:432,preconditions:433,querystring:396,request:438,sjcl:571,url:421,util:424}],3:[function(a,b,c){"use strict";var d={};d.SCRIPT_TYPES={P2SH:"P2SH",P2PKH:"P2PKH"},d.DERIVATION_STRATEGIES={BIP44:"BIP44",BIP45:"BIP45",BIP48:"BIP48"},d.PATHS={REQUEST_KEY:"m/1'/0",TXPROPOSAL_KEY:"m/1'/1",REQUEST_KEY_AUTH:"m/2"},d.BIP45_SHARED_INDEX=2147483647,d.UNITS={btc:{toSatoshis:1e8,full:{maxDecimals:8,minDecimals:8},"short":{maxDecimals:6,minDecimals:2}},bit:{toSatoshis:100,full:{maxDecimals:2,minDecimals:2},"short":{maxDecimals:0,minDecimals:0}}},b.exports=d},{}],4:[function(a,b,c){"use strict";var d={};d.DEFAULT_FEE_PER_KB=1e4,d.MIN_FEE_PER_KB=0,d.MAX_FEE_PER_KB=1e6,d.MAX_TX_FEE=1e8,b.exports=d},{}],5:[function(a,b,c){var d={};d.Constants=a("./constants"),d.Defaults=a("./defaults"),d.Utils=a("./utils"),b.exports=d},{"./constants":3,"./defaults":4,"./utils":6}],6:[function(a,b,c){(function(c){"use strict";function d(){}var e=a("lodash"),f=a("preconditions").singleton(),g=a("sjcl"),h=a("json-stable-stringify"),i=a("bitcore-lib"),j=i.Address,k=i.PrivateKey,l=i.PublicKey,m=i.crypto,n=(i.encoding,a("./constants")),o=a("./defaults");d.SJCL={},d.encryptMessage=function(a,b){var c=g.codec.base64.toBits(b);return g.encrypt(c,a,e.defaults({ks:128,iter:1},d.SJCL))},d.decryptMessage=function(a,b){try{var c=g.codec.base64.toBits(b);return g.decrypt(c,a)}catch(d){return a}},d.hashMessage=function(a){f.checkArgument(a);var b=new c(a),d=m.Hash.sha256sha256(b);return d=new i.encoding.BufferReader(d).readReverse()},d.signMessage=function(a,b){f.checkArgument(a);var c=new k(b),e=d.hashMessage(a);return m.ECDSA.sign(e,c,"little").toString()},d.verifyMessage=function(a,b,c){if(f.checkArgument(a),f.checkArgument(c),!b)return!1;var e=new l(c),g=d.hashMessage(a);try{var h=new m.Signature.fromString(b);return m.ECDSA.verify(g,h,e,"little")}catch(i){return!1}},d.privateKeyToAESKey=function(a){f.checkArgument(a&&e.isString(a)),f.checkArgument(i.PrivateKey.isValid(a),"The private key received is invalid");var b=i.PrivateKey.fromString(a);return i.crypto.Hash.sha256(b.toBuffer()).slice(0,16).toString("base64")},d.getCopayerHash=function(a,b,c){return[a,b,c].join("|")},d.getProposalHash=function(a){function b(a,b,c,d){return[a,b,c||"",d||""].join("|")}return arguments.length>1?b.apply(this,arguments):h(a)},d.deriveAddress=function(a,b,c,d,g){f.checkArgument(e.contains(e.values(n.SCRIPT_TYPES),a));var h,k=e.map(b,function(a){var b=new i.HDPublicKey(a.xPubKey);return b.derive(c).publicKey});switch(a){case n.SCRIPT_TYPES.P2SH:h=j.createMultisig(k,d,g);break;case n.SCRIPT_TYPES.P2PKH:f.checkState(e.isArray(k)&&1==k.length),h=j.fromPublicKey(k[0],g)}return{address:h.toString(),path:c,publicKeys:e.invoke(k,"toString")}},d.xPubToCopayerId=function(a){var b=g.hash.sha256.hash(a);return g.codec.hex.fromBits(b)},d.signRequestPubKey=function(a,b){var c=new i.HDPrivateKey(b).derive(n.PATHS.REQUEST_KEY_AUTH).privateKey;return d.signMessage(a,c)},d.verifyRequestPubKey=function(a,b,c){var e=new i.HDPublicKey(c).derive(n.PATHS.REQUEST_KEY_AUTH).publicKey;return d.verifyMessage(a,b,e.toString())},d.formatAmount=function(a,b,c){function d(a,b){var c=a.toString().split("."),d=(c[1]||"0").substring(0,b);return parseFloat(c[0]+"."+d)}function g(a,b,c,d){a=a.replace(".",c);var f=a.split(c),g=f[0],h=f[1];h=e.dropRightWhile(h,function(a,b){return"0"==a&&b>=d}).join("");var i=f.length>1?c+h:"";return g=g.replace(/\B(?=(\d{3})+(?!\d))/g,b),g+i}f.shouldBeNumber(a),f.checkArgument(e.contains(e.keys(n.UNITS),b)),c=c||{};var h=n.UNITS[b],i=c.fullPrecision?"full":"short",j=d(a/h.toSatoshis,h[i].maxDecimals).toFixed(h[i].maxDecimals);return g(j,c.thousandsSeparator||",",c.decimalSeparator||".",h[i].minDecimals)},d.buildTx=function(a){var b=new i.Transaction;switch(f.checkState(e.contains(e.values(n.SCRIPT_TYPES),a.addressType)),a.addressType){case n.SCRIPT_TYPES.P2SH:e.each(a.inputs,function(c){b.from(c,c.publicKeys,a.requiredSignatures)});break;case n.SCRIPT_TYPES.P2PKH:b.from(a.inputs)}if(a.toAddress&&a.amount&&!a.outputs?b.to(a.toAddress,a.amount):a.outputs&&e.each(a.outputs,function(a){f.checkState(a.script||a.toAddress,"Output should have either toAddress or script specified"),a.script?b.addOutput(new i.Transaction.Output({script:a.script,satoshis:a.amount})):b.to(a.toAddress,a.amount)}),b.fee(a.fee),b.change(a.changeAddress.address),b.outputs.length>1){var c=e.reject(a.outputOrder,function(a){return a>=b.outputs.length});f.checkState(b.outputs.length==c.length),b.sortOutputs(function(a){return e.map(c,function(b){return a[b]})})}var d=e.reduce(a.inputs,function(a,b){return+b.satoshis+a},0),g=e.reduce(b.outputs,function(a,b){return+b.satoshis+a},0);return f.checkState(d-g>=0),f.checkState(d-g<=o.MAX_TX_FEE),b},b.exports=d}).call(this,a("buffer").Buffer)},{"./constants":3,"./defaults":4,"bitcore-lib":64,buffer:191,"json-stable-stringify":428,lodash:432,preconditions:433,sjcl:571}],7:[function(a,b,c){(function(c){"use strict";function d(){this.version="1.0.0",this.derivationStrategy=l.DERIVATION_STRATEGIES.BIP44,this.account=0}function e(a){if(!g.contains(["livenet","testnet"],a))throw new Error("Invalid network")}var f=a("preconditions").singleton(),g=a("lodash"),h=a("bitcore-lib"),i=a("bitcore-mnemonic"),j=a("sjcl"),k=a("./common"),l=k.Constants,m=k.Utils,n=["network","xPrivKey","xPrivKeyEncrypted","xPubKey","requestPrivKey","requestPubKey","copayerId","publicKeyRing","walletId","walletName","m","n","walletPrivKey","personalEncryptingKey","sharedEncryptingKey","copayerName","externalSource","mnemonic","mnemonicEncrypted","entropySource","mnemonicHasPassphrase","derivationStrategy","account","addressType"];d.create=function(a){e(a);var b=new d;return b.network=a,b.xPrivKey=new h.HDPrivateKey(a).toString(),b._expand(),b};var o={en:i.Words.ENGLISH,es:i.Words.SPANISH,ja:i.Words.JAPANESE,zh:i.Words.CHINESE,fr:i.Words.FRENCH,it:i.Words.ITALIAN};d.createWithMnemonic=function(a,b,c,g,h){if(e(a),!o[c])throw new Error("Unsupported language");f.shouldBeNumber(g),h=h||{};for(var j=new i(o[c]);!i.isValid(j.toString());)j=new i(o[c]);var k=new d;return k.network=a,k.account=g,k.xPrivKey=j.toHDPrivateKey(b,a).toString(),k._expand(),k.mnemonic=j.phrase,k.mnemonicHasPassphrase=!!b,k},d.fromExtendedPrivateKey=function(a,b,c,e){f.shouldBeNumber(b),f.checkArgument(g.contains(g.values(l.DERIVATION_STRATEGIES),c)),e=e||{};var h=new d;return h.xPrivKey=a,h.account=b,h.derivationStrategy=c,h._expand(),h},d.fromMnemonic=function(a,b,c,h,j,k){e(a),f.shouldBeNumber(h),f.checkArgument(g.contains(g.values(l.DERIVATION_STRATEGIES),j)),k=k||{};var m=new i(b),n=new d;return n.xPrivKey=m.toHDPrivateKey(c,a).toString(),n.mnemonic=b,n.mnemonicHasPassphrase=!!c,n.account=h,n.derivationStrategy=j,n._expand(),n},d.fromExtendedPublicKey=function(a,b,e,i,j,k){f.checkArgument(e),f.shouldBeNumber(i),f.checkArgument(g.contains(g.values(l.DERIVATION_STRATEGIES),j)),k=k||{};var m=new c(e,"hex");f.checkArgument(m.length>=14,"At least 112 bits of entropy are needed");var n=new d;return n.xPubKey=a,n.entropySource=h.crypto.Hash.sha256sha256(m).toString("hex"),n.account=i,n.derivationStrategy=j,n.externalSource=b,n._expand(),n},d._getNetworkFromExtendedKey=function(a){return f.checkArgument(a&&g.isString(a)),"t"==a.charAt(0)?"testnet":"livenet"},d._xPubToCopayerId=function(a){var b=j.hash.sha256.hash(a);return j.codec.hex.fromBits(b)},d.prototype._hashFromEntropy=function(a,b){f.checkState(a);var d=new c(this.entropySource,"hex"),e=h.crypto.Hash.sha256hmac(d,new c(a));return e.slice(0,b)},d.prototype._expand=function(){f.checkState(this.xPrivKey||this.xPubKey&&this.entropySource);var a=d._getNetworkFromExtendedKey(this.xPrivKey||this.xPubKey);if(this.network?f.checkState(this.network==a):this.network=a,this.xPrivKey){var b=new h.HDPrivateKey.fromString(this.xPrivKey),c=b.derive(this.getBaseAddressDerivationPath());this.xPubKey=new h.HDPublicKey(c).toString();var e=b.derive(l.PATHS.REQUEST_KEY);this.requestPrivKey=e.privateKey.toString();var g=e.publicKey;this.requestPubKey=g.toString(),this.entropySource=h.crypto.Hash.sha256(e.privateKey.toBuffer()).toString("hex")}else{var i=this._hashFromEntropy("reqPrivKey",32),j=new h.PrivateKey(i.toString("hex"),a);this.requestPrivKey=j.toString(),this.requestPubKey=j.toPublicKey().toString()}this.personalEncryptingKey=this._hashFromEntropy("personalKey",16).toString("base64"),this.copayerId=d._xPubToCopayerId(this.xPubKey),this.publicKeyRing=[{xPubKey:this.xPubKey,requestPubKey:this.requestPubKey}]},d.fromObj=function(a){var b=new d;return g.each(n,function(c){b[c]=a[c]}),b.derivationStrategy=b.derivationStrategy||l.DERIVATION_STRATEGIES.BIP45,b.addressType=b.addressType||l.SCRIPT_TYPES.P2SH,b.account=b.account||0,f.checkState(b.xPrivKey||b.xPubKey||b.xPrivKeyEncrypted,"invalid input"),b},d.prototype.toObj=function(){var a=this,b={};return g.each(n,function(c){b[c]=a[c]}),b},d.prototype.getBaseAddressDerivationPath=function(){var a;switch(this.derivationStrategy){case l.DERIVATION_STRATEGIES.BIP45:return"m/45'";case l.DERIVATION_STRATEGIES.BIP44:a="44";break;case l.DERIVATION_STRATEGIES.BIP48:a="48"}var b="livenet"==this.network?"0":"1";return"m/"+a+"'/"+b+"'/"+this.account+"'"},d.prototype.getDerivedXPrivKey=function(a){var b=this.getBaseAddressDerivationPath(),c=this.getKeys(a).xPrivKey;return new h.HDPrivateKey(c,this.network).derive(b)},d.prototype.addWalletPrivateKey=function(a){this.walletPrivKey=a,this.sharedEncryptingKey=m.privateKeyToAESKey(a)},d.prototype.addWalletInfo=function(a,b,c,d,e){this.walletId=a,this.walletName=b,this.m=c,this.n=d,e&&(this.copayerName=e),"BIP44"==this.derivationStrategy&&1==d?this.addressType=l.SCRIPT_TYPES.P2PKH:this.addressType=l.SCRIPT_TYPES.P2SH,!this.xPrivKey&&this.externalSource&&d>1&&(this.derivationStrategy=l.DERIVATION_STRATEGIES.BIP48),1==d&&this.addPublicKeyRing([{xPubKey:this.xPubKey,requestPubKey:this.requestPubKey}])},d.prototype.hasWalletInfo=function(){return!!this.walletId},d.prototype.isPrivKeyEncrypted=function(){return!!this.xPrivKeyEncrypted&&!this.xPrivKey},d.prototype.encryptPrivateKey=function(a,b){if(this.xPrivKeyEncrypted)throw new Error("Private key already encrypted");if(!this.xPrivKey)throw new Error("No private key to encrypt");if(this.xPrivKeyEncrypted=j.encrypt(a,this.xPrivKey,b),!this.xPrivKeyEncrypted)throw new Error("Could not encrypt");this.mnemonic&&(this.mnemonicEncrypted=j.encrypt(a,this.mnemonic,b)),delete this.xPrivKey,delete this.mnemonic},d.prototype.decryptPrivateKey=function(a){if(!this.xPrivKeyEncrypted)throw new Error("Private key is not encrypted");try{this.xPrivKey=j.decrypt(a,this.xPrivKeyEncrypted),this.mnemonicEncrypted&&(this.mnemonic=j.decrypt(a,this.mnemonicEncrypted)),delete this.xPrivKeyEncrypted,delete this.mnemonicEncrypted}catch(b){throw new Error("Could not decrypt")}},d.prototype.getKeys=function(a){var b={};if(this.isPrivKeyEncrypted()){f.checkArgument(a,"Private keys are encrypted, a password is needed");try{b.xPrivKey=j.decrypt(a,this.xPrivKeyEncrypted),this.mnemonicEncrypted&&(b.mnemonic=j.decrypt(a,this.mnemonicEncrypted))}catch(c){throw new Error("Could not decrypt")}}else b.xPrivKey=this.xPrivKey,b.mnemonic=this.mnemonic;return b},d.prototype.addPublicKeyRing=function(a){this.publicKeyRing=g.clone(a)},d.prototype.canSign=function(){return!!this.xPrivKey||!!this.xPrivKeyEncrypted},d.prototype.setNoSign=function(){delete this.xPrivKey,delete this.xPrivKeyEncrypted,delete this.mnemonic,delete this.mnemonicEncrypted},d.prototype.isComplete=function(){return this.m&&this.n&&this.publicKeyRing&&this.publicKeyRing.length==this.n?!0:!1},d.prototype.hasExternalSource=function(){return"string"==typeof this.externalSource},d.prototype.getExternalSourceName=function(){return this.externalSource},d.prototype.getMnemonic=function(){if(this.mnemonicEncrypted&&!this.mnemonic)throw new Error("Credentials are encrypted");return this.mnemonic},d.prototype.clearMnemonic=function(){delete this.mnemonic,delete this.mnemonicEncrypted},d.fromOldCopayWallet=function(a){function b(a){var b=a.publicKeyRing.copayersExtPubKeys.sort().join(""),d=new c(b),e=new h.PrivateKey.fromBuffer(h.crypto.Hash.sha256(d));return e.toString()}var e=new d;e.derivationStrategy=l.DERIVATION_STRATEGIES.BIP45,e.xPrivKey=a.privateKey.extendedPrivateKeyString,e._expand(),e.addWalletPrivateKey(b(a)),e.addWalletInfo(a.opts.id,a.opts.name,a.opts.requiredCopayers,a.opts.totalCopayers);var f=g.map(a.publicKeyRing.copayersExtPubKeys,function(b){var c,d=b===e.xPubKey;if(d){var f=l.PATHS.REQUEST_KEY;c=new h.HDPrivateKey(e.xPrivKey).derive(f).hdPublicKey}else{var f=l.PATHS.REQUEST_KEY_AUTH;c=new h.HDPublicKey(b).derive(f)}var g=new h.HDPublicKey(b).derive("m/2147483646/0/0"),i=g.publicKey.toString("hex"),j=a.publicKeyRing.nicknameFor[i];return d&&(e.copayerName=j),{xPubKey:b,requestPubKey:c.publicKey.toString(),copayerName:j}});return e.addPublicKeyRing(f),e},b.exports=d}).call(this,a("buffer").Buffer)},{"./common":5,"bitcore-lib":64,"bitcore-mnemonic":136,buffer:191,lodash:432,preconditions:433,sjcl:571}],8:[function(a,b,c){"use strict";function d(a,b){return a.replace("{0}",b[0]).replace("{1}",b[1]).replace("{2}",b[2])}var e=a("lodash"),f=function(a,b){var c=function(){if(e.isString(b.message))this.message=d(b.message,arguments);else{if(!e.isFunction(b.message))throw new Error("Invalid error definition for "+b.name);this.message=b.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return c.prototype=Object.create(a.prototype),c.prototype.name=a.prototype.name+b.name,a[b.name]=c,b.errors&&g(c,b.errors),c},g=function(a,b){e.each(b,function(b){f(a,b)})},h=function(a,b){return g(a,b),a},i={};i.Error=function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack},i.Error.prototype=Object.create(Error.prototype),i.Error.prototype.name="bwc.Error";var j=a("./spec");h(i.Error,j),b.exports=i.Error,b.exports.extend=function(a){return f(i.Error,a)}},{"./spec":9,lodash:432}],9:[function(a,b,c){"use strict";var d=[{name:"INVALID_BACKUP",message:"Invalid Backup"},{name:"WALLET_DOES_NOT_EXIST",message:"Wallet does not exist. Need to recreate"},{name:"MISSING_PRIVATE_KEY",message:"Missing private keys to sign"},{name:"ENCRYPTED_PRIVATE_KEY",message:"Private key is encrypted, cannot sign"},{name:"SERVER_COMPROMISED",message:"Server response could not be verified"},{name:"COULD_NOT_BUILD_TRANSACTION",message:"Could not build transaction"},{name:"INSUFFICIENT_FUNDS",message:"Insufficient funds"},{name:"CONNECTION_ERROR",message:"connection error"},{name:"NOT_FOUND",message:"not found"},{name:"ECONNRESET_ERROR",message:"ECONNRESET, body: {0}"},{name:"WALLET_ALREADY_EXISTS",message:"wallet already exists"},{name:"COPAYER_IN_WALLET",message:"copayer in wallet"},{name:"WALLET_FULL",message:"wallet is full"},{name:"WALLET_NOT_FOUND",message:"wallet not found"},{name:"INSUFFICIENT_FUNDS_FOR_FEE",message:"insufficient funds for fee"},{name:"LOCKED_FUNDS",message:"locked funds"},{name:"COPAYER_VOTED",message:"Copayer already voted on this transaction proposal"},{name:"NOT_AUTHORIZED",message:"not authorized"},{name:"UNAVAILABLE_UTXOS",message:"Unavailable unspent outputs"},{name:"TX_NOT_FOUND",message:"transaction proposal not found"}];b.exports=d},{}],10:[function(a,b,c){var d=b.exports=a("./api");d.Verifier=a("./verifier"),d.Utils=a("./common/utils"),d.sjcl=a("sjcl"),d.Bitcore=a("bitcore-lib")},{"./api":2,"./common/utils":6,"./verifier":13,"bitcore-lib":64,sjcl:571}],11:[function(a,b,c){var d=a("lodash"),e=function(a){this.name=a||"log",this.level=2};e.prototype.getLevels=function(){return f};var f={debug:0,info:1,log:2,warn:3,error:4,fatal:5};d.each(f,function(a,b){e.prototype[b]=function(){if(a>=f[this.level]){if(Error.stackTraceLimit&&"debug"==this.level){var c=Error.stackTraceLimit;Error.stackTraceLimit=2;var d;try{anerror()}catch(e){d=e.stack}var g=d.split("\n"),h=g[2];h=":"+h.substr(6),Error.stackTraceLimit=c}var i,j="["+b+(h||"")+"] "+arguments[0],i=[].slice.call(arguments,1);console[b]?(i.unshift(j),console[b].apply(console,i)):(i.length&&(j+=JSON.stringify(i)),console.log(j))}}}),e.prototype.setLevel=function(a){this.level=a};var g=new e("copay");new Error;g.setLevel("info"),b.exports=g},{lodash:432}],12:[function(a,b,c){(function(c,d){var e=a("preconditions").singleton(),f=a("bitcore-lib"),g=a("bitcore-payment-protocol"),h={};h._nodeRequest=function(b,c){b.agent=!1;var e=b.httpNode||a("http"===b.proto?"http":"https"),f="POST"==b.method?"post":"get";e[f](b,function(a){if(200!=a.statusCode)return c(new Error("HTTP Request Error"));var b=[];a.on("data",function(a){b.push(a)}),a.on("end",function(){return b=d.concat(b),c(null,b)})})},h._browserRequest=function(a,b){var c=(a.method||"GET").toUpperCase(),d=a.url,e=a;e.headers=e.headers||{},e.body=e.body||e.data||"";var f=a.xhr||new XMLHttpRequest;f.open(c,d,!0),Object.keys(e.headers).forEach(function(a){var b=e.headers[a];"Content-Length"!==a&&"Content-Transfer-Encoding"!==a&&f.setRequestHeader(a,b)}),f.responseType="arraybuffer",f.onload=function(a){var c=f.response;return b(null,new Uint8Array(c))},f.onerror=function(a){var c;return c=0!==f.status&&f.statusText?f.statusText:"HTTP Request Error",b(new Error(c))},e.body?f.send(e.body):f.send(null)};var i=function(a){a.url.match(/^((http[s]?):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/);if(a.proto=RegExp.$2,a.host=RegExp.$3,a.path=RegExp.$4+RegExp.$6,a.http)return a.http;var b=a.env;return b||(b=c&&!c.browser?"node":"browser"),"node"==b?h._nodeRequest:http=h._browserRequest};h.get=function(a,b){e.checkArgument(a&&a.url);var c=i(a);a.headers=a.headers||{Accept:g.PAYMENT_REQUEST_CONTENT_TYPE,"Content-Type":"application/octet-stream"},c(a,function(c,e){if(c)return b(c);var h,i,j,k;try{var l=g.PaymentRequest.decode(e);h=(new g).makePaymentRequest(l),j=h.get("signature"),k=h.get("serialized_payment_details"),i=h.verify(!0)}catch(m){return b(new Error("Could not parse payment protocol: "+m))}var n=g.PaymentDetails.decode(k),o=new g;o=o.makePaymentDetails(n);var p=o.get("outputs");if(p.length>1)return b(new Error("Payment Protocol Error: Requests with more that one output are not supported"));var q=p[0],r=q.get("amount").toNumber(),s="test"==o.get("network")?"testnet":"livenet",t=q.get("script").offset,u=q.get("script").limit,v=new d(new Uint8Array(q.get("script").buffer)),w=v.slice(t,u),x=new f.Address.fromScript(new f.Script(w),s),y=o.get("merchant_data");y&&(y=y.toString());var z=i.verified;return i.isChain&&(z=z&&i.chainVerified),b(null,{verified:z,caTrusted:i.caTrusted,caName:i.caName,selfSigned:i.selfSigned,expires:o.get("expires"),memo:o.get("memo"),time:o.get("time"),merchant_data:y,toAddress:x.toString(),amount:r,network:s,domain:a.host,url:a.url})})},h._getPayProRefundOutputs=function(a,b){b=b.toString(10);var c,d=new g.Output,e=new f.Address(a);if(e.isPayToPublicKeyHash())c=f.Script.buildPublicKeyHashOut(e);else{if(!e.isPayToScriptHash())throw new Error("Unrecognized address type "+e.type);c=f.Script.buildScriptHashOut(e)}return d.set("script",c.toBuffer()),d.set("amount",b),[d]},h._createPayment=function(a,b,c,e){var f=new g;f=f.makePayment(),a&&(a=new d(a),f.set("merchant_data",a));var h=new d(b,"hex");f.set("transactions",[h]);var i=this._getPayProRefundOutputs(c,e);i&&f.set("refund_to",i),f=f.serialize();for(var j=new ArrayBuffer(f.length),k=new Uint8Array(j),l=0;l=3))throw new Error("Transaction proposal not supported");var k=i.buildTx(b);return h=k.uncheckedSerialize(),j.debug("Regenerating & verifying tx proposal hash -> Hash: ",h," Signature: ",b.proposalSignature),i.verifyMessage(h,b.proposalSignature,g)&&d.checkAddress(a,b.changeAddress)?!0:!1},d.checkPaypro=function(a,b){var c,d;return parseInt(a.version)>=3?(c=a.outputs[0].toAddress,d=a.amount):(c=a.toAddress,d=a.amount),c==b.toAddress&&d==b.amount},d.checkTxProposal=function(a,b,c){return c=c||{},this.checkTxProposalSignature(a,b)?c.paypro&&!this.checkPaypro(b,c.paypro)?!1:!0:!1},b.exports=d},{"./common":5,"./log":11,"bitcore-lib":64,lodash:432,preconditions:433}],14:[function(a,b,c){(function(a){!function(){function c(a){var b=!1;return function(){if(b)throw new Error("Callback was already called.");b=!0,a.apply(d,arguments)}}var d,e,f={};d=this,null!=d&&(e=d.async),f.noConflict=function(){return d.async=e,f};var g=Object.prototype.toString,h=Array.isArray||function(a){return"[object Array]"===g.call(a)},i=function(a,b){for(var c=0;c=a.length&&d())}if(d=d||function(){},!a.length)return d();var f=0;i(a,function(a){b(a,c(e))})},f.forEach=f.each,f.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},f.forEachSeries=f.eachSeries,f.eachLimit=function(a,b,c,d){var e=m(b);e.apply(null,[a,c,d])},f.forEachLimit=f.eachLimit;var m=function(a){return function(b,c,d){if(d=d||function(){},!b.length||0>=a)return d();var e=0,f=0,g=0;!function h(){if(e>=b.length)return d();for(;a>g&&f=b.length?d():h())})}()}},n=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[f.each].concat(b))}},o=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[m(a)].concat(c))}},p=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[f.eachSeries].concat(b))}},q=function(a,b,c,d){if(b=j(b,function(a,b){return{index:b,value:a}}),d){var e=[];a(b,function(a,b){c(a.value,function(c,d){e[a.index]=d,b(c)})},function(a){d(a,e)})}else a(b,function(a,b){c(a.value,function(a){b(a)})})};f.map=n(q),f.mapSeries=p(q),f.mapLimit=function(a,b,c,d){return r(b)(a,c,d)};var r=function(a){return o(a,q)};f.reduce=function(a,b,c,d){f.eachSeries(a,function(a,d){c(b,a,function(a,c){b=c,d(a)})},function(a){d(a,b)})},f.inject=f.reduce,f.foldl=f.reduce,f.reduceRight=function(a,b,c,d){var e=j(a,function(a){return a}).reverse();f.reduce(e,b,c,d)},f.foldr=f.reduceRight;var s=function(a,b,c,d){var e=[];b=j(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c&&e.push(a),b()})},function(a){d(j(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};f.filter=n(s),f.filterSeries=p(s),f.select=f.filter,f.selectSeries=f.filterSeries;var t=function(a,b,c,d){var e=[];b=j(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c||e.push(a),b()})},function(a){d(j(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};f.reject=n(t),f.rejectSeries=p(t);var u=function(a,b,c,d){a(b,function(a,b){c(a,function(c){c?(d(a),d=function(){}):b()})},function(a){d()})};f.detect=n(u),f.detectSeries=p(u),f.some=function(a,b,c){f.each(a,function(a,d){b(a,function(a){a&&(c(!0),c=function(){}),d()})},function(a){c(!1)})},f.any=f.some,f.every=function(a,b,c){f.each(a,function(a,d){b(a,function(a){a||(c(!1),c=function(){}),d()})},function(a){c(!0)})},f.all=f.every,f.sortBy=function(a,b,c){f.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);var d=function(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0};c(null,j(b.sort(d),function(a){return a.value}))})},f.auto=function(a,b){b=b||function(){};var c=l(a),d=c.length;if(!d)return b();var e={},g=[],j=function(a){g.unshift(a)},m=function(a){for(var b=0;bd;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function e(a,b,e,g){return a.started||(a.started=!0),h(b)||(b=[b]),0==b.length?f.setImmediate(function(){a.drain&&a.drain()}):void i(b,function(b){var h={data:b,priority:e,callback:"function"==typeof g?g:null};a.tasks.splice(d(a.tasks,h,c)+1,0,h),a.saturated&&a.tasks.length===a.concurrency&&a.saturated(),f.setImmediate(a.process)})}var g=f.queue(a,b);return g.push=function(a,b,c){e(g,a,b,c)},delete g.unshift,g},f.cargo=function(a,b){var c=!1,d=[],e={tasks:d,payload:b,saturated:null,empty:null,drain:null,drained:!0,push:function(a,c){h(a)||(a=[a]),i(a,function(a){d.push({data:a,callback:"function"==typeof c?c:null}),e.drained=!1,e.saturated&&d.length===b&&e.saturated()}),f.setImmediate(e.process)},process:function g(){if(!c){if(0===d.length)return e.drain&&!e.drained&&e.drain(),void(e.drained=!0);var f="number"==typeof b?d.splice(0,b):d.splice(0,d.length),h=j(f,function(a){return a.data});e.empty&&e.empty(),c=!0,a(h,function(){c=!1;var a=arguments;i(f,function(b){b.callback&&b.callback.apply(null,a)}),g()})}},length:function(){return d.length},running:function(){return c}};return e};var x=function(a){return function(b){var c=Array.prototype.slice.call(arguments,1);b.apply(null,c.concat([function(b){var c=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(b?console.error&&console.error(b):console[a]&&i(c,function(b){console[a](b)}))}]))}};f.log=x("log"),f.dir=x("dir"),f.memoize=function(a,b){var c={},d={};b=b||function(a){return a};var e=function(){var e=Array.prototype.slice.call(arguments),g=e.pop(),h=b.apply(null,e);h in c?f.nextTick(function(){g.apply(null,c[h])}):h in d?d[h].push(g):(d[h]=[g],a.apply(null,e.concat([function(){c[h]=arguments;var a=d[h];delete d[h];for(var b=0,e=a.length;e>b;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},f.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},f.times=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return f.map(d,b,c)},f.timesSeries=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return f.mapSeries(d,b,c)},f.seq=function(){var a=arguments;return function(){var b=this,c=Array.prototype.slice.call(arguments),d=c.pop();f.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){d.apply(b,[a].concat(c))})}},f.compose=function(){return f.seq.apply(null,Array.prototype.reverse.call(arguments))};var y=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};f.applyEach=n(y),f.applyEachSeries=p(y),f.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof b&&b.exports?b.exports=f:"undefined"!=typeof define&&define.amd?define([],function(){return f}):d.async=f}()}).call(this,a("_process"))},{_process:392}],15:[function(a,b,c){(function(c){function d(a){return a=h("sha256").update(a).digest(),h("sha256").update(a).digest()}function e(a){return this instanceof e?(this.versions=a||{"private":128},void(this.scryptParams={N:16384,r:8,p:8})):new e}var f=a("browserify-aes"),g=a("assert"),h=a("create-hash"),i=a("coinstring"),j=a("scryptsy"),k=a("buffer-xor"),l=a("ecurve"),m=l.getCurveByName("secp256k1"),n=a("bigi");e.prototype.encryptRaw=function(a,b,e,h,i){g.equal(a.length,32,"Invalid private key length");var l=new c(e,"utf8"),m=d(h).slice(0,4),n=this.scryptParams.N,o=this.scryptParams.r,p=this.scryptParams.p,q=j(l,m,n,o,p,64,i),r=q.slice(0,32),s=q.slice(32,64),t=k(a,r),u=f.createCipheriv("aes-256-ecb",s,new c(0));u.setAutoPadding(!1),u.end(t);var v=u.read(),w=b?224:192,x=new c(3);return x.writeUInt8(1,0),x.writeUInt8(66,1),x.writeUInt8(w,2),c.concat([x,m,v])},e.prototype.encrypt=function(a,b,c,d){var e=i.decode(a).slice(1),f=33===e.length&&1===e[32];return f&&(e=e.slice(0,-1)),i.encode(this.encryptRaw(e,f,b,c,d))},e.prototype.decryptRaw=function(a,b,d){g.equal(a.length,39,"Invalid BIP38 data length"),g.equal(a.readUInt8(0),1,"Invalid BIP38 prefix");var e=a.readUInt8(1);if(67===e)return this.decryptECMult(a,b,d);b=new c(b,"utf8"),g.equal(e,66,"Invalid BIP38 type");var h=a.readUInt8(2),i=224===h;i||g.equal(h,192,"Invalid BIP38 compression flag");var l=this.scryptParams.N,m=this.scryptParams.r,n=this.scryptParams.p,o=a.slice(3,7),p=j(b,o,l,m,n,64,d),q=p.slice(0,32),r=p.slice(32,64),s=a.slice(7,39),t=f.createDecipheriv("aes-256-ecb",r,new c(0));t.setAutoPadding(!1),t.end(s);var u=t.read(),v=k(u,q);return{privateKey:v,compressed:i}},e.prototype.decrypt=function(a,b,d){var e=i.decode(a),f=this.decryptRaw(e,b,d),g=f.compressed?34:33,h=new c(g);return h.writeUInt8(this.versions["private"],0),f.privateKey.copy(h,1),f.compressed&&h.writeUInt8(1,33),i.encode(h)},e.prototype.decryptECMult=function(a,b,e){b=new c(b,"utf8"),a=a.slice(1);var h=0!==(32&a[1]),i=0!==(4&a[1]);g.equal(36&a[1],a[1],"Invalid private key.");var l,o=a.slice(2,6),p=a.slice(6,14);l=i?p.slice(0,4):p;var q,r=a.slice(14,22),s=a.slice(22,38),t=this.scryptParams.N,u=this.scryptParams.r,v=this.scryptParams.p,w=j(b,l,t,u,v,32,e);if(i){var x=c.concat([w,p]);q=d(x)}else q=w;var y=n.fromBuffer(q),z=m.G.multiply(y).getEncoded(!0),A=j(z,c.concat([o,p]),1024,1,1,64),B=A.slice(0,32),C=A.slice(32,64),D=f.createDecipheriv("aes-256-ecb",C,new c(0));D.setAutoPadding(!1),D.end(s);var E=D.read(),F=k(E,B.slice(16,32)),G=F.slice(8,16),H=f.createDecipheriv("aes-256-ecb",C,new c(0));H.setAutoPadding(!1),H.write(r),H.end(F.slice(0,8));var I=k(H.read(),B.slice(0,16)),J=c.concat([I,G],24),K=d(J),L=y.multiply(n.fromBuffer(K)).mod(m.n);return{privateKey:L.toBuffer(32),compressed:h}},e.prototype.verify=function(a){var b;try{b=i.decode(a)}catch(c){return!1}if(39!==b.length)return!1;if(1!==b.readUInt8(0))return!1;var d=b.readUInt8(1),e=b.readUInt8(2);if(66===d){if(192!==e&&224!==e)return!1}else{if(67!==d)return!1;if(-37&e)return!1}return!0},b.exports=e}).call(this,a("buffer").Buffer)},{assert:176,bigi:18,"browserify-aes":22,buffer:191,"buffer-xor":38,coinstring:39,"create-hash":41,ecurve:57,scryptsy:60}],16:[function(a,b,c){function d(a,b,c){return this instanceof d?void(null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))):new d(a,b,c)}function e(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function f(a){return fb.charAt(a)}function g(a,b){var c=gb[a.charCodeAt(b)];return null==c?-1:c}function h(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function i(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+bb:this.t=0}function j(a){var b=new d;return b.fromInt(a),b}function k(a,b){var c,e=this;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void e.fromRadix(a,b);c=2}e.t=0,e.s=0;for(var f=a.length,h=!1,i=0;--f>=0;){var j=8==c?255&a[f]:g(a,f);0>j?"-"==a.charAt(f)&&(h=!0):(h=!1,0==i?e[e.t++]=j:i+c>e.DB?(e[e.t-1]|=(j&(1<>e.DB-i):e[e.t-1]|=j<=e.DB&&(i-=e.DB))}8==c&&0!=(128&a[0])&&(e.s=-1,i>0&&(e[e.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function m(a){var b=this;if(b.s<0)return"-"+b.negate().toString(a);var c;if(16==a)c=4;else if(8==a)c=3;else if(2==a)c=1;else if(32==a)c=5;else{if(4!=a)return b.toRadix(a);c=2}var d,e=(1<0)for(j>j)>0&&(g=!0,h=f(d));i>=0;)c>j?(d=(b[i]&(1<>(j+=b.DB-c)):(d=b[i]>>(j-=c)&e,0>=j&&(j+=b.DB,--i)),d>0&&(g=!0),g&&(h+=f(d));return g?h:"0"}function n(){var a=new d;return d.ZERO.subTo(this,a),a}function o(){return this.s<0?this.negate():this}function p(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function q(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function r(){return this.t<=0?0:this.DB*(this.t-1)+q(this[this.t-1]^this.s&this.DM)}function s(){return this.bitLength()>>3}function t(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function u(a,b){for(var c=a;c=0;--c)b[c+h+1]=d[c]>>f|i,i=(d[c]&g)<=0;--c)b[c]=0;b[h]=i,b.t=d.t+h+1,b.s=d.s,b.clamp()}function w(a,b){var c=this;b.s=c.s;var d=Math.floor(a/c.DB);if(d>=c.t)return void(b.t=0);var e=a%c.DB,f=c.DB-e,g=(1<>e;for(var h=d+1;h>e;e>0&&(b[c.t-d-1]|=(c.s&g)<d;)e+=c[d]-a[d],b[d++]=e&c.DM,e>>=c.DB;if(a.t>=c.DB;e+=c.s}else{for(e+=c.s;d>=c.DB;e-=a.s}b.s=0>e?-1:0,-1>e?b[d++]=c.DV+e:e>0&&(b[d++]=e),b.t=d,b.clamp()}function y(a,b){var c=this.abs(),e=a.abs(),f=c.t;for(b.t=f+e.t;--f>=0;)b[f]=0;for(f=0;f=0;)a[c]=0;for(c=0;c=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function A(a,b,c){var e=this,f=a.abs();if(!(f.t<=0)){var g=e.abs();if(g.t0?(f.lShiftTo(k,h),g.lShiftTo(k,c)):(f.copyTo(h),g.copyTo(c));var l=h.t,m=h[l-1];if(0!=m){var n=m*(1<1?h[l-2]>>e.F2:0),o=e.FV/n,p=(1<=0&&(c[c.t++]=1,c.subTo(u,c)),d.ONE.dlShiftTo(l,u),u.subTo(h,h);h.t=0;){var v=c[--s]==m?e.DM:Math.floor(c[s]*o+(c[s-1]+r)*p);if((c[s]+=h.am(0,v,c,t,0,l))0&&c.rShiftTo(k,c),0>i&&d.ZERO.subTo(c,c)}}}function B(a){var b=new d;return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(d.ZERO)>0&&a.subTo(b,b),b}function C(a){this.m=a}function D(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function E(a){return a}function F(a){a.divRemTo(this.m,null,a)}function G(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function H(a,b){a.squareTo(b),this.reduce(b)}function I(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function J(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(b,b),b}function L(a){var b=new d;return a.copyTo(b),this.reduce(b),b}function M(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function N(a,b){a.squareTo(b),this.reduce(b)}function O(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function P(){return 0==(this.t>0?1&this[0]:this.s)}function Q(a,b){if(a>4294967295||1>a)return d.ONE;var c=new d,e=new d,f=b.convert(this),g=q(a)-1;for(f.copyTo(c);--g>=0;)if(b.sqrTo(c,e),(a&1<0)b.mulTo(e,f,c);else{var h=c;c=e,e=h}return b.revert(c)}function R(a,b){var c;return c=256>a||b.isEven()?new C(b):new J(b),this.exp(a,c)}function S(){var a=new d;return this.copyTo(a),a}function T(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function V(){return 0==this.t?this.s:this[0]<<16>>16}function W(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function X(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function Y(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),e=j(c),f=new d,g=new d,h="";for(this.divRemTo(e,f,g);f.signum()>0;)h=(c+g.intValue()).toString(a).substr(1)+h,f.divRemTo(e,f,g);return g.intValue().toString(a)+h}function Z(a,b){var c=this;c.fromInt(0),null==b&&(b=10);for(var e=c.chunkSize(b),f=Math.pow(b,e),h=!1,i=0,j=0,k=0;kl?"-"==a.charAt(k)&&0==c.signum()&&(h=!0):(j=b*j+l,++i>=e&&(c.dMultiply(f),c.dAddOffset(j,0),i=0,j=0))}i>0&&(c.dMultiply(Math.pow(b,i)),c.dAddOffset(j,0)),h&&d.ZERO.subTo(c,c)}function $(a,b,c){var e=this;if("number"==typeof b)if(2>a)e.fromInt(1);else for(e.fromNumber(a,c),e.testBit(a-1)||e.bitwiseTo(d.ONE.shiftLeft(a-1),ga,e),e.isEven()&&e.dAddOffset(1,0);!e.isProbablePrime(b);)e.dAddOffset(2,0),e.bitLength()>a&&e.subTo(d.ONE.shiftLeft(a-1),e);else{var f=new Array,g=7&a;f.length=(a>>3)+1,b.nextBytes(f),g>0?f[0]&=(1<0)for(e>e)!=(a.s&a.DM)>>e&&(c[f++]=d|a.s<=0;)8>e?(d=(a[b]&(1<>(e+=a.DB-8)):(d=a[b]>>(e-=8)&255,0>=e&&(e+=a.DB,--b)),0!=(128&d)&&(d|=-256),0===f&&(128&a.s)!=(128&d)&&++f,(f>0||d!=a.s)&&(c[f++]=d);return c}function aa(a){return 0==this.compareTo(a)}function ba(a){return this.compareTo(a)<0?this:a}function ca(a){return this.compareTo(a)>0?this:a}function da(a,b,c){var d,e,f=this,g=Math.min(a.t,f.t);for(d=0;g>d;++d)c[d]=b(f[d],a[d]);if(a.ta?this.rShiftTo(-a,b):this.lShiftTo(a,b),b}function oa(a){var b=new d;return 0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b),b}function pa(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function qa(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<d;)e+=c[d]+a[d],b[d++]=e&c.DM,e>>=c.DB;if(a.t>=c.DB;e+=c.s}else{for(e+=c.s;d>=c.DB;e+=a.s}b.s=0>e?-1:0,e>0?b[d++]=e:-1>e&&(b[d++]=c.DV+e),b.t=d,b.clamp()}function za(a){var b=new d;return this.addTo(a,b),b}function Aa(a){var b=new d;return this.subTo(a,b),b}function Ba(a){var b=new d;return this.multiplyTo(a,b),b}function Ca(){var a=new d;return this.squareTo(a),a}function Da(a){var b=new d;return this.divRemTo(a,b,null),b}function Ea(a){var b=new d;return this.divRemTo(a,null,b),b}function Fa(a){var b=new d,c=new d;return this.divRemTo(a,b,c),new Array(b,c)}function Ga(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function Ha(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function Ia(){}function Ja(a){return a}function Ka(a,b,c){a.multiplyTo(b,c)}function La(a,b){a.squareTo(b)}function Ma(a){return this.exp(a,new Ia)}function Na(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function Oa(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=new d;return a.copyTo(b),this.reduce(b),b}function Ra(a){return a}function Sa(a){var b=this;for(a.drShiftTo(b.m.t-1,b.r2),a.t>b.m.t+1&&(a.t=b.m.t+1,a.clamp()),b.mu.multiplyUpperTo(b.r2,b.m.t+1,b.q3),b.m.multiplyLowerTo(b.q3,b.m.t+1,b.r2);a.compareTo(b.r2)<0;)a.dAddOffset(1,b.m.t+1);for(a.subTo(b.r2,a);a.compareTo(b.m)>=0;)a.subTo(b.m,a)}function Ta(a,b){a.squareTo(b),this.reduce(b)}function Ua(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function Va(a,b){var c,e,f=a.bitLength(),g=j(1);if(0>=f)return g;c=18>f?1:48>f?3:144>f?4:768>f?5:6,e=8>f?new C(b):b.isEven()?new Pa(b):new J(b);var h=new Array,i=3,k=c-1,l=(1<1){var m=new d;for(e.sqrTo(h[1],m);l>=i;)h[i]=new d,e.mulTo(m,h[i-2],h[i]),i+=2}var n,o,p=a.t-1,r=!0,s=new d;for(f=q(a[p])-1;p>=0;){for(f>=k?n=a[p]>>f-k&l:(n=(a[p]&(1<0&&(n|=a[p-1]>>this.DB+f-k)),i=c;0==(1&n);)n>>=1,--i;if((f-=i)<0&&(f+=this.DB,--p),r)h[n].copyTo(g),r=!1;else{for(;i>1;)e.sqrTo(g,s),e.sqrTo(s,g),i-=2;i>0?e.sqrTo(g,s):(o=g,g=s,s=o),e.mulTo(s,h[n],g)}for(;p>=0&&0==(a[p]&1<f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function Xa(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function Ya(a){var b=a.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&b||0==a.signum())return d.ZERO;for(var c=a.clone(),e=this.clone(),f=j(1),g=j(0),h=j(0),i=j(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(f.isEven()&&g.isEven()||(f.addTo(this,f),g.subTo(a,g)),f.rShiftTo(1,f)):g.isEven()||g.subTo(a,g),g.rShiftTo(1,g);for(;e.isEven();)e.rShiftTo(1,e),b?(h.isEven()&&i.isEven()||(h.addTo(this,h),i.subTo(a,i)),h.rShiftTo(1,h)):i.isEven()||i.subTo(a,i),i.rShiftTo(1,i);c.compareTo(e)>=0?(c.subTo(e,c),b&&f.subTo(h,f),g.subTo(i,g)):(e.subTo(c,e),b&&h.subTo(f,h),i.subTo(g,i))}if(0!=e.compareTo(d.ONE))return d.ZERO;for(;i.compareTo(a)>=0;)i.subTo(a,i);for(;i.signum()<0;)i.addTo(a,i);return i}function Za(a){var b,c=this.abs();if(1==c.t&&c[0]<=hb[hb.length-1]){for(b=0;bd;)d*=hb[e++];for(d=c.modInt(d);e>b;)if(d%hb[b++]==0)return!1}return c.millerRabin(a)}function $a(a){var b=this.subtract(d.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var e=b.shiftRight(c);a=a+1>>1,a>hb.length&&(a=hb.length);for(var f,g=new d(null),h=[],i=0;a>i;++i){for(;f=hb[Math.floor(Math.random()*hb.length)],-1!=h.indexOf(f););h.push(f),g.fromInt(f);var j=g.modPow(e,this);if(0!=j.compareTo(d.ONE)&&0!=j.compareTo(b)){for(var f=1;f++=eb;++eb)gb[db++]=eb;for(db="a".charCodeAt(0),eb=10;36>eb;++eb)gb[db++]=eb;for(db="A".charCodeAt(0),eb=10;36>eb;++eb)gb[db++]=eb;C.prototype.convert=D,C.prototype.revert=E,C.prototype.reduce=F,C.prototype.mulTo=G,C.prototype.sqrTo=H,J.prototype.convert=K,J.prototype.revert=L,J.prototype.reduce=M,J.prototype.mulTo=O,J.prototype.sqrTo=N,_a.copyTo=h,_a.fromInt=i,_a.fromString=k,_a.clamp=l,_a.dlShiftTo=t,_a.drShiftTo=u,_a.lShiftTo=v,_a.rShiftTo=w,_a.subTo=x,_a.multiplyTo=y,_a.squareTo=z,_a.divRemTo=A,_a.invDigit=I,_a.isEven=P,_a.exp=Q,_a.toString=m,_a.negate=n,_a.abs=o,_a.compareTo=p,_a.bitLength=r,_a.byteLength=s,_a.mod=B,_a.modPowInt=R,Ia.prototype.convert=Ja,Ia.prototype.revert=Ja,Ia.prototype.mulTo=Ka,Ia.prototype.sqrTo=La,Pa.prototype.convert=Qa,Pa.prototype.revert=Ra,Pa.prototype.reduce=Sa,Pa.prototype.mulTo=Ua,Pa.prototype.sqrTo=Ta;var hb=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ib=(1<<26)/hb[hb.length-1];_a.chunkSize=W,_a.toRadix=Y,_a.fromRadix=Z,_a.fromNumber=$,_a.bitwiseTo=da,_a.changeBit=ua,_a.addTo=ya,_a.dMultiply=Ga,_a.dAddOffset=Ha,_a.multiplyLowerTo=Na,_a.multiplyUpperTo=Oa,_a.modInt=Xa,_a.millerRabin=$a,_a.clone=S,_a.intValue=T,_a.byteValue=U,_a.shortValue=V,_a.signum=X,_a.toByteArray=_,_a.equals=aa,_a.min=ba,_a.max=ca,_a.and=fa,_a.or=ha,_a.xor=ja,_a.andNot=la,_a.not=ma,_a.shiftLeft=na,_a.shiftRight=oa,_a.getLowestSetBit=qa,_a.bitCount=sa,_a.testBit=ta,_a.setBit=va,_a.clearBit=wa,_a.flipBit=xa,_a.add=za,_a.subtract=Aa,_a.multiply=Ba,_a.divide=Da,_a.remainder=Ea,_a.divideAndRemainder=Fa,_a.modPow=Va,_a.modInverse=Ya,_a.pow=Ma,_a.gcd=Wa,_a.isProbablePrime=Za,_a.square=Ca,d.ZERO=j(0),d.ONE=j(1),d.valueOf=j,b.exports=d},{"../package.json":19}],17:[function(a,b,c){(function(b){var c=a("assert"),d=a("./bigi");d.fromByteArrayUnsigned=function(a){return new d(128&a[0]?[0].concat(a):a)},d.prototype.toByteArrayUnsigned=function(){var a=this.toByteArray();return 0===a[0]?a.slice(1):a},d.fromDERInteger=function(a){return new d(a)},d.prototype.toDERInteger=d.prototype.toByteArray,d.fromBuffer=function(a){if(128&a[0]){var b=Array.prototype.slice.call(a);return new d([0].concat(b))}return new d(a)},d.fromHex=function(a){return""===a?d.ZERO:(c.equal(a,a.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),c.equal(a.length%2,0,"Incomplete hex"),new d(a,16))},d.prototype.toBuffer=function(a){for(var c=this.toByteArrayUnsigned(),d=[],e=a-c.length;d.length=1.2.0 <2.0.0",_npmVersion:"3.8.6",_nodeVersion:"6.1.0",_npmUser:{name:"jprichardson",email:"jprichardson@gmail.com"},dist:{shasum:"9c665a95f88b8b08fc05cfd731f561859d725825",tarball:"https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz"},maintainers:[{name:"midnightlightning",email:"boydb@midnightdesign.ws"},{name:"sidazhang",email:"sidazhang89@gmail.com"},{name:"nadav",email:"npm@shesek.info"},{name:"jprichardson",email:"jprichardson@gmail.com"}],_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bigi-1.4.2.tgz_1469584192413_0.6801238611806184"},directories:{},_resolved:"https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",readme:"ERROR: No README data found!"}},{}],20:[function(a,b,c){(function(a){function b(a){var b,c;return b=a>h||0>a?(c=Math.abs(a)%h,0>a?h-c:c):a}function d(a){for(var b=0;ba;b=++a)128>b?c.push(b<<1):c.push(b<<1^283);return c}(),e=0,i=0,b=j=0;256>j;b=++j)c=i^i<<1^i<<2^i<<3^i<<4,c=c>>>8^255&c^99,this.SBOX[e]=c,this.INV_SBOX[c]=e,f=a[e],g=a[f],h=a[g],d=257*a[c]^16843008*c,this.SUB_MIX[0][e]=d<<24|d>>>8,this.SUB_MIX[1][e]=d<<16|d>>>16,this.SUB_MIX[2][e]=d<<8|d>>>24,this.SUB_MIX[3][e]=d,d=16843009*h^65537*g^257*f^16843008*e,this.INV_SUB_MIX[0][c]=d<<24|d>>>8,this.INV_SUB_MIX[1][c]=d<<16|d>>>16,this.INV_SUB_MIX[2][c]=d<<8|d>>>24,this.INV_SUB_MIX[3][c]=d,0===e?e=i=1:(e=f^a[a[a[h^f]]],i^=a[a[i]]);return!0};var i=new e;g.blockSize=16,g.prototype.blockSize=g.blockSize,g.keySize=32,g.prototype.keySize=g.keySize,g.prototype._doReset=function(){var a,b,c,d,e,f;for(c=this._key,b=c.length,this._nRounds=b+6,e=4*(this._nRounds+1),this._keySchedule=[],d=0;e>d;d++)this._keySchedule[d]=b>d?c[d]:(f=this._keySchedule[d-1],d%b===0?(f=f<<8|f>>>24,f=i.SBOX[f>>>24]<<24|i.SBOX[f>>>16&255]<<16|i.SBOX[f>>>8&255]<<8|i.SBOX[255&f],f^=i.RCON[d/b|0]<<24):b>6&&d%b===4?f=i.SBOX[f>>>24]<<24|i.SBOX[f>>>16&255]<<16|i.SBOX[f>>>8&255]<<8|i.SBOX[255&f]:void 0,this._keySchedule[d-b]^f);for(this._invKeySchedule=[],a=0;e>a;a++)d=e-a,f=this._keySchedule[d-(a%4?0:4)],this._invKeySchedule[a]=4>a||4>=d?f:i.INV_SUB_MIX[0][i.SBOX[f>>>24]]^i.INV_SUB_MIX[1][i.SBOX[f>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[f>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&f]];return!0},g.prototype.encryptBlock=function(b){b=f(new a(b));var c=this._doCryptBlock(b,this._keySchedule,i.SUB_MIX,i.SBOX),d=new a(16);return d.writeUInt32BE(c[0],0),d.writeUInt32BE(c[1],4),d.writeUInt32BE(c[2],8),d.writeUInt32BE(c[3],12),d},g.prototype.decryptBlock=function(b){b=f(new a(b));var c=[b[3],b[1]];b[1]=c[0],b[3]=c[1];var d=this._doCryptBlock(b,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX),e=new a(16);return e.writeUInt32BE(d[0],0),e.writeUInt32BE(d[3],4),e.writeUInt32BE(d[2],8),e.writeUInt32BE(d[1],12),e},g.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},g.prototype._doCryptBlock=function(a,c,d,e){var f,g,h,i,j,k,l,m,n;g=a[0]^c[0],h=a[1]^c[1],i=a[2]^c[2],j=a[3]^c[3],f=4;for(var o=1;o>>24]^d[1][h>>>16&255]^d[2][i>>>8&255]^d[3][255&j]^c[f++],l=d[0][h>>>24]^d[1][i>>>16&255]^d[2][j>>>8&255]^d[3][255&g]^c[f++],m=d[0][i>>>24]^d[1][j>>>16&255]^d[2][g>>>8&255]^d[3][255&h]^c[f++],n=d[0][j>>>24]^d[1][g>>>16&255]^d[2][h>>>8&255]^d[3][255&i]^c[f++],g=k,h=l,i=m,j=n;return k=(e[g>>>24]<<24|e[h>>>16&255]<<16|e[i>>>8&255]<<8|e[255&j])^c[f++],l=(e[h>>>24]<<24|e[i>>>16&255]<<16|e[j>>>8&255]<<8|e[255&g])^c[f++],m=(e[i>>>24]<<24|e[j>>>16&255]<<16|e[g>>>8&255]<<8|e[255&h])^c[f++],n=(e[j>>>24]<<24|e[g>>>16&255]<<16|e[h>>>8&255]<<8|e[255&i])^c[f++],[b(k),b(l),b(m),b(n)]},c.AES=g}).call(this,a("buffer").Buffer)},{buffer:191}],21:[function(a,b,c){(function(c){function d(a,b,e,h){if(!(this instanceof d))return new d(a,b,e);g.call(this),this._finID=c.concat([e,new c([0,0,0,1])]),e=c.concat([e,new c([0,0,0,2])]),this._cipher=new f.AES(b),this._prev=new c(e.length),this._cache=new c(""),this._secCache=new c(""),this._decrypt=h,this._alen=0,this._len=0,e.copy(this._prev),this._mode=a;var j=new c(4);j.fill(0),this._ghash=new i(this._cipher.encryptBlock(j)),this._authTag=null,this._called=!1}function e(a,b){var c=0;a.length!==b.length&&c++;for(var d=Math.min(a.length,b.length),e=-1;++eb&&(b=new c(b),b.fill(0),this._ghash.update(b))}this._called=!0;var d=this._mode.encrypt(this,a);return this._decrypt?this._ghash.update(a):this._ghash.update(d),this._len+=a.length,d},d.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var a=j(this._ghash["final"](8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt){if(e(a,this._authTag))throw new Error("Unsupported state or unable to authenticate data")}else this._authTag=a;this._cipher.scrub()},d.prototype.getAuthTag=function(){if(!this._decrypt&&c.isBuffer(this._authTag))return this._authTag;throw new Error("Attempting to get auth tag in unsupported state")},d.prototype.setAuthTag=function(a){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=a},d.prototype.setAAD=function(a){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(a),this._alen+=a.length}}).call(this,a("buffer").Buffer)},{"./aes":20,"./ghash":25,buffer:191,"buffer-xor":38,"cipher-base":34,inherits:36}],22:[function(a,b,c){function d(){return Object.keys(g)}var e=a("./encrypter");c.createCipher=c.Cipher=e.createCipher,c.createCipheriv=c.Cipheriv=e.createCipheriv;var f=a("./decrypter");c.createDecipher=c.Decipher=f.createDecipher, -c.createDecipheriv=c.Decipheriv=f.createDecipheriv;var g=a("./modes");c.listCiphers=c.getCiphers=d},{"./decrypter":23,"./encrypter":24,"./modes":26}],23:[function(a,b,c){(function(b){function d(a,c,f){return this instanceof d?(j.call(this),this._cache=new e,this._last=void 0,this._cipher=new i.AES(c),this._prev=new b(f.length),f.copy(this._prev),this._mode=a,void(this._autopadding=!0)):new d(a,c,f)}function e(){return this instanceof e?void(this.cache=new b("")):new e}function f(a){for(var b=a[15],c=-1;++c16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},e.prototype.flush=function(){return this.cache.length?this.cache:void 0};var p={ECB:a("./modes/ecb"),CBC:a("./modes/cbc"),CFB:a("./modes/cfb"),CFB8:a("./modes/cfb8"),CFB1:a("./modes/cfb1"),OFB:a("./modes/ofb"),CTR:a("./modes/ctr"),GCM:a("./modes/ctr")};c.createDecipher=h,c.createDecipheriv=g}).call(this,a("buffer").Buffer)},{"./aes":20,"./authCipher":21,"./modes":26,"./modes/cbc":27,"./modes/cfb":28,"./modes/cfb1":29,"./modes/cfb8":30,"./modes/ctr":31,"./modes/ecb":32,"./modes/ofb":33,"./streamCipher":37,buffer:191,"cipher-base":34,evp_bytestokey:35,inherits:36}],24:[function(a,b,c){(function(b){function d(a,c,f){return this instanceof d?(i.call(this),this._cache=new e,this._cipher=new h.AES(c),this._prev=new b(f.length),f.copy(this._prev),this._mode=a,void(this._autopadding=!0)):new d(a,c,f)}function e(){return this instanceof e?void(this.cache=new b("")):new e}function f(a,c,e){var f=k[a.toLowerCase()];if(!f)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=new b(e)),"string"==typeof c&&(c=new b(c)),c.length!==f.key/8)throw new TypeError("invalid key length "+c.length);if(e.length!==f.iv)throw new TypeError("invalid iv length "+e.length);return"stream"===f.type?new m(o[f.mode],c,e):"auth"===f.type?new n(o[f.mode],c,e):new d(o[f.mode],c,e)}function g(a,b){var c=k[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=l(b,!1,c.key,c.iv);return f(a,d.key,d.iv)}var h=a("./aes"),i=a("cipher-base"),j=a("inherits"),k=a("./modes"),l=a("evp_bytestokey"),m=a("./streamCipher"),n=a("./authCipher");j(d,i),d.prototype._update=function(a){this._cache.add(a);for(var c,d,e=[];c=this._cache.get();)d=this._mode.encrypt(this,c),e.push(d);return b.concat(e)},d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return a=this._mode.encrypt(this,a),this._cipher.scrub(),a;if("10101010101010101010101010101010"!==a.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=b.concat([this.cache,a])},e.prototype.get=function(){if(this.cache.length>15){var a=this.cache.slice(0,16);return this.cache=this.cache.slice(16),a}return null},e.prototype.flush=function(){for(var a=16-this.cache.length,c=new b(a),d=-1;++di||0>a?(c=Math.abs(a)%i,0>a?i-c:c):a}function g(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var h=new a(16);h.fill(0),b.exports=c,c.prototype.ghash=function(a){for(var b=-1;++b0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=e(h)},c.prototype.update=function(b){this.cache=a.concat([this.cache,b]);for(var c;this.cache.length>=16;)c=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(c)},c.prototype["final"]=function(b,c){return this.cache.length&&this.ghash(a.concat([this.cache,h],16)),this.ghash(e([0,b,0,c])),this.state};var i=Math.pow(2,32)}).call(this,a("buffer").Buffer)},{buffer:191}],26:[function(a,b,c){c["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},c["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},c["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},c["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},c["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},c["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},c.aes128=c["aes-128-cbc"],c.aes192=c["aes-192-cbc"],c.aes256=c["aes-256-cbc"],c["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},c["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},c["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},c["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},c["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},c["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},c["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},c["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},c["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},c["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},c["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},c["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},c["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},c["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},c["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},c["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},c["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},c["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],27:[function(a,b,c){var d=a("buffer-xor");c.encrypt=function(a,b){var c=d(b,a._prev);return a._prev=a._cipher.encryptBlock(c),a._prev},c.decrypt=function(a,b){var c=a._prev;a._prev=b;var e=a._cipher.decryptBlock(b);return d(e,c)}},{"buffer-xor":38}],28:[function(a,b,c){(function(b){function d(a,c,d){var f=c.length,g=e(c,a._cache);return a._cache=a._cache.slice(f),a._prev=b.concat([a._prev,d?c:g]),g}var e=a("buffer-xor");c.encrypt=function(a,c,e){for(var f,g=new b("");c.length;){if(0===a._cache.length&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=new b("")),!(a._cache.length<=c.length)){g=b.concat([g,d(a,c,e)]);break}f=a._cache.length,g=b.concat([g,d(a,c.slice(0,f),e)]),c=c.slice(f)}return g}}).call(this,a("buffer").Buffer)},{buffer:191,"buffer-xor":38}],29:[function(a,b,c){(function(a){function b(a,b,c){for(var e,f,g,h=-1,i=8,j=0;++h>h%8,a._prev=d(a._prev,c?f:g);return j}function d(b,c){var d=b.length,e=-1,f=new a(b.length);for(b=a.concat([b,new a([c])]);++e>7;return f}c.encrypt=function(c,d,e){for(var f=d.length,g=new a(f),h=-1;++h0&&n.push(g),n.push(a),b&&n.push(b),g=e(c.concat(n)),n=[],h=0,d>0)for(;;){if(0===d)break;if(h===g.length)break;k[i++]=g[h],d--,h++}if(f>0&&h!==g.length)for(;;){if(0===f)break;if(h===g.length)break;l[j++]=g[h],f--,h++}if(0===d&&0===f)break}for(h=0;hf;++f)e[f]=b[f]^c[f];return e}}).call(this,a("buffer").Buffer)},{buffer:191}],39:[function(a,b,c){(function(c){function d(a,b){(Array.isArray(a)||a instanceof Uint8Array)&&(a=new c(a));var d;null!=b?("number"==typeof b&&(b=new c([b])),d=c.concat([b,a])):d=a;var e=j(d).slice(0,4),f=c.concat([d,e]);return k.encode(f)}function e(a,b){var d,e=k.decode(a),f=new c(e);if(null==b)d=0;else{"number"==typeof b&&(b=new c([b])),d=b.length;var g=f.slice(0,d);if(g.toString("hex")!==b.toString("hex"))throw new Error("Invalid version")}var h=f.slice(-4),i=f.length-4,l=f.slice(0,i),m=j(l).slice(0,4);if(h.toString("hex")!==m.toString("hex"))throw new Error("Invalid checksum");return l.slice(d)}function f(a,b){try{e(a,b)}catch(c){return!1}return!0}function g(a){return function(b){return d(b,a)}}function h(a){return function(b){return e(b,a)}}function i(a){return function(b){return f(b,a)}}function j(a){var b=l("sha256").update(a).digest();return l("sha256").update(b).digest()}var k=a("bs58"),l=a("create-hash");b.exports={encode:d,decode:e,isValid:f,createEncoder:g,createDecoder:h,createValidator:i}}).call(this,a("buffer").Buffer)},{bs58:40,buffer:191,"create-hash":41}],40:[function(a,b,c){function d(a){if(0===a.length)return"";var b,c,d=[0];for(b=0;b=0;b--)g+=f[d[b]];return g}function e(a){if(0===a.length)return[];var b,c,d=[0];for(b=0;b>8,d[c]&=255;for(;f;)d.push(255&f),f>>=8}for(b=0;"1"===a[b]&&b>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,k=271733878,l=0;l>16)+(b>>16)+(c>>16);return d<<16|65535&c}function k(a,b){return a<>>32-b}var l=a("./helpers");b.exports=function(a){return l.hash(a,d,16)}},{"./helpers":42}],44:[function(a,b,c){arguments[4][34][0].apply(c,arguments)},{buffer:191,dup:34,inherits:45,stream:413,string_decoder:420}],45:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],46:[function(a,b,c){(function(a){function c(a){for(var b=[],c=0,d=0;c>>5]|=a[c]<<24-d%32;return b}function d(a){for(var b=[],c=0;c<32*a.length;c+=8)b.push(a[c>>>5]>>>24-c%32&255);return b}function e(a,b,c){for(var d=0;16>d;d++){var e=c+d,l=b[e];b[e]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}var s,t,u,v,w,x,y,z,A,B;x=s=a[0],y=t=a[1],z=u=a[2],A=v=a[3],B=w=a[4];var C;for(d=0;80>d;d+=1)C=s+b[c+m[d]]|0,C+=16>d?f(t,u,v)+q[0]:32>d?g(t,u,v)+q[1]:48>d?h(t,u,v)+q[2]:64>d?i(t,u,v)+q[3]:j(t,u,v)+q[4],C=0|C,C=k(C,o[d]),C=C+w|0,s=w,w=v,v=k(u,10),u=t,t=C,C=x+b[c+n[d]]|0,C+=16>d?j(y,z,A)+r[0]:32>d?i(y,z,A)+r[1]:48>d?h(y,z,A)+r[2]:64>d?g(y,z,A)+r[3]:f(y,z,A)+r[4],C=0|C,C=k(C,p[d]),C=C+B|0,x=B,B=A,A=k(z,10),z=y,y=C;C=a[1]+u+A|0,a[1]=a[2]+v+B|0,a[2]=a[3]+w+x|0,a[3]=a[4]+s+y|0,a[4]=a[0]+t+z|0,a[0]=C}function f(a,b,c){return a^b^c}function g(a,b,c){return a&b|~a&c}function h(a,b,c){return(a|~b)^c}function i(a,b,c){return a&c|b&~c}function j(a,b,c){return a^(b|~c)}function k(a,b){return a<>>32-b}function l(b){var f=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof b&&(b=new a(b,"utf8"));var g=c(b),h=8*b.length,i=8*b.length;g[h>>>5]|=128<<24-h%32,g[(h+64>>>9<<4)+14]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);for(var j=0;jj;j++){var k=f[j];f[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l=d(f);return new a(l)}var m=[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],n=[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],o=[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],p=[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],q=[0,1518500249,1859775393,2400959708,2840853838],r=[1352829926,1548603684,1836072691,2053994217,0];b.exports=l}).call(this,a("buffer").Buffer)},{buffer:191}],47:[function(a,b,c){(function(a){function c(b,c){this._block=new a(b),this._finalSize=c,this._blockSize=b,this._len=0,this._s=0}c.prototype.update=function(b,c){"string"==typeof b&&(c=c||"utf8",b=new a(b,c));for(var d=this._len+=b.length,e=this._s||0,f=0,g=this._block;d>e;){for(var h=Math.min(b.length,f+this._blockSize-e%this._blockSize),i=h-f,j=0;i>j;j++)g[e%this._blockSize+j]=b[j+f];e+=i,f+=i,e%this._blockSize===0&&this._update(g)}return this._s=e,this},c.prototype.digest=function(a){var b=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),b%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(b,this._blockSize-4);var c=this._update(this._block)||this._hash();return a?c.toString(a):c},c.prototype._update=function(){throw new Error("_update must be implemented by subclass")},b.exports=c}).call(this,a("buffer").Buffer)},{buffer:191}],48:[function(a,b,c){var c=b.exports=function(a){a=a.toLowerCase();var b=c[a];if(!b)throw new Error(a+" is not supported (we accept pull requests)");return new b};c.sha=a("./sha"),c.sha1=a("./sha1"),c.sha224=a("./sha224"),c.sha256=a("./sha256"),c.sha384=a("./sha384"),c.sha512=a("./sha512")},{"./sha":49,"./sha1":50,"./sha224":51,"./sha256":52,"./sha384":53,"./sha512":54}],49:[function(a,b,c){(function(c){function d(){this.init(),this._w=k,i.call(this,64,56)}function e(a){return a<<5|a>>>27}function f(a){return a<<30|a>>>2}function g(a,b,c,d){return 0===a?b&c|~b&d:2===a?b&c|b&d|c&d:b^c^d}var h=a("inherits"),i=a("./hash"),j=[1518500249,1859775393,-1894007588,-899497514],k=new Array(80);h(d,i),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(a){for(var b=this._w,c=0|this._a,d=0|this._b,h=0|this._c,i=0|this._d,k=0|this._e,l=0;16>l;++l)b[l]=a.readInt32BE(4*l);for(;80>l;++l)b[l]=b[l-3]^b[l-8]^b[l-14]^b[l-16];for(var m=0;80>m;++m){var n=~~(m/20),o=e(c)+g(n,d,h,i)+k+b[m]+j[n]|0;k=i,i=h,h=f(d),d=c,c=o}this._a=c+this._a|0,this._b=d+this._b|0,this._c=h+this._c|0,this._d=i+this._d|0,this._e=k+this._e|0},d.prototype._hash=function(){var a=new c(20);return a.writeInt32BE(0|this._a,0),a.writeInt32BE(0|this._b,4),a.writeInt32BE(0|this._c,8),a.writeInt32BE(0|this._d,12),a.writeInt32BE(0|this._e,16),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],50:[function(a,b,c){(function(c){function d(){this.init(),this._w=l,j.call(this,64,56)}function e(a){return a<<1|a>>>31}function f(a){return a<<5|a>>>27}function g(a){return a<<30|a>>>2}function h(a,b,c,d){return 0===a?b&c|~b&d:2===a?b&c|b&d|c&d:b^c^d}var i=a("inherits"),j=a("./hash"),k=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);i(d,j),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(a){for(var b=this._w,c=0|this._a,d=0|this._b,i=0|this._c,j=0|this._d,l=0|this._e,m=0;16>m;++m)b[m]=a.readInt32BE(4*m);for(;80>m;++m)b[m]=e(b[m-3]^b[m-8]^b[m-14]^b[m-16]);for(var n=0;80>n;++n){var o=~~(n/20),p=f(c)+h(o,d,i,j)+l+b[n]+k[o]|0;l=j,j=i,i=g(d),d=c,c=p}this._a=c+this._a|0,this._b=d+this._b|0,this._c=i+this._c|0,this._d=j+this._d|0,this._e=l+this._e|0},d.prototype._hash=function(){var a=new c(20);return a.writeInt32BE(0|this._a,0),a.writeInt32BE(0|this._b,4),a.writeInt32BE(0|this._c,8),a.writeInt32BE(0|this._d,12),a.writeInt32BE(0|this._e,16),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],51:[function(a,b,c){(function(c){function d(){this.init(),this._w=h,g.call(this,64,56)}var e=a("inherits"),f=a("./sha256"),g=a("./hash"),h=new Array(64);e(d,f),d.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},d.prototype._hash=function(){var a=new c(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,"./sha256":52,buffer:191,inherits:45}],52:[function(a,b,c){(function(c){function d(){this.init(),this._w=n,l.call(this,64,56)}function e(a,b,c){return c^a&(b^c)}function f(a,b,c){return a&b|c&(a|b)}function g(a){return(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10)}function h(a){return(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7)}function i(a){return(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3}function j(a){return(a>>>17|a<<15)^(a>>>19|a<<13)^a>>>10}var k=a("inherits"),l=a("./hash"),m=[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],n=new Array(64);k(d,l),d.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},d.prototype._update=function(a){for(var b=this._w,c=0|this._a,d=0|this._b,k=0|this._c,l=0|this._d,n=0|this._e,o=0|this._f,p=0|this._g,q=0|this._h,r=0;16>r;++r)b[r]=a.readInt32BE(4*r);for(;64>r;++r)b[r]=j(b[r-2])+b[r-7]+i(b[r-15])+b[r-16]|0;for(var s=0;64>s;++s){var t=q+h(n)+e(n,o,p)+m[s]+b[s]|0,u=g(c)+f(c,d,k)|0;q=p,p=o,o=n,n=l+t|0,l=k,k=d,d=c,c=t+u|0}this._a=c+this._a|0,this._b=d+this._b|0,this._c=k+this._c|0,this._d=l+this._d|0,this._e=n+this._e|0,this._f=o+this._f|0,this._g=p+this._g|0,this._h=q+this._h|0},d.prototype._hash=function(){var a=new c(32);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a.writeInt32BE(this._h,28),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],53:[function(a,b,c){(function(c){function d(){this.init(),this._w=h,g.call(this,128,112)}var e=a("inherits"),f=a("./sha512"),g=a("./hash"),h=new Array(160);e(d,f),d.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},d.prototype._hash=function(){function a(a,c,d){b.writeInt32BE(a,d),b.writeInt32BE(c,d+4)}var b=new c(48);return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),b},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,"./sha512":54,buffer:191,inherits:45}],54:[function(a,b,c){(function(c){function d(){this.init(),this._w=q,o.call(this,128,112)}function e(a,b,c){return c^a&(b^c)}function f(a,b,c){return a&b|c&(a|b)}function g(a,b){return(a>>>28|b<<4)^(b>>>2|a<<30)^(b>>>7|a<<25)}function h(a,b){return(a>>>14|b<<18)^(a>>>18|b<<14)^(b>>>9|a<<23)}function i(a,b){return(a>>>1|b<<31)^(a>>>8|b<<24)^a>>>7}function j(a,b){return(a>>>1|b<<31)^(a>>>8|b<<24)^(a>>>7|b<<25)}function k(a,b){return(a>>>19|b<<13)^(b>>>29|a<<3)^a>>>6}function l(a,b){return(a>>>19|b<<13)^(b>>>29|a<<3)^(a>>>6|b<<26)}function m(a,b){return b>>>0>a>>>0?1:0}var n=a("inherits"),o=a("./hash"),p=[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],q=new Array(160);n(d,o),d.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},d.prototype._update=function(a){for(var b=this._w,c=0|this._ah,d=0|this._bh,n=0|this._ch,o=0|this._dh,q=0|this._eh,r=0|this._fh,s=0|this._gh,t=0|this._hh,u=0|this._al,v=0|this._bl,w=0|this._cl,x=0|this._dl,y=0|this._el,z=0|this._fl,A=0|this._gl,B=0|this._hl,C=0;32>C;C+=2)b[C]=a.readInt32BE(4*C),b[C+1]=a.readInt32BE(4*C+4);for(;160>C;C+=2){var D=b[C-30],E=b[C-30+1],F=i(D,E),G=j(E,D);D=b[C-4],E=b[C-4+1];var H=k(D,E),I=l(E,D),J=b[C-14],K=b[C-14+1],L=b[C-32],M=b[C-32+1],N=G+K|0,O=F+J+m(N,G)|0;N=N+I|0,O=O+H+m(N,I)|0,N=N+M|0,O=O+L+m(N,M)|0,b[C]=O,b[C+1]=N}for(var P=0;160>P;P+=2){O=b[P],N=b[P+1];var Q=f(c,d,n),R=f(u,v,w),S=g(c,u),T=g(u,c),U=h(q,y),V=h(y,q),W=p[P],X=p[P+1],Y=e(q,r,s),Z=e(y,z,A),$=B+V|0,_=t+U+m($,B)|0;$=$+Z|0,_=_+Y+m($,Z)|0,$=$+X|0,_=_+W+m($,X)|0,$=$+N|0,_=_+O+m($,N)|0;var aa=T+R|0,ba=S+Q+m(aa,T)|0;t=s,B=A,s=r,A=z,r=q,z=y,y=x+$|0,q=o+_+m(y,x)|0,o=n,x=w,n=d,w=v,d=c,v=u,u=$+aa|0,c=_+ba+m(u,$)|0}this._al=this._al+u|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+x|0,this._el=this._el+y|0,this._fl=this._fl+z|0,this._gl=this._gl+A|0,this._hl=this._hl+B|0,this._ah=this._ah+c+m(this._al,u)|0,this._bh=this._bh+d+m(this._bl,v)|0,this._ch=this._ch+n+m(this._cl,w)|0,this._dh=this._dh+o+m(this._dl,x)|0,this._eh=this._eh+q+m(this._el,y)|0,this._fh=this._fh+r+m(this._fl,z)|0,this._gh=this._gh+s+m(this._gl,A)|0,this._hh=this._hh+t+m(this._hl,B)|0},d.prototype._hash=function(){function a(a,c,d){b.writeInt32BE(a,d),b.writeInt32BE(c,d+4)}var b=new c(64);return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),b},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],55:[function(a,b,c){function d(a,b,c,d,e,h,i){this.p=a,this.a=b,this.b=c,this.G=g.fromAffine(this,d,e),this.n=h,this.h=i,this.infinity=new g(this,null,null,f.ZERO),this.pOverFour=a.add(f.ONE).shiftRight(2)}var e=a("assert"),f=a("bigi"),g=a("./point");d.prototype.pointFromX=function(a,b){var c=b.pow(3).add(this.a.multiply(b)).add(this.b).mod(this.p),d=c.modPow(this.pOverFour,this.p),e=d;return d.isEven()^!a&&(e=this.p.subtract(e)),g.fromAffine(this,b,e)},d.prototype.isInfinity=function(a){return a===this.infinity?!0:0===a.z.signum()&&0!==a.y.signum()},d.prototype.isOnCurve=function(a){if(this.isInfinity(a))return!0;var b=a.affineX,c=a.affineY,d=this.a,e=this.b,f=this.p;if(b.signum()<0||b.compareTo(f)>=0)return!1;if(c.signum()<0||c.compareTo(f)>=0)return!1;var g=c.square().mod(f),h=b.pow(3).add(d.multiply(b)).add(e).mod(f);return g.equals(h)},d.prototype.validate=function(a){e(!this.isInfinity(a),"Point is at infinity"),e(this.isOnCurve(a),"Point is not on the curve");var b=a.multiply(this.n);return e(this.isInfinity(b),"Point is not a scalar multiple of G"),!0},b.exports=d},{"./point":59,assert:176,bigi:18}],56:[function(a,b,c){b.exports={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}},{}],57:[function(a,b,c){var d=a("./point"),e=a("./curve"),f=a("./names");b.exports={Curve:e,Point:d,getCurveByName:f}},{"./curve":55,"./names":58,"./point":59}],58:[function(a,b,c){function d(a){var b=f[a];if(!b)return null;var c=new e(b.p,16),d=new e(b.a,16),h=new e(b.b,16),i=new e(b.n,16),j=new e(b.h,16),k=new e(b.Gx,16),l=new e(b.Gy,16);return new g(c,d,h,k,l,i,j)}var e=a("bigi"),f=a("./curves.json"),g=a("./curve");b.exports=d},{"./curve":55,"./curves.json":56,bigi:18}],59:[function(a,b,c){(function(c){function d(a,b,c,d){e.notStrictEqual(d,void 0,"Missing Z coordinate"),this.curve=a,this.x=b,this.y=c,this.z=d,this._zInv=null,this.compressed=!0}var e=a("assert"),f=a("bigi"),g=f.valueOf(3);Object.defineProperty(d.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(d.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(d.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),d.fromAffine=function(a,b,c){return new d(a,b,c,f.ONE)},d.prototype.equals=function(a){if(a===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(a);if(this.curve.isInfinity(a))return this.curve.isInfinity(this);var b=a.y.multiply(this.z).subtract(this.y.multiply(a.z)).mod(this.curve.p);if(0!==b.signum())return!1;var c=a.x.multiply(this.z).subtract(this.x.multiply(a.z)).mod(this.curve.p);return 0===c.signum()},d.prototype.negate=function(){var a=this.curve.p.subtract(this.y);return new d(this.curve,this.x,a,this.z)},d.prototype.add=function(a){if(this.curve.isInfinity(this))return a;if(this.curve.isInfinity(a))return this;var b=this.x,c=this.y,e=a.x,f=a.y,h=f.multiply(this.z).subtract(c.multiply(a.z)).mod(this.curve.p),i=e.multiply(this.z).subtract(b.multiply(a.z)).mod(this.curve.p);if(0===i.signum())return 0===h.signum()?this.twice():this.curve.infinity;var j=i.square(),k=j.multiply(i),l=b.multiply(j),m=h.square().multiply(this.z),n=m.subtract(l.shiftLeft(1)).multiply(a.z).subtract(k).multiply(i).mod(this.curve.p),o=l.multiply(g).multiply(h).subtract(c.multiply(k)).subtract(m.multiply(h)).multiply(a.z).add(h.multiply(k)).mod(this.curve.p),p=k.multiply(this.z).multiply(a.z).mod(this.curve.p);return new d(this.curve,n,o,p)},d.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var a=this.x,b=this.y,c=b.multiply(this.z),e=c.multiply(b).mod(this.curve.p),f=this.curve.a,h=a.square().multiply(g);0!==f.signum()&&(h=h.add(this.z.square().multiply(f))),h=h.mod(this.curve.p);var i=h.square().subtract(a.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(c).mod(this.curve.p),j=h.multiply(g).multiply(a).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(h.pow(3)).mod(this.curve.p),k=c.pow(3).shiftLeft(3).mod(this.curve.p);return new d(this.curve,i,j,k)},d.prototype.multiply=function(a){if(this.curve.isInfinity(this))return this;if(0===a.signum())return this.curve.infinity;for(var b=a,c=b.multiply(g),d=this.negate(),e=this,f=c.bitLength()-2;f>0;--f){var h=c.testBit(f),i=b.testBit(f);e=e.twice(),h!==i&&(e=e.add(h?this:d))}return e},d.prototype.multiplyTwo=function(a,b,c){for(var d=Math.max(a.bitLength(),c.bitLength())-1,e=this.curve.infinity,f=this.add(b);d>=0;){var g=a.testBit(d),h=c.testBit(d);e=e.twice(),g?e=h?e.add(f):e.add(this):h&&(e=e.add(b)),--d}return e},d.prototype.getEncoded=function(a){if(null==a&&(a=this.compressed),this.curve.isInfinity(this))return new c("00","hex");var b,d=this.affineX,e=this.affineY,f=Math.floor((this.curve.p.bitLength()+7)/8);return a?(b=new c(1+f),b.writeUInt8(e.isEven()?2:3,0)):(b=new c(1+f+f),b.writeUInt8(4,0),e.toBuffer(f).copy(b,1+f)),d.toBuffer(f).copy(b,1),b},d.decodeFrom=function(a,b){var c,g=b.readUInt8(0),h=4!==g,i=Math.floor((a.p.bitLength()+7)/8),j=f.fromBuffer(b.slice(1,1+i));if(h){e.equal(b.length,i+1,"Invalid sequence length"),e(2===g||3===g,"Invalid sequence tag");var k=3===g;c=a.pointFromX(k,j)}else{e.equal(b.length,1+i+i,"Invalid sequence length");var l=f.fromBuffer(b.slice(1+i));c=d.fromAffine(a,j,l)}return c.compressed=h,c},d.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},b.exports=d}).call(this,a("buffer").Buffer)},{assert:176,bigi:18,buffer:191}],60:[function(a,b,c){(function(c){function d(a,b,d,h,i,j,k){function l(a,b,c,d,e,f){var g,h=0,i=128*c;for(a.copy(f,h,b,b+i),g=0;d>g;g++)f.copy(e,g*i,h,h+i),m(f,h,i,c),q&&q();for(g=0;d>g;g++){var j=h+64*(2*c-1),k=f.readUInt32LE(j)&d-1;p(e,k*i,f,h,i),m(f,h,i,c),q&&q()}f.copy(a,b,h,h+i)}function m(a,b,c,d){var f;for(e(a,b+64*(2*d-1),v,0,64),f=0;2*d>f;f++)p(a,64*f,v,0,64),o(v),e(v,0,a,c+64*f,64);for(f=0;d>f;f++)e(a,c+2*f*64,a,b+64*f,64);for(f=0;d>f;f++)e(a,c+64*(2*f+1),a,b+64*(f+d),64)}function n(a,b){return a<>>32-b}function o(a){var b;for(b=0;16>b;b++)t[b]=(255&a[4*b+0])<<0,t[b]|=(255&a[4*b+1])<<8,t[b]|=(255&a[4*b+2])<<16,t[b]|=(255&a[4*b+3])<<24;for(e(t,0,u,0,16),b=8;b>0;b-=2)u[4]^=n(u[0]+u[12],7),u[8]^=n(u[4]+u[0],9),u[12]^=n(u[8]+u[4],13),u[0]^=n(u[12]+u[8],18),u[9]^=n(u[5]+u[1],7),u[13]^=n(u[9]+u[5],9),u[1]^=n(u[13]+u[9],13),u[5]^=n(u[1]+u[13],18),u[14]^=n(u[10]+u[6],7),u[2]^=n(u[14]+u[10],9),u[6]^=n(u[2]+u[14],13),u[10]^=n(u[6]+u[2],18),u[3]^=n(u[15]+u[11],7),u[7]^=n(u[3]+u[15],9),u[11]^=n(u[7]+u[3],13),u[15]^=n(u[11]+u[7],18),u[1]^=n(u[0]+u[3],7),u[2]^=n(u[1]+u[0],9),u[3]^=n(u[2]+u[1],13),u[0]^=n(u[3]+u[2],18),u[6]^=n(u[5]+u[4],7),u[7]^=n(u[6]+u[5],9),u[4]^=n(u[7]+u[6],13),u[5]^=n(u[4]+u[7],18),u[11]^=n(u[10]+u[9],7),u[8]^=n(u[11]+u[10],9),u[9]^=n(u[8]+u[11],13),u[10]^=n(u[9]+u[8],18),u[12]^=n(u[15]+u[14],7),u[13]^=n(u[12]+u[15],9),u[14]^=n(u[13]+u[12],13),u[15]^=n(u[14]+u[13],18);for(b=0;16>b;++b)t[b]=u[b]+t[b];for(b=0;16>b;b++){var c=4*b;a[c+0]=t[b]>>0&255,a[c+1]=t[b]>>8&255,a[c+2]=t[b]>>16&255,a[c+3]=t[b]>>24&255}}function p(a,b,c,d,e){for(var f=0;e>f;f++)c[d+f]^=a[b+f]}if(0===d||0!==(d&d-1))throw Error("N must be > 0 and a power of 2");if(d>g/128/h)throw Error("Parameter N is too large");if(h>g/128/i)throw Error("Parameter r is too large");var q,r=new c(256*h),s=new c(128*h*d),t=new Int32Array(16),u=new Int32Array(16),v=new c(64),w=f(a,b,1,128*i*h,"sha256");if(k){var x=i*d*2,y=0;q=function(){++y,y%1e3===0&&k({current:y,total:x,percent:y/x*100})}}for(var z=0;i>z;z++)l(w,128*z*h,h,d,s,r);return f(a,w,1,j,"sha256")}function e(a,b,d,e,f){if(c.isBuffer(a)&&c.isBuffer(d))a.copy(d,e,b,b+f);else for(;f--;)d[e++]=a[b++]}var f=a("pbkdf2").pbkdf2Sync,g=2147483647;b.exports=d}).call(this,a("buffer").Buffer)},{buffer:191,pbkdf2:61}],61:[function(a,b,c){(function(b){function d(a,b,c,d,f,g){if("function"==typeof f&&(g=f,f=void 0),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");var h=e(a,b,c,d,f);setTimeout(function(){g(void 0,h)})}function e(a,c,d,e,h){if("number"!=typeof d)throw new TypeError("Iterations not a number");if(0>d)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(0>e||e>g)throw new TypeError("Bad key length");h=h||"sha1",b.isBuffer(a)||(a=new b(a,"binary")),b.isBuffer(c)||(c=new b(c,"binary"));var i,j=1,k=new b(e),l=new b(c.length+4);c.copy(l,0,0,c.length);for(var m,n,o=1;j>=o;o++){l.writeUInt32BE(o,c.length);var p=f(h,a).update(l).digest();i||(i=p.length,n=new b(i),j=Math.ceil(e/i),m=e-(j-1)*i),p.copy(n,0,0,i);for(var q=1;d>q;q++){p=f(h,a).update(p).digest();for(var r=0;i>r;r++)n[r]^=p[r]}var s=(o-1)*i,t=o===j?m:i;n.copy(k,s,0,t)}return k}var f=a("create-hmac"),g=Math.pow(2,30)-1;c.pbkdf2=d,c.pbkdf2Sync=e}).call(this,a("buffer").Buffer)},{buffer:191,"create-hmac":62}],62:[function(a,b,c){(function(c){"use strict";function d(a,b){g.call(this),a=a.toLowerCase(),"string"==typeof b&&(b=new c(b));var d="sha512"===a||"sha384"===a?128:64;this._alg=a,this._key=b,b.length>d?b=e(a).update(b).digest():b.lengthj;j++)f[j]=54^b[j],i[j]=92^b[j];this._hash=e(a).update(f)}var e=a("create-hash/browser"),f=a("inherits"),g=a("stream").Transform,h=new c(128);h.fill(0),f(d,g),d.prototype.update=function(a,b){return this._hash.update(a,b),this},d.prototype._transform=function(a,b,c){this._hash.update(a),c()},d.prototype._flush=function(a){this.push(this.digest()),a()},d.prototype.digest=function(a){var b=this._hash.digest();return e(this._alg).update(this._opad).update(b).digest(a)},b.exports=function(a,b){return new d(a,b)}}).call(this,a("buffer").Buffer)},{buffer:191,"create-hash/browser":41,inherits:63,stream:413}],63:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],64:[function(a,b,c){(function(c,d){"use strict";var e=b.exports;e.version="v"+a("./package.json").version,e.versionGuard=function(a){if(void 0!==a){var b="More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.";throw new Error(b)}},e.versionGuard(c._bitcore),c._bitcore=e.version,e.crypto={},e.crypto.BN=a("./lib/crypto/bn"),e.crypto.ECDSA=a("./lib/crypto/ecdsa"),e.crypto.Hash=a("./lib/crypto/hash"),e.crypto.Random=a("./lib/crypto/random"),e.crypto.Point=a("./lib/crypto/point"),e.crypto.Signature=a("./lib/crypto/signature"),e.encoding={},e.encoding.Base58=a("./lib/encoding/base58"),e.encoding.Base58Check=a("./lib/encoding/base58check"),e.encoding.BufferReader=a("./lib/encoding/bufferreader"),e.encoding.BufferWriter=a("./lib/encoding/bufferwriter"),e.encoding.Varint=a("./lib/encoding/varint"),e.util={},e.util.buffer=a("./lib/util/buffer"),e.util.js=a("./lib/util/js"),e.util.preconditions=a("./lib/util/preconditions"),e.errors=a("./lib/errors"),e.Address=a("./lib/address"),e.Block=a("./lib/block"),e.MerkleBlock=a("./lib/block/merkleblock"),e.BlockHeader=a("./lib/block/blockheader"),e.HDPrivateKey=a("./lib/hdprivatekey.js"),e.HDPublicKey=a("./lib/hdpublickey.js"),e.Networks=a("./lib/networks"),e.Opcode=a("./lib/opcode"),e.PrivateKey=a("./lib/privatekey"),e.PublicKey=a("./lib/publickey"),e.Script=a("./lib/script"),e.Transaction=a("./lib/transaction"),e.URI=a("./lib/uri"),e.Unit=a("./lib/unit"),e.deps={},e.deps.bnjs=a("bn.js"),e.deps.bs58=a("bs58"),e.deps.Buffer=d,e.deps.elliptic=a("elliptic"),e.deps._=a("lodash"),e._HDKeyCache=a("./lib/hdkeycache"),e.Transaction.sighash=a("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"./lib/address":65,"./lib/block":68,"./lib/block/blockheader":67,"./lib/block/merkleblock":69,"./lib/crypto/bn":70,"./lib/crypto/ecdsa":71,"./lib/crypto/hash":72,"./lib/crypto/point":73,"./lib/crypto/random":74,"./lib/crypto/signature":75,"./lib/encoding/base58":76,"./lib/encoding/base58check":77,"./lib/encoding/bufferreader":78,"./lib/encoding/bufferwriter":79,"./lib/encoding/varint":80,"./lib/errors":81,"./lib/hdkeycache":83,"./lib/hdprivatekey.js":84,"./lib/hdpublickey.js":85,"./lib/networks":86,"./lib/opcode":87,"./lib/privatekey":88,"./lib/publickey":89,"./lib/script":90,"./lib/transaction":93,"./lib/transaction/sighash":101,"./lib/unit":105,"./lib/uri":106,"./lib/util/buffer":107,"./lib/util/js":108,"./lib/util/preconditions":109,"./package.json":135,"bn.js":110,bs58:111,buffer:191,elliptic:113,lodash:432}],65:[function(a,b,c){(function(c){"use strict";function d(a,b,c){if(!(this instanceof d))return new d(a,b,c);if(e.isArray(a)&&e.isNumber(b))return d.createMultisig(a,b,c);if(a instanceof d)return a;if(f.checkArgument(a,"First argument is required, please include address data.","guide/address.html"),b&&!i.get(b))throw new TypeError('Second argument must be "livenet" or "testnet".');if(c&&c!==d.PayToPublicKeyHash&&c!==d.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var g=this._classifyArguments(a,b,c);return g.network=g.network||i.get(b)||i.defaultNetwork,g.type=g.type||c||d.PayToPublicKeyHash,k.defineImmutable(this,{hashBuffer:g.hashBuffer,network:g.network,type:g.type}),this}var e=a("lodash"),f=a("./util/preconditions"),g=a("./errors"),h=a("./encoding/base58check"),i=a("./networks"),j=a("./crypto/hash"),k=a("./util/js"),l=a("./publickey");d.prototype._classifyArguments=function(a,b,f){if((a instanceof c||a instanceof Uint8Array)&&20===a.length)return d._transformHash(a);if((a instanceof c||a instanceof Uint8Array)&&21===a.length)return d._transformBuffer(a,b,f);if(a instanceof l)return d._transformPublicKey(a);if(a instanceof m)return d._transformScript(a,b);if("string"==typeof a)return d._transformString(a,b,f);if(e.isObject(a))return d._transformObject(a);throw new TypeError("First argument is an unrecognized data format.")},d.PayToPublicKeyHash="pubkeyhash",d.PayToScriptHash="scripthash",d._transformHash=function(a){var b={};if(!(a instanceof c||a instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==a.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return b.hashBuffer=a,b},d._transformObject=function(a){return f.checkArgument(a.hash||a.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),f.checkArgument(a.type,"Must provide a `type` property"),{hashBuffer:a.hash?new c(a.hash,"hex"):a.hashBuffer,network:i.get(a.network)||i.defaultNetwork,type:a.type}},d._classifyFromVersion=function(a){var b={},c=i.get(a[0],"pubkeyhash"),e=i.get(a[0],"scripthash");return c?(b.network=c,b.type=d.PayToPublicKeyHash):e&&(b.network=e,b.type=d.PayToScriptHash),b},d._transformBuffer=function(a,b,e){var f={};if(!(a instanceof c||a instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==a.length)throw new TypeError("Address buffers must be exactly 21 bytes.");b=i.get(b);var g=d._classifyFromVersion(a);if(!g.network||b&&b!==g.network)throw new TypeError("Address has mismatched network type.");if(!g.type||e&&e!==g.type)throw new TypeError("Address has mismatched type.");return f.hashBuffer=a.slice(1),f.network=g.network,f.type=g.type,f},d._transformPublicKey=function(a){var b={};if(!(a instanceof l))throw new TypeError("Address must be an instance of PublicKey.");return b.hashBuffer=j.sha256ripemd160(a.toBuffer()),b.type=d.PayToPublicKeyHash,b},d._transformScript=function(a,b){f.checkArgument(a instanceof m,"script must be a Script instance");var c=a.getAddressInfo(b);if(!c)throw new g.Script.CantDeriveAddress(a);return c},d.createMultisig=function(a,b,c){return c=c||a[0].network||i.defaultNetwork,d.payingTo(m.buildMultisigOut(a,b),c)},d._transformString=function(a,b,c){if("string"!=typeof a)throw new TypeError("data parameter supplied is not a string.");a=a.trim();var e=h.decode(a),f=d._transformBuffer(e,b,c);return f},d.fromPublicKey=function(a,b){var c=d._transformPublicKey(a);return b=b||i.defaultNetwork,new d(c.hashBuffer,b,c.type)},d.fromPublicKeyHash=function(a,b){var c=d._transformHash(a);return new d(c.hashBuffer,b,d.PayToPublicKeyHash)},d.fromScriptHash=function(a,b){f.checkArgument(a,"hash parameter is required");var c=d._transformHash(a);return new d(c.hashBuffer,b,d.PayToScriptHash)},d.payingTo=function(a,b){return f.checkArgument(a,"script is required"),f.checkArgument(a instanceof m,"script must be instance of Script"),d.fromScriptHash(j.sha256ripemd160(a.toBuffer()),b)},d.fromScript=function(a,b){f.checkArgument(a instanceof m,"script must be a Script instance");var c=d._transformScript(a,b);return new d(c.hashBuffer,b,c.type)},d.fromBuffer=function(a,b,c){var e=d._transformBuffer(a,b,c);return new d(e.hashBuffer,e.network,e.type)},d.fromString=function(a,b,c){var e=d._transformString(a,b,c);return new d(e.hashBuffer,e.network,e.type)},d.fromObject=function(a){f.checkState(k.isHexa(a.hash),'Unexpected hash property, "'+a.hash+'", expected to be hex.');var b=new c(a.hash,"hex");return new d(b,a.network,a.type)},d.getValidationError=function(a,b,c){var e;try{new d(a,b,c)}catch(f){e=f}return e},d.isValid=function(a,b,c){return!d.getValidationError(a,b,c)},d.prototype.isPayToPublicKeyHash=function(){return this.type===d.PayToPublicKeyHash},d.prototype.isPayToScriptHash=function(){return this.type===d.PayToScriptHash},d.prototype.toBuffer=function(){var a=new c([this.network[this.type]]),b=c.concat([a,this.hashBuffer]);return b},d.prototype.toObject=d.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},d.prototype.toString=function(){return h.encode(this.toBuffer())},d.prototype.inspect=function(){return""},b.exports=d;var m=a("./script")}).call(this,a("buffer").Buffer)},{"./crypto/hash":72,"./encoding/base58check":77,"./errors":81,"./networks":86,"./publickey":89,"./script":90,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],66:[function(a,b,c){(function(c){"use strict";function d(a){return this instanceof d?(e.extend(this,d._from(a)),this):new d(a)}var e=a("lodash"),f=a("./blockheader"),g=a("../crypto/bn"),h=a("../util/buffer"),i=a("../encoding/bufferreader"),j=a("../encoding/bufferwriter"),k=a("../crypto/hash"),l=a("../transaction"),m=a("../util/preconditions");d.MAX_BLOCK_SIZE=1e6,d._from=function(a){var b={};if(h.isBuffer(a))b=d._fromBufferReader(i(a));else{if(!e.isObject(a))throw new TypeError("Unrecognized argument for Block");b=d._fromObject(a)}return b},d._fromObject=function(a){var b=[];a.transactions.forEach(function(a){a instanceof l?b.push(a):b.push(l().fromObject(a))});var c={header:f.fromObject(a.header),transactions:b};return c},d.fromObject=function(a){var b=d._fromObject(a);return new d(b)},d._fromBufferReader=function(a){var b={};m.checkState(!a.finished(),"No block data received"),b.header=f.fromBufferReader(a);var c=a.readVarintNum();b.transactions=[];for(var d=0;c>d;d++)b.transactions.push(l().fromBufferReader(a));return b},d.fromBufferReader=function(a){m.checkArgument(a,"br is required");var b=d._fromBufferReader(a);return new d(b)},d.fromBuffer=function(a){return d.fromBufferReader(new i(a))},d.fromString=function(a){var b=new c(a,"hex");return d.fromBuffer(b)},d.fromRawBlock=function(a){h.isBuffer(a)||(a=new c(a,"binary"));var b=i(a);b.pos=d.Values.START_OF_BLOCK;var e=d._fromBufferReader(b);return new d(e)},d.prototype.toObject=d.prototype.toJSON=function(){var a=[];return this.transactions.forEach(function(b){a.push(b.toObject())}),{header:this.header.toObject(),transactions:a}},d.prototype.toBuffer=function(){return this.toBufferWriter().concat()},d.prototype.toString=function(){return this.toBuffer().toString("hex")},d.prototype.toBufferWriter=function(a){a||(a=new j),a.write(this.header.toBuffer()),a.writeVarintNum(this.transactions.length);for(var b=0;b1;d=Math.floor((d+1)/2)){for(var e=0;d>e;e+=2){var f=Math.min(e+1,d-1),g=c.concat([a[b+e],a[b+f]]);a.push(k.sha256sha256(g))}b+=d}return a},d.prototype.getMerkleRoot=function(){var a=this.getMerkleTree();return a[a.length-1]},d.prototype.validMerkleRoot=function(){var a=new g(this.header.merkleRoot.toString("hex"),"hex"),b=new g(this.getMerkleRoot().toString("hex"),"hex");return 0!==a.cmp(b)?!1:!0},d.prototype._getHash=function(){return this.header._getHash()};var n={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:e.noop};Object.defineProperty(d.prototype,"id",n),Object.defineProperty(d.prototype,"hash",n),d.prototype.inspect=function(){return""},d.Values={START_OF_BLOCK:8,NULL_HASH:new c("0000000000000000000000000000000000000000000000000000000000000000","hex")},b.exports=d}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"../crypto/hash":72,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../transaction":93,"../util/buffer":107,"../util/preconditions":109,"./blockheader":67,buffer:191,lodash:432}],67:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("../crypto/bn"),f=a("../util/buffer"),g=a("../encoding/bufferreader"),h=a("../encoding/bufferwriter"),i=a("../crypto/hash"),j=(a("../util/js"),a("../util/preconditions")),k=486604799,l=function n(a){if(!(this instanceof n))return new n(a);var b=n._from(a);return this.version=b.version,this.prevHash=b.prevHash,this.merkleRoot=b.merkleRoot,this.time=b.time,this.timestamp=b.time,this.bits=b.bits,this.nonce=b.nonce,b.hash&&j.checkState(this.hash===b.hash,"Argument object hash property does not match block hash."),this};l._from=function(a){var b={};if(f.isBuffer(a))b=l._fromBufferReader(g(a));else{if(!d.isObject(a))throw new TypeError("Unrecognized argument for BlockHeader");b=l._fromObject(a)}return b},l._fromObject=function(a){j.checkArgument(a,"data is required");var b=a.prevHash,e=a.merkleRoot;d.isString(a.prevHash)&&(b=f.reverse(new c(a.prevHash,"hex"))),d.isString(a.merkleRoot)&&(e=f.reverse(new c(a.merkleRoot,"hex")));var g={hash:a.hash,version:a.version,prevHash:b,merkleRoot:e,time:a.time,timestamp:a.time,bits:a.bits,nonce:a.nonce};return g},l.fromObject=function(a){var b=l._fromObject(a);return new l(b)},l.fromRawBlock=function(a){f.isBuffer(a)||(a=new c(a,"binary"));var b=g(a);b.pos=l.Constants.START_OF_HEADER;var d=l._fromBufferReader(b);return new l(d)},l.fromBuffer=function(a){var b=l._fromBufferReader(g(a));return new l(b)},l.fromString=function(a){var b=new c(a,"hex");return l.fromBuffer(b)},l._fromBufferReader=function(a){var b={};return b.version=a.readUInt32LE(),b.prevHash=a.read(32),b.merkleRoot=a.read(32),b.time=a.readUInt32LE(),b.bits=a.readUInt32LE(),b.nonce=a.readUInt32LE(),b},l.fromBufferReader=function(a){var b=l._fromBufferReader(a);return new l(b)},l.prototype.toObject=l.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:f.reverse(this.prevHash).toString("hex"),merkleRoot:f.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},l.prototype.toBuffer=function(){return this.toBufferWriter().concat()},l.prototype.toString=function(){return this.toBuffer().toString("hex")},l.prototype.toBufferWriter=function(a){return a||(a=new h),a.writeUInt32LE(this.version),a.write(this.prevHash),a.write(this.merkleRoot),a.writeUInt32LE(this.time),a.writeUInt32LE(this.bits),a.writeUInt32LE(this.nonce),a},l.prototype.getTargetDifficulty=function(a){a=a||this.bits;for(var b=new e(16777215&a),c=8*((a>>>24)-3);c-->0;)b=b.mul(new e(2));return b},l.prototype.getDifficulty=function(){var a=this.getTargetDifficulty(k).mul(new e(Math.pow(10,8))),b=this.getTargetDifficulty(),c=a.div(b).toString(10),d=c.length-8;return c=c.slice(0,d)+"."+c.slice(d),parseFloat(c)},l.prototype._getHash=function(){var a=this.toBuffer();return i.sha256sha256(a)};var m={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=g(this._getHash()).readReverse().toString("hex")),this._id},set:d.noop};Object.defineProperty(l.prototype,"id",m),Object.defineProperty(l.prototype,"hash",m),l.prototype.validTimestamp=function(){var a=Math.round((new Date).getTime()/1e3);return this.time>a+l.Constants.MAX_TIME_OFFSET?!1:!0},l.prototype.validProofOfWork=function(){var a=new e(this.id,"hex"),b=this.getTargetDifficulty();return a.cmp(b)>0?!1:!0},l.prototype.inspect=function(){return""},l.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new e("10000000000000000000000000000000000000000000000000000000000000000","hex")},b.exports=l}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"../crypto/hash":72,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,buffer:191,lodash:432}],68:[function(a,b,c){b.exports=a("./block"),b.exports.BlockHeader=a("./blockheader"),b.exports.MerkleBlock=a("./merkleblock")},{"./block":66,"./blockheader":67,"./merkleblock":69}],69:[function(a,b,c){(function(c){"use strict";function d(a){if(!(this instanceof d))return new d(a);var b={};if(g.isBuffer(a))b=d._fromBufferReader(h(a));else{if(!e.isObject(a))throw new TypeError("Unrecognized argument for MerkleBlock");var c;c=a.header instanceof f?a.header:f.fromObject(a.header),b={header:c,numTransactions:a.numTransactions,hashes:a.hashes,flags:a.flags}}return e.extend(this,b),this._flagBitsUsed=0,this._hashesUsed=0,this}var e=a("lodash"),f=a("./blockheader"),g=a("../util/buffer"),h=a("../encoding/bufferreader"),i=a("../encoding/bufferwriter"),j=a("../crypto/hash"),k=(a("../util/js"),a("../transaction")),l=a("../util/preconditions");d.fromBuffer=function(a){return d.fromBufferReader(h(a))},d.fromBufferReader=function(a){return new d(d._fromBufferReader(a))},d.prototype.toBuffer=function(){return this.toBufferWriter().concat()},d.prototype.toBufferWriter=function(a){a||(a=new i),a.write(this.header.toBuffer()),a.writeUInt32LE(this.numTransactions),a.writeVarintNum(this.hashes.length);for(var b=0;bthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var e=this.flags[d.flagBitsUsed>>3]>>>(7&d.flagBitsUsed++)&1;if(0!==a&&e){var f=this._traverseMerkleTree(a-1,2*b,d),g=f;return 2*b+1=this.hashes.length)return null;var h=this.hashes[d.hashesUsed++];return 0===a&&e&&d.txs.push(h),new c(h,"hex")},d.prototype._calcTreeWidth=function(a){ -return this.numTransactions+(1<>a},d.prototype._calcTreeHeight=function(){for(var a=0;this._calcTreeWidth(a)>1;)a++;return a},d.prototype.hasTransaction=function(a){l.checkArgument(!e.isUndefined(a),"tx cannot be undefined"),l.checkArgument(a instanceof k||"string"==typeof a,'Invalid tx given, tx must be a "string" or "Transaction"');var b=a;a instanceof k&&(b=g.reverse(new c(a.id,"hex")).toString("hex"));var d=[],f=this._calcTreeHeight();return this._traverseMerkleTree(f,0,{txs:d}),-1!==d.indexOf(b)},d._fromBufferReader=function(a){l.checkState(!a.finished(),"No merkleblock data received");var b={};b.header=f.fromBufferReader(a),b.numTransactions=a.readUInt32LE();var c=a.readVarintNum();b.hashes=[];for(var d=0;c>d;d++)b.hashes.push(a.read(32).toString("hex"));var e=a.readVarintNum();for(b.flags=[],d=0;e>d;d++)b.flags.push(a.readUInt8());return b},d.fromObject=function(a){return new d(a)},b.exports=d}).call(this,a("buffer").Buffer)},{"../crypto/hash":72,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../transaction":93,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,"./blockheader":67,buffer:191,lodash:432}],70:[function(a,b,c){(function(c){"use strict";var d=a("bn.js"),e=a("../util/preconditions"),f=a("lodash"),g=function(a){for(var b=new c(a.length),d=0;da.size?b=d.trim(b,f):f0&&0===(127&a[a.length-1])&&(a.length<=1||0===(128&a[a.length-2])))throw new Error("non-minimally encoded script number");return d.fromSM(a,{endian:"little"})},d.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},d.prototype.gt=function(a){return this.cmp(a)>0},d.prototype.gte=function(a){return this.cmp(a)>=0},d.prototype.lt=function(a){return this.cmp(a)<0},d.trim=function(a,b){return a.slice(b-a.length,a.length)},d.pad=function(a,b,d){for(var e=new c(d),f=0;ff;f++)e[f]=0;return e},b.exports=d}).call(this,a("buffer").Buffer)},{"../util/preconditions":109,"bn.js":110,buffer:191,lodash:432}],71:[function(a,b,c){(function(c){"use strict";var d=a("./bn"),e=a("./point"),f=a("./signature"),g=a("../publickey"),h=a("./random"),i=a("./hash"),j=a("../util/buffer"),k=a("lodash"),l=a("../util/preconditions"),m=function n(a){return this instanceof n?void(a&&this.set(a)):new n(a)};m.prototype.set=function(a){return this.hashbuf=a.hashbuf||this.hashbuf,this.endian=a.endian||this.endian,this.privkey=a.privkey||this.privkey,this.pubkey=a.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),this.sig=a.sig||this.sig,this.k=a.k||this.k,this.verified=a.verified||this.verified,this},m.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()},m.prototype.calci=function(){for(var a=0;4>a;a++){this.sig.i=a;var b;try{b=this.toPublicKey()}catch(c){console.error(c);continue}if(b.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")},m.fromString=function(a){var b=JSON.parse(a);return new m(b)},m.prototype.randomK=function(){var a,b=e.getN();do a=d.fromBuffer(h.getRandomBuffer(32));while(!a.lt(b)||!a.gt(d.Zero));return this.k=a,this},m.prototype.deterministicK=function(a){k.isUndefined(a)&&(a=0);var b=new c(32);b.fill(1);var f=new c(32);f.fill(0);var g=this.privkey.bn.toBuffer({size:32}),h="little"===this.endian?j.reverse(this.hashbuf):this.hashbuf;f=i.sha256hmac(c.concat([b,new c([0]),g,h]),f),b=i.sha256hmac(b,f),f=i.sha256hmac(c.concat([b,new c([1]),g,h]),f),b=i.sha256hmac(b,f),b=i.sha256hmac(b,f);for(var l=d.fromBuffer(b),m=e.getN(),n=0;a>n||!l.lt(m)||!l.gt(d.Zero);n++)f=i.sha256hmac(c.concat([b,new c([0])]),f),b=i.sha256hmac(b,f),b=i.sha256hmac(b,f),l=d.fromBuffer(b);return this.k=l,this},m.prototype.toPublicKey=function(){var a=this.sig.i;l.checkArgument(0===a||1===a||2===a||3===a,new Error("i must be equal to 0, 1, 2, or 3"));var b=d.fromBuffer(this.hashbuf),c=this.sig.r,f=this.sig.s,h=1&a,i=a>>1,j=e.getN(),k=e.getG(),m=i?c.add(j):c,n=e.fromX(h,m),o=n.mul(j);if(!o.isInfinity())throw new Error("nR is not a valid curve point");var p=b.neg().mod(j),q=c.invm(j),r=n.mul(f).add(k.mul(p)).mul(q),s=g.fromPoint(r,this.sig.compressed);return s},m.prototype.sigError=function(){if(!j.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var a=this.sig.r,b=this.sig.s;if(!(a.gt(d.Zero)&&a.lt(e.getN())&&b.gt(d.Zero)&&b.lt(e.getN())))return"r and s not in range";var c=d.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),f=e.getN(),g=b.invm(f),h=g.mul(c).mod(f),i=g.mul(a).mod(f),k=e.getG().mulAdd(h,this.pubkey.point,i);return k.isInfinity()?"p is infinity":0!==k.getX().mod(f).cmp(a)?"Invalid signature":!1},m.toLowS=function(a){return a.gt(d.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(a=e.getN().sub(a)),a},m.prototype._findSignature=function(a,b){var c,f,g,h,i=e.getN(),j=e.getG(),k=0;do(!this.k||k>0)&&this.deterministicK(k),k++,c=this.k,f=j.mul(c),g=f.x.mod(i),h=c.invm(i).mul(b.add(a.mul(g))).mod(i);while(g.cmp(d.Zero)<=0||h.cmp(d.Zero)<=0);return h=m.toLowS(h),{s:h,r:g}},m.prototype.sign=function(){var a=this.hashbuf,b=this.privkey,c=b.bn;l.checkState(a&&b&&c,new Error("invalid parameters")),l.checkState(j.isBuffer(a)&&32===a.length,new Error("hashbuf must be a 32 byte buffer"));var e=d.fromBuffer(a,this.endian?{endian:this.endian}:void 0),g=this._findSignature(c,e);return g.compressed=this.pubkey.compressed,this.sig=new f(g),this},m.prototype.signRandomK=function(){return this.randomK(),this.sign()},m.prototype.toString=function(){var a={};return this.hashbuf&&(a.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(a.privkey=this.privkey.toString()),this.pubkey&&(a.pubkey=this.pubkey.toString()),this.sig&&(a.sig=this.sig.toString()),this.k&&(a.k=this.k.toString()),JSON.stringify(a)},m.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},m.sign=function(a,b,c){return m().set({hashbuf:a,endian:c,privkey:b}).sign().sig},m.verify=function(a,b,c,d){return m().set({hashbuf:a,endian:d,sig:b,pubkey:c}).verify().verified},b.exports=m}).call(this,a("buffer").Buffer)},{"../publickey":89,"../util/buffer":107,"../util/preconditions":109,"./bn":70,"./hash":72,"./point":73,"./random":74,"./signature":75,buffer:191,lodash:432}],72:[function(a,b,c){(function(c){"use strict";var d=a("crypto"),e=a("../util/buffer"),f=a("../util/preconditions"),g=b.exports;g.sha1=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("sha1").update(a).digest()},g.sha1.blocksize=512,g.sha256=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("sha256").update(a).digest()},g.sha256.blocksize=512,g.sha256sha256=function(a){return f.checkArgument(e.isBuffer(a)),g.sha256(g.sha256(a))},g.ripemd160=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("ripemd160").update(a).digest()},g.sha256ripemd160=function(a){return f.checkArgument(e.isBuffer(a)),g.ripemd160(g.sha256(a))},g.sha512=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("sha512").update(a).digest()},g.sha512.blocksize=1024,g.hmac=function(a,b,d){f.checkArgument(e.isBuffer(b)),f.checkArgument(e.isBuffer(d)),f.checkArgument(a.blocksize);var g=a.blocksize/8;if(d.length>g)d=a(d);else if(g>d){var h=new c(g);h.fill(0),d.copy(h),d=h}var i=new c(g);i.fill(92);var j=new c(g);j.fill(54);for(var k=new c(g),l=new c(g),m=0;g>m;m++)k[m]=i[m]^d[m],l[m]=j[m]^d[m];return a(c.concat([k,a(c.concat([l,b]))]))},g.sha256hmac=function(a,b){return g.hmac(g.sha256,a,b)},g.sha512hmac=function(a,b){return g.hmac(g.sha512,a,b)}}).call(this,a("buffer").Buffer)},{"../util/buffer":107,"../util/preconditions":109,buffer:191,crypto:195}],73:[function(a,b,c){(function(c){"use strict";var d=a("./bn"),e=a("../util/buffer"),f=a("elliptic").curves.secp256k1,g=f.curve.point.bind(f.curve),h=f.curve.pointFromX.bind(f.curve),i=function(a,b,c){var d=g(a,b,c);return d.validate(),d};i.prototype=Object.getPrototypeOf(f.curve.point()),i.fromX=function(a,b){var c=h(a,b);return c.validate(),c},i.getG=function(){return f.curve.g},i.getN=function(){return new d(f.curve.n.toArray())},i.prototype._getX=i.prototype.getX,i.prototype.getX=function(){return new d(this._getX().toArray())},i.prototype._getY=i.prototype.getY,i.prototype.getY=function(){return new d(this._getY().toArray())},i.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");if(0===this.getX().cmp(d.Zero)||0===this.getY().cmp(d.Zero))throw new Error("Invalid x,y value for curve, cannot equal 0.");var a=h(this.getY().isOdd(),this.getX());if(0!==a.y.cmp(this.y))throw new Error("Invalid y value for curve.");var b=this.getX().gt(d.Minus1)&&this.getX().lt(i.getN()),c=this.getY().gt(d.Minus1)&&this.getY().lt(i.getN());if(!b||!c)throw new Error("Point does not lie on the curve");if(!this.mul(i.getN()).isInfinity())throw new Error("Point times N must be infinity");return this},i.pointToCompressed=function(a){var b,d=a.getX().toBuffer({size:32}),f=a.getY().toBuffer({size:32}),g=f[f.length-1]%2;return b=new c(g?[3]:[2]),e.concat([b,d])},b.exports=i}).call(this,a("buffer").Buffer)},{"../util/buffer":107,"./bn":70,buffer:191,elliptic:113}],74:[function(a,b,c){(function(c,d){"use strict";function e(){}e.getRandomBuffer=function(a){return c.browser?e.getRandomBufferBrowser(a):e.getRandomBufferNode(a)},e.getRandomBufferNode=function(b){var c=a("crypto");return c.randomBytes(b)},e.getRandomBufferBrowser=function(a){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var b=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");var b=window.msCrypto}var c=new Uint8Array(a);b.getRandomValues(c);var e=new d(c);return e},e.getPseudoRandomBuffer=function(a){for(var b,c=4294967296,e=new d(a),f=0;a>=f;f++){var g=Math.floor(f/4),h=f-4*g;0===h?(b=Math.random()*c,e[f]=255&b):e[f]=255&(b>>>=8)}return e},b.exports=e}).call(this,a("_process"),a("buffer").Buffer)},{_process:392,buffer:191,crypto:195}],75:[function(a,b,c){(function(c){"use strict";var d=a("./bn"),e=a("lodash"),f=a("../util/preconditions"),g=a("../util/buffer"),h=a("../util/js"),i=function j(a,b){if(!(this instanceof j))return new j(a,b);if(a instanceof d)this.set({r:a,s:b});else if(a){var c=a;this.set(c)}};i.prototype.set=function(a){return this.r=a.r||this.r||void 0,this.s=a.s||this.s||void 0,this.i="undefined"!=typeof a.i?a.i:this.i,this.compressed="undefined"!=typeof a.compressed?a.compressed:this.compressed,this.nhashtype=a.nhashtype||this.nhashtype||void 0,this},i.fromCompact=function(a){f.checkArgument(g.isBuffer(a),"Argument is expected to be a Buffer");var b=new i,c=!0,e=a.slice(0,1)[0]-27-4;0>e&&(c=!1,e+=4);var h=a.slice(1,33),j=a.slice(33,65);return f.checkArgument(0===e||1===e||2===e||3===e,new Error("i must be 0, 1, 2, or 3")),f.checkArgument(32===h.length,new Error("r must be 32 bytes")),f.checkArgument(32===j.length,new Error("s must be 32 bytes")),b.compressed=c,b.i=e,b.r=d.fromBuffer(h),b.s=d.fromBuffer(j),b},i.fromDER=i.fromBuffer=function(a,b){var c=i.parseDER(a,b),d=new i;return d.r=c.r,d.s=c.s,d},i.fromTxFormat=function(a){var b=a.readUInt8(a.length-1),c=a.slice(0,a.length-1),d=new i.fromDER(c,!1);return d.nhashtype=b,d},i.fromString=function(a){var b=new c(a,"hex");return i.fromDER(b)},i.parseDER=function(a,b){f.checkArgument(g.isBuffer(a),new Error("DER formatted signature should be a buffer")),e.isUndefined(b)&&(b=!0);var c=a[0];f.checkArgument(48===c,new Error("Header byte should be 0x30"));var h=a[1],i=a.slice(2).length;f.checkArgument(!b||h===i,new Error("Length byte should length of what follows")),h=i>h?h:i;var j=a[2];f.checkArgument(2===j,new Error("Integer byte for r should be 0x02"));var k=a[3],l=a.slice(4,4+k),m=d.fromBuffer(l),n=0===a[4]?!0:!1;f.checkArgument(k===l.length,new Error("Length of r incorrect"));var o=a[4+k+0];f.checkArgument(2===o,new Error("Integer byte for s should be 0x02"));var p=a[4+k+1],q=a.slice(4+k+2,4+k+2+p),r=d.fromBuffer(q),s=0===a[4+k+2+2]?!0:!1;f.checkArgument(p===q.length,new Error("Length of s incorrect"));var t=4+k+2+p;f.checkArgument(h===t-2,new Error("Length of signature incorrect"));var u={header:c,length:h,rheader:j,rlength:k,rneg:n,rbuf:l,r:m,sheader:o,slength:p,sneg:s,sbuf:q,s:r};return u},i.prototype.toCompact=function(a,b){if(a="number"==typeof a?a:this.i,b="boolean"==typeof b?b:this.compressed,0!==a&&1!==a&&2!==a&&3!==a)throw new Error("i must be equal to 0, 1, 2, or 3");var d=a+27+4;b===!1&&(d-=4);var e=new c([d]),f=this.r.toBuffer({size:32}),g=this.s.toBuffer({size:32});return c.concat([e,f,g])},i.prototype.toBuffer=i.prototype.toDER=function(){var a=this.r.toBuffer(),b=this.s.toBuffer(),d=128&a[0]?!0:!1,e=128&b[0]?!0:!1,f=d?c.concat([new c([0]),a]):a,g=e?c.concat([new c([0]),b]):b,h=f.length,i=g.length,j=2+h+2+i,k=2,l=2,m=48,n=c.concat([new c([m,j,k,h]),f,new c([l,i]),g]);return n},i.prototype.toString=function(){var a=this.toDER();return a.toString("hex")},i.isTxDER=function(a){if(a.length<9)return!1;if(a.length>73)return!1;if(48!==a[0])return!1;if(a[1]!==a.length-3)return!1;var b=a[3];if(5+b>=a.length)return!1;var c=a[5+b];if(b+c+7!==a.length)return!1;var d=a.slice(4);if(2!==a[2])return!1;if(0===b)return!1;if(128&d[0])return!1;if(b>1&&0===d[0]&&!(128&d[1]))return!1;var e=a.slice(6+b);return 2!==a[6+b-2]?!1:0===c?!1:128&e[0]?!1:c>1&&0===e[0]&&!(128&e[1])?!1:!0},i.prototype.hasLowS=function(){return this.s.lt(new d(1))||this.s.gt(new d("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))?!1:!0},i.prototype.hasDefinedHashtype=function(){if(!h.isNaturalNumber(this.nhashtype))return!1;var a=this.nhashtype&~i.SIGHASH_ANYONECANPAY;return ai.SIGHASH_SINGLE?!1:!0},i.prototype.toTxFormat=function(){var a=this.toDER(),b=new c(1);return b.writeUInt8(this.nhashtype,0),c.concat([a,b])},i.SIGHASH_ALL=1,i.SIGHASH_NONE=2,i.SIGHASH_SINGLE=3,i.SIGHASH_ANYONECANPAY=128,b.exports=i}).call(this,a("buffer").Buffer)},{"../util/buffer":107,"../util/js":108,"../util/preconditions":109,"./bn":70,buffer:191,lodash:432}],76:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("bs58"),f=a("buffer"),g="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),h=function i(a){if(!(this instanceof i))return new i(a);if(c.isBuffer(a)){var b=a;this.fromBuffer(b)}else if("string"==typeof a){var d=a;this.fromString(d)}else a&&this.set(a)};h.validCharacters=function(a){return f.Buffer.isBuffer(a)&&(a=a.toString()),d.all(d.map(a,function(a){return d.contains(g,a)}))},h.prototype.set=function(a){return this.buf=a.buf||this.buf||void 0,this},h.encode=function(a){if(!f.Buffer.isBuffer(a))throw new Error("Input should be a buffer");return e.encode(a)},h.decode=function(a){if("string"!=typeof a)throw new Error("Input should be a string");return new c(e.decode(a))},h.prototype.fromBuffer=function(a){return this.buf=a,this},h.prototype.fromString=function(a){var b=h.decode(a);return this.buf=b,this},h.prototype.toBuffer=function(){return this.buf},h.prototype.toString=function(){return h.encode(this.buf)},b.exports=h}).call(this,a("buffer").Buffer)},{bs58:111,buffer:191,lodash:432}],77:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("./base58"),f=a("buffer"),g=a("../crypto/hash").sha256sha256,h=function i(a){if(!(this instanceof i))return new i(a);if(c.isBuffer(a)){var b=a;this.fromBuffer(b)}else if("string"==typeof a){var d=a;this.fromString(d)}else a&&this.set(a)};h.prototype.set=function(a){return this.buf=a.buf||this.buf||void 0,this},h.validChecksum=function(a,b){return d.isString(a)&&(a=new f.Buffer(e.decode(a))),d.isString(b)&&(b=new f.Buffer(e.decode(b))),b||(b=a.slice(-4),a=a.slice(0,-4)),h.checksum(a).toString("hex")===b.toString("hex")},h.decode=function(a){if("string"!=typeof a)throw new Error("Input must be a string");var b=new c(e.decode(a));if(b.length<4)throw new Error("Input string too short");var d=b.slice(0,-4),f=b.slice(-4),h=g(d),i=h.slice(0,4);if(f.toString("hex")!==i.toString("hex"))throw new Error("Checksum mismatch");return d},h.checksum=function(a){return g(a).slice(0,4)},h.encode=function(a){if(!c.isBuffer(a))throw new Error("Input must be a buffer");var b=new c(a.length+4),d=h.checksum(a);return a.copy(b),d.copy(b,a.length),e.encode(b)},h.prototype.fromBuffer=function(a){return this.buf=a,this},h.prototype.fromString=function(a){var b=h.decode(a);return this.buf=b,this},h.prototype.toBuffer=function(){return this.buf},h.prototype.toString=function(){return h.encode(this.buf)},b.exports=h}).call(this,a("buffer").Buffer)},{"../crypto/hash":72,"./base58":76,buffer:191,lodash:432}],78:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("../util/preconditions"),f=a("../util/buffer"),g=a("../crypto/bn"),h=function i(a){if(!(this instanceof i))return new i(a);if(!d.isUndefined(a))if(c.isBuffer(a))this.set({buf:a});else if(d.isString(a))this.set({buf:new c(a,"hex")});else{if(!d.isObject(a))throw new TypeError("Unrecognized argument for BufferReader");var b=a;this.set(b)}};h.prototype.set=function(a){return this.buf=a.buf||this.buf||void 0,this.pos=a.pos||this.pos||0,this},h.prototype.eof=function(){return this.pos>=this.buf.length},h.prototype.finished=h.prototype.eof,h.prototype.read=function(a){e.checkArgument(!d.isUndefined(a),"Must specify a length");var b=this.buf.slice(this.pos,this.pos+a);return this.pos=this.pos+a,b},h.prototype.readAll=function(){var a=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,a},h.prototype.readUInt8=function(){var a=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,a},h.prototype.readUInt16BE=function(){var a=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,a},h.prototype.readUInt16LE=function(){var a=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,a},h.prototype.readUInt32BE=function(){var a=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,a},h.prototype.readUInt32LE=function(){var a=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,a},h.prototype.readUInt64BEBN=function(){var a=this.buf.slice(this.pos,this.pos+8),b=g.fromBuffer(a);return this.pos=this.pos+8,b},h.prototype.readUInt64LEBN=function(){var a,b=this.buf.readUInt32LE(this.pos),c=this.buf.readUInt32LE(this.pos+4),d=4294967296*c+b;if(9007199254740991>=d)a=new g(d);else{var e=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);a=new g(e,10,"le")}return this.pos=this.pos+8,a},h.prototype.readVarintNum=function(){var a=this.readUInt8();switch(a){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var b=this.readUInt64LEBN(),c=b.toNumber();if(c<=Math.pow(2,53))return c;throw new Error("number too large to retain precision - use readVarintBN");default:return a}},h.prototype.readVarLengthBuffer=function(){var a=this.readVarintNum(),b=this.read(a);return e.checkState(b.length===a,"Invalid length while reading varlength buffer. Expected to read: "+a+" and read "+b.length),b},h.prototype.readVarintBuf=function(){var a=this.buf.readUInt8(this.pos);switch(a){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},h.prototype.readVarintBN=function(){var a=this.readUInt8();switch(a){case 253:return new g(this.readUInt16LE());case 254:return new g(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new g(a)}},h.prototype.reverse=function(){for(var a=new c(this.buf.length),b=0;ba?(b=new c(1),b.writeUInt8(a,0)):65536>a?(b=new c(3),b.writeUInt8(253,0),b.writeUInt16LE(a,1)):4294967296>a?(b=new c(5),b.writeUInt8(254,0),b.writeUInt32LE(a,1)):(b=new c(9),b.writeUInt8(255,0),b.writeInt32LE(-1&a,1),b.writeUInt32LE(Math.floor(a/4294967296),5)),b},f.varintBufBN=function(a){var b=void 0,d=a.toNumber();if(253>d)b=new c(1),b.writeUInt8(d,0);else if(65536>d)b=new c(3),b.writeUInt8(253,0),b.writeUInt16LE(d,1);else if(4294967296>d)b=new c(5),b.writeUInt8(254,0),b.writeUInt32LE(d,1);else{var e=new f;e.writeUInt8(255),e.writeUInt64LEBN(a);var b=e.concat()}return b},b.exports=f}).call(this,a("buffer").Buffer)},{"../util/buffer":107,assert:176,buffer:191}],80:[function(a,b,c){(function(c){"use strict";var d=a("./bufferwriter"),e=a("./bufferreader"),f=a("../crypto/bn"),g=function h(a){if(!(this instanceof h))return new h(a);if(c.isBuffer(a))this.buf=a;else if("number"==typeof a){var b=a;this.fromNumber(b)}else if(a instanceof f){var d=a;this.fromBN(d)}else if(a){var e=a;this.set(e)}};g.prototype.set=function(a){return this.buf=a.buf||this.buf,this},g.prototype.fromString=function(a){return this.set({buf:new c(a,"hex")}),this},g.prototype.toString=function(){return this.buf.toString("hex")},g.prototype.fromBuffer=function(a){return this.buf=a,this},g.prototype.fromBufferReader=function(a){return this.buf=a.readVarintBuf(),this},g.prototype.fromBN=function(a){return this.buf=d().writeVarintBN(a).concat(),this},g.prototype.fromNumber=function(a){return this.buf=d().writeVarintNum(a).concat(),this},g.prototype.toBuffer=function(){return this.buf},g.prototype.toBN=function(){return e(this.buf).readVarintBN()},g.prototype.toNumber=function(){return e(this.buf).readVarintNum()},b.exports=g}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"./bufferreader":78,"./bufferwriter":79,buffer:191}],81:[function(a,b,c){"use strict";function d(a,b){return a.replace("{0}",b[0]).replace("{1}",b[1]).replace("{2}",b[2])}var e=a("lodash"),f=function(a,b){var c=function(){if(e.isString(b.message))this.message=d(b.message,arguments);else{if(!e.isFunction(b.message))throw new Error("Invalid error definition for "+b.name);this.message=b.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return c.prototype=Object.create(a.prototype),c.prototype.name=a.prototype.name+b.name,a[b.name]=c,b.errors&&g(c,b.errors),c},g=function(a,b){e.each(b,function(b){f(a,b)})},h=function(a,b){return g(a,b),a},i={};i.Error=function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack},i.Error.prototype=Object.create(Error.prototype),i.Error.prototype.name="bitcore.Error";var j=a("./spec");h(i.Error,j),b.exports=i.Error,b.exports.extend=function(a){return f(i.Error,a)}},{"./spec":82,lodash:432}],82:[function(a,b,c){"use strict";var d="http://bitcore.io/";b.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+d+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]},{}],83:[function(a,b,c){"use strict";b.exports={_cache:{},_count:0,_eraseIndex:0,_usedList:{},_usedIndex:{},_CACHE_SIZE:5e3,get:function(a,b,c){c=!!c;var d=a+"/"+b+"/"+c;return this._cache[d]?(this._cacheHit(d),this._cache[d]):void 0},set:function(a,b,c,d){c=!!c;var e=a+"/"+b+"/"+c;this._cache[e]=d,this._cacheHit(e)},_cacheHit:function(a){this._usedIndex[a]&&delete this._usedList[this._usedIndex[a]],this._usedList[this._count]=a,this._usedIndex[a]=this._count,this._count++,this._cacheRemove()},_cacheRemove:function(){for(;this._eraseIndex=0&&a=d.Hardened?!0:b,ax*w)throw new s.InvalidEntropyArgument.TooMuchEntropy(a);var e=l.sha512hmac(a,new f.Buffer("Bitcoin seed"));return new d({network:m.get(b)||m.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:e.slice(0,32),chainCode:e.slice(32,64)})},d.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var b=a("./hdpublickey");this._hdPublicKey=new b(this)}},d.prototype._buildFromBuffers=function(a){d._validateBufferArguments(a),u.defineImmutable(this,{_buffers:a});var b=[a.version,a.depth,a.parentFingerPrint,a.childIndex,a.chainCode,t.emptyBuffer(1),a.privateKey],e=f.Buffer.concat(b);if(a.checksum&&a.checksum.length){if(a.checksum.toString()!==k.checksum(e).toString())throw new r.InvalidB58Checksum(e)}else a.checksum=k.checksum(e);var g,h=m.get(t.integerFromBuffer(a.version));g=k.encode(f.Buffer.concat(b)),a.xprivkey=new c(g);var j=new p(i.fromBuffer(a.privateKey),h),n=j.toPublicKey(),o=d.ParentFingerPrintSize,q=l.sha256ripemd160(n.toBuffer()).slice(0,o);return u.defineImmutable(this,{xprivkey:g,network:h,depth:t.integerFromSingleByteBuffer(a.depth),privateKey:j,publicKey:n,fingerPrint:q}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},d._validateBufferArguments=function(a){var b=function(b,c){var d=a[b];e(t.isBuffer(d),b+" argument is not a buffer"),e(d.length===c,b+" has not the expected size: found "+d.length+", expected "+c)};b("version",d.VersionSize),b("depth",d.DepthSize),b("parentFingerPrint",d.ParentFingerPrintSize),b("childIndex",d.ChildIndexSize),b("chainCode",d.ChainCodeSize),b("privateKey",d.PrivateKeySize),a.checksum&&a.checksum.length&&b("checksum",d.CheckSumSize)},d.prototype.toString=function(){return this.xprivkey},d.prototype.inspect=function(){return""},d.prototype.toObject=d.prototype.toJSON=function(){return{network:m.get(t.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:t.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:t.integerFromBuffer(this.fingerPrint),parentFingerPrint:t.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:t.integerFromBuffer(this._buffers.childIndex),chainCode:t.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:t.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},d.fromBuffer=function(a){return new d(a.toString())},d.prototype.toBuffer=function(){return t.copy(this._buffers.xprivkey)},d.DefaultDepth=0,d.DefaultFingerprint=0,d.DefaultChildIndex=0,d.Hardened=2147483648,d.MaxIndex=2*d.Hardened,d.RootElementAlias=["m","M","m'","M'"],d.VersionSize=4,d.DepthSize=1,d.ParentFingerPrintSize=4,d.ChildIndexSize=4,d.ChainCodeSize=32,d.PrivateKeySize=32,d.CheckSumSize=4,d.DataLength=78,d.SerializedByteSize=82,d.VersionStart=0,d.VersionEnd=d.VersionStart+d.VersionSize,d.DepthStart=d.VersionEnd,d.DepthEnd=d.DepthStart+d.DepthSize,d.ParentFingerPrintStart=d.DepthEnd,d.ParentFingerPrintEnd=d.ParentFingerPrintStart+d.ParentFingerPrintSize,d.ChildIndexStart=d.ParentFingerPrintEnd,d.ChildIndexEnd=d.ChildIndexStart+d.ChildIndexSize,d.ChainCodeStart=d.ChildIndexEnd,d.ChainCodeEnd=d.ChainCodeStart+d.ChainCodeSize,d.PrivateKeyStart=d.ChainCodeEnd+1,d.PrivateKeyEnd=d.PrivateKeyStart+d.PrivateKeySize,d.ChecksumStart=d.PrivateKeyEnd,d.ChecksumEnd=d.ChecksumStart+d.CheckSumSize,e(d.ChecksumEnd===d.SerializedByteSize),b.exports=d}).call(this,a("buffer").Buffer)},{"./crypto/bn":70,"./crypto/hash":72,"./crypto/point":73,"./crypto/random":74,"./encoding/base58":76,"./encoding/base58check":77,"./errors":81,"./hdkeycache":83,"./hdpublickey":85,"./networks":86,"./privatekey":88,"./util/buffer":107,"./util/js":108,"./util/preconditions":109,assert:176,buffer:191,lodash:432}],85:[function(a,b,c){(function(c){"use strict";function d(a){if(a instanceof d)return a;if(!(this instanceof d))return new d(a);if(a){if(e.isString(a)||u.isBuffer(a)){var b=d.getSerializedError(a);if(b){if(u.isBuffer(a)&&!d.getSerializedError(a.toString()))return this._buildFromSerialized(a.toString());if(b instanceof r.ArgumentIsPrivateExtended)return new k(a).hdPublicKey;throw b}return this._buildFromSerialized(a)}if(e.isObject(a))return a instanceof k?this._buildFromPrivate(a):this._buildFromObject(a);throw new r.UnrecognizedArgument(a)}throw new r.MustSupplyArgument}var e=a("lodash"),f=a("./util/preconditions"),g=a("./crypto/bn"),h=a("./encoding/base58"),i=a("./encoding/base58check"),j=a("./crypto/hash"),k=a("./hdprivatekey"),l=a("./hdkeycache"),m=a("./networks"),n=a("./crypto/point"),o=a("./publickey"),p=a("./errors"),q=p,r=p.HDPublicKey,s=a("assert"),t=a("./util/js"),u=a("./util/buffer");d.isValidPath=function(a){if(e.isString(a)){var b=k._getDerivationIndexes(a);return null!==b&&e.all(b,d.isValidPath)}return e.isNumber(a)?a>=0&&a=d.Hardened||b)throw new r.InvalidIndexCantDeriveHardened;if(0>a)throw new r.InvalidPath(a);var c=l.get(this.xpubkey,a,!1);if(c)return c;var e=u.integerAsBuffer(a),f=u.concat([this.publicKey.toBuffer(),e]),h=j.sha512hmac(f,this._buffers.chainCode),i=g.fromBuffer(h.slice(0,32),{size:32}),k=h.slice(32,64),m=o.fromPoint(n.getG().mul(i).add(this.publicKey.point)),p=new d({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:a,chainCode:k,publicKey:m});return l.set(this.xpubkey,a,!1,p),p},d.prototype._deriveFromString=function(a){if(e.contains(a,"'"))throw new r.InvalidIndexCantDeriveHardened;if(!d.isValidPath(a))throw new r.InvalidPath(a);var b=k._getDerivationIndexes(a),c=b.reduce(function(a,b){return a._deriveWithNumber(b)},this);return c},d.isValidSerialized=function(a,b){return e.isNull(d.getSerializedError(a,b))},d.getSerializedError=function(a,b){if(!e.isString(a)&&!u.isBuffer(a))return new r.UnrecognizedArgument("expected buffer or string");if(!h.validCharacters(a))return new q.InvalidB58Char("(unknown)",a);try{a=i.decode(a)}catch(c){return new q.InvalidB58Checksum(a)}if(a.length!==d.DataSize)return new r.InvalidLength(a);if(!e.isUndefined(b)){var f=d._validateNetwork(a,b);if(f)return f}var g=u.integerFromBuffer(a.slice(0,4));return g===m.livenet.xprivkey||g===m.testnet.xprivkey?new r.ArgumentIsPrivateExtended:null},d._validateNetwork=function(a,b){var c=m.get(b);if(!c)return new q.InvalidNetworkArgument(b);var e=a.slice(d.VersionStart,d.VersionEnd);return u.integerFromBuffer(e)!==c.xpubkey?new q.InvalidNetwork(e):null},d.prototype._buildFromPrivate=function(a){var b=e.clone(a._buffers),c=n.getG().mul(g.fromBuffer(b.privateKey));return b.publicKey=n.pointToCompressed(c),b.version=u.integerAsBuffer(m.get(u.integerFromBuffer(b.version)).xpubkey),b.privateKey=void 0,b.checksum=void 0,b.xprivkey=void 0,this._buildFromBuffers(b)},d.prototype._buildFromObject=function(a){var b={version:a.network?u.integerAsBuffer(m.get(a.network).xpubkey):a.version,depth:e.isNumber(a.depth)?u.integerAsSingleByteBuffer(a.depth):a.depth,parentFingerPrint:e.isNumber(a.parentFingerPrint)?u.integerAsBuffer(a.parentFingerPrint):a.parentFingerPrint,childIndex:e.isNumber(a.childIndex)?u.integerAsBuffer(a.childIndex):a.childIndex,chainCode:e.isString(a.chainCode)?u.hexToBuffer(a.chainCode):a.chainCode,publicKey:e.isString(a.publicKey)?u.hexToBuffer(a.publicKey):u.isBuffer(a.publicKey)?a.publicKey:a.publicKey.toBuffer(),checksum:e.isNumber(a.checksum)?u.integerAsBuffer(a.checksum):a.checksum};return this._buildFromBuffers(b)},d.prototype._buildFromSerialized=function(a){var b=i.decode(a),c={version:b.slice(d.VersionStart,d.VersionEnd),depth:b.slice(d.DepthStart,d.DepthEnd),parentFingerPrint:b.slice(d.ParentFingerPrintStart,d.ParentFingerPrintEnd),childIndex:b.slice(d.ChildIndexStart,d.ChildIndexEnd),chainCode:b.slice(d.ChainCodeStart,d.ChainCodeEnd),publicKey:b.slice(d.PublicKeyStart,d.PublicKeyEnd),checksum:b.slice(d.ChecksumStart,d.ChecksumEnd),xpubkey:a};return this._buildFromBuffers(c)},d.prototype._buildFromBuffers=function(a){d._validateBufferArguments(a),t.defineImmutable(this,{_buffers:a});var b=[a.version,a.depth,a.parentFingerPrint,a.childIndex,a.chainCode,a.publicKey],e=u.concat(b),f=i.checksum(e);if(a.checksum&&a.checksum.length){if(a.checksum.toString("hex")!==f.toString("hex"))throw new q.InvalidB58Checksum(e,f)}else a.checksum=f;var g,h=m.get(u.integerFromBuffer(a.version));g=i.encode(u.concat(b)),a.xpubkey=new c(g);var k=new o(a.publicKey,{network:h}),l=d.ParentFingerPrintSize,n=j.sha256ripemd160(k.toBuffer()).slice(0,l);return t.defineImmutable(this,{xpubkey:g,network:h,depth:u.integerFromSingleByteBuffer(a.depth),publicKey:k,fingerPrint:n}),this},d._validateBufferArguments=function(a){var b=function(b,c){var d=a[b];s(u.isBuffer(d),b+" argument is not a buffer, it's "+typeof d),s(d.length===c,b+" has not the expected size: found "+d.length+", expected "+c)};b("version",d.VersionSize),b("depth",d.DepthSize),b("parentFingerPrint",d.ParentFingerPrintSize),b("childIndex",d.ChildIndexSize),b("chainCode",d.ChainCodeSize),b("publicKey",d.PublicKeySize),a.checksum&&a.checksum.length&&b("checksum",d.CheckSumSize)},d.fromString=function(a){return f.checkArgument(e.isString(a),"No valid string was provided"),new d(a)},d.fromObject=function(a){return f.checkArgument(e.isObject(a),"No valid argument was provided"),new d(a)},d.prototype.toString=function(){return this.xpubkey},d.prototype.inspect=function(){return""},d.prototype.toObject=d.prototype.toJSON=function(){return{network:m.get(u.integerFromBuffer(this._buffers.version)).name,depth:u.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:u.integerFromBuffer(this.fingerPrint),parentFingerPrint:u.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:u.integerFromBuffer(this._buffers.childIndex),chainCode:u.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:u.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},d.fromBuffer=function(a){return new d(a)},d.prototype.toBuffer=function(){return u.copy(this._buffers.xpubkey)},d.Hardened=2147483648,d.RootElementAlias=["m","M"],d.VersionSize=4,d.DepthSize=1,d.ParentFingerPrintSize=4,d.ChildIndexSize=4,d.ChainCodeSize=32,d.PublicKeySize=33,d.CheckSumSize=4,d.DataSize=78,d.SerializedByteSize=82,d.VersionStart=0,d.VersionEnd=d.VersionStart+d.VersionSize,d.DepthStart=d.VersionEnd,d.DepthEnd=d.DepthStart+d.DepthSize,d.ParentFingerPrintStart=d.DepthEnd,d.ParentFingerPrintEnd=d.ParentFingerPrintStart+d.ParentFingerPrintSize,d.ChildIndexStart=d.ParentFingerPrintEnd,d.ChildIndexEnd=d.ChildIndexStart+d.ChildIndexSize,d.ChainCodeStart=d.ChildIndexEnd,d.ChainCodeEnd=d.ChainCodeStart+d.ChainCodeSize,d.PublicKeyStart=d.ChainCodeEnd,d.PublicKeyEnd=d.PublicKeyStart+d.PublicKeySize,d.ChecksumStart=d.PublicKeyEnd,d.ChecksumEnd=d.ChecksumStart+d.CheckSumSize,s(d.PublicKeyEnd===d.DataSize),s(d.ChecksumEnd===d.SerializedByteSize),b.exports=d}).call(this,a("buffer").Buffer)},{"./crypto/bn":70,"./crypto/hash":72,"./crypto/point":73,"./encoding/base58":76,"./encoding/base58check":77,"./errors":81,"./hdkeycache":83,"./hdprivatekey":84,"./networks":86,"./publickey":89,"./util/buffer":107,"./util/js":108,"./util/preconditions":109,assert:176,buffer:191,lodash:432}],86:[function(a,b,c){"use strict";function d(){}function e(a,b){if(~m.indexOf(a))return a;if(b){j.isArray(b)||(b=[b]);var c=function(b){return m[d][b]===a};for(var d in m)if(j.any(b,c))return m[d];return void 0}return n[a]}function f(a){var b=new d;return l.defineImmutable(b,{name:a.name,alias:a.alias,pubkeyhash:a.pubkeyhash,privatekey:a.privatekey,scripthash:a.scripthash,xpubkey:a.xpubkey,xprivkey:a.xprivkey}),a.networkMagic&&l.defineImmutable(b,{networkMagic:k.integerAsBuffer(a.networkMagic)}),a.port&&l.defineImmutable(b,{port:a.port}),a.dnsSeeds&&l.defineImmutable(b,{dnsSeeds:a.dnsSeeds}),j.each(b,function(a){j.isUndefined(a)||j.isObject(a)||(n[a]=b)}),m.push(b),b}function g(a){for(var b=0;b=0&&16>=a,"Invalid Argument: n must be between 0 and 16"),0===a?d("OP_0"):new d(d.map.OP_1+a-1)},d.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},d.reverseMap=[];for(var i in d.map)d.reverseMap[d.map[i]]=i;e.extend(d,d.map),d.isSmallIntOp=function(a){return a instanceof d&&(a=a.toNumber()),a===d.map.OP_0||a>=d.map.OP_1&&a<=d.map.OP_16},d.prototype.inspect=function(){return""},b.exports=d}).call(this,a("buffer").Buffer)},{"./util/buffer":107,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],88:[function(a,b,c){(function(c){"use strict";function d(a,b){if(!(this instanceof d))return new d(a,b);if(a instanceof d)return a;var c=this._classifyArguments(a,b);if(!c.bn||0===c.bn.cmp(new h(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!c.bn.lt(k.getN()))throw new TypeError("Number must be less than N");if("undefined"==typeof c.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return i.defineImmutable(this,{bn:c.bn,compressed:c.compressed,network:c.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}var e=a("lodash"),f=a("./address"),g=a("./encoding/base58check"),h=a("./crypto/bn"),i=a("./util/js"),j=a("./networks"),k=a("./crypto/point"),l=a("./publickey"),m=a("./crypto/random"),n=a("./util/preconditions");d.prototype._classifyArguments=function(a,b){var f={compressed:!0,network:b?j.get(b):j.defaultNetwork};if(e.isUndefined(a)||e.isNull(a))f.bn=d._getRandomBN();else if(a instanceof h)f.bn=a;else if(a instanceof c||a instanceof Uint8Array)f=d._transformBuffer(a,b);else if(a.bn&&a.network)f=d._transformObject(a);else if(!b&&j.get(a))f.bn=d._getRandomBN(),f.network=j.get(a);else{if("string"!=typeof a)throw new TypeError("First argument is an unrecognized data type.");i.isHexa(a)?f.bn=new h(new c(a,"hex")):f=d._transformWIF(a,b)}return f},d._getRandomBN=function(){var a,b;do{var c=m.getRandomBuffer(32);b=h.fromBuffer(c),a=b.lt(k.getN())}while(!a);return b},d._transformBuffer=function(a,b){var c={};if(32===a.length)return d._transformBNBuffer(a,b);if(c.network=j.get(a[0],"privatekey"),!c.network)throw new Error("Invalid network");if(b&&c.network!==j.get(b))throw new TypeError("Private key network mismatch");if(34===a.length&&1===a[33])c.compressed=!0;else{if(33!==a.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");c.compressed=!1}return c.bn=h.fromBuffer(a.slice(1,33)),c},d._transformBNBuffer=function(a,b){var c={};return c.network=j.get(b)||j.defaultNetwork,c.bn=h.fromBuffer(a),c.compressed=!1,c},d._transformWIF=function(a,b){return d._transformBuffer(g.decode(a),b)},d.fromBuffer=function(a,b){return new d(a,b)},d._transformObject=function(a){var b=new h(a.bn,"hex"),c=j.get(a.network);return{bn:b,network:c,compressed:a.compressed}},d.fromString=d.fromWIF=function(a){return n.checkArgument(e.isString(a),"First argument is expected to be a string."),new d(a)},d.fromObject=function(a){return n.checkArgument(e.isObject(a),"First argument is expected to be an object."),new d(a)},d.fromRandom=function(a){var b=d._getRandomBN();return new d(b,a)},d.getValidationError=function(a,b){var c;try{new d(a,b)}catch(e){c=e}return c},d.isValid=function(a,b){return a?!d.getValidationError(a,b):!1},d.prototype.toString=function(){return this.toBuffer().toString("hex")},d.prototype.toWIF=function(){var a,b=this.network,d=this.compressed;return a=d?c.concat([new c([b.privatekey]),this.bn.toBuffer({size:32}),new c([1])]):c.concat([new c([b.privatekey]),this.bn.toBuffer({size:32})]),g.encode(a)},d.prototype.toBigNumber=function(){return this.bn},d.prototype.toBuffer=function(){return this.bn.toBuffer()},d.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=l.fromPrivateKey(this)),this._pubkey},d.prototype.toAddress=function(a){var b=this.toPublicKey();return f.fromPublicKey(b,a||this.network)},d.prototype.toObject=d.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},d.prototype.inspect=function(){var a=this.compressed?"":", uncompressed";return""},b.exports=d}).call(this,a("buffer").Buffer)},{"./address":65,"./crypto/bn":70,"./crypto/point":73,"./crypto/random":74,"./encoding/base58check":77,"./networks":86,"./publickey":89,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],89:[function(a,b,c){(function(c){"use strict";function d(a,b){if(!(this instanceof d))return new d(a,b);if(k.checkArgument(a,"First argument is required, please include public key data."),a instanceof d)return a;b=b||{};var c=this._classifyArgs(a,b);return c.point.validate(),h.defineImmutable(this,{point:c.point,compressed:c.compressed,network:c.network||i.defaultNetwork}),this}var e=a("./crypto/bn"),f=a("./crypto/point"),g=a("./crypto/hash"),h=a("./util/js"),i=a("./networks"),j=a("lodash"),k=a("./util/preconditions");d.prototype._classifyArgs=function(a,b){var e={compressed:j.isUndefined(b.compressed)||b.compressed};if(a instanceof f)e.point=a;else if(a.x&&a.y)e=d._transformObject(a);else if("string"==typeof a)e=d._transformDER(new c(a,"hex"));else if(d._isBuffer(a))e=d._transformDER(a);else{if(!d._isPrivateKey(a))throw new TypeError("First argument is an unrecognized data format.");e=d._transformPrivateKey(a)}return e.network||(e.network=j.isUndefined(b.network)?void 0:i.get(b.network)),e},d._isPrivateKey=function(b){var c=a("./privatekey");return b instanceof c},d._isBuffer=function(a){return a instanceof c||a instanceof Uint8Array},d._transformPrivateKey=function(a){k.checkArgument(d._isPrivateKey(a),"Must be an instance of PrivateKey");var b={};return b.point=f.getG().mul(a.bn),b.compressed=a.compressed,b.network=a.network,b},d._transformDER=function(a,b){k.checkArgument(d._isBuffer(a),"Must be a hex buffer of DER encoded public key");var c={};b=j.isUndefined(b)?!0:b;var g,h,i,l;if(4!==a[0]&&(b||6!==a[0]&&7!==a[0]))if(3===a[0])i=a.slice(1),g=new e(i),c=d._transformX(!0,g),c.compressed=!0;else{if(2!==a[0])throw new TypeError("Invalid DER format public key");i=a.slice(1),g=new e(i),c=d._transformX(!1,g),c.compressed=!0}else{if(i=a.slice(1,33),l=a.slice(33,65),32!==i.length||32!==l.length||65!==a.length)throw new TypeError("Length of x and y must be 32 bytes");g=new e(i),h=new e(l),c.point=new f(g,h),c.compressed=!1}return c},d._transformX=function(a,b){k.checkArgument("boolean"==typeof a,"Must specify whether y is odd or not (true or false)");var c={};return c.point=f.fromX(a,b),c},d._transformObject=function(a){var b=new e(a.x,"hex"),c=new e(a.y,"hex"),g=new f(b,c);return new d(g,{compressed:a.compressed})},d.fromPrivateKey=function(a){k.checkArgument(d._isPrivateKey(a),"Must be an instance of PrivateKey");var b=d._transformPrivateKey(a);return new d(b.point,{compressed:b.compressed,network:b.network})},d.fromDER=d.fromBuffer=function(a,b){k.checkArgument(d._isBuffer(a),"Must be a hex buffer of DER encoded public key");var c=d._transformDER(a,b);return new d(c.point,{compressed:c.compressed})},d.fromPoint=function(a,b){return k.checkArgument(a instanceof f,"First argument must be an instance of Point."),new d(a,{compressed:b})},d.fromString=function(a,b){var e=new c(a,b||"hex"),f=d._transformDER(e);return new d(f.point,{compressed:f.compressed})},d.fromX=function(a,b){var c=d._transformX(a,b);return new d(c.point,{compressed:c.compressed})},d.getValidationError=function(a){var b;try{new d(a)}catch(c){b=c}return b},d.isValid=function(a){return!d.getValidationError(a)},d.prototype.toObject=d.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},d.prototype.toBuffer=d.prototype.toDER=function(){var a,b=this.point.getX(),d=this.point.getY(),e=b.toBuffer({size:32}),f=d.toBuffer({size:32});if(this.compressed){var g=f[f.length-1]%2;return a=new c(g?[3]:[2]),c.concat([a,e])}return a=new c([4]),c.concat([a,e,f])},d.prototype._getID=function(){return g.sha256ripemd160(this.toBuffer())},d.prototype.toAddress=function(b){var c=a("./address");return c.fromPublicKey(this,b||this.network)},d.prototype.toString=function(){return this.toDER().toString("hex")},d.prototype.inspect=function(){return""},b.exports=d}).call(this,a("buffer").Buffer)},{"./address":65,"./crypto/bn":70,"./crypto/hash":72,"./crypto/point":73,"./networks":86,"./privatekey":88,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],90:[function(a,b,c){b.exports=a("./script"),b.exports.Interpreter=a("./interpreter")},{"./interpreter":91,"./script":92}],91:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("./script"),f=a("../opcode"),g=a("../crypto/bn"),h=a("../crypto/hash"),i=a("../crypto/signature"),j=a("../publickey"),k=function l(a){return this instanceof l?void(a?(this.initialize(),this.set(a)):this.initialize()):new l(a)};k.prototype.verify=function(b,c,f,g,h){var i=a("../transaction");d.isUndefined(f)&&(f=new i),d.isUndefined(g)&&(g=0),d.isUndefined(h)&&(h=0),this.set({script:b,tx:f,nin:g,flags:h});var j;if(0!==(h&k.SCRIPT_VERIFY_SIGPUSHONLY)&&!b.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;h&k.SCRIPT_VERIFY_P2SH&&(j=this.stack.slice());var l=this.stack;if(this.initialize(),this.set({script:c,stack:l,tx:f,nin:g,flags:h}),!this.evaluate())return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var m=this.stack[this.stack.length-1];if(!k.castToBool(m))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(h&k.SCRIPT_VERIFY_P2SH&&c.isScriptHashOut()){if(!b.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===j.length)throw new Error("internal error - stack copy empty");var n=j[j.length-1],o=e.fromBuffer(n);return j.pop(),this.initialize(),this.set({script:o,stack:j,tx:f,nin:g,flags:h}),this.evaluate()?0===j.length?(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1):k.castToBool(j[j.length-1])?!0:(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1):!1}return!0},b.exports=k,k.prototype.initialize=function(a){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},k.prototype.set=function(a){this.script=a.script||this.script,this.tx=a.tx||this.tx,this.nin="undefined"!=typeof a.nin?a.nin:this.nin,this.stack=a.stack||this.stack,this.altstack=a.altack||this.altstack,this.pc="undefined"!=typeof a.pc?a.pc:this.pc,this.pbegincodehash="undefined"!=typeof a.pbegincodehash?a.pbegincodehash:this.pbegincodehash,this.nOpCount="undefined"!=typeof a.nOpCount?a.nOpCount:this.nOpCount,this.vfExec=a.vfExec||this.vfExec,this.errstr=a.errstr||this.errstr,this.flags="undefined"!=typeof a.flags?a.flags:this.flags},k["true"]=new c([1]),k["false"]=new c([]),k.MAX_SCRIPT_ELEMENT_SIZE=520,k.LOCKTIME_THRESHOLD=5e8,k.LOCKTIME_THRESHOLD_BN=new g(k.LOCKTIME_THRESHOLD),k.SCRIPT_VERIFY_NONE=0,k.SCRIPT_VERIFY_P2SH=1,k.SCRIPT_VERIFY_STRICTENC=2,k.SCRIPT_VERIFY_DERSIG=4,k.SCRIPT_VERIFY_LOW_S=8,k.SCRIPT_VERIFY_NULLDUMMY=16,k.SCRIPT_VERIFY_SIGPUSHONLY=32,k.SCRIPT_VERIFY_MINIMALDATA=64,k.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,k.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,k.castToBool=function(a){for(var b=0;b0&&(c.lastNotificationId=g.last(d).id),g.each(d,function(a){c.emit("notification",a)}),b())})},e.prototype._initNotifications=function(a){var b=this;a=a||{};var c=a.notificationIntervalSeconds||5;b.notificationsIntervalId=setInterval(function(){b._fetchLatestNotifications(c,function(a){a&&(a instanceof y.NOT_FOUND||a instanceof y.NOT_AUTHORIZED)&&b._disposeNotifications()})},1e3*c)},e.prototype._disposeNotifications=function(){var a=this;a.notificationsIntervalId&&(clearInterval(a.notificationsIntervalId),a.notificationsIntervalId=null)},e.prototype.setNotificationsInterval=function(a){var b=this;b._disposeNotifications(),a>0&&b._initNotifications({notificationIntervalSeconds:a})},e._encryptMessage=function(a,b){return a?s.encryptMessage(a,b):null},e._decryptMessage=function(a,b){if(!a)return"";try{return s.decryptMessage(a,b)}catch(c){return""}},e.prototype._processTxNotes=function(a){var b=this;if(a){var c=b.credentials.sharedEncryptingKey;g.each([].concat(a),function(a){a.encryptedBody=a.body,a.body=e._decryptMessage(a.body,c),a.encryptedEditedByName=a.editedByName,a.editedByName=e._decryptMessage(a.editedByName,c)})}},e.prototype._processTxps=function(a){var b=this;if(a){var c=b.credentials.sharedEncryptingKey;g.each([].concat(a),function(a){a.encryptedMessage=a.message,a.message=e._decryptMessage(a.message,c)||null,a.creatorName=e._decryptMessage(a.creatorName,c),g.each(a.actions,function(a){a.copayerName=e._decryptMessage(a.copayerName,c),a.comment=e._decryptMessage(a.comment,c)}),g.each(a.outputs,function(a){a.encryptedMessage=a.message,a.message=e._decryptMessage(a.message,c)||null}),a.hasUnconfirmedInputs=g.any(a.inputs,function(a){return 0==a.confirmations}),b._processTxNotes(a.note)})}},e._parseError=function(a){if(a){if(g.isString(a))try{a=JSON.parse(a)}catch(b){a={error:a}}var c;return a.code?y[a.code]?(c=new y[a.code],a.message&&(c.message=a.message)):c=new Error(a.code+": "+a.message):c=new Error(a.error||a),u.error(c),c}},e._signRequest=function(a,b,c,d){var e=[a.toLowerCase(),b,JSON.stringify(c)].join("|");return s.signMessage(e,d)},e.prototype.seedFromRandom=function(a){h.checkArgument(arguments.length<=1,"DEPRECATED: only 1 argument accepted."),h.checkArgument(g.isUndefined(a)||g.isObject(a),"DEPRECATED: argument should be an options object."),a=a||{},this.credentials=v.create(a.network||"livenet")};var A;e.prototype.validateKeyDerivation=function(a,b){function c(a,b){var c="m/0/0",d="Lorem ipsum dolor sit amet, ne amet urbanitas percipitur vim, libris disputando his ne, et facer suavitate qui. Ei quidam laoreet sea. Cu pro dico aliquip gubergren, in mundi postea usu. Ad labitur posidonium interesset duo, est et doctus molestie adipiscing.",e=a.derive(c).privateKey,f=s.signMessage(d,e),g=b.derive(c).publicKey;return s.verifyMessage(d,f,g)}function d(){var a="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",b=m(a).toHDPrivateKey();if("xprv9s21ZrQH143K3GJpoapnV8SFfukcVBSfeCficPSGfubmSFDxo1kuHnLisriDvSnRRuL2Qrg5ggqHKNVpxR86QEC8w35uxmGoggxtQTPvfUu"!=b.toString())return!1;if(b=b.derive("m/44'/0'/0'"),"xprv9xpXFhFpqdQK3TmytPBqXtGSwS3DLjojFhTGht8gwAAii8py5X6pxeBnQ6ehJiyJ6nDjWGJfZ95WxByFXVkDxHXrqu53WCRGypk2ttuqncb"!=b.toString())return!1;var d=l.HDPublicKey.fromString("xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj");return c(b,d)}function e(){var b;try{b=g.getMnemonic()}catch(d){}var e;if(b&&(!g.mnemonicHasPassphrase||a.passphrase)){var f=new m(b);e=f.toHDPrivateKey(a.passphrase,g.network)}e||(e=new l.HDPrivateKey(g.xPrivKey)),e=e.derive(g.getBaseAddressDerivationPath());var h=new l.HDPublicKey(g.xPubKey);return c(e,h)}var f=this;a=a||{};var g=f.credentials,h=!0;A||a.skipDeviceValidation||(h=d(),A=!0);var i=g.canSign()&&!g.isPrivKeyEncrypted()?e():!0;return f.keyDerivationOk=h&&i,b(null,f.keyDerivationOk)},e.prototype.seedFromRandomWithMnemonic=function(a){h.checkArgument(arguments.length<=1,"DEPRECATED: only 1 argument accepted."),h.checkArgument(g.isUndefined(a)||g.isObject(a),"DEPRECATED: argument should be an options object."),a=a||{},this.credentials=v.createWithMnemonic(a.network||"livenet",a.passphrase,a.language||"en",a.account||0)},e.prototype.getMnemonic=function(){return this.credentials.getMnemonic()},e.prototype.mnemonicHasPassphrase=function(){return this.credentials.mnemonicHasPassphrase},e.prototype.clearMnemonic=function(){return this.credentials.clearMnemonic()},e.prototype.seedFromExtendedPrivateKey=function(a,b){b=b||{},this.credentials=v.fromExtendedPrivateKey(a,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)},e.prototype.seedFromMnemonic=function(a,b){h.checkArgument(g.isUndefined(b)||g.isObject(b),"DEPRECATED: second argument should be an options object."),b=b||{},this.credentials=v.fromMnemonic(b.network||"livenet",a,b.passphrase,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)},e.prototype.seedFromExtendedPublicKey=function(a,b,c,d){h.checkArgument(g.isUndefined(d)||g.isObject(d)),d=d||{},this.credentials=v.fromExtendedPublicKey(a,b,c,d.account||0,d.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)},e.prototype["export"]=function(a){h.checkState(this.credentials),a=a||{};var b,c=v.fromObj(this.credentials);return a.noSign&&c.setNoSign(),b=JSON.stringify(c.toObj())},e.prototype["import"]=function(a){try{var b=v.fromObj(JSON.parse(a));this.credentials=b}catch(c){throw new y.INVALID_BACKUP}},e.prototype._import=function(a){h.checkState(this.credentials);var b=this;b.openWallet(function(c,d){return c?c instanceof y.NOT_AUTHORIZED||b.isPrivKeyExternal()?a(c):(u.info("Copayer not found, trying to add access"),void b.addAccess({},function(c){return c?a(new y.WALLET_DOES_NOT_EXIST):void b.openWallet(a)})):a(null,d)})},e.prototype.importFromMnemonic=function(a,b,c){u.debug("Importing from 12 Words"),b=b||{};try{this.credentials=v.fromMnemonic(b.network||"livenet",a,b.passphrase,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)}catch(d){return u.info("Mnemonic error:",d),c(new y.INVALID_BACKUP)}this._import(c)},e.prototype.importFromExtendedPrivateKey=function(a,b,c){u.debug("Importing from Extended Private Key"),c||(c=b,b={},u.warn("DEPRECATED WARN: importFromExtendedPrivateKey should receive 3 parameters."));try{this.credentials=v.fromExtendedPrivateKey(a,b.account||0,b.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)}catch(d){return u.info("xPriv error:",d),c(new y.INVALID_BACKUP)}this._import(c)},e.prototype.importFromExtendedPublicKey=function(a,b,c,d,e){h.checkArgument(5==arguments.length,"DEPRECATED: should receive 5 arguments"),h.checkArgument(g.isUndefined(d)||g.isObject(d)),h.shouldBeFunction(e),d=d||{},u.debug("Importing from Extended Private Key");try{this.credentials=v.fromExtendedPublicKey(a,b,c,d.account||0,d.derivationStrategy||r.DERIVATION_STRATEGIES.BIP44)}catch(f){return u.info("xPriv error:",f),e(new y.INVALID_BACKUP)}this._import(e)},e.prototype.decryptBIP38PrivateKey=function(b,c,e,f){var g,h=a("bip38"),i=new h;try{g=i.decrypt(b,c)}catch(j){return f(new Error("Could not decrypt BIP38 private key",j))}var k=new l.PrivateKey(g),m=k.publicKey.toAddress().toString(),n=new d(m,"ascii"),o=l.crypto.Hash.sha256sha256(n).toString("hex").substring(0,8),p=l.encoding.Base58Check.decode(b).toString("hex").substring(6,14);return o!=p?f(new Error("Incorrect passphrase")):f(null,g)},e.prototype.getBalanceFromPrivateKey=function(a,b){var c=this,a=new l.PrivateKey(a),d=a.publicKey.toAddress();c.getUtxos({addresses:d.toString()},function(a,c){return a?b(a):b(null,g.sum(c,"satoshis"))})},e.prototype.buildTxFromPrivateKey=function(a,b,c,d){var e=this;c=c||{};var a=new l.PrivateKey(a),f=a.publicKey.toAddress();j.waterfall([function(a){e.getUtxos({addresses:f.toString()},function(b,c){return a(b,c)})},function(d,e){if(!g.isArray(d)||0==d.length)return e(new Error("No utxos found"));var f=c.fee||1e4,h=g.sum(d,"satoshis")-f;if(0>=h)return e(new y.INSUFFICIENT_FUNDS);var i;try{var j=l.Address.fromString(b);i=(new l.Transaction).from(d).to(j,h).fee(f).sign(a),i.serialize()}catch(k){return u.error("Could not build transaction from private key",k),e(new y.COULD_NOT_BUILD_TRANSACTION)}return e(null,i)}],d)},e.prototype.openWallet=function(a){h.checkState(this.credentials);var b=this;return b.credentials.isComplete()&&b.credentials.hasWalletInfo()?a(null,!0):void b._doGetRequest("/v2/wallets/?includeExtendedInfo=1",function(c,d){if(c)return a(c);var f=d.wallet;if(b._processStatus(d),!b.credentials.hasWalletInfo()){var h=g.find(f.copayers,{id:b.credentials.copayerId});b.credentials.addWalletInfo(f.id,f.name,f.m,f.n,h.name)}if("complete"!=f.status)return a();if(b.credentials.walletPrivKey){if(!w.checkCopayers(b.credentials,f.copayers))return a(new y.SERVER_COMPROMISED)}else u.warn("Could not verify copayers key (missing wallet Private Key)");return b.credentials.addPublicKeyRing(e._extractPublicKeyRing(f.copayers)),b.emit("walletCompleted",f),a(null,d)})},e.prototype._getHeaders=function(a,b,c){var d={"x-client-version":"bwc-"+x.version};if(this.credentials){var f,g=c._requestPrivKey||this.credentials.requestPrivKey;g&&(delete c._requestPrivKey,f=e._signRequest(a,b,c,g)),d["x-identity"]=this.credentials.copayerId,d["x-signature"]=f}return d},e.prototype._doRequest=function(a,b,c,d){var f=this.baseUrl+b,g={relUrl:this.basePath+b,headers:this._getHeaders(a,b,c),method:a,url:f,body:c,json:!0,withCredentials:!1,timeout:this.timeout};u.debug("Request Args",i.inspect(c,{depth:10})),this.request(g,function(a,b,c){return u.debug(i.inspect(c,{depth:10})),b?200!==b.statusCode?404===b.statusCode?d(new y.NOT_FOUND):b.statusCode?(u.error("HTTP Error:"+b.statusCode),d(c?e._parseError(c):new Error(b.statusCode))):d(new y.CONNECTION_ERROR):'{"error":"read ECONNRESET"}'===c?d(new y.ECONNRESET_ERROR(JSON.parse(c))):d(null,c,b.header):d(new y.CONNECTION_ERROR)})},e.prototype._doPostRequest=function(a,b,c){return this._doRequest("post",a,b,c)},e.prototype._doPutRequest=function(a,b,c){return this._doRequest("put",a,b,c)},e.prototype._doGetRequest=function(a,b){return a+=a.indexOf("?")>0?"&":"?",a+="r="+g.random(1e4,99999),this._doRequest("get",a,{},b)},e.prototype._doDeleteRequest=function(a,b){return this._doRequest("delete",a,{},b)},e._buildSecret=function(a,b,c){g.isString(b)&&(b=l.PrivateKey.fromString(b));var e=new d(a.replace(/-/g,""),"hex"),f=new l.encoding.Base58(e).toString();return g.padRight(f,22,"0")+b.toWIF()+("testnet"==c?"T":"L")},e.parseSecret=function(a){function b(a,b){var c=[];b.push(a.length);for(var d=0;d1?k:null)})})},e.prototype.joinWallet=function(a,b,c,d){var f=this;if(d||(d=c,c={},u.warn("DEPRECATED WARN: joinWallet should receive 4 parameters.")),!f._checkKeyDerivation())return d(new Error("Cannot join wallet"));c=c||{};try{var g=e.parseSecret(a)}catch(h){return d(h)}f.credentials||f.seedFromRandom({network:g.network}),f.credentials.addWalletPrivateKey(g.walletPrivKey.toString()),f._doJoinWallet(g.walletId,g.walletPrivKey,f.credentials.xPubKey,f.credentials.requestPubKey,b,{dryRun:!!c.dryRun},function(a,e){return a?d(a):(c.dryRun||f.credentials.addWalletInfo(e.id,e.name,e.m,e.n,b),d(null,e))})},e.prototype.recreateWallet=function(a){h.checkState(this.credentials),h.checkState(this.credentials.isComplete()),h.checkState(this.credentials.walletPrivKey);var b=this;this.getStatus({includeExtendedInfo:!0},function(c){if(!c)return u.info("Wallet is already created"),a();var d=b.credentials,e=l.PrivateKey.fromString(d.walletPrivKey),f=d.walletId,g=d.derivationStrategy!=r.DERIVATION_STRATEGIES.BIP45,h=s.encryptMessage(d.walletName||"recovered wallet",d.sharedEncryptingKey),i={name:h,m:d.m,n:d.n,pubKey:e.toPublicKey().toString(),network:d.network,id:f,supportBIP44AndP2PKH:g};b._doPostRequest("/v2/wallets/",i,function(c,d){if(c)return c instanceof y.WALLET_ALREADY_EXISTS?b.addAccess({},function(c){return c?a(c):void b.openWallet(function(b){return a(b)})}):a(c);f||(f=d.walletId);var h=1;j.each(b.credentials.publicKeyRing,function(a,c){var d=a.copayerName||"copayer "+h++;b._doJoinWallet(f,e,a.xPubKey,a.requestPubKey,d,{supportBIP44AndP2PKH:g},function(a){return a&&a instanceof y.COPAYER_IN_WALLET?c():c(a)})},a)})})},e.prototype._processWallet=function(a){var b=this,c=b.credentials.sharedEncryptingKey,d=s.decryptMessage(a.name,c);d!=a.name&&(a.encryptedName=a.name),a.name=d,g.each(a.copayers,function(a){var b=s.decryptMessage(a.name,c);b!=a.name&&(a.encryptedName=a.name),a.name=b,g.each(a.requestPubKeys,function(a){if(a.name){var b=s.decryptMessage(a.name,c);b!=a.name&&(a.encryptedName=a.name),a.name=b}})})},e.prototype._processStatus=function(a){function b(a){var b=a.wallet.copayers;if(b){var d=g.find(b,{id:c.credentials.copayerId});if(d&&d.customData){var e;try{e=JSON.parse(s.decryptMessage(d.customData,c.credentials.personalEncryptingKey))}catch(f){u.warn("Could not decrypt customData:",d.customData)}e&&(a.customData=e,!c.credentials.walletPrivKey&&e.walletPrivKey&&c.credentials.addWalletPrivateKey(e.walletPrivKey))}}}var c=this;b(a),c._processWallet(a.wallet),c._processTxps(a.pendingTxps)},e.prototype.getNotifications=function(a,b){h.checkState(this.credentials);var c=this;a=a||{};var d="/v1/notifications/";a.lastNotificationId?d+="?notificationId="+a.lastNotificationId:a.timeSpan&&(d+="?timeSpan="+a.timeSpan),c._doGetRequest(d,function(d,e){if(d)return b(d);var f=g.filter(e,function(b){return a.includeOwn||b.creatorId!=c.credentials.copayerId});return b(null,f)})},e.prototype.getStatus=function(a,b){h.checkState(this.credentials),b||(b=a,a={},u.warn("DEPRECATED WARN: getStatus should receive 2 parameters."));var c=this;a=a||{};var d=[];d.push("includeExtendedInfo="+(a.includeExtendedInfo?"1":"0")),d.push("twoStep="+(a.twoStep?"1":"0")),c._doGetRequest("/v2/wallets/?"+d.join("&"),function(a,d){if(a)return b(a);if("pending"==d.wallet.status){var f=c.credentials;d.wallet.secret=e._buildSecret(f.walletId,f.walletPrivKey,f.network)}return c._processStatus(d),b(a,d)})},e.prototype.getPreferences=function(a){h.checkState(this.credentials),h.checkArgument(a);var b=this;b._doGetRequest("/v1/preferences/",function(b,c){return b?a(b):a(null,c)})},e.prototype.savePreferences=function(a,b){h.checkState(this.credentials),h.checkArgument(b);var c=this;c._doPutRequest("/v1/preferences/",a,b)},e.prototype.fetchPayPro=function(a,b){h.checkArgument(a).checkArgument(a.payProUrl),t.get({url:a.payProUrl,http:this.payProHttp},function(a,c){return a?b(a):b(null,c)})},e.prototype.getUtxos=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete()),a=a||{};var c="/v1/utxos/";a.addresses&&(c+="?"+p.stringify({addresses:[].concat(a.addresses).join(",")})),this._doGetRequest(c,b)},e.prototype._getCreateTxProposalArgs=function(a){var b=this,c=g.cloneDeep(a);return c.message=e._encryptMessage(a.message,this.credentials.sharedEncryptingKey)||null,c.payProUrl=a.payProUrl||null,g.each(c.outputs,function(a){a.message=e._encryptMessage(a.message,b.credentials.sharedEncryptingKey)||null}),c},e.prototype.createTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkState(this.credentials.sharedEncryptingKey),h.checkArgument(a);var c=this,d=c._getCreateTxProposalArgs(a);c._doPostRequest("/v2/txproposals/",d,function(a,e){return a?b(a):(c._processTxps(e),w.checkProposalCreation(d,e,c.credentials.sharedEncryptingKey)?b(null,e):b(new y.SERVER_COMPROMISED))})},e.prototype.publishTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkArgument(a).checkArgument(a.txp),h.checkState(parseInt(a.txp.version)>=3);var c=this,d=s.buildTx(a.txp),e=d.uncheckedSerialize(),f={proposalSignature:s.signMessage(e,c.credentials.requestPrivKey)},g="/v1/txproposals/"+a.txp.id+"/publish/";c._doPostRequest(g,f,function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.createAddress=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;return b||(b=a,a={},u.warn("DEPRECATED WARN: createAddress should receive 2 parameters.")),c._checkKeyDerivation()?(a=a||{},void c._doPostRequest("/v3/addresses/",a,function(a,d){return a?b(a):w.checkAddress(c.credentials,d)?b(null,d):b(new y.SERVER_COMPROMISED)})):b(new Error("Cannot create new address for this wallet"))},e.prototype.getMainAddresses=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;a=a||{};var d=[];a.limit&&d.push("limit="+a.limit),a.reverse&&d.push("reverse=1");var e="";d.length>0&&(e="?"+d.join("&"));var f="/v1/addresses/"+e;c._doGetRequest(f,function(d,e){if(d)return b(d);if(!a.doNotVerify){var f=g.any(e,function(a){return!w.checkAddress(c.credentials,a)});if(f)return b(new y.SERVER_COMPROMISED)}return b(null,e)})},e.prototype.getBalance=function(a,b){b||(b=a,a={},u.warn("DEPRECATED WARN: getBalance should receive 2 parameters."));a=a||{},h.checkState(this.credentials&&this.credentials.isComplete());var c="/v1/balance/";a.twoStep&&(c+="?twoStep=1"),this._doGetRequest(c,b)},e.prototype.getTxProposals=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;c._doGetRequest("/v1/txproposals/",function(d,e){return d?b(d):(c._processTxps(e),void j.every(e,function(b,d){return a.doNotVerify?d(!0):void c.getPayPro(b,function(a,e){var f=w.checkTxProposal(c.credentials,b,{paypro:e});return d(f)})},function(d){if(!d)return b(new y.SERVER_COMPROMISED);var f;return f=a.forAirGapped?{txps:JSON.parse(JSON.stringify(e)),encryptedPkr:a.doNotEncryptPkr?null:s.encryptMessage(JSON.stringify(c.credentials.publicKeyRing),c.credentials.personalEncryptingKey),unencryptedPkr:a.doNotEncryptPkr?JSON.stringify(c.credentials.publicKeyRing):null,m:c.credentials.m,n:c.credentials.n}:e,b(null,f)}))})},e.prototype.getPayPro=function(a,b){var c=this;return!a.payProUrl||this.doNotVerifyPayPro?b():void t.get({url:a.payProUrl,http:c.payProHttp},function(a,c){return a?b(new Error("Cannot check transaction now:"+a)):b(null,c)})},e.prototype.signTxProposal=function(a,b,c){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkArgument(a.creatorId),g.isFunction(b)&&(c=b,b=null);var d=this;if(!a.signatures){if(!d.canSign())return c(new y.MISSING_PRIVATE_KEY);if(d.isPrivKeyEncrypted()&&!b)return c(new y.ENCRYPTED_PRIVATE_KEY)}d.getPayPro(a,function(e,f){if(e)return c(e);var h=w.checkTxProposal(d.credentials,a,{paypro:f});if(!h)return c(new y.SERVER_COMPROMISED);var i=a.signatures;if(g.isEmpty(i))try{i=d._signTxp(a,b)}catch(j){return u.error("Error signing tx",j),c(j)}var k="/v1/txproposals/"+a.id+"/signatures/",l={signatures:i};d._doPostRequest(k,l,function(a,b){return a?c(a):(d._processTxps(b),c(null,b))})})},e.prototype.signTxProposalFromAirGapped=function(a,b,c,d,e){h.checkState(this.credentials);var f=this;if(!f.canSign())throw new y.MISSING_PRIVATE_KEY;if(f.isPrivKeyEncrypted()&&!e)throw new y.ENCRYPTED_PRIVATE_KEY;var i;try{i=JSON.parse(s.decryptMessage(b,f.credentials.personalEncryptingKey))}catch(j){throw new Error("Could not decrypt public key ring")}if(!g.isArray(i)||i.length!=d)throw new Error("Invalid public key ring");if(f.credentials.m=c,f.credentials.n=d,f.credentials.addressType=a.addressType,f.credentials.addPublicKeyRing(i),!w.checkTxProposalSignature(f.credentials,a))throw new Error("Fake transaction proposal");return f._signTxp(a,e)},e.signTxProposalFromAirGapped=function(a,b,c,d,f,h){h=h||{};var i=JSON.parse(c);if(!g.isArray(i)||i.length!=f)throw new Error("Invalid public key ring");var j=new e({baseUrl:"https://bws.example.com/bws/api",verbose:!1});if("xprv"===a.slice(0,4)||"tprv"===a.slice(0,4)){if("xprv"===a.slice(0,4)&&"testnet"==b.network)throw new Error("testnet HD keys must start with tprv");if("tprv"===a.slice(0,4)&&"livenet"==b.network)throw new Error("livenet HD keys must start with xprv");j.seedFromExtendedPrivateKey(a,{account:h.account,derivationStrategy:h.derivationStrategy})}else j.seedFromMnemonic(a,{network:b.network,passphrase:h.passphrase,account:h.account,derivationStrategy:h.derivationStrategy});if(j.credentials.m=d,j.credentials.n=f,j.credentials.addressType=b.addressType,j.credentials.addPublicKeyRing(i),!w.checkTxProposalSignature(j.credentials,b))throw new Error("Fake transaction proposal");return j._signTxp(b)},e.prototype.rejectTxProposal=function(a,b,c){h.checkState(this.credentials&&this.credentials.isComplete()),h.checkArgument(c);var d=this,f="/v1/txproposals/"+a.id+"/rejections/",g={reason:e._encryptMessage(b,d.credentials.sharedEncryptingKey)||""};d._doPostRequest(f,g,function(a,b){return a?c(a):(d._processTxps(b),c(null,b))})},e.prototype.broadcastRawTx=function(a,b){h.checkState(this.credentials),h.checkArgument(b);var c=this;a=a||{};var d="/v1/broadcast_raw/";c._doPostRequest(d,a,function(a,c){return a?b(a):b(null,c)})},e.prototype._doBroadcast=function(a,b){var c=this,d="/v1/txproposals/"+a.id+"/broadcast/";c._doPostRequest(d,{},function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.broadcastTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this;c.getPayPro(a,function(d,e){if(e){var f=s.buildTx(a);c._applyAllSignatures(a,f),t.send({http:c.payProHttp,url:a.payProUrl,amountSat:a.amount,refundAddr:a.changeAddress.address,merchant_data:e.merchant_data,rawTx:f.serialize({disableSmallFees:!0,disableLargeFees:!0,disableDustOutputs:!0})},function(d,e,f){return d?b(d):void c._doBroadcast(a,function(a,c){return b(a,c,f)})})}else c._doBroadcast(a,b)})},e.prototype.removeTxProposal=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d="/v1/txproposals/"+a.id;c._doDeleteRequest(d,function(a){return b(a)})},e.prototype.getTxHistory=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d=[];a&&(a.skip&&d.push("skip="+a.skip),a.limit&&d.push("limit="+a.limit),a.includeExtendedInfo&&d.push("includeExtendedInfo=1"));var e="";d.length>0&&(e="?"+d.join("&"));var f="/v1/txhistory/"+e;c._doGetRequest(f,function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.getTx=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d="/v1/txproposals/"+a;this._doGetRequest(d,function(a,d){return a?b(a):(c._processTxps(d),b(null,d))})},e.prototype.startScan=function(a,b){h.checkState(this.credentials&&this.credentials.isComplete());var c=this,d={includeCopayerBranches:a.includeCopayerBranches};c._doPostRequest("/v1/addresses/scan",d,function(a){return b(a)})},e.prototype.addAccess=function(a,b){h.checkState(this.credentials&&this.credentials.canSign()),a=a||{};var c=new l.PrivateKey(a.generateNewKey?null:this.credentials.requestPrivKey),d=c.toPublicKey().toString(),e=new l.HDPrivateKey(this.credentials.xPrivKey).derive(this.credentials.getBaseAddressDerivationPath()),f=s.signRequestPubKey(d,e),g=this.credentials.copayerId,i=a.name?s.encryptMessage(a.name,this.credentials.sharedEncryptingKey):null,a={copayerId:g,requestPubKey:d,signature:f,name:i,restrictions:a.restrictions};this._doPutRequest("/v1/copayers/"+g+"/",a,function(a,d){return a?b(a):b(null,d.wallet,c)})},e.prototype.getTxNote=function(a,b){h.checkState(this.credentials);var c=this;a=a||{},c._doGetRequest("/v1/txnotes/"+a.txid+"/",function(a,d){return a?b(a):(c._processTxNotes(d),b(null,d))})},e.prototype.editTxNote=function(a,b){h.checkState(this.credentials),a=a||{},a.body&&(a.body=e._encryptMessage(a.body,this.credentials.sharedEncryptingKey)),this._doPutRequest("/v1/txnotes/"+a.txid+"/",a,function(a,c){return b(a)})},e.prototype.getTxNotes=function(a,b){h.checkState(this.credentials);var c=this;a=a||{};var d=[];g.isNumber(a.minTs)&&d.push("minTs="+a.minTs);var e="";d.length>0&&(e="?"+d.join("&")),c._doGetRequest("/v1/txnotes/"+e,function(a,d){return a?b(a):(c._processTxNotes(d),b(null,d))})},e.prototype.getFiatRate=function(a,b){h.checkState(this.credentials),h.checkArgument(b);var c=this,a=a||{},d=[];a.ts&&d.push("ts="+a.ts),a.provider&&d.push("provider="+a.provider);var e="";d.length>0&&(e="?"+d.join("&")),c._doGetRequest("/v1/fiatrates/"+a.code+"/"+e,function(a,c){return a?b(a):b(null,c)})},e.prototype.pushNotificationsSubscribe=function(a,b){var c="/v1/pushnotifications/subscriptions/";this._doPostRequest(c,a,function(a,c){return a?b(a):b(null,c)})},e.prototype.pushNotificationsUnsubscribe=function(a){var b="/v1/pushnotifications/subscriptions/";this._doDeleteRequest(b,function(b){return a(b?b:null)})},e.prototype.getSendMaxInfo=function(a,b){var c=this,d=[];a=a||{},a.feeLevel&&d.push("feeLevel="+a.feeLevel),a.feePerKb&&d.push("feePerKb="+a.feePerKb),a.excludeUnconfirmedUtxos&&d.push("excludeUnconfirmedUtxos=1"),a.returnInputs&&d.push("returnInputs=1");var e="";d.length>0&&(e="?"+d.join("&"));var f="/v1/sendmaxinfo/"+e;c._doGetRequest(f,function(a,c){return a?b(a):b(null,c)})},e.prototype._oldCopayDecrypt=function(a,b,c){ +var d,e="@#$",f="%^#@";try{var g=a+e+b;d=n.decrypt(g,c)}catch(h){g=a+f+b;try{d=n.decrypt(g,c)}catch(h){u.debug(h)}}if(!d)return null;var i;try{i=JSON.parse(d)}catch(h){}return i},e.prototype.getWalletIdsFromOldCopay=function(a,b,c){var d=this._oldCopayDecrypt(a,b,c);if(!d)return null;var e=d.walletIds.concat(g.keys(d.focusedTimestamps));return g.uniq(e)},e.prototype.createWalletFromOldCopay=function(a,b,c,d){var e=this._oldCopayDecrypt(a,b,c);return e?e.publicKeyRing.copayersExtPubKeys.length!=e.opts.totalCopayers?d(new Error("Wallet is incomplete, cannot be imported")):(this.credentials=v.fromOldCopayWallet(e),void this.recreateWallet(d)):d(new Error("Could not decrypt"))},b.exports=e}).call(this,a("_process"),a("buffer").Buffer)},{"../package.json":572,"./common":5,"./credentials":7,"./errors":8,"./log":11,"./paypro":12,"./verifier":13,_process:392,async:14,bip38:15,"bitcore-lib":64,"bitcore-mnemonic":136,"browser-request":174,buffer:191,events:387,"json-stable-stringify":428,lodash:432,preconditions:433,querystring:396,request:438,sjcl:571,url:421,util:424}],3:[function(a,b,c){"use strict";var d={};d.SCRIPT_TYPES={P2SH:"P2SH",P2PKH:"P2PKH"},d.DERIVATION_STRATEGIES={BIP44:"BIP44",BIP45:"BIP45",BIP48:"BIP48"},d.PATHS={REQUEST_KEY:"m/1'/0",TXPROPOSAL_KEY:"m/1'/1",REQUEST_KEY_AUTH:"m/2"},d.BIP45_SHARED_INDEX=2147483647,d.UNITS={btc:{toSatoshis:1e8,full:{maxDecimals:8,minDecimals:8},"short":{maxDecimals:6,minDecimals:2}},bit:{toSatoshis:100,full:{maxDecimals:2,minDecimals:2},"short":{maxDecimals:0,minDecimals:0}}},b.exports=d},{}],4:[function(a,b,c){"use strict";var d={};d.DEFAULT_FEE_PER_KB=1e4,d.MIN_FEE_PER_KB=0,d.MAX_FEE_PER_KB=1e6,d.MAX_TX_FEE=1e8,b.exports=d},{}],5:[function(a,b,c){var d={};d.Constants=a("./constants"),d.Defaults=a("./defaults"),d.Utils=a("./utils"),b.exports=d},{"./constants":3,"./defaults":4,"./utils":6}],6:[function(a,b,c){(function(c){"use strict";function d(){}var e=a("lodash"),f=a("preconditions").singleton(),g=a("sjcl"),h=a("json-stable-stringify"),i=a("bitcore-lib"),j=i.Address,k=i.PrivateKey,l=i.PublicKey,m=i.crypto,n=(i.encoding,a("./constants")),o=a("./defaults");d.SJCL={},d.encryptMessage=function(a,b){var c=g.codec.base64.toBits(b);return g.encrypt(c,a,e.defaults({ks:128,iter:1},d.SJCL))},d.decryptMessage=function(a,b){try{var c=g.codec.base64.toBits(b);return g.decrypt(c,a)}catch(d){return a}},d.hashMessage=function(a){f.checkArgument(a);var b=new c(a),d=m.Hash.sha256sha256(b);return d=new i.encoding.BufferReader(d).readReverse()},d.signMessage=function(a,b){f.checkArgument(a);var c=new k(b),e=d.hashMessage(a);return m.ECDSA.sign(e,c,"little").toString()},d.verifyMessage=function(a,b,c){if(f.checkArgument(a),f.checkArgument(c),!b)return!1;var e=new l(c),g=d.hashMessage(a);try{var h=new m.Signature.fromString(b);return m.ECDSA.verify(g,h,e,"little")}catch(i){return!1}},d.privateKeyToAESKey=function(a){f.checkArgument(a&&e.isString(a)),f.checkArgument(i.PrivateKey.isValid(a),"The private key received is invalid");var b=i.PrivateKey.fromString(a);return i.crypto.Hash.sha256(b.toBuffer()).slice(0,16).toString("base64")},d.getCopayerHash=function(a,b,c){return[a,b,c].join("|")},d.getProposalHash=function(a){function b(a,b,c,d){return[a,b,c||"",d||""].join("|")}return arguments.length>1?b.apply(this,arguments):h(a)},d.deriveAddress=function(a,b,c,d,g){f.checkArgument(e.contains(e.values(n.SCRIPT_TYPES),a));var h,k=e.map(b,function(a){var b=new i.HDPublicKey(a.xPubKey);return b.derive(c).publicKey});switch(a){case n.SCRIPT_TYPES.P2SH:h=j.createMultisig(k,d,g);break;case n.SCRIPT_TYPES.P2PKH:f.checkState(e.isArray(k)&&1==k.length),h=j.fromPublicKey(k[0],g)}return{address:h.toString(),path:c,publicKeys:e.invoke(k,"toString")}},d.xPubToCopayerId=function(a){var b=g.hash.sha256.hash(a);return g.codec.hex.fromBits(b)},d.signRequestPubKey=function(a,b){var c=new i.HDPrivateKey(b).derive(n.PATHS.REQUEST_KEY_AUTH).privateKey;return d.signMessage(a,c)},d.verifyRequestPubKey=function(a,b,c){var e=new i.HDPublicKey(c).derive(n.PATHS.REQUEST_KEY_AUTH).publicKey;return d.verifyMessage(a,b,e.toString())},d.formatAmount=function(a,b,c){function d(a,b){var c=a.toString().split("."),d=(c[1]||"0").substring(0,b);return parseFloat(c[0]+"."+d)}function g(a,b,c,d){a=a.replace(".",c);var f=a.split(c),g=f[0],h=f[1];h=e.dropRightWhile(h,function(a,b){return"0"==a&&b>=d}).join("");var i=f.length>1?c+h:"";return g=g.replace(/\B(?=(\d{3})+(?!\d))/g,b),g+i}f.shouldBeNumber(a),f.checkArgument(e.contains(e.keys(n.UNITS),b)),c=c||{};var h=n.UNITS[b],i=c.fullPrecision?"full":"short",j=d(a/h.toSatoshis,h[i].maxDecimals).toFixed(h[i].maxDecimals);return g(j,c.thousandsSeparator||",",c.decimalSeparator||".",h[i].minDecimals)},d.buildTx=function(a){var b=new i.Transaction;switch(f.checkState(e.contains(e.values(n.SCRIPT_TYPES),a.addressType)),a.addressType){case n.SCRIPT_TYPES.P2SH:e.each(a.inputs,function(c){b.from(c,c.publicKeys,a.requiredSignatures)});break;case n.SCRIPT_TYPES.P2PKH:b.from(a.inputs)}if(a.toAddress&&a.amount&&!a.outputs?b.to(a.toAddress,a.amount):a.outputs&&e.each(a.outputs,function(a){f.checkState(a.script||a.toAddress,"Output should have either toAddress or script specified"),a.script?b.addOutput(new i.Transaction.Output({script:a.script,satoshis:a.amount})):b.to(a.toAddress,a.amount)}),b.fee(a.fee),b.change(a.changeAddress.address),b.outputs.length>1){var c=e.reject(a.outputOrder,function(a){return a>=b.outputs.length});f.checkState(b.outputs.length==c.length),b.sortOutputs(function(a){return e.map(c,function(b){return a[b]})})}var d=e.reduce(a.inputs,function(a,b){return+b.satoshis+a},0),g=e.reduce(b.outputs,function(a,b){return+b.satoshis+a},0);return f.checkState(d-g>=0),f.checkState(d-g<=o.MAX_TX_FEE),b},b.exports=d}).call(this,a("buffer").Buffer)},{"./constants":3,"./defaults":4,"bitcore-lib":64,buffer:191,"json-stable-stringify":428,lodash:432,preconditions:433,sjcl:571}],7:[function(a,b,c){(function(c){"use strict";function d(){this.version="1.0.0",this.derivationStrategy=l.DERIVATION_STRATEGIES.BIP44,this.account=0}function e(a){if(!g.contains(["livenet","testnet"],a))throw new Error("Invalid network")}var f=a("preconditions").singleton(),g=a("lodash"),h=a("bitcore-lib"),i=a("bitcore-mnemonic"),j=a("sjcl"),k=a("./common"),l=k.Constants,m=k.Utils,n=["network","xPrivKey","xPrivKeyEncrypted","xPubKey","requestPrivKey","requestPubKey","copayerId","publicKeyRing","walletId","walletName","m","n","walletPrivKey","personalEncryptingKey","sharedEncryptingKey","copayerName","externalSource","mnemonic","mnemonicEncrypted","entropySource","mnemonicHasPassphrase","derivationStrategy","account","addressType"];d.create=function(a){e(a);var b=new d;return b.network=a,b.xPrivKey=new h.HDPrivateKey(a).toString(),b._expand(),b};var o={en:i.Words.ENGLISH,es:i.Words.SPANISH,ja:i.Words.JAPANESE,zh:i.Words.CHINESE,fr:i.Words.FRENCH,it:i.Words.ITALIAN};d.createWithMnemonic=function(a,b,c,g,h){if(e(a),!o[c])throw new Error("Unsupported language");f.shouldBeNumber(g),h=h||{};for(var j=new i(o[c]);!i.isValid(j.toString());)j=new i(o[c]);var k=new d;return k.network=a,k.account=g,k.xPrivKey=j.toHDPrivateKey(b,a).toString(),k._expand(),k.mnemonic=j.phrase,k.mnemonicHasPassphrase=!!b,k},d.fromExtendedPrivateKey=function(a,b,c,e){f.shouldBeNumber(b),f.checkArgument(g.contains(g.values(l.DERIVATION_STRATEGIES),c)),e=e||{};var h=new d;return h.xPrivKey=a,h.account=b,h.derivationStrategy=c,h._expand(),h},d.fromMnemonic=function(a,b,c,h,j,k){e(a),f.shouldBeNumber(h),f.checkArgument(g.contains(g.values(l.DERIVATION_STRATEGIES),j)),k=k||{};var m=new i(b),n=new d;return n.xPrivKey=m.toHDPrivateKey(c,a).toString(),n.mnemonic=b,n.mnemonicHasPassphrase=!!c,n.account=h,n.derivationStrategy=j,n._expand(),n},d.fromExtendedPublicKey=function(a,b,e,i,j,k){f.checkArgument(e),f.shouldBeNumber(i),f.checkArgument(g.contains(g.values(l.DERIVATION_STRATEGIES),j)),k=k||{};var m=new c(e,"hex");f.checkArgument(m.length>=14,"At least 112 bits of entropy are needed");var n=new d;return n.xPubKey=a,n.entropySource=h.crypto.Hash.sha256sha256(m).toString("hex"),n.account=i,n.derivationStrategy=j,n.externalSource=b,n._expand(),n},d._getNetworkFromExtendedKey=function(a){return f.checkArgument(a&&g.isString(a)),"t"==a.charAt(0)?"testnet":"livenet"},d._xPubToCopayerId=function(a){var b=j.hash.sha256.hash(a);return j.codec.hex.fromBits(b)},d.prototype._hashFromEntropy=function(a,b){f.checkState(a);var d=new c(this.entropySource,"hex"),e=h.crypto.Hash.sha256hmac(d,new c(a));return e.slice(0,b)},d.prototype._expand=function(){f.checkState(this.xPrivKey||this.xPubKey&&this.entropySource);var a=d._getNetworkFromExtendedKey(this.xPrivKey||this.xPubKey);if(this.network?f.checkState(this.network==a):this.network=a,this.xPrivKey){var b=new h.HDPrivateKey.fromString(this.xPrivKey),c=b.derive(this.getBaseAddressDerivationPath());this.xPubKey=new h.HDPublicKey(c).toString();var e=b.derive(l.PATHS.REQUEST_KEY);this.requestPrivKey=e.privateKey.toString();var g=e.publicKey;this.requestPubKey=g.toString(),this.entropySource=h.crypto.Hash.sha256(e.privateKey.toBuffer()).toString("hex")}else{var i=this._hashFromEntropy("reqPrivKey",32),j=new h.PrivateKey(i.toString("hex"),a);this.requestPrivKey=j.toString(),this.requestPubKey=j.toPublicKey().toString()}this.personalEncryptingKey=this._hashFromEntropy("personalKey",16).toString("base64"),this.copayerId=d._xPubToCopayerId(this.xPubKey),this.publicKeyRing=[{xPubKey:this.xPubKey,requestPubKey:this.requestPubKey}]},d.fromObj=function(a){var b=new d;return g.each(n,function(c){b[c]=a[c]}),b.derivationStrategy=b.derivationStrategy||l.DERIVATION_STRATEGIES.BIP45,b.addressType=b.addressType||l.SCRIPT_TYPES.P2SH,b.account=b.account||0,f.checkState(b.xPrivKey||b.xPubKey||b.xPrivKeyEncrypted,"invalid input"),b},d.prototype.toObj=function(){var a=this,b={};return g.each(n,function(c){b[c]=a[c]}),b},d.prototype.getBaseAddressDerivationPath=function(){var a;switch(this.derivationStrategy){case l.DERIVATION_STRATEGIES.BIP45:return"m/45'";case l.DERIVATION_STRATEGIES.BIP44:a="44";break;case l.DERIVATION_STRATEGIES.BIP48:a="48"}var b="livenet"==this.network?"0":"1";return"m/"+a+"'/"+b+"'/"+this.account+"'"},d.prototype.getDerivedXPrivKey=function(a){var b=this.getBaseAddressDerivationPath(),c=this.getKeys(a).xPrivKey;return new h.HDPrivateKey(c,this.network).derive(b)},d.prototype.addWalletPrivateKey=function(a){this.walletPrivKey=a,this.sharedEncryptingKey=m.privateKeyToAESKey(a)},d.prototype.addWalletInfo=function(a,b,c,d,e){this.walletId=a,this.walletName=b,this.m=c,this.n=d,e&&(this.copayerName=e),"BIP44"==this.derivationStrategy&&1==d?this.addressType=l.SCRIPT_TYPES.P2PKH:this.addressType=l.SCRIPT_TYPES.P2SH,!this.xPrivKey&&this.externalSource&&d>1&&(this.derivationStrategy=l.DERIVATION_STRATEGIES.BIP48),1==d&&this.addPublicKeyRing([{xPubKey:this.xPubKey,requestPubKey:this.requestPubKey}])},d.prototype.hasWalletInfo=function(){return!!this.walletId},d.prototype.isPrivKeyEncrypted=function(){return!!this.xPrivKeyEncrypted&&!this.xPrivKey},d.prototype.encryptPrivateKey=function(a,b){if(this.xPrivKeyEncrypted)throw new Error("Private key already encrypted");if(!this.xPrivKey)throw new Error("No private key to encrypt");if(this.xPrivKeyEncrypted=j.encrypt(a,this.xPrivKey,b),!this.xPrivKeyEncrypted)throw new Error("Could not encrypt");this.mnemonic&&(this.mnemonicEncrypted=j.encrypt(a,this.mnemonic,b)),delete this.xPrivKey,delete this.mnemonic},d.prototype.decryptPrivateKey=function(a){if(!this.xPrivKeyEncrypted)throw new Error("Private key is not encrypted");try{this.xPrivKey=j.decrypt(a,this.xPrivKeyEncrypted),this.mnemonicEncrypted&&(this.mnemonic=j.decrypt(a,this.mnemonicEncrypted)),delete this.xPrivKeyEncrypted,delete this.mnemonicEncrypted}catch(b){throw new Error("Could not decrypt")}},d.prototype.getKeys=function(a){var b={};if(this.isPrivKeyEncrypted()){f.checkArgument(a,"Private keys are encrypted, a password is needed");try{b.xPrivKey=j.decrypt(a,this.xPrivKeyEncrypted),this.mnemonicEncrypted&&(b.mnemonic=j.decrypt(a,this.mnemonicEncrypted))}catch(c){throw new Error("Could not decrypt")}}else b.xPrivKey=this.xPrivKey,b.mnemonic=this.mnemonic;return b},d.prototype.addPublicKeyRing=function(a){this.publicKeyRing=g.clone(a)},d.prototype.canSign=function(){return!!this.xPrivKey||!!this.xPrivKeyEncrypted},d.prototype.setNoSign=function(){delete this.xPrivKey,delete this.xPrivKeyEncrypted,delete this.mnemonic,delete this.mnemonicEncrypted},d.prototype.isComplete=function(){return this.m&&this.n&&this.publicKeyRing&&this.publicKeyRing.length==this.n?!0:!1},d.prototype.hasExternalSource=function(){return"string"==typeof this.externalSource},d.prototype.getExternalSourceName=function(){return this.externalSource},d.prototype.getMnemonic=function(){if(this.mnemonicEncrypted&&!this.mnemonic)throw new Error("Credentials are encrypted");return this.mnemonic},d.prototype.clearMnemonic=function(){delete this.mnemonic,delete this.mnemonicEncrypted},d.fromOldCopayWallet=function(a){function b(a){var b=a.publicKeyRing.copayersExtPubKeys.sort().join(""),d=new c(b),e=new h.PrivateKey.fromBuffer(h.crypto.Hash.sha256(d));return e.toString()}var e=new d;e.derivationStrategy=l.DERIVATION_STRATEGIES.BIP45,e.xPrivKey=a.privateKey.extendedPrivateKeyString,e._expand(),e.addWalletPrivateKey(b(a)),e.addWalletInfo(a.opts.id,a.opts.name,a.opts.requiredCopayers,a.opts.totalCopayers);var f=g.map(a.publicKeyRing.copayersExtPubKeys,function(b){var c,d=b===e.xPubKey;if(d){var f=l.PATHS.REQUEST_KEY;c=new h.HDPrivateKey(e.xPrivKey).derive(f).hdPublicKey}else{var f=l.PATHS.REQUEST_KEY_AUTH;c=new h.HDPublicKey(b).derive(f)}var g=new h.HDPublicKey(b).derive("m/2147483646/0/0"),i=g.publicKey.toString("hex"),j=a.publicKeyRing.nicknameFor[i];return d&&(e.copayerName=j),{xPubKey:b,requestPubKey:c.publicKey.toString(),copayerName:j}});return e.addPublicKeyRing(f),e},b.exports=d}).call(this,a("buffer").Buffer)},{"./common":5,"bitcore-lib":64,"bitcore-mnemonic":136,buffer:191,lodash:432,preconditions:433,sjcl:571}],8:[function(a,b,c){"use strict";function d(a,b){return a.replace("{0}",b[0]).replace("{1}",b[1]).replace("{2}",b[2])}var e=a("lodash"),f=function(a,b){var c=function(){if(e.isString(b.message))this.message=d(b.message,arguments);else{if(!e.isFunction(b.message))throw new Error("Invalid error definition for "+b.name);this.message=b.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return c.prototype=Object.create(a.prototype),c.prototype.name=a.prototype.name+b.name,a[b.name]=c,b.errors&&g(c,b.errors),c},g=function(a,b){e.each(b,function(b){f(a,b)})},h=function(a,b){return g(a,b),a},i={};i.Error=function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack},i.Error.prototype=Object.create(Error.prototype),i.Error.prototype.name="bwc.Error";var j=a("./spec");h(i.Error,j),b.exports=i.Error,b.exports.extend=function(a){return f(i.Error,a)}},{"./spec":9,lodash:432}],9:[function(a,b,c){"use strict";var d=[{name:"INVALID_BACKUP",message:"Invalid Backup"},{name:"WALLET_DOES_NOT_EXIST",message:"Wallet does not exist. Need to recreate"},{name:"MISSING_PRIVATE_KEY",message:"Missing private keys to sign"},{name:"ENCRYPTED_PRIVATE_KEY",message:"Private key is encrypted, cannot sign"},{name:"SERVER_COMPROMISED",message:"Server response could not be verified"},{name:"COULD_NOT_BUILD_TRANSACTION",message:"Could not build transaction"},{name:"INSUFFICIENT_FUNDS",message:"Insufficient funds"},{name:"CONNECTION_ERROR",message:"connection error"},{name:"NOT_FOUND",message:"not found"},{name:"ECONNRESET_ERROR",message:"ECONNRESET, body: {0}"},{name:"WALLET_ALREADY_EXISTS",message:"wallet already exists"},{name:"COPAYER_IN_WALLET",message:"copayer in wallet"},{name:"WALLET_FULL",message:"wallet is full"},{name:"WALLET_NOT_FOUND",message:"wallet not found"},{name:"INSUFFICIENT_FUNDS_FOR_FEE",message:"insufficient funds for fee"},{name:"LOCKED_FUNDS",message:"locked funds"},{name:"COPAYER_VOTED",message:"Copayer already voted on this transaction proposal"},{name:"NOT_AUTHORIZED",message:"not authorized"},{name:"UNAVAILABLE_UTXOS",message:"Unavailable unspent outputs"},{name:"TX_NOT_FOUND",message:"transaction proposal not found"}];b.exports=d},{}],10:[function(a,b,c){var d=b.exports=a("./api");d.Verifier=a("./verifier"),d.Utils=a("./common/utils"),d.sjcl=a("sjcl"),d.Bitcore=a("bitcore-lib")},{"./api":2,"./common/utils":6,"./verifier":13,"bitcore-lib":64,sjcl:571}],11:[function(a,b,c){var d=a("lodash"),e=function(a){this.name=a||"log",this.level=2};e.prototype.getLevels=function(){return f};var f={debug:0,info:1,log:2,warn:3,error:4,fatal:5};d.each(f,function(a,b){e.prototype[b]=function(){if(a>=f[this.level]){if(Error.stackTraceLimit&&"debug"==this.level){var c=Error.stackTraceLimit;Error.stackTraceLimit=2;var d;try{anerror()}catch(e){d=e.stack}var g=d.split("\n"),h=g[2];h=":"+h.substr(6),Error.stackTraceLimit=c}var i,j="["+b+(h||"")+"] "+arguments[0],i=[].slice.call(arguments,1);console[b]?(i.unshift(j),console[b].apply(console,i)):(i.length&&(j+=JSON.stringify(i)),console.log(j))}}}),e.prototype.setLevel=function(a){this.level=a};var g=new e("copay");new Error;g.setLevel("info"),b.exports=g},{lodash:432}],12:[function(a,b,c){(function(c,d){var e=a("preconditions").singleton(),f=a("bitcore-lib"),g=a("bitcore-payment-protocol"),h={};h._nodeRequest=function(b,c){b.agent=!1;var e=b.httpNode||a("http"===b.proto?"http":"https"),f="POST"==b.method?"post":"get";e[f](b,function(a){if(200!=a.statusCode)return c(new Error("HTTP Request Error"));var b=[];a.on("data",function(a){b.push(a)}),a.on("end",function(){return b=d.concat(b),c(null,b)})})},h._browserRequest=function(a,b){var c=(a.method||"GET").toUpperCase(),d=a.url,e=a;e.headers=e.headers||{},e.body=e.body||e.data||"";var f=a.xhr||new XMLHttpRequest;f.open(c,d,!0),Object.keys(e.headers).forEach(function(a){var b=e.headers[a];"Content-Length"!==a&&"Content-Transfer-Encoding"!==a&&f.setRequestHeader(a,b)}),f.responseType="arraybuffer",f.onload=function(a){var c=f.response;return b(null,new Uint8Array(c))},f.onerror=function(a){var c;return c=0!==f.status&&f.statusText?f.statusText:"HTTP Request Error",b(new Error(c))},e.body?f.send(e.body):f.send(null)};var i=function(a){a.url.match(/^((http[s]?):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/);if(a.proto=RegExp.$2,a.host=RegExp.$3,a.path=RegExp.$4+RegExp.$6,a.http)return a.http;var b=a.env;return b||(b=c&&!c.browser?"node":"browser"),"node"==b?h._nodeRequest:http=h._browserRequest};h.get=function(a,b){e.checkArgument(a&&a.url);var c=i(a);a.headers=a.headers||{Accept:g.PAYMENT_REQUEST_CONTENT_TYPE,"Content-Type":"application/octet-stream"},c(a,function(c,e){if(c)return b(c);var h,i,j,k;try{var l=g.PaymentRequest.decode(e);h=(new g).makePaymentRequest(l),j=h.get("signature"),k=h.get("serialized_payment_details"),i=h.verify(!0)}catch(m){return b(new Error("Could not parse payment protocol: "+m))}var n=g.PaymentDetails.decode(k),o=new g;o=o.makePaymentDetails(n);var p=o.get("outputs");if(p.length>1)return b(new Error("Payment Protocol Error: Requests with more that one output are not supported"));var q=p[0],r=q.get("amount").toNumber(),s="test"==o.get("network")?"testnet":"livenet",t=q.get("script").offset,u=q.get("script").limit,v=new d(new Uint8Array(q.get("script").buffer)),w=v.slice(t,u),x=new f.Address.fromScript(new f.Script(w),s),y=o.get("merchant_data");y&&(y=y.toString());var z=i.verified;return i.isChain&&(z=z&&i.chainVerified),b(null,{verified:z,caTrusted:i.caTrusted,caName:i.caName,selfSigned:i.selfSigned,expires:o.get("expires"),memo:o.get("memo"),time:o.get("time"),merchant_data:y,toAddress:x.toString(),amount:r,network:s,domain:a.host,url:a.url})})},h._getPayProRefundOutputs=function(a,b){b=b.toString(10);var c,d=new g.Output,e=new f.Address(a);if(e.isPayToPublicKeyHash())c=f.Script.buildPublicKeyHashOut(e);else{if(!e.isPayToScriptHash())throw new Error("Unrecognized address type "+e.type);c=f.Script.buildScriptHashOut(e)}return d.set("script",c.toBuffer()),d.set("amount",b),[d]},h._createPayment=function(a,b,c,e){var f=new g;f=f.makePayment(),a&&(a=new d(a),f.set("merchant_data",a));var h=new d(b,"hex");f.set("transactions",[h]);var i=this._getPayProRefundOutputs(c,e);i&&f.set("refund_to",i),f=f.serialize();for(var j=new ArrayBuffer(f.length),k=new Uint8Array(j),l=0;l=3))throw new Error("Transaction proposal not supported");var k=i.buildTx(b);return h=k.uncheckedSerialize(),j.debug("Regenerating & verifying tx proposal hash -> Hash: ",h," Signature: ",b.proposalSignature),i.verifyMessage(h,b.proposalSignature,g)&&d.checkAddress(a,b.changeAddress)?!0:!1},d.checkPaypro=function(a,b){var c,d;return parseInt(a.version)>=3?(c=a.outputs[0].toAddress,d=a.amount):(c=a.toAddress,d=a.amount),c==b.toAddress&&d==b.amount},d.checkTxProposal=function(a,b,c){return c=c||{},this.checkTxProposalSignature(a,b)?c.paypro&&!this.checkPaypro(b,c.paypro)?!1:!0:!1},b.exports=d},{"./common":5,"./log":11,"bitcore-lib":64,lodash:432,preconditions:433}],14:[function(a,b,c){(function(a){!function(){function c(a){var b=!1;return function(){if(b)throw new Error("Callback was already called.");b=!0,a.apply(d,arguments)}}var d,e,f={};d=this,null!=d&&(e=d.async),f.noConflict=function(){return d.async=e,f};var g=Object.prototype.toString,h=Array.isArray||function(a){return"[object Array]"===g.call(a)},i=function(a,b){for(var c=0;c=a.length&&d())}if(d=d||function(){},!a.length)return d();var f=0;i(a,function(a){b(a,c(e))})},f.forEach=f.each,f.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},f.forEachSeries=f.eachSeries,f.eachLimit=function(a,b,c,d){var e=m(b);e.apply(null,[a,c,d])},f.forEachLimit=f.eachLimit;var m=function(a){return function(b,c,d){if(d=d||function(){},!b.length||0>=a)return d();var e=0,f=0,g=0;!function h(){if(e>=b.length)return d();for(;a>g&&f=b.length?d():h())})}()}},n=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[f.each].concat(b))}},o=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[m(a)].concat(c))}},p=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[f.eachSeries].concat(b))}},q=function(a,b,c,d){if(b=j(b,function(a,b){return{index:b,value:a}}),d){var e=[];a(b,function(a,b){c(a.value,function(c,d){e[a.index]=d,b(c)})},function(a){d(a,e)})}else a(b,function(a,b){c(a.value,function(a){b(a)})})};f.map=n(q),f.mapSeries=p(q),f.mapLimit=function(a,b,c,d){return r(b)(a,c,d)};var r=function(a){return o(a,q)};f.reduce=function(a,b,c,d){f.eachSeries(a,function(a,d){c(b,a,function(a,c){b=c,d(a)})},function(a){d(a,b)})},f.inject=f.reduce,f.foldl=f.reduce,f.reduceRight=function(a,b,c,d){var e=j(a,function(a){return a}).reverse();f.reduce(e,b,c,d)},f.foldr=f.reduceRight;var s=function(a,b,c,d){var e=[];b=j(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c&&e.push(a),b()})},function(a){d(j(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};f.filter=n(s),f.filterSeries=p(s),f.select=f.filter,f.selectSeries=f.filterSeries;var t=function(a,b,c,d){var e=[];b=j(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c||e.push(a),b()})},function(a){d(j(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};f.reject=n(t),f.rejectSeries=p(t);var u=function(a,b,c,d){a(b,function(a,b){c(a,function(c){c?(d(a),d=function(){}):b()})},function(a){d()})};f.detect=n(u),f.detectSeries=p(u),f.some=function(a,b,c){f.each(a,function(a,d){b(a,function(a){a&&(c(!0),c=function(){}),d()})},function(a){c(!1)})},f.any=f.some,f.every=function(a,b,c){f.each(a,function(a,d){b(a,function(a){a||(c(!1),c=function(){}),d()})},function(a){c(!0)})},f.all=f.every,f.sortBy=function(a,b,c){f.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);var d=function(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0};c(null,j(b.sort(d),function(a){return a.value}))})},f.auto=function(a,b){b=b||function(){};var c=l(a),d=c.length;if(!d)return b();var e={},g=[],j=function(a){g.unshift(a)},m=function(a){for(var b=0;bd;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function e(a,b,e,g){return a.started||(a.started=!0),h(b)||(b=[b]),0==b.length?f.setImmediate(function(){a.drain&&a.drain()}):void i(b,function(b){var h={data:b,priority:e,callback:"function"==typeof g?g:null};a.tasks.splice(d(a.tasks,h,c)+1,0,h),a.saturated&&a.tasks.length===a.concurrency&&a.saturated(),f.setImmediate(a.process)})}var g=f.queue(a,b);return g.push=function(a,b,c){e(g,a,b,c)},delete g.unshift,g},f.cargo=function(a,b){var c=!1,d=[],e={tasks:d,payload:b,saturated:null,empty:null,drain:null,drained:!0,push:function(a,c){h(a)||(a=[a]),i(a,function(a){d.push({data:a,callback:"function"==typeof c?c:null}),e.drained=!1,e.saturated&&d.length===b&&e.saturated()}),f.setImmediate(e.process)},process:function g(){if(!c){if(0===d.length)return e.drain&&!e.drained&&e.drain(),void(e.drained=!0);var f="number"==typeof b?d.splice(0,b):d.splice(0,d.length),h=j(f,function(a){return a.data});e.empty&&e.empty(),c=!0,a(h,function(){c=!1;var a=arguments;i(f,function(b){b.callback&&b.callback.apply(null,a)}),g()})}},length:function(){return d.length},running:function(){return c}};return e};var x=function(a){return function(b){var c=Array.prototype.slice.call(arguments,1);b.apply(null,c.concat([function(b){var c=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(b?console.error&&console.error(b):console[a]&&i(c,function(b){console[a](b)}))}]))}};f.log=x("log"),f.dir=x("dir"),f.memoize=function(a,b){var c={},d={};b=b||function(a){return a};var e=function(){var e=Array.prototype.slice.call(arguments),g=e.pop(),h=b.apply(null,e);h in c?f.nextTick(function(){g.apply(null,c[h])}):h in d?d[h].push(g):(d[h]=[g],a.apply(null,e.concat([function(){c[h]=arguments;var a=d[h];delete d[h];for(var b=0,e=a.length;e>b;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},f.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},f.times=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return f.map(d,b,c)},f.timesSeries=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return f.mapSeries(d,b,c)},f.seq=function(){var a=arguments;return function(){var b=this,c=Array.prototype.slice.call(arguments),d=c.pop();f.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){d.apply(b,[a].concat(c))})}},f.compose=function(){return f.seq.apply(null,Array.prototype.reverse.call(arguments))};var y=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};f.applyEach=n(y),f.applyEachSeries=p(y),f.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof b&&b.exports?b.exports=f:"undefined"!=typeof define&&define.amd?define([],function(){return f}):d.async=f}()}).call(this,a("_process"))},{_process:392}],15:[function(a,b,c){(function(c){function d(a){return a=h("sha256").update(a).digest(),h("sha256").update(a).digest()}function e(a){return this instanceof e?(this.versions=a||{"private":128},void(this.scryptParams={N:16384,r:8,p:8})):new e}var f=a("browserify-aes"),g=a("assert"),h=a("create-hash"),i=a("coinstring"),j=a("scryptsy"),k=a("buffer-xor"),l=a("ecurve"),m=l.getCurveByName("secp256k1"),n=a("bigi");e.prototype.encryptRaw=function(a,b,e,h,i){g.equal(a.length,32,"Invalid private key length");var l=new c(e,"utf8"),m=d(h).slice(0,4),n=this.scryptParams.N,o=this.scryptParams.r,p=this.scryptParams.p,q=j(l,m,n,o,p,64,i),r=q.slice(0,32),s=q.slice(32,64),t=k(a,r),u=f.createCipheriv("aes-256-ecb",s,new c(0));u.setAutoPadding(!1),u.end(t);var v=u.read(),w=b?224:192,x=new c(3);return x.writeUInt8(1,0),x.writeUInt8(66,1),x.writeUInt8(w,2),c.concat([x,m,v])},e.prototype.encrypt=function(a,b,c,d){var e=i.decode(a).slice(1),f=33===e.length&&1===e[32];return f&&(e=e.slice(0,-1)),i.encode(this.encryptRaw(e,f,b,c,d))},e.prototype.decryptRaw=function(a,b,d){g.equal(a.length,39,"Invalid BIP38 data length"),g.equal(a.readUInt8(0),1,"Invalid BIP38 prefix");var e=a.readUInt8(1);if(67===e)return this.decryptECMult(a,b,d);b=new c(b,"utf8"),g.equal(e,66,"Invalid BIP38 type");var h=a.readUInt8(2),i=224===h;i||g.equal(h,192,"Invalid BIP38 compression flag");var l=this.scryptParams.N,m=this.scryptParams.r,n=this.scryptParams.p,o=a.slice(3,7),p=j(b,o,l,m,n,64,d),q=p.slice(0,32),r=p.slice(32,64),s=a.slice(7,39),t=f.createDecipheriv("aes-256-ecb",r,new c(0));t.setAutoPadding(!1),t.end(s);var u=t.read(),v=k(u,q);return{privateKey:v,compressed:i}},e.prototype.decrypt=function(a,b,d){var e=i.decode(a),f=this.decryptRaw(e,b,d),g=f.compressed?34:33,h=new c(g);return h.writeUInt8(this.versions["private"],0),f.privateKey.copy(h,1),f.compressed&&h.writeUInt8(1,33),i.encode(h)},e.prototype.decryptECMult=function(a,b,e){b=new c(b,"utf8"),a=a.slice(1);var h=0!==(32&a[1]),i=0!==(4&a[1]);g.equal(36&a[1],a[1],"Invalid private key.");var l,o=a.slice(2,6),p=a.slice(6,14);l=i?p.slice(0,4):p;var q,r=a.slice(14,22),s=a.slice(22,38),t=this.scryptParams.N,u=this.scryptParams.r,v=this.scryptParams.p,w=j(b,l,t,u,v,32,e);if(i){var x=c.concat([w,p]);q=d(x)}else q=w;var y=n.fromBuffer(q),z=m.G.multiply(y).getEncoded(!0),A=j(z,c.concat([o,p]),1024,1,1,64),B=A.slice(0,32),C=A.slice(32,64),D=f.createDecipheriv("aes-256-ecb",C,new c(0));D.setAutoPadding(!1),D.end(s);var E=D.read(),F=k(E,B.slice(16,32)),G=F.slice(8,16),H=f.createDecipheriv("aes-256-ecb",C,new c(0));H.setAutoPadding(!1),H.write(r),H.end(F.slice(0,8));var I=k(H.read(),B.slice(0,16)),J=c.concat([I,G],24),K=d(J),L=y.multiply(n.fromBuffer(K)).mod(m.n);return{privateKey:L.toBuffer(32),compressed:h}},e.prototype.verify=function(a){var b;try{b=i.decode(a)}catch(c){return!1}if(39!==b.length)return!1;if(1!==b.readUInt8(0))return!1;var d=b.readUInt8(1),e=b.readUInt8(2);if(66===d){if(192!==e&&224!==e)return!1}else{if(67!==d)return!1;if(-37&e)return!1}return!0},b.exports=e}).call(this,a("buffer").Buffer)},{assert:176,bigi:18,"browserify-aes":22,buffer:191,"buffer-xor":38,coinstring:39,"create-hash":41,ecurve:57,scryptsy:60}],16:[function(a,b,c){function d(a,b,c){return this instanceof d?void(null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))):new d(a,b,c)}function e(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function f(a){return fb.charAt(a)}function g(a,b){var c=gb[a.charCodeAt(b)];return null==c?-1:c}function h(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function i(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+bb:this.t=0}function j(a){var b=new d;return b.fromInt(a),b}function k(a,b){var c,e=this;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void e.fromRadix(a,b);c=2}e.t=0,e.s=0;for(var f=a.length,h=!1,i=0;--f>=0;){var j=8==c?255&a[f]:g(a,f);0>j?"-"==a.charAt(f)&&(h=!0):(h=!1,0==i?e[e.t++]=j:i+c>e.DB?(e[e.t-1]|=(j&(1<>e.DB-i):e[e.t-1]|=j<=e.DB&&(i-=e.DB))}8==c&&0!=(128&a[0])&&(e.s=-1,i>0&&(e[e.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function m(a){var b=this;if(b.s<0)return"-"+b.negate().toString(a);var c;if(16==a)c=4;else if(8==a)c=3;else if(2==a)c=1;else if(32==a)c=5;else{if(4!=a)return b.toRadix(a);c=2}var d,e=(1<0)for(j>j)>0&&(g=!0,h=f(d));i>=0;)c>j?(d=(b[i]&(1<>(j+=b.DB-c)):(d=b[i]>>(j-=c)&e,0>=j&&(j+=b.DB,--i)),d>0&&(g=!0),g&&(h+=f(d));return g?h:"0"}function n(){var a=new d;return d.ZERO.subTo(this,a),a}function o(){return this.s<0?this.negate():this}function p(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function q(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function r(){return this.t<=0?0:this.DB*(this.t-1)+q(this[this.t-1]^this.s&this.DM)}function s(){return this.bitLength()>>3}function t(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function u(a,b){for(var c=a;c=0;--c)b[c+h+1]=d[c]>>f|i,i=(d[c]&g)<=0;--c)b[c]=0;b[h]=i,b.t=d.t+h+1,b.s=d.s,b.clamp()}function w(a,b){var c=this;b.s=c.s;var d=Math.floor(a/c.DB);if(d>=c.t)return void(b.t=0);var e=a%c.DB,f=c.DB-e,g=(1<>e;for(var h=d+1;h>e;e>0&&(b[c.t-d-1]|=(c.s&g)<d;)e+=c[d]-a[d],b[d++]=e&c.DM,e>>=c.DB;if(a.t>=c.DB;e+=c.s}else{for(e+=c.s;d>=c.DB;e-=a.s}b.s=0>e?-1:0,-1>e?b[d++]=c.DV+e:e>0&&(b[d++]=e),b.t=d,b.clamp()}function y(a,b){var c=this.abs(),e=a.abs(),f=c.t;for(b.t=f+e.t;--f>=0;)b[f]=0;for(f=0;f=0;)a[c]=0;for(c=0;c=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function A(a,b,c){var e=this,f=a.abs();if(!(f.t<=0)){var g=e.abs();if(g.t0?(f.lShiftTo(k,h),g.lShiftTo(k,c)):(f.copyTo(h),g.copyTo(c));var l=h.t,m=h[l-1];if(0!=m){var n=m*(1<1?h[l-2]>>e.F2:0),o=e.FV/n,p=(1<=0&&(c[c.t++]=1,c.subTo(u,c)),d.ONE.dlShiftTo(l,u),u.subTo(h,h);h.t=0;){var v=c[--s]==m?e.DM:Math.floor(c[s]*o+(c[s-1]+r)*p);if((c[s]+=h.am(0,v,c,t,0,l))0&&c.rShiftTo(k,c),0>i&&d.ZERO.subTo(c,c)}}}function B(a){var b=new d;return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(d.ZERO)>0&&a.subTo(b,b),b}function C(a){this.m=a}function D(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function E(a){return a}function F(a){a.divRemTo(this.m,null,a)}function G(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function H(a,b){a.squareTo(b),this.reduce(b)}function I(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function J(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(b,b),b}function L(a){var b=new d;return a.copyTo(b),this.reduce(b),b}function M(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function N(a,b){a.squareTo(b),this.reduce(b)}function O(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function P(){return 0==(this.t>0?1&this[0]:this.s)}function Q(a,b){if(a>4294967295||1>a)return d.ONE;var c=new d,e=new d,f=b.convert(this),g=q(a)-1;for(f.copyTo(c);--g>=0;)if(b.sqrTo(c,e),(a&1<0)b.mulTo(e,f,c);else{var h=c;c=e,e=h}return b.revert(c)}function R(a,b){var c;return c=256>a||b.isEven()?new C(b):new J(b),this.exp(a,c)}function S(){var a=new d;return this.copyTo(a),a}function T(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function V(){return 0==this.t?this.s:this[0]<<16>>16}function W(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function X(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function Y(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),e=j(c),f=new d,g=new d,h="";for(this.divRemTo(e,f,g);f.signum()>0;)h=(c+g.intValue()).toString(a).substr(1)+h,f.divRemTo(e,f,g);return g.intValue().toString(a)+h}function Z(a,b){var c=this;c.fromInt(0),null==b&&(b=10);for(var e=c.chunkSize(b),f=Math.pow(b,e),h=!1,i=0,j=0,k=0;kl?"-"==a.charAt(k)&&0==c.signum()&&(h=!0):(j=b*j+l,++i>=e&&(c.dMultiply(f),c.dAddOffset(j,0),i=0,j=0))}i>0&&(c.dMultiply(Math.pow(b,i)),c.dAddOffset(j,0)),h&&d.ZERO.subTo(c,c)}function $(a,b,c){var e=this;if("number"==typeof b)if(2>a)e.fromInt(1);else for(e.fromNumber(a,c),e.testBit(a-1)||e.bitwiseTo(d.ONE.shiftLeft(a-1),ga,e),e.isEven()&&e.dAddOffset(1,0);!e.isProbablePrime(b);)e.dAddOffset(2,0),e.bitLength()>a&&e.subTo(d.ONE.shiftLeft(a-1),e);else{var f=new Array,g=7&a;f.length=(a>>3)+1,b.nextBytes(f),g>0?f[0]&=(1<0)for(e>e)!=(a.s&a.DM)>>e&&(c[f++]=d|a.s<=0;)8>e?(d=(a[b]&(1<>(e+=a.DB-8)):(d=a[b]>>(e-=8)&255,0>=e&&(e+=a.DB,--b)),0!=(128&d)&&(d|=-256),0===f&&(128&a.s)!=(128&d)&&++f,(f>0||d!=a.s)&&(c[f++]=d);return c}function aa(a){return 0==this.compareTo(a)}function ba(a){return this.compareTo(a)<0?this:a}function ca(a){return this.compareTo(a)>0?this:a}function da(a,b,c){var d,e,f=this,g=Math.min(a.t,f.t);for(d=0;g>d;++d)c[d]=b(f[d],a[d]);if(a.ta?this.rShiftTo(-a,b):this.lShiftTo(a,b),b}function oa(a){var b=new d;return 0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b),b}function pa(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function qa(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<d;)e+=c[d]+a[d],b[d++]=e&c.DM,e>>=c.DB;if(a.t>=c.DB;e+=c.s}else{for(e+=c.s;d>=c.DB;e+=a.s}b.s=0>e?-1:0,e>0?b[d++]=e:-1>e&&(b[d++]=c.DV+e),b.t=d,b.clamp()}function za(a){var b=new d;return this.addTo(a,b),b}function Aa(a){var b=new d;return this.subTo(a,b),b}function Ba(a){var b=new d;return this.multiplyTo(a,b),b}function Ca(){var a=new d;return this.squareTo(a),a}function Da(a){var b=new d;return this.divRemTo(a,b,null),b}function Ea(a){var b=new d;return this.divRemTo(a,null,b),b}function Fa(a){var b=new d,c=new d;return this.divRemTo(a,b,c),new Array(b,c)}function Ga(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function Ha(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function Ia(){}function Ja(a){return a}function Ka(a,b,c){a.multiplyTo(b,c)}function La(a,b){a.squareTo(b)}function Ma(a){return this.exp(a,new Ia)}function Na(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function Oa(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=new d;return a.copyTo(b),this.reduce(b),b}function Ra(a){return a}function Sa(a){var b=this;for(a.drShiftTo(b.m.t-1,b.r2),a.t>b.m.t+1&&(a.t=b.m.t+1,a.clamp()),b.mu.multiplyUpperTo(b.r2,b.m.t+1,b.q3),b.m.multiplyLowerTo(b.q3,b.m.t+1,b.r2);a.compareTo(b.r2)<0;)a.dAddOffset(1,b.m.t+1);for(a.subTo(b.r2,a);a.compareTo(b.m)>=0;)a.subTo(b.m,a)}function Ta(a,b){a.squareTo(b),this.reduce(b)}function Ua(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function Va(a,b){var c,e,f=a.bitLength(),g=j(1);if(0>=f)return g;c=18>f?1:48>f?3:144>f?4:768>f?5:6,e=8>f?new C(b):b.isEven()?new Pa(b):new J(b);var h=new Array,i=3,k=c-1,l=(1<1){var m=new d;for(e.sqrTo(h[1],m);l>=i;)h[i]=new d,e.mulTo(m,h[i-2],h[i]),i+=2}var n,o,p=a.t-1,r=!0,s=new d;for(f=q(a[p])-1;p>=0;){for(f>=k?n=a[p]>>f-k&l:(n=(a[p]&(1<0&&(n|=a[p-1]>>this.DB+f-k)),i=c;0==(1&n);)n>>=1,--i;if((f-=i)<0&&(f+=this.DB,--p),r)h[n].copyTo(g),r=!1;else{for(;i>1;)e.sqrTo(g,s),e.sqrTo(s,g),i-=2;i>0?e.sqrTo(g,s):(o=g,g=s,s=o),e.mulTo(s,h[n],g)}for(;p>=0&&0==(a[p]&1<f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function Xa(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function Ya(a){var b=a.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&b||0==a.signum())return d.ZERO;for(var c=a.clone(),e=this.clone(),f=j(1),g=j(0),h=j(0),i=j(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(f.isEven()&&g.isEven()||(f.addTo(this,f),g.subTo(a,g)),f.rShiftTo(1,f)):g.isEven()||g.subTo(a,g),g.rShiftTo(1,g);for(;e.isEven();)e.rShiftTo(1,e),b?(h.isEven()&&i.isEven()||(h.addTo(this,h),i.subTo(a,i)),h.rShiftTo(1,h)):i.isEven()||i.subTo(a,i),i.rShiftTo(1,i);c.compareTo(e)>=0?(c.subTo(e,c),b&&f.subTo(h,f),g.subTo(i,g)):(e.subTo(c,e),b&&h.subTo(f,h),i.subTo(g,i))}if(0!=e.compareTo(d.ONE))return d.ZERO;for(;i.compareTo(a)>=0;)i.subTo(a,i);for(;i.signum()<0;)i.addTo(a,i);return i}function Za(a){var b,c=this.abs();if(1==c.t&&c[0]<=hb[hb.length-1]){for(b=0;bd;)d*=hb[e++];for(d=c.modInt(d);e>b;)if(d%hb[b++]==0)return!1}return c.millerRabin(a)}function $a(a){var b=this.subtract(d.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var e=b.shiftRight(c);a=a+1>>1,a>hb.length&&(a=hb.length);for(var f,g=new d(null),h=[],i=0;a>i;++i){for(;f=hb[Math.floor(Math.random()*hb.length)],-1!=h.indexOf(f););h.push(f),g.fromInt(f);var j=g.modPow(e,this);if(0!=j.compareTo(d.ONE)&&0!=j.compareTo(b)){for(var f=1;f++=eb;++eb)gb[db++]=eb;for(db="a".charCodeAt(0),eb=10;36>eb;++eb)gb[db++]=eb;for(db="A".charCodeAt(0),eb=10;36>eb;++eb)gb[db++]=eb;C.prototype.convert=D,C.prototype.revert=E,C.prototype.reduce=F,C.prototype.mulTo=G,C.prototype.sqrTo=H,J.prototype.convert=K,J.prototype.revert=L,J.prototype.reduce=M,J.prototype.mulTo=O,J.prototype.sqrTo=N,_a.copyTo=h,_a.fromInt=i,_a.fromString=k,_a.clamp=l,_a.dlShiftTo=t,_a.drShiftTo=u,_a.lShiftTo=v,_a.rShiftTo=w,_a.subTo=x,_a.multiplyTo=y,_a.squareTo=z,_a.divRemTo=A,_a.invDigit=I,_a.isEven=P,_a.exp=Q,_a.toString=m,_a.negate=n,_a.abs=o,_a.compareTo=p,_a.bitLength=r,_a.byteLength=s,_a.mod=B,_a.modPowInt=R,Ia.prototype.convert=Ja,Ia.prototype.revert=Ja,Ia.prototype.mulTo=Ka,Ia.prototype.sqrTo=La,Pa.prototype.convert=Qa,Pa.prototype.revert=Ra,Pa.prototype.reduce=Sa,Pa.prototype.mulTo=Ua,Pa.prototype.sqrTo=Ta;var hb=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ib=(1<<26)/hb[hb.length-1];_a.chunkSize=W,_a.toRadix=Y,_a.fromRadix=Z,_a.fromNumber=$,_a.bitwiseTo=da,_a.changeBit=ua,_a.addTo=ya,_a.dMultiply=Ga,_a.dAddOffset=Ha,_a.multiplyLowerTo=Na,_a.multiplyUpperTo=Oa,_a.modInt=Xa,_a.millerRabin=$a,_a.clone=S,_a.intValue=T,_a.byteValue=U,_a.shortValue=V,_a.signum=X,_a.toByteArray=_,_a.equals=aa,_a.min=ba,_a.max=ca,_a.and=fa,_a.or=ha,_a.xor=ja,_a.andNot=la,_a.not=ma,_a.shiftLeft=na,_a.shiftRight=oa,_a.getLowestSetBit=qa,_a.bitCount=sa,_a.testBit=ta,_a.setBit=va,_a.clearBit=wa,_a.flipBit=xa,_a.add=za,_a.subtract=Aa,_a.multiply=Ba,_a.divide=Da,_a.remainder=Ea,_a.divideAndRemainder=Fa,_a.modPow=Va,_a.modInverse=Ya,_a.pow=Ma,_a.gcd=Wa,_a.isProbablePrime=Za,_a.square=Ca,d.ZERO=j(0),d.ONE=j(1),d.valueOf=j,b.exports=d},{"../package.json":19}],17:[function(a,b,c){(function(b){var c=a("assert"),d=a("./bigi");d.fromByteArrayUnsigned=function(a){return new d(128&a[0]?[0].concat(a):a)},d.prototype.toByteArrayUnsigned=function(){var a=this.toByteArray();return 0===a[0]?a.slice(1):a},d.fromDERInteger=function(a){return new d(a)},d.prototype.toDERInteger=d.prototype.toByteArray,d.fromBuffer=function(a){if(128&a[0]){var b=Array.prototype.slice.call(a);return new d([0].concat(b))}return new d(a)},d.fromHex=function(a){return""===a?d.ZERO:(c.equal(a,a.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),c.equal(a.length%2,0,"Incomplete hex"),new d(a,16))},d.prototype.toBuffer=function(a){for(var c=this.toByteArrayUnsigned(),d=[],e=a-c.length;d.length=1.2.0 <2.0.0",_npmVersion:"3.8.6",_nodeVersion:"6.1.0",_npmUser:{name:"jprichardson",email:"jprichardson@gmail.com"},dist:{shasum:"9c665a95f88b8b08fc05cfd731f561859d725825",tarball:"https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz"},maintainers:[{name:"midnightlightning",email:"boydb@midnightdesign.ws"},{name:"sidazhang",email:"sidazhang89@gmail.com"},{name:"nadav",email:"npm@shesek.info"},{name:"jprichardson",email:"jprichardson@gmail.com"}],_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bigi-1.4.2.tgz_1469584192413_0.6801238611806184"},directories:{},_resolved:"https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",readme:"ERROR: No README data found!"}},{}],20:[function(a,b,c){(function(a){function b(a){var b,c;return b=a>h||0>a?(c=Math.abs(a)%h,0>a?h-c:c):a}function d(a){for(var b=0;ba;b=++a)128>b?c.push(b<<1):c.push(b<<1^283);return c}(),e=0,i=0,b=j=0;256>j;b=++j)c=i^i<<1^i<<2^i<<3^i<<4,c=c>>>8^255&c^99,this.SBOX[e]=c,this.INV_SBOX[c]=e,f=a[e],g=a[f],h=a[g],d=257*a[c]^16843008*c,this.SUB_MIX[0][e]=d<<24|d>>>8,this.SUB_MIX[1][e]=d<<16|d>>>16,this.SUB_MIX[2][e]=d<<8|d>>>24,this.SUB_MIX[3][e]=d,d=16843009*h^65537*g^257*f^16843008*e,this.INV_SUB_MIX[0][c]=d<<24|d>>>8,this.INV_SUB_MIX[1][c]=d<<16|d>>>16,this.INV_SUB_MIX[2][c]=d<<8|d>>>24,this.INV_SUB_MIX[3][c]=d,0===e?e=i=1:(e=f^a[a[a[h^f]]],i^=a[a[i]]);return!0};var i=new e;g.blockSize=16,g.prototype.blockSize=g.blockSize,g.keySize=32,g.prototype.keySize=g.keySize,g.prototype._doReset=function(){var a,b,c,d,e,f;for(c=this._key,b=c.length,this._nRounds=b+6,e=4*(this._nRounds+1),this._keySchedule=[],d=0;e>d;d++)this._keySchedule[d]=b>d?c[d]:(f=this._keySchedule[d-1],d%b===0?(f=f<<8|f>>>24,f=i.SBOX[f>>>24]<<24|i.SBOX[f>>>16&255]<<16|i.SBOX[f>>>8&255]<<8|i.SBOX[255&f],f^=i.RCON[d/b|0]<<24):b>6&&d%b===4?f=i.SBOX[f>>>24]<<24|i.SBOX[f>>>16&255]<<16|i.SBOX[f>>>8&255]<<8|i.SBOX[255&f]:void 0,this._keySchedule[d-b]^f);for(this._invKeySchedule=[],a=0;e>a;a++)d=e-a,f=this._keySchedule[d-(a%4?0:4)],this._invKeySchedule[a]=4>a||4>=d?f:i.INV_SUB_MIX[0][i.SBOX[f>>>24]]^i.INV_SUB_MIX[1][i.SBOX[f>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[f>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&f]];return!0},g.prototype.encryptBlock=function(b){b=f(new a(b));var c=this._doCryptBlock(b,this._keySchedule,i.SUB_MIX,i.SBOX),d=new a(16);return d.writeUInt32BE(c[0],0),d.writeUInt32BE(c[1],4),d.writeUInt32BE(c[2],8),d.writeUInt32BE(c[3],12),d},g.prototype.decryptBlock=function(b){b=f(new a(b));var c=[b[3],b[1]];b[1]=c[0],b[3]=c[1];var d=this._doCryptBlock(b,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX),e=new a(16);return e.writeUInt32BE(d[0],0),e.writeUInt32BE(d[3],4),e.writeUInt32BE(d[2],8),e.writeUInt32BE(d[1],12),e},g.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},g.prototype._doCryptBlock=function(a,c,d,e){var f,g,h,i,j,k,l,m,n;g=a[0]^c[0],h=a[1]^c[1],i=a[2]^c[2],j=a[3]^c[3],f=4;for(var o=1;o>>24]^d[1][h>>>16&255]^d[2][i>>>8&255]^d[3][255&j]^c[f++],l=d[0][h>>>24]^d[1][i>>>16&255]^d[2][j>>>8&255]^d[3][255&g]^c[f++],m=d[0][i>>>24]^d[1][j>>>16&255]^d[2][g>>>8&255]^d[3][255&h]^c[f++],n=d[0][j>>>24]^d[1][g>>>16&255]^d[2][h>>>8&255]^d[3][255&i]^c[f++],g=k,h=l,i=m,j=n;return k=(e[g>>>24]<<24|e[h>>>16&255]<<16|e[i>>>8&255]<<8|e[255&j])^c[f++],l=(e[h>>>24]<<24|e[i>>>16&255]<<16|e[j>>>8&255]<<8|e[255&g])^c[f++],m=(e[i>>>24]<<24|e[j>>>16&255]<<16|e[g>>>8&255]<<8|e[255&h])^c[f++],n=(e[j>>>24]<<24|e[g>>>16&255]<<16|e[h>>>8&255]<<8|e[255&i])^c[f++],[b(k),b(l),b(m),b(n)]},c.AES=g}).call(this,a("buffer").Buffer)},{buffer:191}],21:[function(a,b,c){(function(c){function d(a,b,e,h){if(!(this instanceof d))return new d(a,b,e);g.call(this),this._finID=c.concat([e,new c([0,0,0,1])]),e=c.concat([e,new c([0,0,0,2])]),this._cipher=new f.AES(b),this._prev=new c(e.length),this._cache=new c(""),this._secCache=new c(""),this._decrypt=h,this._alen=0,this._len=0,e.copy(this._prev),this._mode=a;var j=new c(4);j.fill(0),this._ghash=new i(this._cipher.encryptBlock(j)),this._authTag=null,this._called=!1}function e(a,b){var c=0;a.length!==b.length&&c++;for(var d=Math.min(a.length,b.length),e=-1;++eb&&(b=new c(b),b.fill(0),this._ghash.update(b))}this._called=!0;var d=this._mode.encrypt(this,a);return this._decrypt?this._ghash.update(a):this._ghash.update(d),this._len+=a.length,d},d.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var a=j(this._ghash["final"](8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt){if(e(a,this._authTag))throw new Error("Unsupported state or unable to authenticate data")}else this._authTag=a;this._cipher.scrub()},d.prototype.getAuthTag=function(){if(!this._decrypt&&c.isBuffer(this._authTag))return this._authTag;throw new Error("Attempting to get auth tag in unsupported state")},d.prototype.setAuthTag=function(a){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=a},d.prototype.setAAD=function(a){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(a),this._alen+=a.length}}).call(this,a("buffer").Buffer)},{"./aes":20,"./ghash":25,buffer:191,"buffer-xor":38,"cipher-base":34,inherits:36}],22:[function(a,b,c){function d(){return Object.keys(g)}var e=a("./encrypter");c.createCipher=c.Cipher=e.createCipher,c.createCipheriv=c.Cipheriv=e.createCipheriv; +var f=a("./decrypter");c.createDecipher=c.Decipher=f.createDecipher,c.createDecipheriv=c.Decipheriv=f.createDecipheriv;var g=a("./modes");c.listCiphers=c.getCiphers=d},{"./decrypter":23,"./encrypter":24,"./modes":26}],23:[function(a,b,c){(function(b){function d(a,c,f){return this instanceof d?(j.call(this),this._cache=new e,this._last=void 0,this._cipher=new i.AES(c),this._prev=new b(f.length),f.copy(this._prev),this._mode=a,void(this._autopadding=!0)):new d(a,c,f)}function e(){return this instanceof e?void(this.cache=new b("")):new e}function f(a){for(var b=a[15],c=-1;++c16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},e.prototype.flush=function(){return this.cache.length?this.cache:void 0};var p={ECB:a("./modes/ecb"),CBC:a("./modes/cbc"),CFB:a("./modes/cfb"),CFB8:a("./modes/cfb8"),CFB1:a("./modes/cfb1"),OFB:a("./modes/ofb"),CTR:a("./modes/ctr"),GCM:a("./modes/ctr")};c.createDecipher=h,c.createDecipheriv=g}).call(this,a("buffer").Buffer)},{"./aes":20,"./authCipher":21,"./modes":26,"./modes/cbc":27,"./modes/cfb":28,"./modes/cfb1":29,"./modes/cfb8":30,"./modes/ctr":31,"./modes/ecb":32,"./modes/ofb":33,"./streamCipher":37,buffer:191,"cipher-base":34,evp_bytestokey:35,inherits:36}],24:[function(a,b,c){(function(b){function d(a,c,f){return this instanceof d?(i.call(this),this._cache=new e,this._cipher=new h.AES(c),this._prev=new b(f.length),f.copy(this._prev),this._mode=a,void(this._autopadding=!0)):new d(a,c,f)}function e(){return this instanceof e?void(this.cache=new b("")):new e}function f(a,c,e){var f=k[a.toLowerCase()];if(!f)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=new b(e)),"string"==typeof c&&(c=new b(c)),c.length!==f.key/8)throw new TypeError("invalid key length "+c.length);if(e.length!==f.iv)throw new TypeError("invalid iv length "+e.length);return"stream"===f.type?new m(o[f.mode],c,e):"auth"===f.type?new n(o[f.mode],c,e):new d(o[f.mode],c,e)}function g(a,b){var c=k[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=l(b,!1,c.key,c.iv);return f(a,d.key,d.iv)}var h=a("./aes"),i=a("cipher-base"),j=a("inherits"),k=a("./modes"),l=a("evp_bytestokey"),m=a("./streamCipher"),n=a("./authCipher");j(d,i),d.prototype._update=function(a){this._cache.add(a);for(var c,d,e=[];c=this._cache.get();)d=this._mode.encrypt(this,c),e.push(d);return b.concat(e)},d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return a=this._mode.encrypt(this,a),this._cipher.scrub(),a;if("10101010101010101010101010101010"!==a.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=b.concat([this.cache,a])},e.prototype.get=function(){if(this.cache.length>15){var a=this.cache.slice(0,16);return this.cache=this.cache.slice(16),a}return null},e.prototype.flush=function(){for(var a=16-this.cache.length,c=new b(a),d=-1;++di||0>a?(c=Math.abs(a)%i,0>a?i-c:c):a}function g(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var h=new a(16);h.fill(0),b.exports=c,c.prototype.ghash=function(a){for(var b=-1;++b0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=e(h)},c.prototype.update=function(b){this.cache=a.concat([this.cache,b]);for(var c;this.cache.length>=16;)c=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(c)},c.prototype["final"]=function(b,c){return this.cache.length&&this.ghash(a.concat([this.cache,h],16)),this.ghash(e([0,b,0,c])),this.state};var i=Math.pow(2,32)}).call(this,a("buffer").Buffer)},{buffer:191}],26:[function(a,b,c){c["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},c["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},c["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},c["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},c["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},c["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},c.aes128=c["aes-128-cbc"],c.aes192=c["aes-192-cbc"],c.aes256=c["aes-256-cbc"],c["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},c["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},c["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},c["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},c["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},c["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},c["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},c["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},c["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},c["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},c["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},c["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},c["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},c["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},c["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},c["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},c["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},c["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},{}],27:[function(a,b,c){var d=a("buffer-xor");c.encrypt=function(a,b){var c=d(b,a._prev);return a._prev=a._cipher.encryptBlock(c),a._prev},c.decrypt=function(a,b){var c=a._prev;a._prev=b;var e=a._cipher.decryptBlock(b);return d(e,c)}},{"buffer-xor":38}],28:[function(a,b,c){(function(b){function d(a,c,d){var f=c.length,g=e(c,a._cache);return a._cache=a._cache.slice(f),a._prev=b.concat([a._prev,d?c:g]),g}var e=a("buffer-xor");c.encrypt=function(a,c,e){for(var f,g=new b("");c.length;){if(0===a._cache.length&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=new b("")),!(a._cache.length<=c.length)){g=b.concat([g,d(a,c,e)]);break}f=a._cache.length,g=b.concat([g,d(a,c.slice(0,f),e)]),c=c.slice(f)}return g}}).call(this,a("buffer").Buffer)},{buffer:191,"buffer-xor":38}],29:[function(a,b,c){(function(a){function b(a,b,c){for(var e,f,g,h=-1,i=8,j=0;++h>h%8,a._prev=d(a._prev,c?f:g);return j}function d(b,c){var d=b.length,e=-1,f=new a(b.length);for(b=a.concat([b,new a([c])]);++e>7;return f}c.encrypt=function(c,d,e){for(var f=d.length,g=new a(f),h=-1;++h0&&n.push(g),n.push(a),b&&n.push(b),g=e(c.concat(n)),n=[],h=0,d>0)for(;;){if(0===d)break;if(h===g.length)break;k[i++]=g[h],d--,h++}if(f>0&&h!==g.length)for(;;){if(0===f)break;if(h===g.length)break;l[j++]=g[h],f--,h++}if(0===d&&0===f)break}for(h=0;hf;++f)e[f]=b[f]^c[f];return e}}).call(this,a("buffer").Buffer)},{buffer:191}],39:[function(a,b,c){(function(c){function d(a,b){(Array.isArray(a)||a instanceof Uint8Array)&&(a=new c(a));var d;null!=b?("number"==typeof b&&(b=new c([b])),d=c.concat([b,a])):d=a;var e=j(d).slice(0,4),f=c.concat([d,e]);return k.encode(f)}function e(a,b){var d,e=k.decode(a),f=new c(e);if(null==b)d=0;else{"number"==typeof b&&(b=new c([b])),d=b.length;var g=f.slice(0,d);if(g.toString("hex")!==b.toString("hex"))throw new Error("Invalid version")}var h=f.slice(-4),i=f.length-4,l=f.slice(0,i),m=j(l).slice(0,4);if(h.toString("hex")!==m.toString("hex"))throw new Error("Invalid checksum");return l.slice(d)}function f(a,b){try{e(a,b)}catch(c){return!1}return!0}function g(a){return function(b){return d(b,a)}}function h(a){return function(b){return e(b,a)}}function i(a){return function(b){return f(b,a)}}function j(a){var b=l("sha256").update(a).digest();return l("sha256").update(b).digest()}var k=a("bs58"),l=a("create-hash");b.exports={encode:d,decode:e,isValid:f,createEncoder:g,createDecoder:h,createValidator:i}}).call(this,a("buffer").Buffer)},{bs58:40,buffer:191,"create-hash":41}],40:[function(a,b,c){function d(a){if(0===a.length)return"";var b,c,d=[0];for(b=0;b=0;b--)g+=f[d[b]];return g}function e(a){if(0===a.length)return[];var b,c,d=[0];for(b=0;b>8,d[c]&=255;for(;f;)d.push(255&f),f>>=8}for(b=0;"1"===a[b]&&b>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,k=271733878,l=0;l>16)+(b>>16)+(c>>16);return d<<16|65535&c}function k(a,b){return a<>>32-b}var l=a("./helpers");b.exports=function(a){return l.hash(a,d,16)}},{"./helpers":42}],44:[function(a,b,c){arguments[4][34][0].apply(c,arguments)},{buffer:191,dup:34,inherits:45,stream:413,string_decoder:420}],45:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],46:[function(a,b,c){(function(a){function c(a){for(var b=[],c=0,d=0;c>>5]|=a[c]<<24-d%32;return b}function d(a){for(var b=[],c=0;c<32*a.length;c+=8)b.push(a[c>>>5]>>>24-c%32&255);return b}function e(a,b,c){for(var d=0;16>d;d++){var e=c+d,l=b[e];b[e]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}var s,t,u,v,w,x,y,z,A,B;x=s=a[0],y=t=a[1],z=u=a[2],A=v=a[3],B=w=a[4];var C;for(d=0;80>d;d+=1)C=s+b[c+m[d]]|0,C+=16>d?f(t,u,v)+q[0]:32>d?g(t,u,v)+q[1]:48>d?h(t,u,v)+q[2]:64>d?i(t,u,v)+q[3]:j(t,u,v)+q[4],C=0|C,C=k(C,o[d]),C=C+w|0,s=w,w=v,v=k(u,10),u=t,t=C,C=x+b[c+n[d]]|0,C+=16>d?j(y,z,A)+r[0]:32>d?i(y,z,A)+r[1]:48>d?h(y,z,A)+r[2]:64>d?g(y,z,A)+r[3]:f(y,z,A)+r[4],C=0|C,C=k(C,p[d]),C=C+B|0,x=B,B=A,A=k(z,10),z=y,y=C;C=a[1]+u+A|0,a[1]=a[2]+v+B|0,a[2]=a[3]+w+x|0,a[3]=a[4]+s+y|0,a[4]=a[0]+t+z|0,a[0]=C}function f(a,b,c){return a^b^c}function g(a,b,c){return a&b|~a&c}function h(a,b,c){return(a|~b)^c}function i(a,b,c){return a&c|b&~c}function j(a,b,c){return a^(b|~c)}function k(a,b){return a<>>32-b}function l(b){var f=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof b&&(b=new a(b,"utf8"));var g=c(b),h=8*b.length,i=8*b.length;g[h>>>5]|=128<<24-h%32,g[(h+64>>>9<<4)+14]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);for(var j=0;jj;j++){var k=f[j];f[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l=d(f);return new a(l)}var m=[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],n=[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],o=[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],p=[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],q=[0,1518500249,1859775393,2400959708,2840853838],r=[1352829926,1548603684,1836072691,2053994217,0];b.exports=l}).call(this,a("buffer").Buffer)},{buffer:191}],47:[function(a,b,c){(function(a){function c(b,c){this._block=new a(b),this._finalSize=c,this._blockSize=b,this._len=0,this._s=0}c.prototype.update=function(b,c){"string"==typeof b&&(c=c||"utf8",b=new a(b,c));for(var d=this._len+=b.length,e=this._s||0,f=0,g=this._block;d>e;){for(var h=Math.min(b.length,f+this._blockSize-e%this._blockSize),i=h-f,j=0;i>j;j++)g[e%this._blockSize+j]=b[j+f];e+=i,f+=i,e%this._blockSize===0&&this._update(g)}return this._s=e,this},c.prototype.digest=function(a){var b=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),b%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(b,this._blockSize-4);var c=this._update(this._block)||this._hash();return a?c.toString(a):c},c.prototype._update=function(){throw new Error("_update must be implemented by subclass")},b.exports=c}).call(this,a("buffer").Buffer)},{buffer:191}],48:[function(a,b,c){var c=b.exports=function(a){a=a.toLowerCase();var b=c[a];if(!b)throw new Error(a+" is not supported (we accept pull requests)");return new b};c.sha=a("./sha"),c.sha1=a("./sha1"),c.sha224=a("./sha224"),c.sha256=a("./sha256"),c.sha384=a("./sha384"),c.sha512=a("./sha512")},{"./sha":49,"./sha1":50,"./sha224":51,"./sha256":52,"./sha384":53,"./sha512":54}],49:[function(a,b,c){(function(c){function d(){this.init(),this._w=k,i.call(this,64,56)}function e(a){return a<<5|a>>>27}function f(a){return a<<30|a>>>2}function g(a,b,c,d){return 0===a?b&c|~b&d:2===a?b&c|b&d|c&d:b^c^d}var h=a("inherits"),i=a("./hash"),j=[1518500249,1859775393,-1894007588,-899497514],k=new Array(80);h(d,i),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(a){for(var b=this._w,c=0|this._a,d=0|this._b,h=0|this._c,i=0|this._d,k=0|this._e,l=0;16>l;++l)b[l]=a.readInt32BE(4*l);for(;80>l;++l)b[l]=b[l-3]^b[l-8]^b[l-14]^b[l-16];for(var m=0;80>m;++m){var n=~~(m/20),o=e(c)+g(n,d,h,i)+k+b[m]+j[n]|0;k=i,i=h,h=f(d),d=c,c=o}this._a=c+this._a|0,this._b=d+this._b|0,this._c=h+this._c|0,this._d=i+this._d|0,this._e=k+this._e|0},d.prototype._hash=function(){var a=new c(20);return a.writeInt32BE(0|this._a,0),a.writeInt32BE(0|this._b,4),a.writeInt32BE(0|this._c,8),a.writeInt32BE(0|this._d,12),a.writeInt32BE(0|this._e,16),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],50:[function(a,b,c){(function(c){function d(){this.init(),this._w=l,j.call(this,64,56)}function e(a){return a<<1|a>>>31}function f(a){return a<<5|a>>>27}function g(a){return a<<30|a>>>2}function h(a,b,c,d){return 0===a?b&c|~b&d:2===a?b&c|b&d|c&d:b^c^d}var i=a("inherits"),j=a("./hash"),k=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);i(d,j),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(a){for(var b=this._w,c=0|this._a,d=0|this._b,i=0|this._c,j=0|this._d,l=0|this._e,m=0;16>m;++m)b[m]=a.readInt32BE(4*m);for(;80>m;++m)b[m]=e(b[m-3]^b[m-8]^b[m-14]^b[m-16]);for(var n=0;80>n;++n){var o=~~(n/20),p=f(c)+h(o,d,i,j)+l+b[n]+k[o]|0;l=j,j=i,i=g(d),d=c,c=p}this._a=c+this._a|0,this._b=d+this._b|0,this._c=i+this._c|0,this._d=j+this._d|0,this._e=l+this._e|0},d.prototype._hash=function(){var a=new c(20);return a.writeInt32BE(0|this._a,0),a.writeInt32BE(0|this._b,4),a.writeInt32BE(0|this._c,8),a.writeInt32BE(0|this._d,12),a.writeInt32BE(0|this._e,16),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],51:[function(a,b,c){(function(c){function d(){this.init(),this._w=h,g.call(this,64,56)}var e=a("inherits"),f=a("./sha256"),g=a("./hash"),h=new Array(64);e(d,f),d.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},d.prototype._hash=function(){var a=new c(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,"./sha256":52,buffer:191,inherits:45}],52:[function(a,b,c){(function(c){function d(){this.init(),this._w=n,l.call(this,64,56)}function e(a,b,c){return c^a&(b^c)}function f(a,b,c){return a&b|c&(a|b)}function g(a){return(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10)}function h(a){return(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7)}function i(a){return(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3}function j(a){return(a>>>17|a<<15)^(a>>>19|a<<13)^a>>>10}var k=a("inherits"),l=a("./hash"),m=[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],n=new Array(64);k(d,l),d.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},d.prototype._update=function(a){for(var b=this._w,c=0|this._a,d=0|this._b,k=0|this._c,l=0|this._d,n=0|this._e,o=0|this._f,p=0|this._g,q=0|this._h,r=0;16>r;++r)b[r]=a.readInt32BE(4*r);for(;64>r;++r)b[r]=j(b[r-2])+b[r-7]+i(b[r-15])+b[r-16]|0;for(var s=0;64>s;++s){var t=q+h(n)+e(n,o,p)+m[s]+b[s]|0,u=g(c)+f(c,d,k)|0;q=p,p=o,o=n,n=l+t|0,l=k,k=d,d=c,c=t+u|0}this._a=c+this._a|0,this._b=d+this._b|0,this._c=k+this._c|0,this._d=l+this._d|0,this._e=n+this._e|0,this._f=o+this._f|0,this._g=p+this._g|0,this._h=q+this._h|0},d.prototype._hash=function(){var a=new c(32);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a.writeInt32BE(this._h,28),a},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],53:[function(a,b,c){(function(c){function d(){this.init(),this._w=h,g.call(this,128,112)}var e=a("inherits"),f=a("./sha512"),g=a("./hash"),h=new Array(160);e(d,f),d.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},d.prototype._hash=function(){function a(a,c,d){b.writeInt32BE(a,d),b.writeInt32BE(c,d+4)}var b=new c(48);return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),b},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,"./sha512":54,buffer:191,inherits:45}],54:[function(a,b,c){(function(c){function d(){this.init(),this._w=q,o.call(this,128,112)}function e(a,b,c){return c^a&(b^c)}function f(a,b,c){return a&b|c&(a|b)}function g(a,b){return(a>>>28|b<<4)^(b>>>2|a<<30)^(b>>>7|a<<25)}function h(a,b){return(a>>>14|b<<18)^(a>>>18|b<<14)^(b>>>9|a<<23)}function i(a,b){return(a>>>1|b<<31)^(a>>>8|b<<24)^a>>>7}function j(a,b){return(a>>>1|b<<31)^(a>>>8|b<<24)^(a>>>7|b<<25)}function k(a,b){return(a>>>19|b<<13)^(b>>>29|a<<3)^a>>>6}function l(a,b){return(a>>>19|b<<13)^(b>>>29|a<<3)^(a>>>6|b<<26)}function m(a,b){return b>>>0>a>>>0?1:0}var n=a("inherits"),o=a("./hash"),p=[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],q=new Array(160); +n(d,o),d.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},d.prototype._update=function(a){for(var b=this._w,c=0|this._ah,d=0|this._bh,n=0|this._ch,o=0|this._dh,q=0|this._eh,r=0|this._fh,s=0|this._gh,t=0|this._hh,u=0|this._al,v=0|this._bl,w=0|this._cl,x=0|this._dl,y=0|this._el,z=0|this._fl,A=0|this._gl,B=0|this._hl,C=0;32>C;C+=2)b[C]=a.readInt32BE(4*C),b[C+1]=a.readInt32BE(4*C+4);for(;160>C;C+=2){var D=b[C-30],E=b[C-30+1],F=i(D,E),G=j(E,D);D=b[C-4],E=b[C-4+1];var H=k(D,E),I=l(E,D),J=b[C-14],K=b[C-14+1],L=b[C-32],M=b[C-32+1],N=G+K|0,O=F+J+m(N,G)|0;N=N+I|0,O=O+H+m(N,I)|0,N=N+M|0,O=O+L+m(N,M)|0,b[C]=O,b[C+1]=N}for(var P=0;160>P;P+=2){O=b[P],N=b[P+1];var Q=f(c,d,n),R=f(u,v,w),S=g(c,u),T=g(u,c),U=h(q,y),V=h(y,q),W=p[P],X=p[P+1],Y=e(q,r,s),Z=e(y,z,A),$=B+V|0,_=t+U+m($,B)|0;$=$+Z|0,_=_+Y+m($,Z)|0,$=$+X|0,_=_+W+m($,X)|0,$=$+N|0,_=_+O+m($,N)|0;var aa=T+R|0,ba=S+Q+m(aa,T)|0;t=s,B=A,s=r,A=z,r=q,z=y,y=x+$|0,q=o+_+m(y,x)|0,o=n,x=w,n=d,w=v,d=c,v=u,u=$+aa|0,c=_+ba+m(u,$)|0}this._al=this._al+u|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+x|0,this._el=this._el+y|0,this._fl=this._fl+z|0,this._gl=this._gl+A|0,this._hl=this._hl+B|0,this._ah=this._ah+c+m(this._al,u)|0,this._bh=this._bh+d+m(this._bl,v)|0,this._ch=this._ch+n+m(this._cl,w)|0,this._dh=this._dh+o+m(this._dl,x)|0,this._eh=this._eh+q+m(this._el,y)|0,this._fh=this._fh+r+m(this._fl,z)|0,this._gh=this._gh+s+m(this._gl,A)|0,this._hh=this._hh+t+m(this._hl,B)|0},d.prototype._hash=function(){function a(a,c,d){b.writeInt32BE(a,d),b.writeInt32BE(c,d+4)}var b=new c(64);return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),b},b.exports=d}).call(this,a("buffer").Buffer)},{"./hash":47,buffer:191,inherits:45}],55:[function(a,b,c){function d(a,b,c,d,e,h,i){this.p=a,this.a=b,this.b=c,this.G=g.fromAffine(this,d,e),this.n=h,this.h=i,this.infinity=new g(this,null,null,f.ZERO),this.pOverFour=a.add(f.ONE).shiftRight(2)}var e=a("assert"),f=a("bigi"),g=a("./point");d.prototype.pointFromX=function(a,b){var c=b.pow(3).add(this.a.multiply(b)).add(this.b).mod(this.p),d=c.modPow(this.pOverFour,this.p),e=d;return d.isEven()^!a&&(e=this.p.subtract(e)),g.fromAffine(this,b,e)},d.prototype.isInfinity=function(a){return a===this.infinity?!0:0===a.z.signum()&&0!==a.y.signum()},d.prototype.isOnCurve=function(a){if(this.isInfinity(a))return!0;var b=a.affineX,c=a.affineY,d=this.a,e=this.b,f=this.p;if(b.signum()<0||b.compareTo(f)>=0)return!1;if(c.signum()<0||c.compareTo(f)>=0)return!1;var g=c.square().mod(f),h=b.pow(3).add(d.multiply(b)).add(e).mod(f);return g.equals(h)},d.prototype.validate=function(a){e(!this.isInfinity(a),"Point is at infinity"),e(this.isOnCurve(a),"Point is not on the curve");var b=a.multiply(this.n);return e(this.isInfinity(b),"Point is not a scalar multiple of G"),!0},b.exports=d},{"./point":59,assert:176,bigi:18}],56:[function(a,b,c){b.exports={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}},{}],57:[function(a,b,c){var d=a("./point"),e=a("./curve"),f=a("./names");b.exports={Curve:e,Point:d,getCurveByName:f}},{"./curve":55,"./names":58,"./point":59}],58:[function(a,b,c){function d(a){var b=f[a];if(!b)return null;var c=new e(b.p,16),d=new e(b.a,16),h=new e(b.b,16),i=new e(b.n,16),j=new e(b.h,16),k=new e(b.Gx,16),l=new e(b.Gy,16);return new g(c,d,h,k,l,i,j)}var e=a("bigi"),f=a("./curves.json"),g=a("./curve");b.exports=d},{"./curve":55,"./curves.json":56,bigi:18}],59:[function(a,b,c){(function(c){function d(a,b,c,d){e.notStrictEqual(d,void 0,"Missing Z coordinate"),this.curve=a,this.x=b,this.y=c,this.z=d,this._zInv=null,this.compressed=!0}var e=a("assert"),f=a("bigi"),g=f.valueOf(3);Object.defineProperty(d.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(d.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(d.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),d.fromAffine=function(a,b,c){return new d(a,b,c,f.ONE)},d.prototype.equals=function(a){if(a===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(a);if(this.curve.isInfinity(a))return this.curve.isInfinity(this);var b=a.y.multiply(this.z).subtract(this.y.multiply(a.z)).mod(this.curve.p);if(0!==b.signum())return!1;var c=a.x.multiply(this.z).subtract(this.x.multiply(a.z)).mod(this.curve.p);return 0===c.signum()},d.prototype.negate=function(){var a=this.curve.p.subtract(this.y);return new d(this.curve,this.x,a,this.z)},d.prototype.add=function(a){if(this.curve.isInfinity(this))return a;if(this.curve.isInfinity(a))return this;var b=this.x,c=this.y,e=a.x,f=a.y,h=f.multiply(this.z).subtract(c.multiply(a.z)).mod(this.curve.p),i=e.multiply(this.z).subtract(b.multiply(a.z)).mod(this.curve.p);if(0===i.signum())return 0===h.signum()?this.twice():this.curve.infinity;var j=i.square(),k=j.multiply(i),l=b.multiply(j),m=h.square().multiply(this.z),n=m.subtract(l.shiftLeft(1)).multiply(a.z).subtract(k).multiply(i).mod(this.curve.p),o=l.multiply(g).multiply(h).subtract(c.multiply(k)).subtract(m.multiply(h)).multiply(a.z).add(h.multiply(k)).mod(this.curve.p),p=k.multiply(this.z).multiply(a.z).mod(this.curve.p);return new d(this.curve,n,o,p)},d.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var a=this.x,b=this.y,c=b.multiply(this.z),e=c.multiply(b).mod(this.curve.p),f=this.curve.a,h=a.square().multiply(g);0!==f.signum()&&(h=h.add(this.z.square().multiply(f))),h=h.mod(this.curve.p);var i=h.square().subtract(a.shiftLeft(3).multiply(e)).shiftLeft(1).multiply(c).mod(this.curve.p),j=h.multiply(g).multiply(a).subtract(e.shiftLeft(1)).shiftLeft(2).multiply(e).subtract(h.pow(3)).mod(this.curve.p),k=c.pow(3).shiftLeft(3).mod(this.curve.p);return new d(this.curve,i,j,k)},d.prototype.multiply=function(a){if(this.curve.isInfinity(this))return this;if(0===a.signum())return this.curve.infinity;for(var b=a,c=b.multiply(g),d=this.negate(),e=this,f=c.bitLength()-2;f>0;--f){var h=c.testBit(f),i=b.testBit(f);e=e.twice(),h!==i&&(e=e.add(h?this:d))}return e},d.prototype.multiplyTwo=function(a,b,c){for(var d=Math.max(a.bitLength(),c.bitLength())-1,e=this.curve.infinity,f=this.add(b);d>=0;){var g=a.testBit(d),h=c.testBit(d);e=e.twice(),g?e=h?e.add(f):e.add(this):h&&(e=e.add(b)),--d}return e},d.prototype.getEncoded=function(a){if(null==a&&(a=this.compressed),this.curve.isInfinity(this))return new c("00","hex");var b,d=this.affineX,e=this.affineY,f=Math.floor((this.curve.p.bitLength()+7)/8);return a?(b=new c(1+f),b.writeUInt8(e.isEven()?2:3,0)):(b=new c(1+f+f),b.writeUInt8(4,0),e.toBuffer(f).copy(b,1+f)),d.toBuffer(f).copy(b,1),b},d.decodeFrom=function(a,b){var c,g=b.readUInt8(0),h=4!==g,i=Math.floor((a.p.bitLength()+7)/8),j=f.fromBuffer(b.slice(1,1+i));if(h){e.equal(b.length,i+1,"Invalid sequence length"),e(2===g||3===g,"Invalid sequence tag");var k=3===g;c=a.pointFromX(k,j)}else{e.equal(b.length,1+i+i,"Invalid sequence length");var l=f.fromBuffer(b.slice(1+i));c=d.fromAffine(a,j,l)}return c.compressed=h,c},d.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},b.exports=d}).call(this,a("buffer").Buffer)},{assert:176,bigi:18,buffer:191}],60:[function(a,b,c){(function(c){function d(a,b,d,h,i,j,k){function l(a,b,c,d,e,f){var g,h=0,i=128*c;for(a.copy(f,h,b,b+i),g=0;d>g;g++)f.copy(e,g*i,h,h+i),m(f,h,i,c),q&&q();for(g=0;d>g;g++){var j=h+64*(2*c-1),k=f.readUInt32LE(j)&d-1;p(e,k*i,f,h,i),m(f,h,i,c),q&&q()}f.copy(a,b,h,h+i)}function m(a,b,c,d){var f;for(e(a,b+64*(2*d-1),v,0,64),f=0;2*d>f;f++)p(a,64*f,v,0,64),o(v),e(v,0,a,c+64*f,64);for(f=0;d>f;f++)e(a,c+2*f*64,a,b+64*f,64);for(f=0;d>f;f++)e(a,c+64*(2*f+1),a,b+64*(f+d),64)}function n(a,b){return a<>>32-b}function o(a){var b;for(b=0;16>b;b++)t[b]=(255&a[4*b+0])<<0,t[b]|=(255&a[4*b+1])<<8,t[b]|=(255&a[4*b+2])<<16,t[b]|=(255&a[4*b+3])<<24;for(e(t,0,u,0,16),b=8;b>0;b-=2)u[4]^=n(u[0]+u[12],7),u[8]^=n(u[4]+u[0],9),u[12]^=n(u[8]+u[4],13),u[0]^=n(u[12]+u[8],18),u[9]^=n(u[5]+u[1],7),u[13]^=n(u[9]+u[5],9),u[1]^=n(u[13]+u[9],13),u[5]^=n(u[1]+u[13],18),u[14]^=n(u[10]+u[6],7),u[2]^=n(u[14]+u[10],9),u[6]^=n(u[2]+u[14],13),u[10]^=n(u[6]+u[2],18),u[3]^=n(u[15]+u[11],7),u[7]^=n(u[3]+u[15],9),u[11]^=n(u[7]+u[3],13),u[15]^=n(u[11]+u[7],18),u[1]^=n(u[0]+u[3],7),u[2]^=n(u[1]+u[0],9),u[3]^=n(u[2]+u[1],13),u[0]^=n(u[3]+u[2],18),u[6]^=n(u[5]+u[4],7),u[7]^=n(u[6]+u[5],9),u[4]^=n(u[7]+u[6],13),u[5]^=n(u[4]+u[7],18),u[11]^=n(u[10]+u[9],7),u[8]^=n(u[11]+u[10],9),u[9]^=n(u[8]+u[11],13),u[10]^=n(u[9]+u[8],18),u[12]^=n(u[15]+u[14],7),u[13]^=n(u[12]+u[15],9),u[14]^=n(u[13]+u[12],13),u[15]^=n(u[14]+u[13],18);for(b=0;16>b;++b)t[b]=u[b]+t[b];for(b=0;16>b;b++){var c=4*b;a[c+0]=t[b]>>0&255,a[c+1]=t[b]>>8&255,a[c+2]=t[b]>>16&255,a[c+3]=t[b]>>24&255}}function p(a,b,c,d,e){for(var f=0;e>f;f++)c[d+f]^=a[b+f]}if(0===d||0!==(d&d-1))throw Error("N must be > 0 and a power of 2");if(d>g/128/h)throw Error("Parameter N is too large");if(h>g/128/i)throw Error("Parameter r is too large");var q,r=new c(256*h),s=new c(128*h*d),t=new Int32Array(16),u=new Int32Array(16),v=new c(64),w=f(a,b,1,128*i*h,"sha256");if(k){var x=i*d*2,y=0;q=function(){++y,y%1e3===0&&k({current:y,total:x,percent:y/x*100})}}for(var z=0;i>z;z++)l(w,128*z*h,h,d,s,r);return f(a,w,1,j,"sha256")}function e(a,b,d,e,f){if(c.isBuffer(a)&&c.isBuffer(d))a.copy(d,e,b,b+f);else for(;f--;)d[e++]=a[b++]}var f=a("pbkdf2").pbkdf2Sync,g=2147483647;b.exports=d}).call(this,a("buffer").Buffer)},{buffer:191,pbkdf2:61}],61:[function(a,b,c){(function(b){function d(a,b,c,d,f,g){if("function"==typeof f&&(g=f,f=void 0),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");var h=e(a,b,c,d,f);setTimeout(function(){g(void 0,h)})}function e(a,c,d,e,h){if("number"!=typeof d)throw new TypeError("Iterations not a number");if(0>d)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(0>e||e>g)throw new TypeError("Bad key length");h=h||"sha1",b.isBuffer(a)||(a=new b(a,"binary")),b.isBuffer(c)||(c=new b(c,"binary"));var i,j=1,k=new b(e),l=new b(c.length+4);c.copy(l,0,0,c.length);for(var m,n,o=1;j>=o;o++){l.writeUInt32BE(o,c.length);var p=f(h,a).update(l).digest();i||(i=p.length,n=new b(i),j=Math.ceil(e/i),m=e-(j-1)*i),p.copy(n,0,0,i);for(var q=1;d>q;q++){p=f(h,a).update(p).digest();for(var r=0;i>r;r++)n[r]^=p[r]}var s=(o-1)*i,t=o===j?m:i;n.copy(k,s,0,t)}return k}var f=a("create-hmac"),g=Math.pow(2,30)-1;c.pbkdf2=d,c.pbkdf2Sync=e}).call(this,a("buffer").Buffer)},{buffer:191,"create-hmac":62}],62:[function(a,b,c){(function(c){"use strict";function d(a,b){g.call(this),a=a.toLowerCase(),"string"==typeof b&&(b=new c(b));var d="sha512"===a||"sha384"===a?128:64;this._alg=a,this._key=b,b.length>d?b=e(a).update(b).digest():b.lengthj;j++)f[j]=54^b[j],i[j]=92^b[j];this._hash=e(a).update(f)}var e=a("create-hash/browser"),f=a("inherits"),g=a("stream").Transform,h=new c(128);h.fill(0),f(d,g),d.prototype.update=function(a,b){return this._hash.update(a,b),this},d.prototype._transform=function(a,b,c){this._hash.update(a),c()},d.prototype._flush=function(a){this.push(this.digest()),a()},d.prototype.digest=function(a){var b=this._hash.digest();return e(this._alg).update(this._opad).update(b).digest(a)},b.exports=function(a,b){return new d(a,b)}}).call(this,a("buffer").Buffer)},{buffer:191,"create-hash/browser":41,inherits:63,stream:413}],63:[function(a,b,c){arguments[4][36][0].apply(c,arguments)},{dup:36}],64:[function(a,b,c){(function(c,d){"use strict";var e=b.exports;e.version="v"+a("./package.json").version,e.versionGuard=function(a){if(void 0!==a){var b="More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.";throw new Error(b)}},e.versionGuard(c._bitcore),c._bitcore=e.version,e.crypto={},e.crypto.BN=a("./lib/crypto/bn"),e.crypto.ECDSA=a("./lib/crypto/ecdsa"),e.crypto.Hash=a("./lib/crypto/hash"),e.crypto.Random=a("./lib/crypto/random"),e.crypto.Point=a("./lib/crypto/point"),e.crypto.Signature=a("./lib/crypto/signature"),e.encoding={},e.encoding.Base58=a("./lib/encoding/base58"),e.encoding.Base58Check=a("./lib/encoding/base58check"),e.encoding.BufferReader=a("./lib/encoding/bufferreader"),e.encoding.BufferWriter=a("./lib/encoding/bufferwriter"),e.encoding.Varint=a("./lib/encoding/varint"),e.util={},e.util.buffer=a("./lib/util/buffer"),e.util.js=a("./lib/util/js"),e.util.preconditions=a("./lib/util/preconditions"),e.errors=a("./lib/errors"),e.Address=a("./lib/address"),e.Block=a("./lib/block"),e.MerkleBlock=a("./lib/block/merkleblock"),e.BlockHeader=a("./lib/block/blockheader"),e.HDPrivateKey=a("./lib/hdprivatekey.js"),e.HDPublicKey=a("./lib/hdpublickey.js"),e.Networks=a("./lib/networks"),e.Opcode=a("./lib/opcode"),e.PrivateKey=a("./lib/privatekey"),e.PublicKey=a("./lib/publickey"),e.Script=a("./lib/script"),e.Transaction=a("./lib/transaction"),e.URI=a("./lib/uri"),e.Unit=a("./lib/unit"),e.deps={},e.deps.bnjs=a("bn.js"),e.deps.bs58=a("bs58"),e.deps.Buffer=d,e.deps.elliptic=a("elliptic"),e.deps._=a("lodash"),e._HDKeyCache=a("./lib/hdkeycache"),e.Transaction.sighash=a("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"./lib/address":65,"./lib/block":68,"./lib/block/blockheader":67,"./lib/block/merkleblock":69,"./lib/crypto/bn":70,"./lib/crypto/ecdsa":71,"./lib/crypto/hash":72,"./lib/crypto/point":73,"./lib/crypto/random":74,"./lib/crypto/signature":75,"./lib/encoding/base58":76,"./lib/encoding/base58check":77,"./lib/encoding/bufferreader":78,"./lib/encoding/bufferwriter":79,"./lib/encoding/varint":80,"./lib/errors":81,"./lib/hdkeycache":83,"./lib/hdprivatekey.js":84,"./lib/hdpublickey.js":85,"./lib/networks":86,"./lib/opcode":87,"./lib/privatekey":88,"./lib/publickey":89,"./lib/script":90,"./lib/transaction":93,"./lib/transaction/sighash":101,"./lib/unit":105,"./lib/uri":106,"./lib/util/buffer":107,"./lib/util/js":108,"./lib/util/preconditions":109,"./package.json":135,"bn.js":110,bs58:111,buffer:191,elliptic:113,lodash:432}],65:[function(a,b,c){(function(c){"use strict";function d(a,b,c){if(!(this instanceof d))return new d(a,b,c);if(e.isArray(a)&&e.isNumber(b))return d.createMultisig(a,b,c);if(a instanceof d)return a;if(f.checkArgument(a,"First argument is required, please include address data.","guide/address.html"),b&&!i.get(b))throw new TypeError('Second argument must be "livenet" or "testnet".');if(c&&c!==d.PayToPublicKeyHash&&c!==d.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var g=this._classifyArguments(a,b,c);return g.network=g.network||i.get(b)||i.defaultNetwork,g.type=g.type||c||d.PayToPublicKeyHash,k.defineImmutable(this,{hashBuffer:g.hashBuffer,network:g.network,type:g.type}),this}var e=a("lodash"),f=a("./util/preconditions"),g=a("./errors"),h=a("./encoding/base58check"),i=a("./networks"),j=a("./crypto/hash"),k=a("./util/js"),l=a("./publickey");d.prototype._classifyArguments=function(a,b,f){if((a instanceof c||a instanceof Uint8Array)&&20===a.length)return d._transformHash(a);if((a instanceof c||a instanceof Uint8Array)&&21===a.length)return d._transformBuffer(a,b,f);if(a instanceof l)return d._transformPublicKey(a);if(a instanceof m)return d._transformScript(a,b);if("string"==typeof a)return d._transformString(a,b,f);if(e.isObject(a))return d._transformObject(a);throw new TypeError("First argument is an unrecognized data format.")},d.PayToPublicKeyHash="pubkeyhash",d.PayToScriptHash="scripthash",d._transformHash=function(a){var b={};if(!(a instanceof c||a instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==a.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return b.hashBuffer=a,b},d._transformObject=function(a){return f.checkArgument(a.hash||a.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),f.checkArgument(a.type,"Must provide a `type` property"),{hashBuffer:a.hash?new c(a.hash,"hex"):a.hashBuffer,network:i.get(a.network)||i.defaultNetwork,type:a.type}},d._classifyFromVersion=function(a){var b={},c=i.get(a[0],"pubkeyhash"),e=i.get(a[0],"scripthash");return c?(b.network=c,b.type=d.PayToPublicKeyHash):e&&(b.network=e,b.type=d.PayToScriptHash),b},d._transformBuffer=function(a,b,e){var f={};if(!(a instanceof c||a instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==a.length)throw new TypeError("Address buffers must be exactly 21 bytes.");b=i.get(b);var g=d._classifyFromVersion(a);if(!g.network||b&&b!==g.network)throw new TypeError("Address has mismatched network type.");if(!g.type||e&&e!==g.type)throw new TypeError("Address has mismatched type.");return f.hashBuffer=a.slice(1),f.network=g.network,f.type=g.type,f},d._transformPublicKey=function(a){var b={};if(!(a instanceof l))throw new TypeError("Address must be an instance of PublicKey.");return b.hashBuffer=j.sha256ripemd160(a.toBuffer()),b.type=d.PayToPublicKeyHash,b},d._transformScript=function(a,b){f.checkArgument(a instanceof m,"script must be a Script instance");var c=a.getAddressInfo(b);if(!c)throw new g.Script.CantDeriveAddress(a);return c},d.createMultisig=function(a,b,c){return c=c||a[0].network||i.defaultNetwork,d.payingTo(m.buildMultisigOut(a,b),c)},d._transformString=function(a,b,c){if("string"!=typeof a)throw new TypeError("data parameter supplied is not a string.");a=a.trim();var e=h.decode(a),f=d._transformBuffer(e,b,c);return f},d.fromPublicKey=function(a,b){var c=d._transformPublicKey(a);return b=b||i.defaultNetwork,new d(c.hashBuffer,b,c.type)},d.fromPublicKeyHash=function(a,b){var c=d._transformHash(a);return new d(c.hashBuffer,b,d.PayToPublicKeyHash)},d.fromScriptHash=function(a,b){f.checkArgument(a,"hash parameter is required");var c=d._transformHash(a);return new d(c.hashBuffer,b,d.PayToScriptHash)},d.payingTo=function(a,b){return f.checkArgument(a,"script is required"),f.checkArgument(a instanceof m,"script must be instance of Script"),d.fromScriptHash(j.sha256ripemd160(a.toBuffer()),b)},d.fromScript=function(a,b){f.checkArgument(a instanceof m,"script must be a Script instance");var c=d._transformScript(a,b);return new d(c.hashBuffer,b,c.type)},d.fromBuffer=function(a,b,c){var e=d._transformBuffer(a,b,c);return new d(e.hashBuffer,e.network,e.type)},d.fromString=function(a,b,c){var e=d._transformString(a,b,c);return new d(e.hashBuffer,e.network,e.type)},d.fromObject=function(a){f.checkState(k.isHexa(a.hash),'Unexpected hash property, "'+a.hash+'", expected to be hex.');var b=new c(a.hash,"hex");return new d(b,a.network,a.type)},d.getValidationError=function(a,b,c){var e;try{new d(a,b,c)}catch(f){e=f}return e},d.isValid=function(a,b,c){return!d.getValidationError(a,b,c)},d.prototype.isPayToPublicKeyHash=function(){return this.type===d.PayToPublicKeyHash},d.prototype.isPayToScriptHash=function(){return this.type===d.PayToScriptHash},d.prototype.toBuffer=function(){var a=new c([this.network[this.type]]),b=c.concat([a,this.hashBuffer]);return b},d.prototype.toObject=d.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},d.prototype.toString=function(){return h.encode(this.toBuffer())},d.prototype.inspect=function(){return""},b.exports=d;var m=a("./script")}).call(this,a("buffer").Buffer)},{"./crypto/hash":72,"./encoding/base58check":77,"./errors":81,"./networks":86,"./publickey":89,"./script":90,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],66:[function(a,b,c){(function(c){"use strict";function d(a){return this instanceof d?(e.extend(this,d._from(a)),this):new d(a)}var e=a("lodash"),f=a("./blockheader"),g=a("../crypto/bn"),h=a("../util/buffer"),i=a("../encoding/bufferreader"),j=a("../encoding/bufferwriter"),k=a("../crypto/hash"),l=a("../transaction"),m=a("../util/preconditions");d.MAX_BLOCK_SIZE=1e6,d._from=function(a){var b={};if(h.isBuffer(a))b=d._fromBufferReader(i(a));else{if(!e.isObject(a))throw new TypeError("Unrecognized argument for Block");b=d._fromObject(a)}return b},d._fromObject=function(a){var b=[];a.transactions.forEach(function(a){a instanceof l?b.push(a):b.push(l().fromObject(a))});var c={header:f.fromObject(a.header),transactions:b};return c},d.fromObject=function(a){var b=d._fromObject(a);return new d(b)},d._fromBufferReader=function(a){var b={};m.checkState(!a.finished(),"No block data received"),b.header=f.fromBufferReader(a);var c=a.readVarintNum();b.transactions=[];for(var d=0;c>d;d++)b.transactions.push(l().fromBufferReader(a));return b},d.fromBufferReader=function(a){m.checkArgument(a,"br is required");var b=d._fromBufferReader(a);return new d(b)},d.fromBuffer=function(a){return d.fromBufferReader(new i(a))},d.fromString=function(a){var b=new c(a,"hex");return d.fromBuffer(b)},d.fromRawBlock=function(a){h.isBuffer(a)||(a=new c(a,"binary"));var b=i(a);b.pos=d.Values.START_OF_BLOCK;var e=d._fromBufferReader(b);return new d(e)},d.prototype.toObject=d.prototype.toJSON=function(){var a=[];return this.transactions.forEach(function(b){a.push(b.toObject())}),{header:this.header.toObject(),transactions:a}},d.prototype.toBuffer=function(){return this.toBufferWriter().concat()},d.prototype.toString=function(){return this.toBuffer().toString("hex")},d.prototype.toBufferWriter=function(a){a||(a=new j),a.write(this.header.toBuffer()),a.writeVarintNum(this.transactions.length);for(var b=0;b1;d=Math.floor((d+1)/2)){for(var e=0;d>e;e+=2){var f=Math.min(e+1,d-1),g=c.concat([a[b+e],a[b+f]]);a.push(k.sha256sha256(g))}b+=d}return a},d.prototype.getMerkleRoot=function(){var a=this.getMerkleTree();return a[a.length-1]},d.prototype.validMerkleRoot=function(){var a=new g(this.header.merkleRoot.toString("hex"),"hex"),b=new g(this.getMerkleRoot().toString("hex"),"hex");return 0!==a.cmp(b)?!1:!0},d.prototype._getHash=function(){return this.header._getHash()};var n={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:e.noop};Object.defineProperty(d.prototype,"id",n),Object.defineProperty(d.prototype,"hash",n),d.prototype.inspect=function(){return""},d.Values={START_OF_BLOCK:8,NULL_HASH:new c("0000000000000000000000000000000000000000000000000000000000000000","hex")},b.exports=d}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"../crypto/hash":72,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../transaction":93,"../util/buffer":107,"../util/preconditions":109,"./blockheader":67,buffer:191,lodash:432}],67:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("../crypto/bn"),f=a("../util/buffer"),g=a("../encoding/bufferreader"),h=a("../encoding/bufferwriter"),i=a("../crypto/hash"),j=(a("../util/js"),a("../util/preconditions")),k=486604799,l=function n(a){if(!(this instanceof n))return new n(a);var b=n._from(a);return this.version=b.version,this.prevHash=b.prevHash,this.merkleRoot=b.merkleRoot,this.time=b.time,this.timestamp=b.time,this.bits=b.bits,this.nonce=b.nonce,b.hash&&j.checkState(this.hash===b.hash,"Argument object hash property does not match block hash."),this};l._from=function(a){var b={};if(f.isBuffer(a))b=l._fromBufferReader(g(a));else{if(!d.isObject(a))throw new TypeError("Unrecognized argument for BlockHeader");b=l._fromObject(a)}return b},l._fromObject=function(a){j.checkArgument(a,"data is required");var b=a.prevHash,e=a.merkleRoot;d.isString(a.prevHash)&&(b=f.reverse(new c(a.prevHash,"hex"))),d.isString(a.merkleRoot)&&(e=f.reverse(new c(a.merkleRoot,"hex")));var g={hash:a.hash,version:a.version,prevHash:b,merkleRoot:e,time:a.time,timestamp:a.time,bits:a.bits,nonce:a.nonce};return g},l.fromObject=function(a){var b=l._fromObject(a);return new l(b)},l.fromRawBlock=function(a){f.isBuffer(a)||(a=new c(a,"binary"));var b=g(a);b.pos=l.Constants.START_OF_HEADER;var d=l._fromBufferReader(b);return new l(d)},l.fromBuffer=function(a){var b=l._fromBufferReader(g(a));return new l(b)},l.fromString=function(a){var b=new c(a,"hex");return l.fromBuffer(b)},l._fromBufferReader=function(a){var b={};return b.version=a.readUInt32LE(),b.prevHash=a.read(32),b.merkleRoot=a.read(32),b.time=a.readUInt32LE(),b.bits=a.readUInt32LE(),b.nonce=a.readUInt32LE(),b},l.fromBufferReader=function(a){var b=l._fromBufferReader(a);return new l(b)},l.prototype.toObject=l.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:f.reverse(this.prevHash).toString("hex"),merkleRoot:f.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},l.prototype.toBuffer=function(){return this.toBufferWriter().concat()},l.prototype.toString=function(){return this.toBuffer().toString("hex")},l.prototype.toBufferWriter=function(a){return a||(a=new h),a.writeUInt32LE(this.version),a.write(this.prevHash),a.write(this.merkleRoot),a.writeUInt32LE(this.time),a.writeUInt32LE(this.bits),a.writeUInt32LE(this.nonce),a},l.prototype.getTargetDifficulty=function(a){a=a||this.bits;for(var b=new e(16777215&a),c=8*((a>>>24)-3);c-->0;)b=b.mul(new e(2));return b},l.prototype.getDifficulty=function(){var a=this.getTargetDifficulty(k).mul(new e(Math.pow(10,8))),b=this.getTargetDifficulty(),c=a.div(b).toString(10),d=c.length-8;return c=c.slice(0,d)+"."+c.slice(d),parseFloat(c)},l.prototype._getHash=function(){var a=this.toBuffer();return i.sha256sha256(a)};var m={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=g(this._getHash()).readReverse().toString("hex")),this._id},set:d.noop};Object.defineProperty(l.prototype,"id",m),Object.defineProperty(l.prototype,"hash",m),l.prototype.validTimestamp=function(){var a=Math.round((new Date).getTime()/1e3);return this.time>a+l.Constants.MAX_TIME_OFFSET?!1:!0},l.prototype.validProofOfWork=function(){var a=new e(this.id,"hex"),b=this.getTargetDifficulty();return a.cmp(b)>0?!1:!0},l.prototype.inspect=function(){return""},l.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new e("10000000000000000000000000000000000000000000000000000000000000000","hex")},b.exports=l}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"../crypto/hash":72,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,buffer:191,lodash:432}],68:[function(a,b,c){b.exports=a("./block"),b.exports.BlockHeader=a("./blockheader"),b.exports.MerkleBlock=a("./merkleblock")},{"./block":66,"./blockheader":67,"./merkleblock":69}],69:[function(a,b,c){(function(c){"use strict";function d(a){if(!(this instanceof d))return new d(a);var b={};if(g.isBuffer(a))b=d._fromBufferReader(h(a));else{if(!e.isObject(a))throw new TypeError("Unrecognized argument for MerkleBlock");var c;c=a.header instanceof f?a.header:f.fromObject(a.header),b={header:c,numTransactions:a.numTransactions,hashes:a.hashes,flags:a.flags}}return e.extend(this,b),this._flagBitsUsed=0,this._hashesUsed=0,this}var e=a("lodash"),f=a("./blockheader"),g=a("../util/buffer"),h=a("../encoding/bufferreader"),i=a("../encoding/bufferwriter"),j=a("../crypto/hash"),k=(a("../util/js"),a("../transaction")),l=a("../util/preconditions");d.fromBuffer=function(a){return d.fromBufferReader(h(a))},d.fromBufferReader=function(a){return new d(d._fromBufferReader(a))},d.prototype.toBuffer=function(){return this.toBufferWriter().concat()},d.prototype.toBufferWriter=function(a){a||(a=new i),a.write(this.header.toBuffer()),a.writeUInt32LE(this.numTransactions),a.writeVarintNum(this.hashes.length);for(var b=0;bthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var e=this.flags[d.flagBitsUsed>>3]>>>(7&d.flagBitsUsed++)&1;if(0!==a&&e){var f=this._traverseMerkleTree(a-1,2*b,d),g=f;return 2*b+1=this.hashes.length)return null;var h=this.hashes[d.hashesUsed++];return 0===a&&e&&d.txs.push(h),new c(h,"hex"); +},d.prototype._calcTreeWidth=function(a){return this.numTransactions+(1<>a},d.prototype._calcTreeHeight=function(){for(var a=0;this._calcTreeWidth(a)>1;)a++;return a},d.prototype.hasTransaction=function(a){l.checkArgument(!e.isUndefined(a),"tx cannot be undefined"),l.checkArgument(a instanceof k||"string"==typeof a,'Invalid tx given, tx must be a "string" or "Transaction"');var b=a;a instanceof k&&(b=g.reverse(new c(a.id,"hex")).toString("hex"));var d=[],f=this._calcTreeHeight();return this._traverseMerkleTree(f,0,{txs:d}),-1!==d.indexOf(b)},d._fromBufferReader=function(a){l.checkState(!a.finished(),"No merkleblock data received");var b={};b.header=f.fromBufferReader(a),b.numTransactions=a.readUInt32LE();var c=a.readVarintNum();b.hashes=[];for(var d=0;c>d;d++)b.hashes.push(a.read(32).toString("hex"));var e=a.readVarintNum();for(b.flags=[],d=0;e>d;d++)b.flags.push(a.readUInt8());return b},d.fromObject=function(a){return new d(a)},b.exports=d}).call(this,a("buffer").Buffer)},{"../crypto/hash":72,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../transaction":93,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,"./blockheader":67,buffer:191,lodash:432}],70:[function(a,b,c){(function(c){"use strict";var d=a("bn.js"),e=a("../util/preconditions"),f=a("lodash"),g=function(a){for(var b=new c(a.length),d=0;da.size?b=d.trim(b,f):f0&&0===(127&a[a.length-1])&&(a.length<=1||0===(128&a[a.length-2])))throw new Error("non-minimally encoded script number");return d.fromSM(a,{endian:"little"})},d.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},d.prototype.gt=function(a){return this.cmp(a)>0},d.prototype.gte=function(a){return this.cmp(a)>=0},d.prototype.lt=function(a){return this.cmp(a)<0},d.trim=function(a,b){return a.slice(b-a.length,a.length)},d.pad=function(a,b,d){for(var e=new c(d),f=0;ff;f++)e[f]=0;return e},b.exports=d}).call(this,a("buffer").Buffer)},{"../util/preconditions":109,"bn.js":110,buffer:191,lodash:432}],71:[function(a,b,c){(function(c){"use strict";var d=a("./bn"),e=a("./point"),f=a("./signature"),g=a("../publickey"),h=a("./random"),i=a("./hash"),j=a("../util/buffer"),k=a("lodash"),l=a("../util/preconditions"),m=function n(a){return this instanceof n?void(a&&this.set(a)):new n(a)};m.prototype.set=function(a){return this.hashbuf=a.hashbuf||this.hashbuf,this.endian=a.endian||this.endian,this.privkey=a.privkey||this.privkey,this.pubkey=a.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),this.sig=a.sig||this.sig,this.k=a.k||this.k,this.verified=a.verified||this.verified,this},m.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()},m.prototype.calci=function(){for(var a=0;4>a;a++){this.sig.i=a;var b;try{b=this.toPublicKey()}catch(c){console.error(c);continue}if(b.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")},m.fromString=function(a){var b=JSON.parse(a);return new m(b)},m.prototype.randomK=function(){var a,b=e.getN();do a=d.fromBuffer(h.getRandomBuffer(32));while(!a.lt(b)||!a.gt(d.Zero));return this.k=a,this},m.prototype.deterministicK=function(a){k.isUndefined(a)&&(a=0);var b=new c(32);b.fill(1);var f=new c(32);f.fill(0);var g=this.privkey.bn.toBuffer({size:32}),h="little"===this.endian?j.reverse(this.hashbuf):this.hashbuf;f=i.sha256hmac(c.concat([b,new c([0]),g,h]),f),b=i.sha256hmac(b,f),f=i.sha256hmac(c.concat([b,new c([1]),g,h]),f),b=i.sha256hmac(b,f),b=i.sha256hmac(b,f);for(var l=d.fromBuffer(b),m=e.getN(),n=0;a>n||!l.lt(m)||!l.gt(d.Zero);n++)f=i.sha256hmac(c.concat([b,new c([0])]),f),b=i.sha256hmac(b,f),b=i.sha256hmac(b,f),l=d.fromBuffer(b);return this.k=l,this},m.prototype.toPublicKey=function(){var a=this.sig.i;l.checkArgument(0===a||1===a||2===a||3===a,new Error("i must be equal to 0, 1, 2, or 3"));var b=d.fromBuffer(this.hashbuf),c=this.sig.r,f=this.sig.s,h=1&a,i=a>>1,j=e.getN(),k=e.getG(),m=i?c.add(j):c,n=e.fromX(h,m),o=n.mul(j);if(!o.isInfinity())throw new Error("nR is not a valid curve point");var p=b.neg().mod(j),q=c.invm(j),r=n.mul(f).add(k.mul(p)).mul(q),s=g.fromPoint(r,this.sig.compressed);return s},m.prototype.sigError=function(){if(!j.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var a=this.sig.r,b=this.sig.s;if(!(a.gt(d.Zero)&&a.lt(e.getN())&&b.gt(d.Zero)&&b.lt(e.getN())))return"r and s not in range";var c=d.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),f=e.getN(),g=b.invm(f),h=g.mul(c).mod(f),i=g.mul(a).mod(f),k=e.getG().mulAdd(h,this.pubkey.point,i);return k.isInfinity()?"p is infinity":0!==k.getX().mod(f).cmp(a)?"Invalid signature":!1},m.toLowS=function(a){return a.gt(d.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(a=e.getN().sub(a)),a},m.prototype._findSignature=function(a,b){var c,f,g,h,i=e.getN(),j=e.getG(),k=0;do(!this.k||k>0)&&this.deterministicK(k),k++,c=this.k,f=j.mul(c),g=f.x.mod(i),h=c.invm(i).mul(b.add(a.mul(g))).mod(i);while(g.cmp(d.Zero)<=0||h.cmp(d.Zero)<=0);return h=m.toLowS(h),{s:h,r:g}},m.prototype.sign=function(){var a=this.hashbuf,b=this.privkey,c=b.bn;l.checkState(a&&b&&c,new Error("invalid parameters")),l.checkState(j.isBuffer(a)&&32===a.length,new Error("hashbuf must be a 32 byte buffer"));var e=d.fromBuffer(a,this.endian?{endian:this.endian}:void 0),g=this._findSignature(c,e);return g.compressed=this.pubkey.compressed,this.sig=new f(g),this},m.prototype.signRandomK=function(){return this.randomK(),this.sign()},m.prototype.toString=function(){var a={};return this.hashbuf&&(a.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(a.privkey=this.privkey.toString()),this.pubkey&&(a.pubkey=this.pubkey.toString()),this.sig&&(a.sig=this.sig.toString()),this.k&&(a.k=this.k.toString()),JSON.stringify(a)},m.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},m.sign=function(a,b,c){return m().set({hashbuf:a,endian:c,privkey:b}).sign().sig},m.verify=function(a,b,c,d){return m().set({hashbuf:a,endian:d,sig:b,pubkey:c}).verify().verified},b.exports=m}).call(this,a("buffer").Buffer)},{"../publickey":89,"../util/buffer":107,"../util/preconditions":109,"./bn":70,"./hash":72,"./point":73,"./random":74,"./signature":75,buffer:191,lodash:432}],72:[function(a,b,c){(function(c){"use strict";var d=a("crypto"),e=a("../util/buffer"),f=a("../util/preconditions"),g=b.exports;g.sha1=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("sha1").update(a).digest()},g.sha1.blocksize=512,g.sha256=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("sha256").update(a).digest()},g.sha256.blocksize=512,g.sha256sha256=function(a){return f.checkArgument(e.isBuffer(a)),g.sha256(g.sha256(a))},g.ripemd160=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("ripemd160").update(a).digest()},g.sha256ripemd160=function(a){return f.checkArgument(e.isBuffer(a)),g.ripemd160(g.sha256(a))},g.sha512=function(a){return f.checkArgument(e.isBuffer(a)),d.createHash("sha512").update(a).digest()},g.sha512.blocksize=1024,g.hmac=function(a,b,d){f.checkArgument(e.isBuffer(b)),f.checkArgument(e.isBuffer(d)),f.checkArgument(a.blocksize);var g=a.blocksize/8;if(d.length>g)d=a(d);else if(g>d){var h=new c(g);h.fill(0),d.copy(h),d=h}var i=new c(g);i.fill(92);var j=new c(g);j.fill(54);for(var k=new c(g),l=new c(g),m=0;g>m;m++)k[m]=i[m]^d[m],l[m]=j[m]^d[m];return a(c.concat([k,a(c.concat([l,b]))]))},g.sha256hmac=function(a,b){return g.hmac(g.sha256,a,b)},g.sha512hmac=function(a,b){return g.hmac(g.sha512,a,b)}}).call(this,a("buffer").Buffer)},{"../util/buffer":107,"../util/preconditions":109,buffer:191,crypto:195}],73:[function(a,b,c){(function(c){"use strict";var d=a("./bn"),e=a("../util/buffer"),f=a("elliptic").curves.secp256k1,g=f.curve.point.bind(f.curve),h=f.curve.pointFromX.bind(f.curve),i=function(a,b,c){var d=g(a,b,c);return d.validate(),d};i.prototype=Object.getPrototypeOf(f.curve.point()),i.fromX=function(a,b){var c=h(a,b);return c.validate(),c},i.getG=function(){return f.curve.g},i.getN=function(){return new d(f.curve.n.toArray())},i.prototype._getX=i.prototype.getX,i.prototype.getX=function(){return new d(this._getX().toArray())},i.prototype._getY=i.prototype.getY,i.prototype.getY=function(){return new d(this._getY().toArray())},i.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");if(0===this.getX().cmp(d.Zero)||0===this.getY().cmp(d.Zero))throw new Error("Invalid x,y value for curve, cannot equal 0.");var a=h(this.getY().isOdd(),this.getX());if(0!==a.y.cmp(this.y))throw new Error("Invalid y value for curve.");var b=this.getX().gt(d.Minus1)&&this.getX().lt(i.getN()),c=this.getY().gt(d.Minus1)&&this.getY().lt(i.getN());if(!b||!c)throw new Error("Point does not lie on the curve");if(!this.mul(i.getN()).isInfinity())throw new Error("Point times N must be infinity");return this},i.pointToCompressed=function(a){var b,d=a.getX().toBuffer({size:32}),f=a.getY().toBuffer({size:32}),g=f[f.length-1]%2;return b=new c(g?[3]:[2]),e.concat([b,d])},b.exports=i}).call(this,a("buffer").Buffer)},{"../util/buffer":107,"./bn":70,buffer:191,elliptic:113}],74:[function(a,b,c){(function(c,d){"use strict";function e(){}e.getRandomBuffer=function(a){return c.browser?e.getRandomBufferBrowser(a):e.getRandomBufferNode(a)},e.getRandomBufferNode=function(b){var c=a("crypto");return c.randomBytes(b)},e.getRandomBufferBrowser=function(a){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var b=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");var b=window.msCrypto}var c=new Uint8Array(a);b.getRandomValues(c);var e=new d(c);return e},e.getPseudoRandomBuffer=function(a){for(var b,c=4294967296,e=new d(a),f=0;a>=f;f++){var g=Math.floor(f/4),h=f-4*g;0===h?(b=Math.random()*c,e[f]=255&b):e[f]=255&(b>>>=8)}return e},b.exports=e}).call(this,a("_process"),a("buffer").Buffer)},{_process:392,buffer:191,crypto:195}],75:[function(a,b,c){(function(c){"use strict";var d=a("./bn"),e=a("lodash"),f=a("../util/preconditions"),g=a("../util/buffer"),h=a("../util/js"),i=function j(a,b){if(!(this instanceof j))return new j(a,b);if(a instanceof d)this.set({r:a,s:b});else if(a){var c=a;this.set(c)}};i.prototype.set=function(a){return this.r=a.r||this.r||void 0,this.s=a.s||this.s||void 0,this.i="undefined"!=typeof a.i?a.i:this.i,this.compressed="undefined"!=typeof a.compressed?a.compressed:this.compressed,this.nhashtype=a.nhashtype||this.nhashtype||void 0,this},i.fromCompact=function(a){f.checkArgument(g.isBuffer(a),"Argument is expected to be a Buffer");var b=new i,c=!0,e=a.slice(0,1)[0]-27-4;0>e&&(c=!1,e+=4);var h=a.slice(1,33),j=a.slice(33,65);return f.checkArgument(0===e||1===e||2===e||3===e,new Error("i must be 0, 1, 2, or 3")),f.checkArgument(32===h.length,new Error("r must be 32 bytes")),f.checkArgument(32===j.length,new Error("s must be 32 bytes")),b.compressed=c,b.i=e,b.r=d.fromBuffer(h),b.s=d.fromBuffer(j),b},i.fromDER=i.fromBuffer=function(a,b){var c=i.parseDER(a,b),d=new i;return d.r=c.r,d.s=c.s,d},i.fromTxFormat=function(a){var b=a.readUInt8(a.length-1),c=a.slice(0,a.length-1),d=new i.fromDER(c,!1);return d.nhashtype=b,d},i.fromString=function(a){var b=new c(a,"hex");return i.fromDER(b)},i.parseDER=function(a,b){f.checkArgument(g.isBuffer(a),new Error("DER formatted signature should be a buffer")),e.isUndefined(b)&&(b=!0);var c=a[0];f.checkArgument(48===c,new Error("Header byte should be 0x30"));var h=a[1],i=a.slice(2).length;f.checkArgument(!b||h===i,new Error("Length byte should length of what follows")),h=i>h?h:i;var j=a[2];f.checkArgument(2===j,new Error("Integer byte for r should be 0x02"));var k=a[3],l=a.slice(4,4+k),m=d.fromBuffer(l),n=0===a[4]?!0:!1;f.checkArgument(k===l.length,new Error("Length of r incorrect"));var o=a[4+k+0];f.checkArgument(2===o,new Error("Integer byte for s should be 0x02"));var p=a[4+k+1],q=a.slice(4+k+2,4+k+2+p),r=d.fromBuffer(q),s=0===a[4+k+2+2]?!0:!1;f.checkArgument(p===q.length,new Error("Length of s incorrect"));var t=4+k+2+p;f.checkArgument(h===t-2,new Error("Length of signature incorrect"));var u={header:c,length:h,rheader:j,rlength:k,rneg:n,rbuf:l,r:m,sheader:o,slength:p,sneg:s,sbuf:q,s:r};return u},i.prototype.toCompact=function(a,b){if(a="number"==typeof a?a:this.i,b="boolean"==typeof b?b:this.compressed,0!==a&&1!==a&&2!==a&&3!==a)throw new Error("i must be equal to 0, 1, 2, or 3");var d=a+27+4;b===!1&&(d-=4);var e=new c([d]),f=this.r.toBuffer({size:32}),g=this.s.toBuffer({size:32});return c.concat([e,f,g])},i.prototype.toBuffer=i.prototype.toDER=function(){var a=this.r.toBuffer(),b=this.s.toBuffer(),d=128&a[0]?!0:!1,e=128&b[0]?!0:!1,f=d?c.concat([new c([0]),a]):a,g=e?c.concat([new c([0]),b]):b,h=f.length,i=g.length,j=2+h+2+i,k=2,l=2,m=48,n=c.concat([new c([m,j,k,h]),f,new c([l,i]),g]);return n},i.prototype.toString=function(){var a=this.toDER();return a.toString("hex")},i.isTxDER=function(a){if(a.length<9)return!1;if(a.length>73)return!1;if(48!==a[0])return!1;if(a[1]!==a.length-3)return!1;var b=a[3];if(5+b>=a.length)return!1;var c=a[5+b];if(b+c+7!==a.length)return!1;var d=a.slice(4);if(2!==a[2])return!1;if(0===b)return!1;if(128&d[0])return!1;if(b>1&&0===d[0]&&!(128&d[1]))return!1;var e=a.slice(6+b);return 2!==a[6+b-2]?!1:0===c?!1:128&e[0]?!1:c>1&&0===e[0]&&!(128&e[1])?!1:!0},i.prototype.hasLowS=function(){return this.s.lt(new d(1))||this.s.gt(new d("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))?!1:!0},i.prototype.hasDefinedHashtype=function(){if(!h.isNaturalNumber(this.nhashtype))return!1;var a=this.nhashtype&~i.SIGHASH_ANYONECANPAY;return ai.SIGHASH_SINGLE?!1:!0},i.prototype.toTxFormat=function(){var a=this.toDER(),b=new c(1);return b.writeUInt8(this.nhashtype,0),c.concat([a,b])},i.SIGHASH_ALL=1,i.SIGHASH_NONE=2,i.SIGHASH_SINGLE=3,i.SIGHASH_ANYONECANPAY=128,b.exports=i}).call(this,a("buffer").Buffer)},{"../util/buffer":107,"../util/js":108,"../util/preconditions":109,"./bn":70,buffer:191,lodash:432}],76:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("bs58"),f=a("buffer"),g="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),h=function i(a){if(!(this instanceof i))return new i(a);if(c.isBuffer(a)){var b=a;this.fromBuffer(b)}else if("string"==typeof a){var d=a;this.fromString(d)}else a&&this.set(a)};h.validCharacters=function(a){return f.Buffer.isBuffer(a)&&(a=a.toString()),d.all(d.map(a,function(a){return d.contains(g,a)}))},h.prototype.set=function(a){return this.buf=a.buf||this.buf||void 0,this},h.encode=function(a){if(!f.Buffer.isBuffer(a))throw new Error("Input should be a buffer");return e.encode(a)},h.decode=function(a){if("string"!=typeof a)throw new Error("Input should be a string");return new c(e.decode(a))},h.prototype.fromBuffer=function(a){return this.buf=a,this},h.prototype.fromString=function(a){var b=h.decode(a);return this.buf=b,this},h.prototype.toBuffer=function(){return this.buf},h.prototype.toString=function(){return h.encode(this.buf)},b.exports=h}).call(this,a("buffer").Buffer)},{bs58:111,buffer:191,lodash:432}],77:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("./base58"),f=a("buffer"),g=a("../crypto/hash").sha256sha256,h=function i(a){if(!(this instanceof i))return new i(a);if(c.isBuffer(a)){var b=a;this.fromBuffer(b)}else if("string"==typeof a){var d=a;this.fromString(d)}else a&&this.set(a)};h.prototype.set=function(a){return this.buf=a.buf||this.buf||void 0,this},h.validChecksum=function(a,b){return d.isString(a)&&(a=new f.Buffer(e.decode(a))),d.isString(b)&&(b=new f.Buffer(e.decode(b))),b||(b=a.slice(-4),a=a.slice(0,-4)),h.checksum(a).toString("hex")===b.toString("hex")},h.decode=function(a){if("string"!=typeof a)throw new Error("Input must be a string");var b=new c(e.decode(a));if(b.length<4)throw new Error("Input string too short");var d=b.slice(0,-4),f=b.slice(-4),h=g(d),i=h.slice(0,4);if(f.toString("hex")!==i.toString("hex"))throw new Error("Checksum mismatch");return d},h.checksum=function(a){return g(a).slice(0,4)},h.encode=function(a){if(!c.isBuffer(a))throw new Error("Input must be a buffer");var b=new c(a.length+4),d=h.checksum(a);return a.copy(b),d.copy(b,a.length),e.encode(b)},h.prototype.fromBuffer=function(a){return this.buf=a,this},h.prototype.fromString=function(a){var b=h.decode(a);return this.buf=b,this},h.prototype.toBuffer=function(){return this.buf},h.prototype.toString=function(){return h.encode(this.buf)},b.exports=h}).call(this,a("buffer").Buffer)},{"../crypto/hash":72,"./base58":76,buffer:191,lodash:432}],78:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("../util/preconditions"),f=a("../util/buffer"),g=a("../crypto/bn"),h=function i(a){if(!(this instanceof i))return new i(a);if(!d.isUndefined(a))if(c.isBuffer(a))this.set({buf:a});else if(d.isString(a))this.set({buf:new c(a,"hex")});else{if(!d.isObject(a))throw new TypeError("Unrecognized argument for BufferReader");var b=a;this.set(b)}};h.prototype.set=function(a){return this.buf=a.buf||this.buf||void 0,this.pos=a.pos||this.pos||0,this},h.prototype.eof=function(){return this.pos>=this.buf.length},h.prototype.finished=h.prototype.eof,h.prototype.read=function(a){e.checkArgument(!d.isUndefined(a),"Must specify a length");var b=this.buf.slice(this.pos,this.pos+a);return this.pos=this.pos+a,b},h.prototype.readAll=function(){var a=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,a},h.prototype.readUInt8=function(){var a=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,a},h.prototype.readUInt16BE=function(){var a=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,a},h.prototype.readUInt16LE=function(){var a=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,a},h.prototype.readUInt32BE=function(){var a=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,a},h.prototype.readUInt32LE=function(){var a=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,a},h.prototype.readUInt64BEBN=function(){var a=this.buf.slice(this.pos,this.pos+8),b=g.fromBuffer(a);return this.pos=this.pos+8,b},h.prototype.readUInt64LEBN=function(){var a,b=this.buf.readUInt32LE(this.pos),c=this.buf.readUInt32LE(this.pos+4),d=4294967296*c+b;if(9007199254740991>=d)a=new g(d);else{var e=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);a=new g(e,10,"le")}return this.pos=this.pos+8,a},h.prototype.readVarintNum=function(){var a=this.readUInt8();switch(a){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var b=this.readUInt64LEBN(),c=b.toNumber();if(c<=Math.pow(2,53))return c;throw new Error("number too large to retain precision - use readVarintBN");default:return a}},h.prototype.readVarLengthBuffer=function(){var a=this.readVarintNum(),b=this.read(a);return e.checkState(b.length===a,"Invalid length while reading varlength buffer. Expected to read: "+a+" and read "+b.length),b},h.prototype.readVarintBuf=function(){var a=this.buf.readUInt8(this.pos);switch(a){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},h.prototype.readVarintBN=function(){var a=this.readUInt8();switch(a){case 253:return new g(this.readUInt16LE());case 254:return new g(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new g(a)}},h.prototype.reverse=function(){for(var a=new c(this.buf.length),b=0;ba?(b=new c(1),b.writeUInt8(a,0)):65536>a?(b=new c(3),b.writeUInt8(253,0),b.writeUInt16LE(a,1)):4294967296>a?(b=new c(5),b.writeUInt8(254,0),b.writeUInt32LE(a,1)):(b=new c(9),b.writeUInt8(255,0),b.writeInt32LE(-1&a,1),b.writeUInt32LE(Math.floor(a/4294967296),5)),b},f.varintBufBN=function(a){var b=void 0,d=a.toNumber();if(253>d)b=new c(1),b.writeUInt8(d,0);else if(65536>d)b=new c(3),b.writeUInt8(253,0),b.writeUInt16LE(d,1);else if(4294967296>d)b=new c(5),b.writeUInt8(254,0),b.writeUInt32LE(d,1);else{var e=new f;e.writeUInt8(255),e.writeUInt64LEBN(a);var b=e.concat()}return b},b.exports=f}).call(this,a("buffer").Buffer)},{"../util/buffer":107,assert:176,buffer:191}],80:[function(a,b,c){(function(c){"use strict";var d=a("./bufferwriter"),e=a("./bufferreader"),f=a("../crypto/bn"),g=function h(a){if(!(this instanceof h))return new h(a);if(c.isBuffer(a))this.buf=a;else if("number"==typeof a){var b=a;this.fromNumber(b)}else if(a instanceof f){var d=a;this.fromBN(d)}else if(a){var e=a;this.set(e)}};g.prototype.set=function(a){return this.buf=a.buf||this.buf,this},g.prototype.fromString=function(a){return this.set({buf:new c(a,"hex")}),this},g.prototype.toString=function(){return this.buf.toString("hex")},g.prototype.fromBuffer=function(a){return this.buf=a,this},g.prototype.fromBufferReader=function(a){return this.buf=a.readVarintBuf(),this},g.prototype.fromBN=function(a){return this.buf=d().writeVarintBN(a).concat(),this},g.prototype.fromNumber=function(a){return this.buf=d().writeVarintNum(a).concat(),this},g.prototype.toBuffer=function(){return this.buf},g.prototype.toBN=function(){return e(this.buf).readVarintBN()},g.prototype.toNumber=function(){return e(this.buf).readVarintNum()},b.exports=g}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"./bufferreader":78,"./bufferwriter":79,buffer:191}],81:[function(a,b,c){"use strict";function d(a,b){return a.replace("{0}",b[0]).replace("{1}",b[1]).replace("{2}",b[2])}var e=a("lodash"),f=function(a,b){var c=function(){if(e.isString(b.message))this.message=d(b.message,arguments);else{if(!e.isFunction(b.message))throw new Error("Invalid error definition for "+b.name);this.message=b.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return c.prototype=Object.create(a.prototype),c.prototype.name=a.prototype.name+b.name,a[b.name]=c,b.errors&&g(c,b.errors),c},g=function(a,b){e.each(b,function(b){f(a,b)})},h=function(a,b){return g(a,b),a},i={};i.Error=function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack},i.Error.prototype=Object.create(Error.prototype),i.Error.prototype.name="bitcore.Error";var j=a("./spec");h(i.Error,j),b.exports=i.Error,b.exports.extend=function(a){return f(i.Error,a)}},{"./spec":82,lodash:432}],82:[function(a,b,c){"use strict";var d="http://bitcore.io/";b.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+d+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]},{}],83:[function(a,b,c){"use strict";b.exports={_cache:{},_count:0,_eraseIndex:0,_usedList:{},_usedIndex:{},_CACHE_SIZE:5e3,get:function(a,b,c){c=!!c;var d=a+"/"+b+"/"+c;return this._cache[d]?(this._cacheHit(d),this._cache[d]):void 0},set:function(a,b,c,d){c=!!c;var e=a+"/"+b+"/"+c;this._cache[e]=d,this._cacheHit(e)},_cacheHit:function(a){this._usedIndex[a]&&delete this._usedList[this._usedIndex[a]],this._usedList[this._count]=a,this._usedIndex[a]=this._count,this._count++,this._cacheRemove()},_cacheRemove:function(){for(;this._eraseIndex=0&&a=d.Hardened?!0:b,ax*w)throw new s.InvalidEntropyArgument.TooMuchEntropy(a);var e=l.sha512hmac(a,new f.Buffer("Bitcoin seed"));return new d({network:m.get(b)||m.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:e.slice(0,32),chainCode:e.slice(32,64)})},d.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var b=a("./hdpublickey");this._hdPublicKey=new b(this)}},d.prototype._buildFromBuffers=function(a){d._validateBufferArguments(a),u.defineImmutable(this,{_buffers:a});var b=[a.version,a.depth,a.parentFingerPrint,a.childIndex,a.chainCode,t.emptyBuffer(1),a.privateKey],e=f.Buffer.concat(b);if(a.checksum&&a.checksum.length){if(a.checksum.toString()!==k.checksum(e).toString())throw new r.InvalidB58Checksum(e)}else a.checksum=k.checksum(e);var g,h=m.get(t.integerFromBuffer(a.version));g=k.encode(f.Buffer.concat(b)),a.xprivkey=new c(g);var j=new p(i.fromBuffer(a.privateKey),h),n=j.toPublicKey(),o=d.ParentFingerPrintSize,q=l.sha256ripemd160(n.toBuffer()).slice(0,o);return u.defineImmutable(this,{xprivkey:g,network:h,depth:t.integerFromSingleByteBuffer(a.depth),privateKey:j,publicKey:n,fingerPrint:q}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},d._validateBufferArguments=function(a){var b=function(b,c){var d=a[b];e(t.isBuffer(d),b+" argument is not a buffer"),e(d.length===c,b+" has not the expected size: found "+d.length+", expected "+c)};b("version",d.VersionSize),b("depth",d.DepthSize),b("parentFingerPrint",d.ParentFingerPrintSize),b("childIndex",d.ChildIndexSize),b("chainCode",d.ChainCodeSize),b("privateKey",d.PrivateKeySize),a.checksum&&a.checksum.length&&b("checksum",d.CheckSumSize)},d.prototype.toString=function(){return this.xprivkey},d.prototype.inspect=function(){return""},d.prototype.toObject=d.prototype.toJSON=function(){return{network:m.get(t.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:t.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:t.integerFromBuffer(this.fingerPrint),parentFingerPrint:t.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:t.integerFromBuffer(this._buffers.childIndex),chainCode:t.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:t.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},d.fromBuffer=function(a){return new d(a.toString())},d.prototype.toBuffer=function(){return t.copy(this._buffers.xprivkey)},d.DefaultDepth=0,d.DefaultFingerprint=0,d.DefaultChildIndex=0,d.Hardened=2147483648,d.MaxIndex=2*d.Hardened,d.RootElementAlias=["m","M","m'","M'"],d.VersionSize=4,d.DepthSize=1,d.ParentFingerPrintSize=4,d.ChildIndexSize=4,d.ChainCodeSize=32,d.PrivateKeySize=32,d.CheckSumSize=4,d.DataLength=78,d.SerializedByteSize=82,d.VersionStart=0,d.VersionEnd=d.VersionStart+d.VersionSize,d.DepthStart=d.VersionEnd,d.DepthEnd=d.DepthStart+d.DepthSize,d.ParentFingerPrintStart=d.DepthEnd,d.ParentFingerPrintEnd=d.ParentFingerPrintStart+d.ParentFingerPrintSize,d.ChildIndexStart=d.ParentFingerPrintEnd,d.ChildIndexEnd=d.ChildIndexStart+d.ChildIndexSize,d.ChainCodeStart=d.ChildIndexEnd,d.ChainCodeEnd=d.ChainCodeStart+d.ChainCodeSize,d.PrivateKeyStart=d.ChainCodeEnd+1,d.PrivateKeyEnd=d.PrivateKeyStart+d.PrivateKeySize,d.ChecksumStart=d.PrivateKeyEnd,d.ChecksumEnd=d.ChecksumStart+d.CheckSumSize,e(d.ChecksumEnd===d.SerializedByteSize),b.exports=d}).call(this,a("buffer").Buffer)},{"./crypto/bn":70,"./crypto/hash":72,"./crypto/point":73,"./crypto/random":74,"./encoding/base58":76,"./encoding/base58check":77,"./errors":81,"./hdkeycache":83,"./hdpublickey":85,"./networks":86,"./privatekey":88,"./util/buffer":107,"./util/js":108,"./util/preconditions":109,assert:176,buffer:191,lodash:432}],85:[function(a,b,c){(function(c){"use strict";function d(a){if(a instanceof d)return a;if(!(this instanceof d))return new d(a);if(a){if(e.isString(a)||u.isBuffer(a)){var b=d.getSerializedError(a);if(b){if(u.isBuffer(a)&&!d.getSerializedError(a.toString()))return this._buildFromSerialized(a.toString());if(b instanceof r.ArgumentIsPrivateExtended)return new k(a).hdPublicKey;throw b}return this._buildFromSerialized(a)}if(e.isObject(a))return a instanceof k?this._buildFromPrivate(a):this._buildFromObject(a);throw new r.UnrecognizedArgument(a)}throw new r.MustSupplyArgument}var e=a("lodash"),f=a("./util/preconditions"),g=a("./crypto/bn"),h=a("./encoding/base58"),i=a("./encoding/base58check"),j=a("./crypto/hash"),k=a("./hdprivatekey"),l=a("./hdkeycache"),m=a("./networks"),n=a("./crypto/point"),o=a("./publickey"),p=a("./errors"),q=p,r=p.HDPublicKey,s=a("assert"),t=a("./util/js"),u=a("./util/buffer");d.isValidPath=function(a){if(e.isString(a)){var b=k._getDerivationIndexes(a);return null!==b&&e.all(b,d.isValidPath)}return e.isNumber(a)?a>=0&&a=d.Hardened||b)throw new r.InvalidIndexCantDeriveHardened;if(0>a)throw new r.InvalidPath(a);var c=l.get(this.xpubkey,a,!1);if(c)return c;var e=u.integerAsBuffer(a),f=u.concat([this.publicKey.toBuffer(),e]),h=j.sha512hmac(f,this._buffers.chainCode),i=g.fromBuffer(h.slice(0,32),{size:32}),k=h.slice(32,64),m=o.fromPoint(n.getG().mul(i).add(this.publicKey.point)),p=new d({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:a,chainCode:k,publicKey:m});return l.set(this.xpubkey,a,!1,p),p},d.prototype._deriveFromString=function(a){if(e.contains(a,"'"))throw new r.InvalidIndexCantDeriveHardened;if(!d.isValidPath(a))throw new r.InvalidPath(a);var b=k._getDerivationIndexes(a),c=b.reduce(function(a,b){return a._deriveWithNumber(b)},this);return c},d.isValidSerialized=function(a,b){return e.isNull(d.getSerializedError(a,b))},d.getSerializedError=function(a,b){if(!e.isString(a)&&!u.isBuffer(a))return new r.UnrecognizedArgument("expected buffer or string");if(!h.validCharacters(a))return new q.InvalidB58Char("(unknown)",a);try{a=i.decode(a)}catch(c){return new q.InvalidB58Checksum(a)}if(a.length!==d.DataSize)return new r.InvalidLength(a);if(!e.isUndefined(b)){var f=d._validateNetwork(a,b);if(f)return f}var g=u.integerFromBuffer(a.slice(0,4));return g===m.livenet.xprivkey||g===m.testnet.xprivkey?new r.ArgumentIsPrivateExtended:null},d._validateNetwork=function(a,b){var c=m.get(b);if(!c)return new q.InvalidNetworkArgument(b);var e=a.slice(d.VersionStart,d.VersionEnd);return u.integerFromBuffer(e)!==c.xpubkey?new q.InvalidNetwork(e):null},d.prototype._buildFromPrivate=function(a){var b=e.clone(a._buffers),c=n.getG().mul(g.fromBuffer(b.privateKey));return b.publicKey=n.pointToCompressed(c),b.version=u.integerAsBuffer(m.get(u.integerFromBuffer(b.version)).xpubkey),b.privateKey=void 0,b.checksum=void 0,b.xprivkey=void 0,this._buildFromBuffers(b)},d.prototype._buildFromObject=function(a){var b={version:a.network?u.integerAsBuffer(m.get(a.network).xpubkey):a.version,depth:e.isNumber(a.depth)?u.integerAsSingleByteBuffer(a.depth):a.depth,parentFingerPrint:e.isNumber(a.parentFingerPrint)?u.integerAsBuffer(a.parentFingerPrint):a.parentFingerPrint,childIndex:e.isNumber(a.childIndex)?u.integerAsBuffer(a.childIndex):a.childIndex,chainCode:e.isString(a.chainCode)?u.hexToBuffer(a.chainCode):a.chainCode,publicKey:e.isString(a.publicKey)?u.hexToBuffer(a.publicKey):u.isBuffer(a.publicKey)?a.publicKey:a.publicKey.toBuffer(),checksum:e.isNumber(a.checksum)?u.integerAsBuffer(a.checksum):a.checksum};return this._buildFromBuffers(b)},d.prototype._buildFromSerialized=function(a){var b=i.decode(a),c={version:b.slice(d.VersionStart,d.VersionEnd),depth:b.slice(d.DepthStart,d.DepthEnd),parentFingerPrint:b.slice(d.ParentFingerPrintStart,d.ParentFingerPrintEnd),childIndex:b.slice(d.ChildIndexStart,d.ChildIndexEnd),chainCode:b.slice(d.ChainCodeStart,d.ChainCodeEnd),publicKey:b.slice(d.PublicKeyStart,d.PublicKeyEnd),checksum:b.slice(d.ChecksumStart,d.ChecksumEnd),xpubkey:a};return this._buildFromBuffers(c)},d.prototype._buildFromBuffers=function(a){d._validateBufferArguments(a),t.defineImmutable(this,{_buffers:a});var b=[a.version,a.depth,a.parentFingerPrint,a.childIndex,a.chainCode,a.publicKey],e=u.concat(b),f=i.checksum(e);if(a.checksum&&a.checksum.length){if(a.checksum.toString("hex")!==f.toString("hex"))throw new q.InvalidB58Checksum(e,f)}else a.checksum=f;var g,h=m.get(u.integerFromBuffer(a.version));g=i.encode(u.concat(b)),a.xpubkey=new c(g);var k=new o(a.publicKey,{network:h}),l=d.ParentFingerPrintSize,n=j.sha256ripemd160(k.toBuffer()).slice(0,l);return t.defineImmutable(this,{xpubkey:g,network:h,depth:u.integerFromSingleByteBuffer(a.depth),publicKey:k,fingerPrint:n}),this},d._validateBufferArguments=function(a){var b=function(b,c){var d=a[b];s(u.isBuffer(d),b+" argument is not a buffer, it's "+typeof d),s(d.length===c,b+" has not the expected size: found "+d.length+", expected "+c)};b("version",d.VersionSize),b("depth",d.DepthSize),b("parentFingerPrint",d.ParentFingerPrintSize),b("childIndex",d.ChildIndexSize),b("chainCode",d.ChainCodeSize),b("publicKey",d.PublicKeySize),a.checksum&&a.checksum.length&&b("checksum",d.CheckSumSize)},d.fromString=function(a){return f.checkArgument(e.isString(a),"No valid string was provided"),new d(a)},d.fromObject=function(a){return f.checkArgument(e.isObject(a),"No valid argument was provided"),new d(a)},d.prototype.toString=function(){return this.xpubkey},d.prototype.inspect=function(){return""},d.prototype.toObject=d.prototype.toJSON=function(){return{network:m.get(u.integerFromBuffer(this._buffers.version)).name,depth:u.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:u.integerFromBuffer(this.fingerPrint),parentFingerPrint:u.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:u.integerFromBuffer(this._buffers.childIndex),chainCode:u.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:u.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},d.fromBuffer=function(a){return new d(a)},d.prototype.toBuffer=function(){return u.copy(this._buffers.xpubkey)},d.Hardened=2147483648,d.RootElementAlias=["m","M"],d.VersionSize=4,d.DepthSize=1,d.ParentFingerPrintSize=4,d.ChildIndexSize=4,d.ChainCodeSize=32,d.PublicKeySize=33,d.CheckSumSize=4,d.DataSize=78,d.SerializedByteSize=82,d.VersionStart=0,d.VersionEnd=d.VersionStart+d.VersionSize,d.DepthStart=d.VersionEnd,d.DepthEnd=d.DepthStart+d.DepthSize,d.ParentFingerPrintStart=d.DepthEnd,d.ParentFingerPrintEnd=d.ParentFingerPrintStart+d.ParentFingerPrintSize,d.ChildIndexStart=d.ParentFingerPrintEnd,d.ChildIndexEnd=d.ChildIndexStart+d.ChildIndexSize,d.ChainCodeStart=d.ChildIndexEnd,d.ChainCodeEnd=d.ChainCodeStart+d.ChainCodeSize,d.PublicKeyStart=d.ChainCodeEnd,d.PublicKeyEnd=d.PublicKeyStart+d.PublicKeySize,d.ChecksumStart=d.PublicKeyEnd,d.ChecksumEnd=d.ChecksumStart+d.CheckSumSize,s(d.PublicKeyEnd===d.DataSize),s(d.ChecksumEnd===d.SerializedByteSize),b.exports=d}).call(this,a("buffer").Buffer)},{"./crypto/bn":70,"./crypto/hash":72,"./crypto/point":73,"./encoding/base58":76,"./encoding/base58check":77,"./errors":81,"./hdkeycache":83,"./hdprivatekey":84,"./networks":86,"./publickey":89,"./util/buffer":107,"./util/js":108,"./util/preconditions":109,assert:176,buffer:191,lodash:432}],86:[function(a,b,c){"use strict";function d(){}function e(a,b){if(~m.indexOf(a))return a;if(b){j.isArray(b)||(b=[b]);var c=function(b){return m[d][b]===a};for(var d in m)if(j.any(b,c))return m[d];return void 0}return n[a]}function f(a){var b=new d;return l.defineImmutable(b,{name:a.name,alias:a.alias,pubkeyhash:a.pubkeyhash,privatekey:a.privatekey,scripthash:a.scripthash,xpubkey:a.xpubkey,xprivkey:a.xprivkey}),a.networkMagic&&l.defineImmutable(b,{networkMagic:k.integerAsBuffer(a.networkMagic)}),a.port&&l.defineImmutable(b,{port:a.port}),a.dnsSeeds&&l.defineImmutable(b,{dnsSeeds:a.dnsSeeds}),j.each(b,function(a){j.isUndefined(a)||j.isObject(a)||(n[a]=b)}),m.push(b),b}function g(a){for(var b=0;b=0&&16>=a,"Invalid Argument: n must be between 0 and 16"),0===a?d("OP_0"):new d(d.map.OP_1+a-1)},d.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},d.reverseMap=[];for(var i in d.map)d.reverseMap[d.map[i]]=i;e.extend(d,d.map),d.isSmallIntOp=function(a){return a instanceof d&&(a=a.toNumber()),a===d.map.OP_0||a>=d.map.OP_1&&a<=d.map.OP_16},d.prototype.inspect=function(){return""},b.exports=d}).call(this,a("buffer").Buffer)},{"./util/buffer":107,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],88:[function(a,b,c){(function(c){"use strict";function d(a,b){if(!(this instanceof d))return new d(a,b);if(a instanceof d)return a;var c=this._classifyArguments(a,b);if(!c.bn||0===c.bn.cmp(new h(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!c.bn.lt(k.getN()))throw new TypeError("Number must be less than N");if("undefined"==typeof c.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return i.defineImmutable(this,{bn:c.bn,compressed:c.compressed,network:c.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}var e=a("lodash"),f=a("./address"),g=a("./encoding/base58check"),h=a("./crypto/bn"),i=a("./util/js"),j=a("./networks"),k=a("./crypto/point"),l=a("./publickey"),m=a("./crypto/random"),n=a("./util/preconditions");d.prototype._classifyArguments=function(a,b){var f={compressed:!0,network:b?j.get(b):j.defaultNetwork};if(e.isUndefined(a)||e.isNull(a))f.bn=d._getRandomBN();else if(a instanceof h)f.bn=a;else if(a instanceof c||a instanceof Uint8Array)f=d._transformBuffer(a,b);else if(a.bn&&a.network)f=d._transformObject(a);else if(!b&&j.get(a))f.bn=d._getRandomBN(),f.network=j.get(a);else{if("string"!=typeof a)throw new TypeError("First argument is an unrecognized data type.");i.isHexa(a)?f.bn=new h(new c(a,"hex")):f=d._transformWIF(a,b)}return f},d._getRandomBN=function(){var a,b;do{var c=m.getRandomBuffer(32);b=h.fromBuffer(c),a=b.lt(k.getN())}while(!a);return b},d._transformBuffer=function(a,b){var c={};if(32===a.length)return d._transformBNBuffer(a,b);if(c.network=j.get(a[0],"privatekey"),!c.network)throw new Error("Invalid network");if(b&&c.network!==j.get(b))throw new TypeError("Private key network mismatch");if(34===a.length&&1===a[33])c.compressed=!0;else{if(33!==a.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");c.compressed=!1}return c.bn=h.fromBuffer(a.slice(1,33)),c},d._transformBNBuffer=function(a,b){var c={};return c.network=j.get(b)||j.defaultNetwork,c.bn=h.fromBuffer(a),c.compressed=!1,c},d._transformWIF=function(a,b){return d._transformBuffer(g.decode(a),b)},d.fromBuffer=function(a,b){return new d(a,b)},d._transformObject=function(a){var b=new h(a.bn,"hex"),c=j.get(a.network);return{bn:b,network:c,compressed:a.compressed}},d.fromString=d.fromWIF=function(a){return n.checkArgument(e.isString(a),"First argument is expected to be a string."),new d(a)},d.fromObject=function(a){return n.checkArgument(e.isObject(a),"First argument is expected to be an object."),new d(a)},d.fromRandom=function(a){var b=d._getRandomBN();return new d(b,a)},d.getValidationError=function(a,b){var c;try{new d(a,b)}catch(e){c=e}return c},d.isValid=function(a,b){return a?!d.getValidationError(a,b):!1},d.prototype.toString=function(){return this.toBuffer().toString("hex")},d.prototype.toWIF=function(){var a,b=this.network,d=this.compressed;return a=d?c.concat([new c([b.privatekey]),this.bn.toBuffer({size:32}),new c([1])]):c.concat([new c([b.privatekey]),this.bn.toBuffer({size:32})]),g.encode(a)},d.prototype.toBigNumber=function(){return this.bn},d.prototype.toBuffer=function(){return this.bn.toBuffer()},d.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=l.fromPrivateKey(this)),this._pubkey},d.prototype.toAddress=function(a){var b=this.toPublicKey();return f.fromPublicKey(b,a||this.network)},d.prototype.toObject=d.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},d.prototype.inspect=function(){var a=this.compressed?"":", uncompressed";return""},b.exports=d}).call(this,a("buffer").Buffer)},{"./address":65,"./crypto/bn":70,"./crypto/point":73,"./crypto/random":74,"./encoding/base58check":77,"./networks":86,"./publickey":89,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],89:[function(a,b,c){(function(c){"use strict";function d(a,b){if(!(this instanceof d))return new d(a,b);if(k.checkArgument(a,"First argument is required, please include public key data."),a instanceof d)return a;b=b||{};var c=this._classifyArgs(a,b);return c.point.validate(),h.defineImmutable(this,{point:c.point,compressed:c.compressed,network:c.network||i.defaultNetwork}),this}var e=a("./crypto/bn"),f=a("./crypto/point"),g=a("./crypto/hash"),h=a("./util/js"),i=a("./networks"),j=a("lodash"),k=a("./util/preconditions");d.prototype._classifyArgs=function(a,b){var e={compressed:j.isUndefined(b.compressed)||b.compressed};if(a instanceof f)e.point=a;else if(a.x&&a.y)e=d._transformObject(a);else if("string"==typeof a)e=d._transformDER(new c(a,"hex"));else if(d._isBuffer(a))e=d._transformDER(a);else{if(!d._isPrivateKey(a))throw new TypeError("First argument is an unrecognized data format.");e=d._transformPrivateKey(a)}return e.network||(e.network=j.isUndefined(b.network)?void 0:i.get(b.network)),e},d._isPrivateKey=function(b){var c=a("./privatekey");return b instanceof c},d._isBuffer=function(a){return a instanceof c||a instanceof Uint8Array},d._transformPrivateKey=function(a){k.checkArgument(d._isPrivateKey(a),"Must be an instance of PrivateKey");var b={};return b.point=f.getG().mul(a.bn),b.compressed=a.compressed,b.network=a.network,b},d._transformDER=function(a,b){k.checkArgument(d._isBuffer(a),"Must be a hex buffer of DER encoded public key");var c={};b=j.isUndefined(b)?!0:b;var g,h,i,l;if(4!==a[0]&&(b||6!==a[0]&&7!==a[0]))if(3===a[0])i=a.slice(1),g=new e(i),c=d._transformX(!0,g),c.compressed=!0;else{if(2!==a[0])throw new TypeError("Invalid DER format public key");i=a.slice(1),g=new e(i),c=d._transformX(!1,g),c.compressed=!0}else{if(i=a.slice(1,33),l=a.slice(33,65),32!==i.length||32!==l.length||65!==a.length)throw new TypeError("Length of x and y must be 32 bytes");g=new e(i),h=new e(l),c.point=new f(g,h),c.compressed=!1}return c},d._transformX=function(a,b){k.checkArgument("boolean"==typeof a,"Must specify whether y is odd or not (true or false)");var c={};return c.point=f.fromX(a,b),c},d._transformObject=function(a){var b=new e(a.x,"hex"),c=new e(a.y,"hex"),g=new f(b,c);return new d(g,{compressed:a.compressed})},d.fromPrivateKey=function(a){k.checkArgument(d._isPrivateKey(a),"Must be an instance of PrivateKey");var b=d._transformPrivateKey(a);return new d(b.point,{compressed:b.compressed,network:b.network})},d.fromDER=d.fromBuffer=function(a,b){k.checkArgument(d._isBuffer(a),"Must be a hex buffer of DER encoded public key");var c=d._transformDER(a,b);return new d(c.point,{compressed:c.compressed})},d.fromPoint=function(a,b){return k.checkArgument(a instanceof f,"First argument must be an instance of Point."),new d(a,{compressed:b})},d.fromString=function(a,b){var e=new c(a,b||"hex"),f=d._transformDER(e);return new d(f.point,{compressed:f.compressed})},d.fromX=function(a,b){var c=d._transformX(a,b);return new d(c.point,{compressed:c.compressed})},d.getValidationError=function(a){var b;try{new d(a)}catch(c){b=c}return b},d.isValid=function(a){return!d.getValidationError(a)},d.prototype.toObject=d.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},d.prototype.toBuffer=d.prototype.toDER=function(){var a,b=this.point.getX(),d=this.point.getY(),e=b.toBuffer({size:32}),f=d.toBuffer({size:32});if(this.compressed){var g=f[f.length-1]%2;return a=new c(g?[3]:[2]),c.concat([a,e])}return a=new c([4]),c.concat([a,e,f])},d.prototype._getID=function(){return g.sha256ripemd160(this.toBuffer())},d.prototype.toAddress=function(b){var c=a("./address");return c.fromPublicKey(this,b||this.network)},d.prototype.toString=function(){return this.toDER().toString("hex")},d.prototype.inspect=function(){return""},b.exports=d}).call(this,a("buffer").Buffer)},{"./address":65,"./crypto/bn":70,"./crypto/hash":72,"./crypto/point":73,"./networks":86,"./privatekey":88,"./util/js":108,"./util/preconditions":109,buffer:191,lodash:432}],90:[function(a,b,c){b.exports=a("./script"),b.exports.Interpreter=a("./interpreter")},{"./interpreter":91,"./script":92}],91:[function(a,b,c){(function(c){"use strict";var d=a("lodash"),e=a("./script"),f=a("../opcode"),g=a("../crypto/bn"),h=a("../crypto/hash"),i=a("../crypto/signature"),j=a("../publickey"),k=function l(a){return this instanceof l?void(a?(this.initialize(),this.set(a)):this.initialize()):new l(a)};k.prototype.verify=function(b,c,f,g,h){var i=a("../transaction");d.isUndefined(f)&&(f=new i),d.isUndefined(g)&&(g=0),d.isUndefined(h)&&(h=0),this.set({script:b,tx:f,nin:g,flags:h});var j;if(0!==(h&k.SCRIPT_VERIFY_SIGPUSHONLY)&&!b.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;h&k.SCRIPT_VERIFY_P2SH&&(j=this.stack.slice());var l=this.stack;if(this.initialize(),this.set({script:c,stack:l,tx:f,nin:g,flags:h}),!this.evaluate())return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var m=this.stack[this.stack.length-1];if(!k.castToBool(m))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(h&k.SCRIPT_VERIFY_P2SH&&c.isScriptHashOut()){if(!b.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===j.length)throw new Error("internal error - stack copy empty");var n=j[j.length-1],o=e.fromBuffer(n);return j.pop(),this.initialize(),this.set({script:o,stack:j,tx:f,nin:g,flags:h}),this.evaluate()?0===j.length?(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1):k.castToBool(j[j.length-1])?!0:(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1):!1}return!0},b.exports=k,k.prototype.initialize=function(a){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},k.prototype.set=function(a){this.script=a.script||this.script,this.tx=a.tx||this.tx,this.nin="undefined"!=typeof a.nin?a.nin:this.nin,this.stack=a.stack||this.stack,this.altstack=a.altack||this.altstack,this.pc="undefined"!=typeof a.pc?a.pc:this.pc,this.pbegincodehash="undefined"!=typeof a.pbegincodehash?a.pbegincodehash:this.pbegincodehash,this.nOpCount="undefined"!=typeof a.nOpCount?a.nOpCount:this.nOpCount,this.vfExec=a.vfExec||this.vfExec,this.errstr=a.errstr||this.errstr,this.flags="undefined"!=typeof a.flags?a.flags:this.flags},k["true"]=new c([1]),k["false"]=new c([]),k.MAX_SCRIPT_ELEMENT_SIZE=520,k.LOCKTIME_THRESHOLD=5e8,k.LOCKTIME_THRESHOLD_BN=new g(k.LOCKTIME_THRESHOLD),k.SCRIPT_VERIFY_NONE=0,k.SCRIPT_VERIFY_P2SH=1,k.SCRIPT_VERIFY_STRICTENC=2,k.SCRIPT_VERIFY_DERSIG=4,k.SCRIPT_VERIFY_LOW_S=8,k.SCRIPT_VERIFY_NULLDUMMY=16,k.SCRIPT_VERIFY_SIGPUSHONLY=32,k.SCRIPT_VERIFY_MINIMALDATA=64,k.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,k.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,k.castToBool=function(a){for(var b=0;b1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(b){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+b,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0},k.prototype.checkLockTime=function(a){return this.tx.nLockTime=k.LOCKTIME_THRESHOLD&&a.gte(k.LOCKTIME_THRESHOLD_BN)?a.gt(new g(this.tx.nLockTime))?!1:this.tx.inputs[this.nin].isFinal()?!0:!1:!1},k.prototype.step=function(){var a,b,c,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=0!==(this.flags&k.SCRIPT_VERIFY_MINIMALDATA),A=-1===this.vfExec.indexOf(!1),B=this.script.chunks[this.pc];this.pc++;var C=B.opcodenum;if(d.isUndefined(C))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(B.buf&&B.buf.length>k.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(C>f.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(C===f.OP_CAT||C===f.OP_SUBSTR||C===f.OP_LEFT||C===f.OP_RIGHT||C===f.OP_INVERT||C===f.OP_AND||C===f.OP_OR||C===f.OP_XOR||C===f.OP_2MUL||C===f.OP_2DIV||C===f.OP_MUL||C===f.OP_DIV||C===f.OP_MOD||C===f.OP_LSHIFT||C===f.OP_RSHIFT)return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(A&&C>=0&&C<=f.OP_PUSHDATA4){if(z&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(B.buf){if(B.len!==B.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(B.buf)}else this.stack.push(k["false"])}else if(A||f.OP_IF<=C&&C<=f.OP_ENDIF)switch(C){case f.OP_1NEGATE:case f.OP_1:case f.OP_2:case f.OP_3:case f.OP_4:case f.OP_5:case f.OP_6:case f.OP_7:case f.OP_8:case f.OP_9:case f.OP_10:case f.OP_11:case f.OP_12:case f.OP_13:case f.OP_14:case f.OP_15:case f.OP_16:m=C-(f.OP_1-1),a=new g(m).toScriptNumBuffer(),this.stack.push(a);break;case f.OP_NOP:break;case f.OP_NOP2:case f.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&k.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&k.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var D=g.fromScriptNumBuffer(this.stack[this.stack.length-1],z,5);if(D.lt(new g(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(D))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case f.OP_NOP1:case f.OP_NOP3:case f.OP_NOP4:case f.OP_NOP5:case f.OP_NOP6:case f.OP_NOP7:case f.OP_NOP8:case f.OP_NOP9:case f.OP_NOP10:if(this.flags&k.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case f.OP_IF:case f.OP_NOTIF:if(x=!1,A){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;a=this.stack.pop(),x=k.castToBool(a),C===f.OP_NOTIF&&(x=!x)}this.vfExec.push(x);break;case f.OP_ELSE:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case f.OP_ENDIF:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case f.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=this.stack[this.stack.length-1],x=k.castToBool(a),!x)return this.errstr="SCRIPT_ERR_VERIFY",!1;this.stack.pop();break;case f.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case f.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case f.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case f.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case f.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=this.stack[this.stack.length-2],c=this.stack[this.stack.length-1],this.stack.push(b),this.stack.push(c);break;case f.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=this.stack[this.stack.length-3],c=this.stack[this.stack.length-2];var E=this.stack[this.stack.length-1];this.stack.push(b),this.stack.push(c),this.stack.push(E);break;case f.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=this.stack[this.stack.length-4],c=this.stack[this.stack.length-3],this.stack.push(b),this.stack.push(c);break;case f.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=this.stack.splice(this.stack.length-6,2),this.stack.push(l[0]),this.stack.push(l[1]);break;case f.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=this.stack.splice(this.stack.length-4,2),this.stack.push(l[0]),this.stack.push(l[1]);break;case f.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=this.stack[this.stack.length-1],x=k.castToBool(a),x&&this.stack.push(a);break;case f.OP_DEPTH:a=new g(this.stack.length).toScriptNumBuffer(),this.stack.push(a);break;case f.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case f.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1]);break;case f.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case f.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2]);break;case f.OP_PICK:case f.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=this.stack[this.stack.length-1],p=g.fromScriptNumBuffer(a,z),m=p.toNumber(),this.stack.pop(),0>m||m>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=this.stack[this.stack.length-m-1],C===f.OP_ROLL&&this.stack.splice(this.stack.length-m-1,1),this.stack.push(a);break;case f.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var F=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=F,this.stack[this.stack.length-1]=n;break;case f.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=n;break;case f.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case f.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=new g(this.stack[this.stack.length-1].length),this.stack.push(p.toScriptNumBuffer());break;case f.OP_EQUAL:case f.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=this.stack[this.stack.length-2],c=this.stack[this.stack.length-1];var G=b.toString("hex")===c.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(G?k["true"]:k["false"]),C===f.OP_EQUALVERIFY){if(!G)return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;this.stack.pop()}break;case f.OP_1ADD:case f.OP_1SUB:case f.OP_NEGATE:case f.OP_ABS:case f.OP_NOT:case f.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(a=this.stack[this.stack.length-1],p=g.fromScriptNumBuffer(a,z),C){case f.OP_1ADD:p=p.add(g.One);break;case f.OP_1SUB:p=p.sub(g.One);break;case f.OP_NEGATE:p=p.neg();break;case f.OP_ABS:p.cmp(g.Zero)<0&&(p=p.neg());break;case f.OP_NOT:p=new g((0===p.cmp(g.Zero))+0);break;case f.OP_0NOTEQUAL:p=new g((0!==p.cmp(g.Zero))+0)}this.stack.pop(),this.stack.push(p.toScriptNumBuffer());break;case f.OP_ADD:case f.OP_SUB:case f.OP_BOOLAND:case f.OP_BOOLOR:case f.OP_NUMEQUAL:case f.OP_NUMEQUALVERIFY:case f.OP_NUMNOTEQUAL:case f.OP_LESSTHAN:case f.OP_GREATERTHAN:case f.OP_LESSTHANOREQUAL:case f.OP_GREATERTHANOREQUAL:case f.OP_MIN:case f.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(q=g.fromScriptNumBuffer(this.stack[this.stack.length-2],z),r=g.fromScriptNumBuffer(this.stack[this.stack.length-1],z),p=new g(0),C){case f.OP_ADD:p=q.add(r);break;case f.OP_SUB:p=q.sub(r);break;case f.OP_BOOLAND:p=new g((0!==q.cmp(g.Zero)&&0!==r.cmp(g.Zero))+0);break;case f.OP_BOOLOR:p=new g((0!==q.cmp(g.Zero)||0!==r.cmp(g.Zero))+0);break;case f.OP_NUMEQUAL:p=new g((0===q.cmp(r))+0);break;case f.OP_NUMEQUALVERIFY:p=new g((0===q.cmp(r))+0);break;case f.OP_NUMNOTEQUAL:p=new g((0!==q.cmp(r))+0);break;case f.OP_LESSTHAN:p=new g((q.cmp(r)<0)+0);break;case f.OP_GREATERTHAN:p=new g((q.cmp(r)>0)+0);break;case f.OP_LESSTHANOREQUAL:p=new g((q.cmp(r)<=0)+0);break;case f.OP_GREATERTHANOREQUAL:p=new g((q.cmp(r)>=0)+0);break;case f.OP_MIN:p=q.cmp(r)<0?q:r;break;case f.OP_MAX:p=q.cmp(r)>0?q:r}if(this.stack.pop(),this.stack.pop(),this.stack.push(p.toScriptNumBuffer()),C===f.OP_NUMEQUALVERIFY){if(!k.castToBool(this.stack[this.stack.length-1]))return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;this.stack.pop()}break;case f.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;q=g.fromScriptNumBuffer(this.stack[this.stack.length-3],z),r=g.fromScriptNumBuffer(this.stack[this.stack.length-2],z);var H=g.fromScriptNumBuffer(this.stack[this.stack.length-1],z);x=r.cmp(q)<=0&&q.cmp(H)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(x?k["true"]:k["false"]);break;case f.OP_RIPEMD160:case f.OP_SHA1:case f.OP_SHA256:case f.OP_HASH160:case f.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=this.stack[this.stack.length-1];var I;C===f.OP_RIPEMD160?I=h.ripemd160(a):C===f.OP_SHA1?I=h.sha1(a):C===f.OP_SHA256?I=h.sha256(a):C===f.OP_HASH160?I=h.sha256ripemd160(a):C===f.OP_HASH256&&(I=h.sha256sha256(a)),this.stack.pop(),this.stack.push(I);break;case f.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case f.OP_CHECKSIG:case f.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;s=this.stack[this.stack.length-2],t=this.stack[this.stack.length-1],u=(new e).set({chunks:this.script.chunks.slice(this.pbegincodehash)});var J=(new e).add(s);if(u.findAndDelete(J),!this.checkSignatureEncoding(s)||!this.checkPubkeyEncoding(t))return!1;try{v=i.fromTxFormat(s),w=j.fromBuffer(t,!1),y=this.tx.verifySignature(v,w,this.nin,u)}catch(K){y=!1}if(this.stack.pop(),this.stack.pop(),this.stack.push(y?k["true"]:k["false"]),C===f.OP_CHECKSIGVERIFY){if(!y)return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;this.stack.pop()}break;case f.OP_CHECKMULTISIG:case f.OP_CHECKMULTISIGVERIFY:var L=1;if(this.stack.lengthM||M>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=M,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var N=++L;if(L+=M,this.stack.lengthO||O>M)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var P=++L;if(L+=O,this.stack.lengthQ;Q++)s=this.stack[this.stack.length-P-Q],u.findAndDelete((new e).add(s));for(y=!0;y&&O>0;){if(s=this.stack[this.stack.length-P],t=this.stack[this.stack.length-N],!this.checkSignatureEncoding(s)||!this.checkPubkeyEncoding(t))return!1;var R;try{v=i.fromTxFormat(s),w=j.fromBuffer(t,!1),R=this.tx.verifySignature(v,w,this.nin,u)}catch(K){R=!1}R&&(P++,O--),N++,M--,O>M&&(y=!1)}for(;L-->1;)this.stack.pop();if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&k.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(y?k["true"]:k["false"]),C===f.OP_CHECKMULTISIGVERIFY){if(!y)return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;this.stack.pop()}break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"../crypto/hash":72,"../crypto/signature":75,"../opcode":87,"../publickey":89,"../transaction":93,"./script":92,buffer:191,lodash:432}],92:[function(a,b,c){(function(c){"use strict";var d=a("../address"),e=a("../encoding/bufferreader"),f=a("../encoding/bufferwriter"),g=a("../crypto/hash"),h=a("../opcode"),i=a("../publickey"),j=a("../crypto/signature"),k=a("../networks"),l=a("../util/preconditions"),m=a("lodash"),n=a("../errors"),o=a("buffer"),p=a("../util/buffer"),q=a("../util/js"),r=function s(a){return this instanceof s?(this.chunks=[],p.isBuffer(a)?s.fromBuffer(a):a instanceof d?s.fromAddress(a):a instanceof s?s.fromBuffer(a.toBuffer()):"string"==typeof a?s.fromString(a):void("undefined"!=typeof a&&this.set(a))):new s(a)};r.prototype.set=function(a){return this.chunks=a.chunks||this.chunks,this},r.fromBuffer=function(a){var b=new r;b.chunks=[];for(var c=new e(a);!c.finished();)try{var d,f,g=c.readUInt8();g>0&&g0&&i0&&(e=d?e+" "+a.buf.toString("hex"):e+" "+a.len+" 0x"+a.buf.toString("hex"));else if("undefined"!=typeof h.reverseMap[c])e=e+" "+h(c).toString();else{var f=c.toString(16);f.length%2!==0&&(f="0"+f),e=d?e+" "+f:e+" 0x"+f}return e},r.prototype.toASM=function(){for(var a="",b=0;b"},r.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==h.OP_DUP||this.chunks[1].opcodenum!==h.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==h.OP_EQUALVERIFY||this.chunks[4].opcodenum!==h.OP_CHECKSIG)},r.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var a=this.chunks[0].buf,b=this.chunks[1].buf;if(a&&a.length&&48===a[0]&&b&&b.length){var c=b[0];if((4===c||6===c||7===c)&&65===b.length)return!0;if((3===c||2===c)&&33===b.length)return!0}}return!1},r.prototype.getPublicKey=function(){return l.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},r.prototype.getPublicKeyHash=function(){return l.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},r.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===h.OP_CHECKSIG){var a=this.chunks[0].buf,b=a[0],c=!1;if(4!==b&&6!==b&&7!==b||65!==a.length?3!==b&&2!==b||33!==a.length||(c=!0):c=!0,c)return i.isValid(a)}return!1},r.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var a=this.chunks[0].buf;if(a&&a.length&&48===a[0])return!0}return!1},r.prototype.isScriptHashOut=function(){var a=this.toBuffer();return 23===a.length&&a[0]===h.OP_HASH160&&20===a[1]&&a[a.length-1]===h.OP_EQUAL},r.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var a=this.chunks[this.chunks.length-1],b=a.buf;if(!b)return!1;var c;try{c=r.fromBuffer(b)}catch(d){if(d instanceof n.Script.InvalidBuffer)return!1;throw d}var e=c.classify();return e!==r.types.UNKNOWN},r.prototype.isMultisigOut=function(){return this.chunks.length>3&&h.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(a){return a.buf&&p.isBuffer(a.buf)})&&h.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===h.OP_CHECKMULTISIG},r.prototype.isMultisigIn=function(){return this.chunks.length>=2&&0===this.chunks[0].opcodenum&&this.chunks.slice(1,this.chunks.length).every(function(a){return a.buf&&p.isBuffer(a.buf)&&j.isTxDER(a.buf)})},r.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===h.OP_RETURN&&(1===this.chunks.length||2===this.chunks.length&&this.chunks[1].buf&&this.chunks[1].buf.length<=r.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len)},r.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut())return new c(m.isUndefined(this.chunks[1])?0:this.chunks[1].buf);if(this.isPublicKeyHashOut())return new c(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},r.prototype.isPushOnly=function(){return m.every(this.chunks,function(a){return a.opcodenum<=h.OP_16})},r.types={},r.types.UNKNOWN="Unknown",r.types.PUBKEY_OUT="Pay to public key",r.types.PUBKEY_IN="Spend from public key",r.types.PUBKEYHASH_OUT="Pay to public key hash",r.types.PUBKEYHASH_IN="Spend from public key hash",r.types.SCRIPTHASH_OUT="Pay to script hash",r.types.SCRIPTHASH_IN="Spend from script hash",r.types.MULTISIG_OUT="Pay to multisig",r.types.MULTISIG_IN="Spend from multisig",r.types.DATA_OUT="Data push",r.OP_RETURN_STANDARD_SIZE=80,r.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var a=this.classifyOutput();return a!=r.types.UNKNOWN?a:this.classifyInput()},r.outputIdentifiers={},r.outputIdentifiers.PUBKEY_OUT=r.prototype.isPublicKeyOut,r.outputIdentifiers.PUBKEYHASH_OUT=r.prototype.isPublicKeyHashOut,r.outputIdentifiers.MULTISIG_OUT=r.prototype.isMultisigOut,r.outputIdentifiers.SCRIPTHASH_OUT=r.prototype.isScriptHashOut,r.outputIdentifiers.DATA_OUT=r.prototype.isDataOut,r.prototype.classifyOutput=function(){for(var a in r.outputIdentifiers)if(r.outputIdentifiers[a].bind(this)())return r.types[a];return r.types.UNKNOWN},r.inputIdentifiers={},r.inputIdentifiers.PUBKEY_IN=r.prototype.isPublicKeyIn,r.inputIdentifiers.PUBKEYHASH_IN=r.prototype.isPublicKeyHashIn,r.inputIdentifiers.MULTISIG_IN=r.prototype.isMultisigIn,r.inputIdentifiers.SCRIPTHASH_IN=r.prototype.isScriptHashIn,r.prototype.classifyInput=function(){for(var a in r.inputIdentifiers)if(r.inputIdentifiers[a].bind(this)())return r.types[a];return r.types.UNKNOWN},r.prototype.isStandard=function(){return this.classify()!==r.types.UNKNOWN},r.prototype.prepend=function(a){return this._addByType(a,!0),this},r.prototype.equals=function(a){if(l.checkState(a instanceof r,"Must provide another script"),this.chunks.length!==a.chunks.length)return!1;var b;for(b=0;b=0&&d=1&&c[0]<=16?d===h.OP_1+(c[0]-1):1===c.length&&129===c[0]?d===h.OP_1NEGATE:c.length<=75?d===c.length:c.length<=255?d===h.OP_PUSHDATA1:c.length<=65535?d===h.OP_PUSHDATA2:!0:!0},r.prototype._decodeOP_N=function(a){if(a===h.OP_0)return 0;if(a>=h.OP_1&&a<=h.OP_16)return a-(h.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(a))},r.prototype.getSignatureOperationsCount=function(a){a=m.isUndefined(a)?!0:a;var b=this,c=0,d=h.OP_INVALIDOPCODE;return m.each(b.chunks,function(e){var f=e.opcodenum;f==h.OP_CHECKSIG||f==h.OP_CHECKSIGVERIFY?c++:(f==h.OP_CHECKMULTISIG||f==h.OP_CHECKMULTISIGVERIFY)&&(c+=a&&d>=h.OP_1&&d<=h.OP_16?b._decodeOP_N(d):20),d=f}),c},b.exports=r}).call(this,a("buffer").Buffer)},{"../address":65,"../crypto/hash":72,"../crypto/signature":75,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../errors":81,"../networks":86,"../opcode":87,"../publickey":89,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,buffer:191,lodash:432}],93:[function(a,b,c){b.exports=a("./transaction"),b.exports.Input=a("./input"),b.exports.Output=a("./output"),b.exports.UnspentOutput=a("./unspentoutput"),b.exports.Signature=a("./signature"),b.exports.Sighash=a("./sighash")},{"./input":94,"./output":100,"./sighash":101,"./signature":102,"./transaction":103,"./unspentoutput":104}],94:[function(a,b,c){b.exports=a("./input"),b.exports.PublicKey=a("./publickey"),b.exports.PublicKeyHash=a("./publickeyhash"),b.exports.MultiSig=a("./multisig.js"),b.exports.MultiSigScriptHash=a("./multisigscripthash.js")},{"./input":95,"./multisig.js":96,"./multisigscripthash.js":97,"./publickey":98,"./publickeyhash":99}],95:[function(a,b,c){"use strict";function d(a){return this instanceof d?a?this._fromObject(a):void 0:new d(a)}var e=a("lodash"),f=a("../../util/preconditions"),g=a("../../errors"),h=a("../../encoding/bufferwriter"),i=a("buffer"),j=a("../../util/buffer"),k=a("../../util/js"),l=a("../../script"),m=a("../sighash"),n=a("../output"),o=4294967295,p=o-2,q=o,r=o-1;d.MAXINT=o,d.DEFAULT_SEQNUMBER=q,d.DEFAULT_LOCKTIME_SEQNUMBER=r,d.DEFAULT_RBF_SEQNUMBER=p,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new l(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(a){f.checkArgument(e.isObject(a));var b=new d;return b._fromObject(a)},d.prototype._fromObject=function(a){var b;if(b=e.isString(a.prevTxId)&&k.isHexa(a.prevTxId)?new i.Buffer(a.prevTxId,"hex"):a.prevTxId,this.output=a.output?a.output instanceof n?a.output:new n(a.output):void 0,this.prevTxId=b||a.txidbuf,this.outputIndex=e.isUndefined(a.outputIndex)?a.txoutnum:a.outputIndex,this.sequenceNumber=e.isUndefined(a.sequenceNumber)?e.isUndefined(a.seqnum)?q:a.seqnum:a.sequenceNumber,e.isUndefined(a.script)&&e.isUndefined(a.scriptBuffer))throw new g.Transaction.Input.MissingScript;return this.setScript(a.scriptBuffer||a.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var a={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(a.scriptString=this.script.toString()),this.output&&(a.output=this.output.toObject()),a},d.fromBufferReader=function(a){var b=new d;return b.prevTxId=a.readReverse(32),b.outputIndex=a.readUInt32LE(),b._scriptBuffer=a.readVarLengthBuffer(),b.sequenceNumber=a.readUInt32LE(),b},d.prototype.toBufferWriter=function(a){a||(a=new h),a.writeReverse(this.prevTxId),a.writeUInt32LE(this.outputIndex);var b=this._scriptBuffer;return a.writeVarintNum(b.length),a.write(b),a.writeUInt32LE(this.sequenceNumber),a},d.prototype.setScript=function(a){if(this._script=null,a instanceof l)this._script=a,this._script._isInput=!0,this._scriptBuffer=a.toBuffer();else if(k.isHexa(a))this._scriptBuffer=new i.Buffer(a,"hex");else if(e.isString(a))this._script=new l(a),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!j.isBuffer(a))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new i.Buffer(a)}return this},d.prototype.getSignatures=function(){throw new g.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new g.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new g.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new g.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(a,b){return b.signature.nhashtype=b.sigtype, m.verify(a,b.signature,b.publicKey,b.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},b.exports=d},{"../../encoding/bufferwriter":79,"../../errors":81,"../../script":90,"../../util/buffer":107,"../../util/js":108,"../../util/preconditions":109,"../output":100,"../sighash":101,buffer:191,lodash:432}],96:[function(a,b,c){"use strict";function d(a,b,c,d){g.apply(this,arguments);var f=this;b=b||a.publicKeys,c=c||a.threshold,d=d||a.signatures,this.publicKeys=e.sortBy(b,function(a){return a.toString("hex")}),i.checkState(j.buildMultisigOut(this.publicKeys,c).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},e.each(this.publicKeys,function(a,b){f.publicKeyIndex[a.toString()]=b}),this.threshold=c,this.signatures=d?this._deserializeSignatures(d):new Array(this.publicKeys.length)}var e=a("lodash"),f=a("inherits"),g=(a("../transaction"),a("./input")),h=a("../output"),i=a("../../util/preconditions"),j=a("../../script"),k=a("../../crypto/signature"),l=a("../sighash"),m=(a("../../publickey"),a("../../util/buffer")),n=a("../signature");f(d,g),d.prototype.toObject=function(){var a=g.prototype.toObject.apply(this,arguments);return a.threshold=this.threshold,a.publicKeys=e.map(this.publicKeys,function(a){return a.toString()}),a.signatures=this._serializeSignatures(),a},d.prototype._deserializeSignatures=function(a){return e.map(a,function(a){return a?new n(a):void 0})},d.prototype._serializeSignatures=function(){return e.map(this.signatures,function(a){return a?a.toObject():void 0})},d.prototype.getSignatures=function(a,b,c,d){i.checkState(this.output instanceof h),d=d||k.SIGHASH_ALL;var f=this,g=[];return e.each(this.publicKeys,function(e){e.toString()===b.publicKey.toString()&&g.push(new n({publicKey:b.publicKey,prevTxId:f.prevTxId,outputIndex:f.outputIndex,inputIndex:c,signature:l.sign(a,b,d,c,f.output.script),sigtype:d}))}),g},d.prototype.addSignature=function(a,b){return i.checkState(!this.isFullySigned(),"All needed signatures have already been added"),i.checkArgument(!e.isUndefined(this.publicKeyIndex[b.publicKey.toString()]),"Signature has no matching public key"),i.checkState(this.isValidSignature(a,b)),this.signatures[this.publicKeyIndex[b.publicKey.toString()]]=b,this._updateScript(),this},d.prototype._updateScript=function(){return this.setScript(j.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},d.prototype._createSignatures=function(){return e.map(e.filter(this.signatures,function(a){return!e.isUndefined(a)}),function(a){return m.concat([a.signature.toDER(),m.integerAsSingleByteBuffer(a.sigtype)])})},d.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},d.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},d.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},d.prototype.countSignatures=function(){return e.reduce(this.signatures,function(a,b){return a+!!b},0)},d.prototype.publicKeysWithoutSignature=function(){var a=this;return e.filter(this.publicKeys,function(b){return!a.signatures[a.publicKeyIndex[b.toString()]]})},d.prototype.isValidSignature=function(a,b){return b.signature.nhashtype=b.sigtype,l.verify(a,b.signature,b.publicKey,b.inputIndex,this.output.script)},d.normalizeSignatures=function(a,b,c,d,e){return e.map(function(e){var f=null;return d=d.filter(function(d){if(f)return!0;var g=new n({signature:k.fromTxFormat(d),publicKey:e,prevTxId:b.prevTxId,outputIndex:b.outputIndex,inputIndex:c,sigtype:k.SIGHASH_ALL});g.signature.nhashtype=g.sigtype;var h=l.verify(a,g.signature,g.publicKey,g.inputIndex,b.output.script);return h?(f=g,!1):!0}),f?f:null})},d.OPCODES_SIZE=1,d.SIGNATURE_SIZE=73,d.prototype._estimateSize=function(){return d.OPCODES_SIZE+this.threshold*d.SIGNATURE_SIZE},b.exports=d},{"../../crypto/signature":75,"../../publickey":89,"../../script":90,"../../util/buffer":107,"../../util/preconditions":109,"../output":100,"../sighash":101,"../signature":102,"../transaction":103,"./input":95,inherits:134,lodash:432}],97:[function(a,b,c){"use strict";function d(a,b,c,d){g.apply(this,arguments);var f=this;b=b||a.publicKeys,c=c||a.threshold,d=d||a.signatures,this.publicKeys=e.sortBy(b,function(a){return a.toString("hex")}),this.redeemScript=j.buildMultisigOut(this.publicKeys,c),i.checkState(j.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},e.each(this.publicKeys,function(a,b){f.publicKeyIndex[a.toString()]=b}),this.threshold=c,this.signatures=d?this._deserializeSignatures(d):new Array(this.publicKeys.length)}var e=a("lodash"),f=a("inherits"),g=a("./input"),h=a("../output"),i=a("../../util/preconditions"),j=a("../../script"),k=a("../../crypto/signature"),l=a("../sighash"),m=(a("../../publickey"),a("../../util/buffer")),n=a("../signature");f(d,g),d.prototype.toObject=function(){var a=g.prototype.toObject.apply(this,arguments);return a.threshold=this.threshold,a.publicKeys=e.map(this.publicKeys,function(a){return a.toString()}),a.signatures=this._serializeSignatures(),a},d.prototype._deserializeSignatures=function(a){return e.map(a,function(a){return a?new n(a):void 0})},d.prototype._serializeSignatures=function(){return e.map(this.signatures,function(a){return a?a.toObject():void 0})},d.prototype.getSignatures=function(a,b,c,d){i.checkState(this.output instanceof h),d=d||k.SIGHASH_ALL;var f=this,g=[];return e.each(this.publicKeys,function(e){e.toString()===b.publicKey.toString()&&g.push(new n({publicKey:b.publicKey,prevTxId:f.prevTxId,outputIndex:f.outputIndex,inputIndex:c,signature:l.sign(a,b,d,c,f.redeemScript),sigtype:d}))}),g},d.prototype.addSignature=function(a,b){return i.checkState(!this.isFullySigned(),"All needed signatures have already been added"),i.checkArgument(!e.isUndefined(this.publicKeyIndex[b.publicKey.toString()]),"Signature has no matching public key"),i.checkState(this.isValidSignature(a,b)),this.signatures[this.publicKeyIndex[b.publicKey.toString()]]=b,this._updateScript(),this},d.prototype._updateScript=function(){return this.setScript(j.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},d.prototype._createSignatures=function(){return e.map(e.filter(this.signatures,function(a){return!e.isUndefined(a)}),function(a){return m.concat([a.signature.toDER(),m.integerAsSingleByteBuffer(a.sigtype)])})},d.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},d.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},d.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},d.prototype.countSignatures=function(){return e.reduce(this.signatures,function(a,b){return a+!!b},0)},d.prototype.publicKeysWithoutSignature=function(){var a=this;return e.filter(this.publicKeys,function(b){return!a.signatures[a.publicKeyIndex[b.toString()]]})},d.prototype.isValidSignature=function(a,b){return b.signature.nhashtype=b.sigtype,l.verify(a,b.signature,b.publicKey,b.inputIndex,this.redeemScript)},d.OPCODES_SIZE=7,d.SIGNATURE_SIZE=74,d.PUBKEY_SIZE=34,d.prototype._estimateSize=function(){return d.OPCODES_SIZE+this.threshold*d.SIGNATURE_SIZE+this.publicKeys.length*d.PUBKEY_SIZE},b.exports=d},{"../../crypto/signature":75,"../../publickey":89,"../../script":90,"../../util/buffer":107,"../../util/preconditions":109,"../output":100,"../sighash":101,"../signature":102,"./input":95,inherits:134,lodash:432}],98:[function(a,b,c){"use strict";function d(){g.apply(this,arguments)}var e=a("inherits"),f=a("../../util/preconditions"),g=(a("../../util/buffer"),a("./input")),h=a("../output"),i=a("../sighash"),j=a("../../script"),k=a("../../crypto/signature"),l=a("../signature");e(d,g),d.prototype.getSignatures=function(a,b,c,d){f.checkState(this.output instanceof h),d=d||k.SIGHASH_ALL;var e=b.toPublicKey();return e.toString()===this.output.script.getPublicKey().toString("hex")?[new l({publicKey:e,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:c,signature:i.sign(a,b,d,c,this.output.script),sigtype:d})]:[]},d.prototype.addSignature=function(a,b){return f.checkState(this.isValidSignature(a,b),"Signature is invalid"),this.setScript(j.buildPublicKeyIn(b.signature.toDER(),b.sigtype)),this},d.prototype.clearSignatures=function(){return this.setScript(j.empty()),this},d.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},d.SCRIPT_MAX_SIZE=73,d.prototype._estimateSize=function(){return d.SCRIPT_MAX_SIZE},b.exports=d},{"../../crypto/signature":75,"../../script":90,"../../util/buffer":107,"../../util/preconditions":109,"../output":100,"../sighash":101,"../signature":102,"./input":95,inherits:134}],99:[function(a,b,c){"use strict";function d(){i.apply(this,arguments)}var e=a("inherits"),f=a("../../util/preconditions"),g=a("../../util/buffer"),h=a("../../crypto/hash"),i=a("./input"),j=a("../output"),k=a("../sighash"),l=a("../../script"),m=a("../../crypto/signature"),n=a("../signature");e(d,i),d.prototype.getSignatures=function(a,b,c,d,e){return f.checkState(this.output instanceof j),e=e||h.sha256ripemd160(b.publicKey.toBuffer()),d=d||m.SIGHASH_ALL,g.equals(e,this.output.script.getPublicKeyHash())?[new n({publicKey:b.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:c,signature:k.sign(a,b,d,c,this.output.script),sigtype:d})]:[]},d.prototype.addSignature=function(a,b){return f.checkState(this.isValidSignature(a,b),"Signature is invalid"),this.setScript(l.buildPublicKeyHashIn(b.publicKey,b.signature.toDER(),b.sigtype)),this},d.prototype.clearSignatures=function(){return this.setScript(l.empty()),this},d.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},d.SCRIPT_MAX_SIZE=107,d.prototype._estimateSize=function(){return d.SCRIPT_MAX_SIZE},b.exports=d},{"../../crypto/hash":72,"../../crypto/signature":75,"../../script":90,"../../util/buffer":107,"../../util/preconditions":109,"../output":100,"../sighash":101,"../signature":102,"./input":95,inherits:134}],100:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);if(!e.isObject(a))throw new TypeError("Unrecognized argument for Output");if(this.satoshis=a.satoshis,h.isBuffer(a.script))this._scriptBuffer=a.script;else{var b;b=e.isString(a.script)&&i.isHexa(a.script)?new g.Buffer(a.script,"hex"):a.script,this.setScript(b)}}var e=a("lodash"),f=a("../crypto/bn"),g=a("buffer"),h=a("../util/buffer"),i=a("../util/js"),j=a("../encoding/bufferwriter"),k=a("../script"),l=a("../util/preconditions"),m=a("../errors"),n=9007199254740991;Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}}),Object.defineProperty(d.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(a){a instanceof f?(this._satoshisBN=a,this._satoshis=a.toNumber()):e.isString(a)?(this._satoshis=parseInt(a),this._satoshisBN=f.fromNumber(this._satoshis)):(l.checkArgument(i.isNaturalNumber(a),"Output satoshis is not a natural number"),this._satoshisBN=f.fromNumber(a),this._satoshis=a),l.checkState(i.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),d.prototype.invalidSatoshis=function(){return this._satoshis>n?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1},d.prototype.toObject=d.prototype.toJSON=function(){var a={satoshis:this.satoshis};return a.script=this._scriptBuffer.toString("hex"),a},d.fromObject=function(a){return new d(a)},d.prototype.setScriptFromBuffer=function(a){this._scriptBuffer=a;try{this._script=k.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(b){if(!(b instanceof m.Script.InvalidBuffer))throw b;this._script=null}},d.prototype.setScript=function(a){if(a instanceof k)this._scriptBuffer=a.toBuffer(),this._script=a,this._script._isOutput=!0;else if(e.isString(a))this._script=k.fromString(a),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else{if(!h.isBuffer(a))throw new TypeError("Invalid argument type: script");this.setScriptFromBuffer(a)}return this},d.prototype.inspect=function(){var a;return a=this.script?this.script.inspect():this._scriptBuffer.toString("hex"),""},d.fromBufferReader=function(a){var b={};b.satoshis=a.readUInt64LEBN();var c=a.readVarintNum();return 0!==c?b.script=a.read(c):b.script=new g.Buffer([]),new d(b)},d.prototype.toBufferWriter=function(a){a||(a=new j),a.writeUInt64LEBN(this._satoshisBN);var b=this._scriptBuffer;return a.writeVarintNum(b.length),a.write(b),a},b.exports=d},{"../crypto/bn":70,"../encoding/bufferwriter":79,"../errors":81,"../script":90,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,buffer:191,lodash:432}],101:[function(a,b,c){(function(c){"use strict";function d(a,b,c,d,e){var f=s(a,c,d,e),g=n.sign(f,b,"little").set({nhashtype:c});return g}function e(a,b,c,d,e){o.checkArgument(!p.isUndefined(a)),o.checkArgument(!p.isUndefined(b)&&!p.isUndefined(b.nhashtype));var f=s(a,b.nhashtype,d,e);return n.verify(f,b,c,"little")}var f=a("buffer"),g=a("../crypto/signature"),h=a("../script"),i=a("./output"),j=a("../encoding/bufferreader"),k=a("../encoding/bufferwriter"),l=a("../crypto/bn"),m=a("../crypto/hash"),n=a("../crypto/ecdsa"),o=a("../util/preconditions"),p=a("lodash"),q="0000000000000000000000000000000000000000000000000000000000000001",r="ffffffffffffffff",s=function(b,d,e,n){var o,p=a("./transaction"),s=a("./input"),t=p.shallowCopy(b);for(n=new h(n),n.removeCodeseparators(),o=0;o=t.outputs.length)return new c(q,"hex");for(t.outputs.length=e+1,o=0;e>o;o++)t.outputs[o]=new i({satoshis:l.fromBuffer(new f.Buffer(r,"hex")),script:h.empty()})}d&g.SIGHASH_ANYONECANPAY&&(t.inputs=[t.inputs[e]]);var u=(new k).write(t.toBuffer()).writeInt32LE(d).toBuffer(),v=m.sha256sha256(u);return v=new j(v).readReverse()};b.exports={sighash:s,sign:d,verify:e}}).call(this,a("buffer").Buffer)},{"../crypto/bn":70,"../crypto/ecdsa":71,"../crypto/hash":72,"../crypto/signature":75,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../script":90,"../util/preconditions":109,"./input":94,"./output":100,"./transaction":103,buffer:191,lodash:432}],102:[function(a,b,c){(function(c){"use strict";function d(a){if(!(this instanceof d))return new d(a);if(a instanceof d)return a;if(e.isObject(a))return this._fromObject(a);throw new k.InvalidArgument("TransactionSignatures must be instantiated from an object")}var e=a("lodash"),f=a("../util/preconditions"),g=a("inherits"),h=a("../util/buffer"),i=a("../util/js"),j=a("../publickey"),k=a("../errors"),l=a("../crypto/signature");g(d,l),d.prototype._fromObject=function(a){return this._checkObjectArgs(a),this.publicKey=new j(a.publicKey),this.prevTxId=h.isBuffer(a.prevTxId)?a.prevTxId:new c(a.prevTxId,"hex"),this.outputIndex=a.outputIndex,this.inputIndex=a.inputIndex,this.signature=a.signature instanceof l?a.signature:h.isBuffer(a.signature)?l.fromBuffer(a.signature):l.fromString(a.signature),this.sigtype=a.sigtype,this},d.prototype._checkObjectArgs=function(a){f.checkArgument(j(a.publicKey),"publicKey"),f.checkArgument(!e.isUndefined(a.inputIndex),"inputIndex"),f.checkArgument(!e.isUndefined(a.outputIndex),"outputIndex"),f.checkState(e.isNumber(a.inputIndex),"inputIndex must be a number"),f.checkState(e.isNumber(a.outputIndex),"outputIndex must be a number"),f.checkArgument(a.signature,"signature"),f.checkArgument(a.prevTxId,"prevTxId"),f.checkState(a.signature instanceof l||h.isBuffer(a.signature)||i.isHexa(a.signature),"signature must be a buffer or hexa value"),f.checkState(h.isBuffer(a.prevTxId)||i.isHexa(a.prevTxId),"prevTxId must be a buffer or hexa value"),f.checkArgument(a.sigtype,"sigtype"),f.checkState(e.isNumber(a.sigtype),"sigtype must be a number")},d.prototype.toObject=d.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}},d.fromObject=function(a){return f.checkArgument(a),new d(a)},b.exports=d}).call(this,a("buffer").Buffer)},{"../crypto/signature":75,"../errors":81,"../publickey":89,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,buffer:191,inherits:134,lodash:432}],103:[function(a,b,c){(function(c){"use strict";function d(a){if(!(this instanceof d))return new d(a);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,a){if(a instanceof d)return d.shallowCopy(a);if(k.isHexa(a))this.fromString(a);else if(j.isBuffer(a))this.fromBuffer(a);else{if(!e.isObject(a))throw new i.InvalidArgument("Must provide an object or string to deserialize a transaction");this.fromObject(a)}}else this._newTransaction()}var e=a("lodash"),f=a("../util/preconditions"),g=a("buffer"),h=c.compare||a("buffer-compare"),i=a("../errors"),j=a("../util/buffer"),k=a("../util/js"),l=a("../encoding/bufferreader"),m=a("../encoding/bufferwriter"),n=a("../crypto/hash"),o=a("../crypto/signature"),p=a("./sighash"),q=a("../address"),r=a("./unspentoutput"),s=a("./input"),t=s.PublicKeyHash,u=s.PublicKey,v=s.MultiSigScriptHash,w=s.MultiSig,x=a("./output"),y=a("../script"),z=a("../privatekey"),A=a("../crypto/bn"),B=1,C=0,D=1e6;d.DUST_AMOUNT=546,d.FEE_SECURITY_MARGIN=15,d.MAX_MONEY=21e14,d.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,d.NLOCKTIME_MAX_VALUE=4294967295,d.FEE_PER_KB=1e4,d.CHANGE_OUTPUT_MAX_SIZE=62,d.MAXIMUM_EXTRA_SIZE=26,d.shallowCopy=function(a){var b=new d(a.toBuffer());return b};var E={configurable:!1,enumerable:!0,get:function(){return new l(this._getHash()).readReverse().toString("hex")}};Object.defineProperty(d.prototype,"hash",E),Object.defineProperty(d.prototype,"id",E);var F={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(d.prototype,"inputAmount",F),F.get=function(){return this._getOutputAmount()},Object.defineProperty(d.prototype,"outputAmount",F),d.prototype._getHash=function(){return n.sha256sha256(this.toBuffer())},d.prototype.serialize=function(a){return!0===a||a&&a.disableAll?this.uncheckedSerialize():this.checkedSerialize(a)},d.prototype.uncheckedSerialize=d.prototype.toString=function(){return this.toBuffer().toString("hex")},d.prototype.checkedSerialize=function(a){var b=this.getSerializationError(a);if(b)throw b.message+=" Use Transaction#uncheckedSerialize if you want to skip security checks. See http://bitcore.io/guide/transaction.html#Serialization for more info.",b;return this.uncheckedSerialize()},d.prototype.invalidSatoshis=function(){for(var a=!1,b=0;bc?a.disableMoreOutputThanInput||(b=new i.Transaction.InvalidOutputAmountSum):b=this._hasFeeError(a,c),b||this._hasDustOutputs(a)||this._isMissingSignatures(a)},d.prototype._hasFeeError=function(a,b){if(!e.isUndefined(this._fee)&&this._fee!==b)return new i.Transaction.FeeError.Different("Unspent value is "+b+" but specified fee is "+this._fee);if(!a.disableLargeFees){var c=Math.floor(d.FEE_SECURITY_MARGIN*this._estimateFee());if(b>c)return this._missingChange()?new i.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new i.Transaction.FeeError.TooLarge("expected less than "+c+" but got "+b)}if(!a.disableSmallFees){var f=Math.ceil(this._estimateFee()/d.FEE_SECURITY_MARGIN);if(f>b)return new i.Transaction.FeeError.TooSmall("expected more than "+f+" but got "+b)}},d.prototype._missingChange=function(){return!this._changeScript},d.prototype._hasDustOutputs=function(a){if(!a.disableDustOutputs){var b,c;for(b in this.outputs)if(c=this.outputs[b],c.satoshis"},d.prototype.toBuffer=function(){var a=new m;return this.toBufferWriter(a).toBuffer()},d.prototype.toBufferWriter=function(a){return a.writeUInt32LE(this.version),a.writeVarintNum(this.inputs.length),e.each(this.inputs,function(b){b.toBufferWriter(a)}),a.writeVarintNum(this.outputs.length),e.each(this.outputs,function(b){b.toBufferWriter(a)}),a.writeUInt32LE(this.nLockTime),a},d.prototype.fromBuffer=function(a){var b=new l(a);return this.fromBufferReader(b)},d.prototype.fromBufferReader=function(a){f.checkArgument(!a.finished(),"No transaction data received");var b,c,d;for(this.version=a.readUInt32LE(),c=a.readVarintNum(),b=0;c>b;b++){var e=s.fromBufferReader(a);this.inputs.push(e)}for(d=a.readVarintNum(),b=0;d>b;b++)this.outputs.push(x.fromBufferReader(a));return this.nLockTime=a.readUInt32LE(),this},d.prototype.toObject=d.prototype.toJSON=function(){var a=[];this.inputs.forEach(function(b){a.push(b.toObject())});var b=[];this.outputs.forEach(function(a){b.push(a.toObject())});var c={hash:this.hash,version:this.version,inputs:a,outputs:b,nLockTime:this.nLockTime};return this._changeScript&&(c.changeScript=this._changeScript.toString()),e.isUndefined(this._changeIndex)||(c.changeIndex=this._changeIndex),e.isUndefined(this._fee)||(c.fee=this._fee),c},d.prototype.fromObject=function(a){f.checkArgument(e.isObject(a)||a instanceof d);var b,c=this;return b=a instanceof d?b.toObject():a,e.each(b.inputs,function(a){if(!a.output||!a.output.script)return void c.uncheckedAddInput(new s(a));var b,d=new y(a.output.script);if(d.isPublicKeyHashOut())b=new s.PublicKeyHash(a);else if(d.isScriptHashOut()&&a.publicKeys&&a.threshold)b=new s.MultiSigScriptHash(a,a.publicKeys,a.threshold,a.signatures);else{if(!d.isPublicKeyOut())throw new i.Transaction.Input.UnsupportedScript(a.output.script);b=new s.PublicKey(a)}c.addInput(b)}),e.each(b.outputs,function(a){c.addOutput(new x(a))}),b.changeIndex&&(this._changeIndex=b.changeIndex),b.changeScript&&(this._changeScript=new y(b.changeScript)),b.fee&&(this._fee=b.fee),this.nLockTime=b.nLockTime,this.version=b.version,this._checkConsistency(a),this},d.prototype._checkConsistency=function(a){e.isUndefined(this._changeIndex)||(f.checkState(this._changeScript),f.checkState(this.outputs[this._changeIndex]),f.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString())),a&&a.hash&&f.checkState(a.hash===this.hash,"Hash in object does not match transaction hash")},d.prototype.lockUntilDate=function(a){if(f.checkArgument(a),e.isNumber(a)&&a=d.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new i.Transaction.BlockHeightTooHigh;if(0>a)throw new i.Transaction.NLockTimeOutOfRange;for(var b=0;b0?(this._changeIndex=this.outputs.length,this._addOutput(new x({script:this._changeScript,satoshis:c}))):this._changeIndex=void 0}},d.prototype.getFee=function(){return this.isCoinbase()?0:e.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee},d.prototype._estimateFee=function(){var a=this._estimateSize(),b=this._getUnspentValue();return d._estimateFee(a,b,this._feePerKb)},d.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},d.prototype._clearSignatures=function(){e.each(this.inputs,function(a){a.clearSignatures()})},d._estimateFee=function(a,b,c){var e=Math.ceil(a/1e3)*(c||d.FEE_PER_KB);return b>e&&(a+=d.CHANGE_OUTPUT_MAX_SIZE),Math.ceil(a/1e3)*(c||d.FEE_PER_KB)},d.prototype._estimateSize=function(){var a=d.MAXIMUM_EXTRA_SIZE;return e.each(this.inputs,function(b){a+=b._estimateSize()}),e.each(this.outputs,function(b){a+=b.script.toBuffer().length+9}),a},d.prototype._removeOutput=function(a){var b=this.outputs[a];this.outputs=e.without(this.outputs,b),this._outputAmount=void 0},d.prototype.removeOutput=function(a){this._removeOutput(a),this._updateChangeOutput()},d.prototype.sort=function(){return this.sortInputs(function(a){var b=Array.prototype.concat.apply([],a);return b.sort(function(a,b){return h(a.prevTxId,b.prevTxId)||a.outputIndex-b.outputIndex}),b}),this.sortOutputs(function(a){var b=Array.prototype.concat.apply([],a);return b.sort(function(a,b){return a.satoshis-b.satoshis||h(a.script.toBuffer(),b.script.toBuffer())}),b}),this},d.prototype.shuffleOutputs=function(){return this.sortOutputs(e.shuffle)},d.prototype.sortOutputs=function(a){var b=a(this.outputs);return this._newOutputOrder(b)},d.prototype.sortInputs=function(a){return this.inputs=a(this.inputs),this._clearSignatures(),this},d.prototype._newOutputOrder=function(a){var b=this.outputs.length!==a.length||0!==e.difference(this.outputs,a).length;if(b)throw new i.Transaction.InvalidSorting;if(!e.isUndefined(this._changeIndex)){var c=this.outputs[this._changeIndex];this._changeIndex=e.findIndex(a,c)}return this.outputs=a,this},d.prototype.removeInput=function(a,b){var c;if(c=!b&&e.isNumber(a)?a:e.findIndex(this.inputs,function(c){return c.prevTxId.toString("hex")===a&&c.outputIndex===b}),0>c||c>=this.inputs.length)throw new i.Transaction.InvalidIndex(c,this.inputs.length);var d=this.inputs[c];this.inputs=e.without(this.inputs,d),this._inputAmount=void 0,this._updateChangeOutput()},d.prototype.sign=function(a,b){f.checkState(this.hasAllUtxoInfo());var c=this;return e.isArray(a)?(e.each(a,function(a){c.sign(a,b)}),this):(e.each(this.getSignatures(a,b),function(a){c.applySignature(a)}),this)},d.prototype.getSignatures=function(a,b){a=new z(a),b=b||o.SIGHASH_ALL;var c=this,d=[],f=n.sha256ripemd160(a.publicKey.toBuffer());return e.each(this.inputs,function(g,h){e.each(g.getSignatures(c,a,h,b,f),function(a){d.push(a)})}),d},d.prototype.applySignature=function(a){return this.inputs[a.inputIndex].addSignature(this,a),this},d.prototype.isFullySigned=function(){return e.each(this.inputs,function(a){if(a.isFullySigned===s.prototype.isFullySigned)throw new i.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),e.all(e.map(this.inputs,function(a){return a.isFullySigned()}))},d.prototype.isValidSignature=function(a){var b=this;if(this.inputs[a.inputIndex].isValidSignature===s.prototype.isValidSignature)throw new i.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[a.inputIndex].isValidSignature(b,a)},d.prototype.verifySignature=function(a,b,c,d){return p.verify(this,a,b,c,d); },d.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var a=new A(0),b=0;bD)return"transaction over the maximum block size";var f={};for(b=0;b100)return"coinbase transaction script size invalid"}else for(b=0;b=s.MAXINT-1&&(b.sequenceNumber=s.DEFAULT_RBF_SEQNUMBER)}return this},b.exports=d}).call(this,a("buffer").Buffer)},{"../address":65,"../crypto/bn":70,"../crypto/hash":72,"../crypto/signature":75,"../encoding/bufferreader":78,"../encoding/bufferwriter":79,"../errors":81,"../privatekey":88,"../script":90,"../util/buffer":107,"../util/js":108,"../util/preconditions":109,"./input":94,"./output":100,"./sighash":101,"./unspentoutput":104,buffer:191,"buffer-compare":112,lodash:432}],104:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);f.checkArgument(e.isObject(a),"Must provide an object from where to extract data");var b=a.address?new i(a.address):void 0,c=a.txid?a.txid:a.txId;if(!c||!g.isHexaString(c)||c.length>64)throw new Error("Invalid TXID in object",a);var k=e.isUndefined(a.vout)?a.outputIndex:a.vout;if(!e.isNumber(k))throw new Error("Invalid outputIndex, received "+k);f.checkArgument(!e.isUndefined(a.scriptPubKey)||!e.isUndefined(a.script),"Must provide the scriptPubKey for that output!");var l=new h(a.scriptPubKey||a.script);f.checkArgument(!e.isUndefined(a.amount)||!e.isUndefined(a.satoshis),"Must provide an amount for the output");var m=e.isUndefined(a.amount)?a.satoshis:new j.fromBTC(a.amount).toSatoshis();f.checkArgument(e.isNumber(m),"Amount must be a number"),g.defineImmutable(this,{address:b,txId:c,outputIndex:k,script:l,satoshis:m})}var e=a("lodash"),f=a("../util/preconditions"),g=a("../util/js"),h=a("../script"),i=a("../address"),j=a("../unit");d.prototype.inspect=function(){return""},d.prototype.toString=function(){return this.txId+":"+this.outputIndex},d.fromObject=function(a){return new d(a)},d.prototype.toObject=d.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:j.fromSatoshis(this.satoshis).toBTC()}},b.exports=d},{"../address":65,"../script":90,"../unit":105,"../util/js":108,"../util/preconditions":109,lodash:432}],105:[function(a,b,c){"use strict";function d(a,b){if(!(this instanceof d))return new d(a,b);if(e.isNumber(b)){if(0>=b)throw new f.Unit.InvalidRate(b);a/=b,b=d.BTC}this._value=this._from(a,b);var c=this,g=function(a){Object.defineProperty(c,a,{get:function(){return c.to(a)},enumerable:!0})};Object.keys(h).forEach(g)}var e=a("lodash"),f=a("./errors"),g=a("./util/preconditions"),h={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};Object.keys(h).forEach(function(a){d[a]=a}),d.fromObject=function(a){return g.checkArgument(e.isObject(a),"Argument is expected to be an object"),new d(a.amount,a.code)},d.fromBTC=function(a){return new d(a,d.BTC)},d.fromMillis=d.fromMilis=function(a){return new d(a,d.mBTC)},d.fromMicros=d.fromBits=function(a){return new d(a,d.bits)},d.fromSatoshis=function(a){return new d(a,d.satoshis)},d.fromFiat=function(a,b){return new d(a,b)},d.prototype._from=function(a,b){if(!h[b])throw new f.Unit.UnknownCode(b);return parseInt((a*h[b][0]).toFixed())},d.prototype.to=function(a){if(e.isNumber(a)){if(0>=a)throw new f.Unit.InvalidRate(a);return parseFloat((this.BTC*a).toFixed(2))}if(!h[a])throw new f.Unit.UnknownCode(a);var b=this._value/h[a][0];return parseFloat(b.toFixed(h[a][1]))},d.prototype.toBTC=function(){return this.to(d.BTC)},d.prototype.toMillis=d.prototype.toMilis=function(){return this.to(d.mBTC)},d.prototype.toMicros=d.prototype.toBits=function(){return this.to(d.bits)},d.prototype.toSatoshis=function(){return this.to(d.satoshis)},d.prototype.atRate=function(a){return this.to(a)},d.prototype.toString=function(){return this.satoshis+" satoshis"},d.prototype.toObject=d.prototype.toJSON=function(){return{amount:this.BTC,code:d.BTC}},d.prototype.inspect=function(){return""},b.exports=d},{"./errors":81,"./util/preconditions":109,lodash:432}],106:[function(a,b,c){"use strict";var d=a("lodash"),e=a("url"),f=a("./address"),g=a("./unit"),h=function(a,b){if(!(this instanceof h))return new h(a,b);if(this.extras={},this.knownParams=b||[],this.address=this.network=this.amount=this.message=null,"string"==typeof a){var c=h.parse(a);c.amount&&(c.amount=this._parseAmount(c.amount)),this._fromObject(c)}else{if("object"!=typeof a)throw new TypeError("Unrecognized data format.");this._fromObject(a)}};h.fromString=function(a){if("string"!=typeof a)throw new TypeError("Expected a string");return new h(a)},h.fromObject=function(a){return new h(a)},h.isValid=function(a,b){try{new h(a,b)}catch(c){return!1}return!0},h.parse=function(a){var b=e.parse(a,!0);if("bitcoin:"!==b.protocol)throw new TypeError("Invalid bitcoin URI");var c=/[^:]*:\/?\/?([^?]*)/.exec(a);return b.query.address=c&&c[1]||void 0,b.query},h.Members=["address","amount","message","label","r"],h.prototype._fromObject=function(a){if(!f.isValid(a.address))throw new TypeError("Invalid bitcoin address");this.address=new f(a.address),this.network=this.address.network,this.amount=a.amount;for(var b in a)if("address"!==b&&"amount"!==b){if(/^req-/.exec(b)&&-1===this.knownParams.indexOf(b))throw Error("Unknown required argument "+b);var c=h.Members.indexOf(b)>-1?this:this.extras;c[b]=a[b]}},h.prototype._parseAmount=function(a){if(a=Number(a),isNaN(a))throw new TypeError("Invalid amount");return g.fromBTC(a).toSatoshis()},h.prototype.toObject=h.prototype.toJSON=function(){for(var a={},b=0;b"},b.exports=h},{"./address":65,"./unit":105,lodash:432,url:421}],107:[function(a,b,c){(function(c){"use strict";function d(a,b){if(a.length!==b.length)return!1;for(var c=a.length,d=0;c>d;d++)if(a[d]!==b[d])return!1;return!0}var e=a("buffer"),f=a("assert"),g=a("./js"),h=a("./preconditions");b.exports={fill:function(a,b){h.checkArgumentType(a,"Buffer","buffer"),h.checkArgumentType(b,"number","value");for(var c=a.length,d=0;c>d;d++)a[d]=b;return a},copy:function(a){var b=new c(a.length);return a.copy(b),b},isBuffer:function(a){return e.Buffer.isBuffer(a)||a instanceof Uint8Array},emptyBuffer:function(a){h.checkArgumentType(a,"number","bytes");for(var b=new e.Buffer(a),c=0;a>c;c++)b.write("\x00",c);return b},concat:e.Buffer.concat,equals:d,equal:d,integerAsSingleByteBuffer:function(a){return h.checkArgumentType(a,"number","integer"),new e.Buffer([255&a])},integerAsBuffer:function(a){h.checkArgumentType(a,"number","integer");var b=[];return b.push(a>>24&255),b.push(a>>16&255),b.push(a>>8&255),b.push(255&a),new c(b)},integerFromBuffer:function(a){return h.checkArgumentType(a,"Buffer","buffer"),a[0]<<24|a[1]<<16|a[2]<<8|a[3]},integerFromSingleByteBuffer:function(a){return h.checkArgumentType(a,"Buffer","buffer"),a[0]},bufferToHex:function(a){return h.checkArgumentType(a,"Buffer","buffer"),a.toString("hex")},reverse:function(a){for(var b=new e.Buffer(a.length),c=0;c=0}}},{lodash:432}],109:[function(a,b,c){"use strict";var d=a("../errors"),e=a("lodash");b.exports={checkState:function(a,b){if(!a)throw new d.InvalidState(b)},checkArgument:function(a,b,c,e){if(!a)throw new d.InvalidArgument(b,c,e)},checkArgumentType:function(b,c,f){if(f=f||"(unknown name)",e.isString(c)){if("Buffer"===c){var g=a("./buffer");if(!g.isBuffer(b))throw new d.InvalidArgumentType(b,c,f)}else if(typeof b!==c)throw new d.InvalidArgumentType(b,c,f)}else if(!(b instanceof c))throw new d.InvalidArgumentType(b,c.name,f)}}},{"../errors":81,"./buffer":107,lodash:432}],110:[function(a,b,c){!function(a,b){"use strict";function c(a,b){if(!a)throw new Error(b||"Assertion failed")}function d(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}function e(a,b,c){return null!==a&&"object"==typeof a&&Array.isArray(a.words)?a:(this.sign=!1,this.words=null,this.length=0,this.red=null,("le"===b||"be"===b)&&(c=b,b=10),void(null!==a&&this._init(a||0,b||10,c||"be")))}function f(a,b,c){for(var d=0,e=Math.min(a.length,c),f=b;e>f;f++){var g=a.charCodeAt(f)-48;d<<=4,d|=g>=49&&54>=g?g-49+10:g>=17&&22>=g?g-17+10:15&g}return d}function g(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;f>g;g++){var h=a.charCodeAt(g)-48;e*=d,e+=h>=49?h-49+10:h>=17?h-17+10:h}return e}function h(a,b){this.name=a,this.p=new e(b,16),this.n=this.p.bitLength(),this.k=new e(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function i(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function l(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function m(a){if("string"==typeof a){var b=e._prime(a);this.m=b.p,this.prime=b}else this.m=a,this.prime=null}function n(a){m.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new e(1).ishln(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.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof a?a.exports=e:b.BN=e,e.BN=e,e.wordSize=26,e.prototype._init=function(a,b,d){if("number"==typeof a)return 0>a&&(this.sign=!0,a=-a),void(67108864>a?(this.words=[67108863&a],this.length=1):4503599627370496>a?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(c(9007199254740992>a),this.words=[67108863&a,a/67108864&67108863,1],this.length=3));if("object"==typeof a)return this._initArray(a,b,d);"hex"===b&&(b=16),c(b===(0|b)&&b>=2&&36>=b),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.sign=!0),this.strip()},e.prototype._initArray=function(a,b,d){if(c("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3){var h=a[e]|a[e-1]<<8|a[e-2]<<16;this.words[g]|=h<>>26-f&67108863,f+=24,f>=26&&(f-=26,g++)}else if("le"===d)for(var e=0,g=0;e>>26-f&67108863,f+=24,f>=26&&(f-=26,g++)}return this.strip()},e.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6){var g=f(a,c,c+6);this.words[e]|=g<>>26-d&4194303,d+=24,d>=26&&(d-=26,e++)}if(c+6!==b){var g=f(a,b,c+6);this.words[e]|=g<>>26-d&4194303}this.strip()},e.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;67108863>=e;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,h=f%d,i=Math.min(f,f-h)+c,j=0,k=c;i>k;k+=d)j=g(a,k,k+d,b),this.imuln(e),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j);if(0!==h){for(var l=1,j=g(a,k,a.length,b),k=0;h>k;k++)l*=b;this.imuln(l),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j)}},e.prototype.copy=function(a){a.words=new Array(this.length);for(var b=0;b1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},e.prototype.inspect=function(){return(this.red?""};var o=["","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"],p=[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],q=[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];e.prototype.toString=function(a,b){if(a=a||10,16===a||"hex"===a){for(var d="",e=0,b=0|b||1,f=0,g=0;g>>24-e&16777215,d=0!==f||g!==this.length-1?o[6-i.length]+i+d:i+d,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(d=f.toString(16)+d);d.length%b!==0;)d="0"+d;return this.sign&&(d="-"+d),d}if(a===(0|a)&&a>=2&&36>=a){var j=p[a],k=q[a],d="",l=this.clone();for(l.sign=!1;0!==l.cmpn(0);){var m=l.modn(k).toString(a);l=l.idivn(k),d=0!==l.cmpn(0)?o[j-m.length]+m+d:m+d}return 0===this.cmpn(0)&&(d="0"+d),this.sign&&(d="-"+d),d}c(!1,"Base should be between 2 and 36")},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toArray=function(){this.strip();var a=new Array(this.byteLength());a[0]=0;for(var b=this.clone(),c=0;0!==b.cmpn(0);c++){var d=b.andln(255);b.ishrn(8),a[a.length-c-1]=d}return a},Math.clz32?e.prototype._countBits=function(a){return 32-Math.clz32(a)}:e.prototype._countBits=function(a){var b=a,c=0;return b>=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},e.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},e.prototype.bitLength=function(){var a=0,b=this.words[this.length-1],a=this._countBits(b);return 26*(this.length-1)+a},e.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},e.prototype.iand=function(a){this.sign=this.sign&&a.sign;var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},e.prototype.ixor=function(a){this.sign=this.sign||a.sign;var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},e.prototype.setn=function(a,b){c("number"==typeof a&&a>=0);for(var d=a/26|0,e=a%26;this.length<=d;)this.words[this.length++]=0;return b?this.words[d]=this.words[d]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26}for(;0!==e&&f>>26}if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},e.prototype.isub=function(a){if(a.sign){a.sign=!1;var b=this.iadd(a);return a.sign=!0,b._normSign()}if(this.sign)return this.sign=!1,this.iadd(a),this.sign=!0,this._normSign();var c=this.cmp(a);if(0===c)return this.sign=!1,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b}for(;0!==f&&g>26,this.words[g]=67108863&b}if(0===f&&g>>26,f=67108863&c,g=Math.min(d,a.length-1),h=Math.max(0,d-this.length+1);g>=h;h++){var i=d-h,j=0|this.words[i],k=0|a.words[h],l=j*k,m=67108863&l;e=e+(l/67108864|0)|0,m=m+f|0,f=67108863&m,e=e+(m>>>26)|0}b.words[d]=f,c=e}return 0!==c?b.words[d]=c:b.length--,b.strip()},e.prototype._bigMulTo=function(a,b){b.sign=a.sign!==this.sign,b.length=this.length+a.length;for(var c=0,d=0,e=0;e=i;i++){var j=e-i,k=0|this.words[j],l=0|a.words[i],m=k*l,n=67108863&m;f=f+(m/67108864|0)|0,n=n+g|0,g=67108863&n,f=f+(n>>>26)|0,d+=f>>>26,f&=67108863}b.words[e]=g,c=f,f=d}return 0!==c?b.words[e]=c:b.length--,b.strip()},e.prototype.mulTo=function(a,b){var c;return c=this.length+a.length<63?this._smallMulTo(a,b):this._bigMulTo(a,b)},e.prototype.mul=function(a){var b=new e(null);return b.words=new Array(this.length+a.length),this.mulTo(a,b)},e.prototype.imul=function(a){if(0===this.cmpn(0)||0===a.cmpn(0))return this.words[0]=0,this.length=1,this;var b=this.length,c=a.length;this.sign=a.sign!==this.sign,this.length=this.length+a.length,this.words[this.length-1]=0;for(var d=this.length-2;d>=0;d--){for(var e=0,f=0,g=Math.min(d,c-1),h=Math.max(0,d-b+1);g>=h;h++){var i=d-h,j=this.words[i],k=a.words[h],l=j*k,m=67108863&l;e+=l/67108864|0,m+=f,f=67108863&m,e+=m>>>26}this.words[d]=f,this.words[d+1]+=e,e=0}for(var e=0,i=1;i>>26}return this.strip()},e.prototype.imuln=function(a){c("number"==typeof a);for(var b=0,d=0;d>=26,b+=e/67108864|0,b+=f>>>26,this.words[d]=67108863&f}return 0!==b&&(this.words[d]=b,this.length++),this},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.mul(this)},e.prototype.ishln=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26,e=67108863>>>26-b<<26-b;if(0!==b){for(var f=0,g=0;g>>26-b}f&&(this.words[g]=f,this.length++)}if(0!==d){for(var g=this.length-1;g>=0;g--)this.words[g+d]=this.words[g];for(var g=0;d>g;g++)this.words[g]=0;this.length+=d}return this.strip()},e.prototype.ishrn=function(a,b,d){c("number"==typeof a&&a>=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<j;j++)i.words[j]=this.words[j];i.length=g}if(0===g);else if(this.length>g){this.length-=g;for(var j=0;j=0&&(0!==k||j>=e);j--){var l=this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},e.prototype.shln=function(a){return this.clone().ishln(a)},e.prototype.shrn=function(a){return this.clone().ishrn(a)},e.prototype.testn=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26,e=1<=0);var b=a%26,d=(a-b)/26;if(c(!this.sign,"imaskn works only with positive numbers"),0!==b&&d++,this.length=Math.min(d,this.length),0!==b){var e=67108863^67108863>>>b<a?this.isubn(-a):this.sign?1===this.length&&this.words[0]=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},e.prototype.isubn=function(a){if(c("number"==typeof a),0>a)return this.iaddn(-a);if(this.sign)return this.sign=!1,this.iaddn(a),this.sign=!0,this;this.words[0]-=a;for(var b=0;b>26)-(j/67108864|0),this.words[e+d]=67108863&i}for(;e>26,this.words[e+d]=67108863&i}if(0===h)return this.strip();c(-1===h),h=0;for(var e=0;e>26,this.words[e]=67108863&i}return this.sign=!0,this.strip()},e.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),f=a,g=f.words[f.length-1],h=this._countBits(g);c=26-h,0!==c&&(f=f.shln(c),d.ishln(c),g=f.words[f.length-1]);var i,j=d.length-f.length;if("mod"!==b){i=new e(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*d.words[f.length+m]+d.words[f.length+m-1];for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(f,n,m);d.sign;)n--,d.sign=!1,d._ishlnsubmul(f,1,m),0!==d.cmpn(0)&&(d.sign=!d.sign);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.ishrn(c),{div:i?i:null,mod:d}},e.prototype.divmod=function(a,b){if(c(0!==a.cmpn(0)),this.sign&&!a.sign){var d,f,g=this.neg().divmod(a,b);return"mod"!==b&&(d=g.div.neg()),"div"!==b&&(f=0===g.mod.cmpn(0)?g.mod:a.sub(g.mod)),{div:d,mod:f}}if(!this.sign&&a.sign){var d,g=this.divmod(a.neg(),b);return"mod"!==b&&(d=g.div.neg()),{div:d,mod:g.mod}}return this.sign&&a.sign?this.neg().divmod(a.neg(),b):a.length>this.length||this.cmp(a)<0?{div:new e(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new e(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new e(this.modn(a.words[0]))}:this._wordDiv(a,b)},e.prototype.div=function(a){return this.divmod(a,"div").div},e.prototype.mod=function(a){return this.divmod(a,"mod").mod},e.prototype.divRound=function(a){var b=this.divmod(a);if(0===b.mod.cmpn(0))return b.div;var c=b.div.sign?b.mod.isub(a):b.mod,d=a.shrn(1),e=a.andln(1),f=c.cmp(d);return 0>f||1===e&&0===f?b.div:b.div.sign?b.div.isubn(1):b.div.iaddn(1)},e.prototype.modn=function(a){c(67108863>=a);for(var b=(1<<26)%a,d=0,e=this.length-1;e>=0;e--)d=(b*d+this.words[e])%a;return d},e.prototype.idivn=function(a){c(67108863>=a);for(var b=0,d=this.length-1;d>=0;d--){var e=this.words[d]+67108864*b;this.words[d]=e/a|0,b=e%a}return this.strip()},e.prototype.divn=function(a){return this.clone().idivn(a)},e.prototype.egcd=function(a){c(!a.sign),c(0!==a.cmpn(0));var b=this,d=a.clone();b=b.sign?b.mod(a):b.clone();for(var f=new e(1),g=new e(0),h=new e(0),i=new e(1),j=0;b.isEven()&&d.isEven();)b.ishrn(1),d.ishrn(1),++j;for(var k=d.clone(),l=b.clone();0!==b.cmpn(0);){for(;b.isEven();)b.ishrn(1),f.isEven()&&g.isEven()?(f.ishrn(1),g.ishrn(1)):(f.iadd(k).ishrn(1),g.isub(l).ishrn(1));for(;d.isEven();)d.ishrn(1),h.isEven()&&i.isEven()?(h.ishrn(1),i.ishrn(1)):(h.iadd(k).ishrn(1),i.isub(l).ishrn(1));b.cmp(d)>=0?(b.isub(d),f.isub(h),g.isub(i)):(d.isub(b),h.isub(f),i.isub(g))}return{a:h,b:i,gcd:d.ishln(j)}},e.prototype._invmp=function(a){c(!a.sign),c(0!==a.cmpn(0));var b=this,d=a.clone();b=b.sign?b.mod(a):b.clone();for(var f=new e(1),g=new e(0),h=d.clone();b.cmpn(1)>0&&d.cmpn(1)>0;){for(;b.isEven();)b.ishrn(1),f.isEven()?f.ishrn(1):f.iadd(h).ishrn(1);for(;d.isEven();)d.ishrn(1),g.isEven()?g.ishrn(1):g.iadd(h).ishrn(1);b.cmp(d)>=0?(b.isub(d),f.isub(g)):(d.isub(b),g.isub(f))}return 0===b.cmpn(1)?f:g},e.prototype.gcd=function(a){if(0===this.cmpn(0))return a.clone();if(0===a.cmpn(0))return this.clone();var b=this.clone(),c=a.clone();b.sign=!1,c.sign=!1;for(var d=0;b.isEven()&&c.isEven();d++)b.ishrn(1),c.ishrn(1);for(;;){for(;b.isEven();)b.ishrn(1);for(;c.isEven();)c.ishrn(1);var e=b.cmp(c);if(0>e){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.ishln(d)},e.prototype.invm=function(a){return this.egcd(a).a.mod(a)},e.prototype.isEven=function(){return 0===(1&this.words[0])},e.prototype.isOdd=function(){return 1===(1&this.words[0])},e.prototype.andln=function(a){return this.words[0]&a},e.prototype.bincn=function(a){c("number"==typeof a);var b=a%26,d=(a-b)/26,e=1<f;f++)this.words[f]=0;return this.words[d]|=e,this.length=d+1,this}for(var g=e,f=d;0!==g&&f>>26,h&=67108863,this.words[f]=h}return 0!==g&&(this.words[f]=g,this.length++),this},e.prototype.cmpn=function(a){var b=0>a;if(b&&(a=-a),this.sign&&!b)return-1;if(!this.sign&&b)return 1;a&=67108863,this.strip();var c;if(this.length>1)c=1;else{var d=this.words[0];c=d===a?0:a>d?-1:1}return this.sign&&(c=-c),c},e.prototype.cmp=function(a){if(this.sign&&!a.sign)return-1;if(!this.sign&&a.sign)return 1;var b=this.ucmp(a);return this.sign?-b:b},e.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length=0;c--){var d=this.words[c],e=a.words[c];if(d!==e){e>d?b=-1:d>e&&(b=1);break}}return b},e.red=function(a){return new m(a)},e.prototype.toRed=function(a){return c(!this.red,"Already a number in reduction context"),c(!this.sign,"red works only with positives"),a.convertTo(this)._forceRed(a)},e.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(a){return this.red=a,this},e.prototype.forceRed=function(a){return c(!this.red,"Already a number in reduction context"),this._forceRed(a)},e.prototype.redAdd=function(a){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},e.prototype.redIAdd=function(a){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},e.prototype.redSub=function(a){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},e.prototype.redISub=function(a){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},e.prototype.redShl=function(a){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},e.prototype.redMul=function(a){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},e.prototype.redIMul=function(a){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},e.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(a){return c(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var r={k256:null,p224:null,p192:null,p25519:null};h.prototype._tmp=function(){var a=new e(null);return a.words=new Array(Math.ceil(this.n/13)),a},h.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},h.prototype.split=function(a,b){a.ishrn(this.n,0,b)},h.prototype.imulK=function(a){ @@ -69,5 +69,5 @@ if(a){var b=a.split(A);if(b){for(var c=null,d=null,e=null,f=null,g=null,h=null,i "kiyama.saga.jp":!0,"kouhoku.saga.jp":!0,"kyuragi.saga.jp":!0,"nishiarita.saga.jp":!0,"ogi.saga.jp":!0,"omachi.saga.jp":!0,"ouchi.saga.jp":!0,"saga.saga.jp":!0,"shiroishi.saga.jp":!0,"taku.saga.jp":!0,"tara.saga.jp":!0,"tosu.saga.jp":!0,"yoshinogari.saga.jp":!0,"arakawa.saitama.jp":!0,"asaka.saitama.jp":!0,"chichibu.saitama.jp":!0,"fujimi.saitama.jp":!0,"fujimino.saitama.jp":!0,"fukaya.saitama.jp":!0,"hanno.saitama.jp":!0,"hanyu.saitama.jp":!0,"hasuda.saitama.jp":!0,"hatogaya.saitama.jp":!0,"hatoyama.saitama.jp":!0,"hidaka.saitama.jp":!0,"higashichichibu.saitama.jp":!0,"higashimatsuyama.saitama.jp":!0,"honjo.saitama.jp":!0,"ina.saitama.jp":!0,"iruma.saitama.jp":!0,"iwatsuki.saitama.jp":!0,"kamiizumi.saitama.jp":!0,"kamikawa.saitama.jp":!0,"kamisato.saitama.jp":!0,"kasukabe.saitama.jp":!0,"kawagoe.saitama.jp":!0,"kawaguchi.saitama.jp":!0,"kawajima.saitama.jp":!0,"kazo.saitama.jp":!0,"kitamoto.saitama.jp":!0,"koshigaya.saitama.jp":!0,"kounosu.saitama.jp":!0,"kuki.saitama.jp":!0,"kumagaya.saitama.jp":!0,"matsubushi.saitama.jp":!0,"minano.saitama.jp":!0,"misato.saitama.jp":!0,"miyashiro.saitama.jp":!0,"miyoshi.saitama.jp":!0,"moroyama.saitama.jp":!0,"nagatoro.saitama.jp":!0,"namegawa.saitama.jp":!0,"niiza.saitama.jp":!0,"ogano.saitama.jp":!0,"ogawa.saitama.jp":!0,"ogose.saitama.jp":!0,"okegawa.saitama.jp":!0,"omiya.saitama.jp":!0,"otaki.saitama.jp":!0,"ranzan.saitama.jp":!0,"ryokami.saitama.jp":!0,"saitama.saitama.jp":!0,"sakado.saitama.jp":!0,"satte.saitama.jp":!0,"sayama.saitama.jp":!0,"shiki.saitama.jp":!0,"shiraoka.saitama.jp":!0,"soka.saitama.jp":!0,"sugito.saitama.jp":!0,"toda.saitama.jp":!0,"tokigawa.saitama.jp":!0,"tokorozawa.saitama.jp":!0,"tsurugashima.saitama.jp":!0,"urawa.saitama.jp":!0,"warabi.saitama.jp":!0,"yashio.saitama.jp":!0,"yokoze.saitama.jp":!0,"yono.saitama.jp":!0,"yorii.saitama.jp":!0,"yoshida.saitama.jp":!0,"yoshikawa.saitama.jp":!0,"yoshimi.saitama.jp":!0,"aisho.shiga.jp":!0,"gamo.shiga.jp":!0,"higashiomi.shiga.jp":!0,"hikone.shiga.jp":!0,"koka.shiga.jp":!0,"konan.shiga.jp":!0,"kosei.shiga.jp":!0,"koto.shiga.jp":!0,"kusatsu.shiga.jp":!0,"maibara.shiga.jp":!0,"moriyama.shiga.jp":!0,"nagahama.shiga.jp":!0,"nishiazai.shiga.jp":!0,"notogawa.shiga.jp":!0,"omihachiman.shiga.jp":!0,"otsu.shiga.jp":!0,"ritto.shiga.jp":!0,"ryuoh.shiga.jp":!0,"takashima.shiga.jp":!0,"takatsuki.shiga.jp":!0,"torahime.shiga.jp":!0,"toyosato.shiga.jp":!0,"yasu.shiga.jp":!0,"akagi.shimane.jp":!0,"ama.shimane.jp":!0,"gotsu.shimane.jp":!0,"hamada.shimane.jp":!0,"higashiizumo.shimane.jp":!0,"hikawa.shimane.jp":!0,"hikimi.shimane.jp":!0,"izumo.shimane.jp":!0,"kakinoki.shimane.jp":!0,"masuda.shimane.jp":!0,"matsue.shimane.jp":!0,"misato.shimane.jp":!0,"nishinoshima.shimane.jp":!0,"ohda.shimane.jp":!0,"okinoshima.shimane.jp":!0,"okuizumo.shimane.jp":!0,"shimane.shimane.jp":!0,"tamayu.shimane.jp":!0,"tsuwano.shimane.jp":!0,"unnan.shimane.jp":!0,"yakumo.shimane.jp":!0,"yasugi.shimane.jp":!0,"yatsuka.shimane.jp":!0,"arai.shizuoka.jp":!0,"atami.shizuoka.jp":!0,"fuji.shizuoka.jp":!0,"fujieda.shizuoka.jp":!0,"fujikawa.shizuoka.jp":!0,"fujinomiya.shizuoka.jp":!0,"fukuroi.shizuoka.jp":!0,"gotemba.shizuoka.jp":!0,"haibara.shizuoka.jp":!0,"hamamatsu.shizuoka.jp":!0,"higashiizu.shizuoka.jp":!0,"ito.shizuoka.jp":!0,"iwata.shizuoka.jp":!0,"izu.shizuoka.jp":!0,"izunokuni.shizuoka.jp":!0,"kakegawa.shizuoka.jp":!0,"kannami.shizuoka.jp":!0,"kawanehon.shizuoka.jp":!0,"kawazu.shizuoka.jp":!0,"kikugawa.shizuoka.jp":!0,"kosai.shizuoka.jp":!0,"makinohara.shizuoka.jp":!0,"matsuzaki.shizuoka.jp":!0,"minamiizu.shizuoka.jp":!0,"mishima.shizuoka.jp":!0,"morimachi.shizuoka.jp":!0,"nishiizu.shizuoka.jp":!0,"numazu.shizuoka.jp":!0,"omaezaki.shizuoka.jp":!0,"shimada.shizuoka.jp":!0,"shimizu.shizuoka.jp":!0,"shimoda.shizuoka.jp":!0,"shizuoka.shizuoka.jp":!0,"susono.shizuoka.jp":!0,"yaizu.shizuoka.jp":!0,"yoshida.shizuoka.jp":!0,"ashikaga.tochigi.jp":!0,"bato.tochigi.jp":!0,"haga.tochigi.jp":!0,"ichikai.tochigi.jp":!0,"iwafune.tochigi.jp":!0,"kaminokawa.tochigi.jp":!0,"kanuma.tochigi.jp":!0,"karasuyama.tochigi.jp":!0,"kuroiso.tochigi.jp":!0,"mashiko.tochigi.jp":!0,"mibu.tochigi.jp":!0,"moka.tochigi.jp":!0,"motegi.tochigi.jp":!0,"nasu.tochigi.jp":!0,"nasushiobara.tochigi.jp":!0,"nikko.tochigi.jp":!0,"nishikata.tochigi.jp":!0,"nogi.tochigi.jp":!0,"ohira.tochigi.jp":!0,"ohtawara.tochigi.jp":!0,"oyama.tochigi.jp":!0,"sakura.tochigi.jp":!0,"sano.tochigi.jp":!0,"shimotsuke.tochigi.jp":!0,"shioya.tochigi.jp":!0,"takanezawa.tochigi.jp":!0,"tochigi.tochigi.jp":!0,"tsuga.tochigi.jp":!0,"ujiie.tochigi.jp":!0,"utsunomiya.tochigi.jp":!0,"yaita.tochigi.jp":!0,"aizumi.tokushima.jp":!0,"anan.tokushima.jp":!0,"ichiba.tokushima.jp":!0,"itano.tokushima.jp":!0,"kainan.tokushima.jp":!0,"komatsushima.tokushima.jp":!0,"matsushige.tokushima.jp":!0,"mima.tokushima.jp":!0,"minami.tokushima.jp":!0,"miyoshi.tokushima.jp":!0,"mugi.tokushima.jp":!0,"nakagawa.tokushima.jp":!0,"naruto.tokushima.jp":!0,"sanagochi.tokushima.jp":!0,"shishikui.tokushima.jp":!0,"tokushima.tokushima.jp":!0,"wajiki.tokushima.jp":!0,"adachi.tokyo.jp":!0,"akiruno.tokyo.jp":!0,"akishima.tokyo.jp":!0,"aogashima.tokyo.jp":!0,"arakawa.tokyo.jp":!0,"bunkyo.tokyo.jp":!0,"chiyoda.tokyo.jp":!0,"chofu.tokyo.jp":!0,"chuo.tokyo.jp":!0,"edogawa.tokyo.jp":!0,"fuchu.tokyo.jp":!0,"fussa.tokyo.jp":!0,"hachijo.tokyo.jp":!0,"hachioji.tokyo.jp":!0,"hamura.tokyo.jp":!0,"higashikurume.tokyo.jp":!0,"higashimurayama.tokyo.jp":!0,"higashiyamato.tokyo.jp":!0,"hino.tokyo.jp":!0,"hinode.tokyo.jp":!0,"hinohara.tokyo.jp":!0,"inagi.tokyo.jp":!0,"itabashi.tokyo.jp":!0,"katsushika.tokyo.jp":!0,"kita.tokyo.jp":!0,"kiyose.tokyo.jp":!0,"kodaira.tokyo.jp":!0,"koganei.tokyo.jp":!0,"kokubunji.tokyo.jp":!0,"komae.tokyo.jp":!0,"koto.tokyo.jp":!0,"kouzushima.tokyo.jp":!0,"kunitachi.tokyo.jp":!0,"machida.tokyo.jp":!0,"meguro.tokyo.jp":!0,"minato.tokyo.jp":!0,"mitaka.tokyo.jp":!0,"mizuho.tokyo.jp":!0,"musashimurayama.tokyo.jp":!0,"musashino.tokyo.jp":!0,"nakano.tokyo.jp":!0,"nerima.tokyo.jp":!0,"ogasawara.tokyo.jp":!0,"okutama.tokyo.jp":!0,"ome.tokyo.jp":!0,"oshima.tokyo.jp":!0,"ota.tokyo.jp":!0,"setagaya.tokyo.jp":!0,"shibuya.tokyo.jp":!0,"shinagawa.tokyo.jp":!0,"shinjuku.tokyo.jp":!0,"suginami.tokyo.jp":!0,"sumida.tokyo.jp":!0,"tachikawa.tokyo.jp":!0,"taito.tokyo.jp":!0,"tama.tokyo.jp":!0,"toshima.tokyo.jp":!0,"chizu.tottori.jp":!0,"hino.tottori.jp":!0,"kawahara.tottori.jp":!0,"koge.tottori.jp":!0,"kotoura.tottori.jp":!0,"misasa.tottori.jp":!0,"nanbu.tottori.jp":!0,"nichinan.tottori.jp":!0,"sakaiminato.tottori.jp":!0,"tottori.tottori.jp":!0,"wakasa.tottori.jp":!0,"yazu.tottori.jp":!0,"yonago.tottori.jp":!0,"asahi.toyama.jp":!0,"fuchu.toyama.jp":!0,"fukumitsu.toyama.jp":!0,"funahashi.toyama.jp":!0,"himi.toyama.jp":!0,"imizu.toyama.jp":!0,"inami.toyama.jp":!0,"johana.toyama.jp":!0,"kamiichi.toyama.jp":!0,"kurobe.toyama.jp":!0,"nakaniikawa.toyama.jp":!0,"namerikawa.toyama.jp":!0,"nanto.toyama.jp":!0,"nyuzen.toyama.jp":!0,"oyabe.toyama.jp":!0,"taira.toyama.jp":!0,"takaoka.toyama.jp":!0,"tateyama.toyama.jp":!0,"toga.toyama.jp":!0,"tonami.toyama.jp":!0,"toyama.toyama.jp":!0,"unazuki.toyama.jp":!0,"uozu.toyama.jp":!0,"yamada.toyama.jp":!0,"arida.wakayama.jp":!0,"aridagawa.wakayama.jp":!0,"gobo.wakayama.jp":!0,"hashimoto.wakayama.jp":!0,"hidaka.wakayama.jp":!0,"hirogawa.wakayama.jp":!0,"inami.wakayama.jp":!0,"iwade.wakayama.jp":!0,"kainan.wakayama.jp":!0,"kamitonda.wakayama.jp":!0,"katsuragi.wakayama.jp":!0,"kimino.wakayama.jp":!0,"kinokawa.wakayama.jp":!0,"kitayama.wakayama.jp":!0,"koya.wakayama.jp":!0,"koza.wakayama.jp":!0,"kozagawa.wakayama.jp":!0,"kudoyama.wakayama.jp":!0,"kushimoto.wakayama.jp":!0,"mihama.wakayama.jp":!0,"misato.wakayama.jp":!0,"nachikatsuura.wakayama.jp":!0,"shingu.wakayama.jp":!0,"shirahama.wakayama.jp":!0,"taiji.wakayama.jp":!0,"tanabe.wakayama.jp":!0,"wakayama.wakayama.jp":!0,"yuasa.wakayama.jp":!0,"yura.wakayama.jp":!0,"asahi.yamagata.jp":!0,"funagata.yamagata.jp":!0,"higashine.yamagata.jp":!0,"iide.yamagata.jp":!0,"kahoku.yamagata.jp":!0,"kaminoyama.yamagata.jp":!0,"kaneyama.yamagata.jp":!0,"kawanishi.yamagata.jp":!0,"mamurogawa.yamagata.jp":!0,"mikawa.yamagata.jp":!0,"murayama.yamagata.jp":!0,"nagai.yamagata.jp":!0,"nakayama.yamagata.jp":!0,"nanyo.yamagata.jp":!0,"nishikawa.yamagata.jp":!0,"obanazawa.yamagata.jp":!0,"oe.yamagata.jp":!0,"oguni.yamagata.jp":!0,"ohkura.yamagata.jp":!0,"oishida.yamagata.jp":!0,"sagae.yamagata.jp":!0,"sakata.yamagata.jp":!0,"sakegawa.yamagata.jp":!0,"shinjo.yamagata.jp":!0,"shirataka.yamagata.jp":!0,"shonai.yamagata.jp":!0,"takahata.yamagata.jp":!0,"tendo.yamagata.jp":!0,"tozawa.yamagata.jp":!0,"tsuruoka.yamagata.jp":!0,"yamagata.yamagata.jp":!0,"yamanobe.yamagata.jp":!0,"yonezawa.yamagata.jp":!0,"yuza.yamagata.jp":!0,"abu.yamaguchi.jp":!0,"hagi.yamaguchi.jp":!0,"hikari.yamaguchi.jp":!0,"hofu.yamaguchi.jp":!0,"iwakuni.yamaguchi.jp":!0,"kudamatsu.yamaguchi.jp":!0,"mitou.yamaguchi.jp":!0,"nagato.yamaguchi.jp":!0,"oshima.yamaguchi.jp":!0,"shimonoseki.yamaguchi.jp":!0,"shunan.yamaguchi.jp":!0,"tabuse.yamaguchi.jp":!0,"tokuyama.yamaguchi.jp":!0,"toyota.yamaguchi.jp":!0,"ube.yamaguchi.jp":!0,"yuu.yamaguchi.jp":!0,"chuo.yamanashi.jp":!0,"doshi.yamanashi.jp":!0,"fuefuki.yamanashi.jp":!0,"fujikawa.yamanashi.jp":!0,"fujikawaguchiko.yamanashi.jp":!0,"fujiyoshida.yamanashi.jp":!0,"hayakawa.yamanashi.jp":!0,"hokuto.yamanashi.jp":!0,"ichikawamisato.yamanashi.jp":!0,"kai.yamanashi.jp":!0,"kofu.yamanashi.jp":!0,"koshu.yamanashi.jp":!0,"kosuge.yamanashi.jp":!0,"minami-alps.yamanashi.jp":!0,"minobu.yamanashi.jp":!0,"nakamichi.yamanashi.jp":!0,"nanbu.yamanashi.jp":!0,"narusawa.yamanashi.jp":!0,"nirasaki.yamanashi.jp":!0,"nishikatsura.yamanashi.jp":!0,"oshino.yamanashi.jp":!0,"otsuki.yamanashi.jp":!0,"showa.yamanashi.jp":!0,"tabayama.yamanashi.jp":!0,"tsuru.yamanashi.jp":!0,"uenohara.yamanashi.jp":!0,"yamanakako.yamanashi.jp":!0,"yamanashi.yamanashi.jp":!0,"*.ke":!0,kg:!0,"org.kg":!0,"net.kg":!0,"com.kg":!0,"edu.kg":!0,"gov.kg":!0,"mil.kg":!0,"*.kh":!0,ki:!0,"edu.ki":!0,"biz.ki":!0,"net.ki":!0,"org.ki":!0,"gov.ki":!0,"info.ki":!0,"com.ki":!0,km:!0,"org.km":!0,"nom.km":!0,"gov.km":!0,"prd.km":!0,"tm.km":!0,"edu.km":!0,"mil.km":!0,"ass.km":!0,"com.km":!0,"coop.km":!0,"asso.km":!0,"presse.km":!0,"medecin.km":!0,"notaires.km":!0,"pharmaciens.km":!0,"veterinaire.km":!0,"gouv.km":!0,kn:!0,"net.kn":!0,"org.kn":!0,"edu.kn":!0,"gov.kn":!0,kp:!0,"com.kp":!0,"edu.kp":!0,"gov.kp":!0,"org.kp":!0,"rep.kp":!0,"tra.kp":!0,kr:!0,"ac.kr":!0,"co.kr":!0,"es.kr":!0,"go.kr":!0,"hs.kr":!0,"kg.kr":!0,"mil.kr":!0,"ms.kr":!0,"ne.kr":!0,"or.kr":!0,"pe.kr":!0,"re.kr":!0,"sc.kr":!0,"busan.kr":!0,"chungbuk.kr":!0,"chungnam.kr":!0,"daegu.kr":!0,"daejeon.kr":!0,"gangwon.kr":!0,"gwangju.kr":!0,"gyeongbuk.kr":!0,"gyeonggi.kr":!0,"gyeongnam.kr":!0,"incheon.kr":!0,"jeju.kr":!0,"jeonbuk.kr":!0,"jeonnam.kr":!0,"seoul.kr":!0,"ulsan.kr":!0,"*.kw":!0,ky:!0,"edu.ky":!0,"gov.ky":!0,"com.ky":!0,"org.ky":!0,"net.ky":!0,kz:!0,"org.kz":!0,"edu.kz":!0,"net.kz":!0,"gov.kz":!0,"mil.kz":!0,"com.kz":!0,la:!0,"int.la":!0,"net.la":!0,"info.la":!0,"edu.la":!0,"gov.la":!0,"per.la":!0,"com.la":!0,"org.la":!0,lb:!0,"com.lb":!0,"edu.lb":!0,"gov.lb":!0,"net.lb":!0,"org.lb":!0,lc:!0,"com.lc":!0,"net.lc":!0,"co.lc":!0,"org.lc":!0,"edu.lc":!0,"gov.lc":!0,li:!0,lk:!0,"gov.lk":!0,"sch.lk":!0,"net.lk":!0,"int.lk":!0,"com.lk":!0,"org.lk":!0,"edu.lk":!0,"ngo.lk":!0,"soc.lk":!0,"web.lk":!0,"ltd.lk":!0,"assn.lk":!0,"grp.lk":!0,"hotel.lk":!0,"ac.lk":!0,lr:!0,"com.lr":!0,"edu.lr":!0,"gov.lr":!0,"org.lr":!0,"net.lr":!0,ls:!0,"co.ls":!0,"org.ls":!0,lt:!0,"gov.lt":!0,lu:!0,lv:!0,"com.lv":!0,"edu.lv":!0,"gov.lv":!0,"org.lv":!0,"mil.lv":!0,"id.lv":!0,"net.lv":!0,"asn.lv":!0,"conf.lv":!0,ly:!0,"com.ly":!0,"net.ly":!0,"gov.ly":!0,"plc.ly":!0,"edu.ly":!0,"sch.ly":!0,"med.ly":!0,"org.ly":!0,"id.ly":!0,ma:!0,"co.ma":!0,"net.ma":!0,"gov.ma":!0,"org.ma":!0,"ac.ma":!0,"press.ma":!0,mc:!0,"tm.mc":!0,"asso.mc":!0,md:!0,me:!0,"co.me":!0,"net.me":!0,"org.me":!0,"edu.me":!0,"ac.me":!0,"gov.me":!0,"its.me":!0,"priv.me":!0,mg:!0,"org.mg":!0,"nom.mg":!0,"gov.mg":!0,"prd.mg":!0,"tm.mg":!0,"edu.mg":!0,"mil.mg":!0,"com.mg":!0,"co.mg":!0,mh:!0,mil:!0,mk:!0,"com.mk":!0,"org.mk":!0,"net.mk":!0,"edu.mk":!0,"gov.mk":!0,"inf.mk":!0,"name.mk":!0,ml:!0,"com.ml":!0,"edu.ml":!0,"gouv.ml":!0,"gov.ml":!0,"net.ml":!0,"org.ml":!0,"presse.ml":!0,"*.mm":!0,mn:!0,"gov.mn":!0,"edu.mn":!0,"org.mn":!0,mo:!0,"com.mo":!0,"net.mo":!0,"org.mo":!0,"edu.mo":!0,"gov.mo":!0,mobi:!0,mp:!0,mq:!0,mr:!0,"gov.mr":!0,ms:!0,"com.ms":!0,"edu.ms":!0,"gov.ms":!0,"net.ms":!0,"org.ms":!0,mt:!0,"com.mt":!0,"edu.mt":!0,"net.mt":!0,"org.mt":!0,mu:!0,"com.mu":!0,"net.mu":!0,"org.mu":!0,"gov.mu":!0,"ac.mu":!0,"co.mu":!0,"or.mu":!0,museum:!0,"academy.museum":!0,"agriculture.museum":!0,"air.museum":!0,"airguard.museum":!0,"alabama.museum":!0,"alaska.museum":!0,"amber.museum":!0,"ambulance.museum":!0,"american.museum":!0,"americana.museum":!0,"americanantiques.museum":!0,"americanart.museum":!0,"amsterdam.museum":!0,"and.museum":!0,"annefrank.museum":!0,"anthro.museum":!0,"anthropology.museum":!0,"antiques.museum":!0,"aquarium.museum":!0,"arboretum.museum":!0,"archaeological.museum":!0,"archaeology.museum":!0,"architecture.museum":!0,"art.museum":!0,"artanddesign.museum":!0,"artcenter.museum":!0,"artdeco.museum":!0,"arteducation.museum":!0,"artgallery.museum":!0,"arts.museum":!0,"artsandcrafts.museum":!0,"asmatart.museum":!0,"assassination.museum":!0,"assisi.museum":!0,"association.museum":!0,"astronomy.museum":!0,"atlanta.museum":!0,"austin.museum":!0,"australia.museum":!0,"automotive.museum":!0,"aviation.museum":!0,"axis.museum":!0,"badajoz.museum":!0,"baghdad.museum":!0,"bahn.museum":!0,"bale.museum":!0,"baltimore.museum":!0,"barcelona.museum":!0,"baseball.museum":!0,"basel.museum":!0,"baths.museum":!0,"bauern.museum":!0,"beauxarts.museum":!0,"beeldengeluid.museum":!0,"bellevue.museum":!0,"bergbau.museum":!0,"berkeley.museum":!0,"berlin.museum":!0,"bern.museum":!0,"bible.museum":!0,"bilbao.museum":!0,"bill.museum":!0,"birdart.museum":!0,"birthplace.museum":!0,"bonn.museum":!0,"boston.museum":!0,"botanical.museum":!0,"botanicalgarden.museum":!0,"botanicgarden.museum":!0,"botany.museum":!0,"brandywinevalley.museum":!0,"brasil.museum":!0,"bristol.museum":!0,"british.museum":!0,"britishcolumbia.museum":!0,"broadcast.museum":!0,"brunel.museum":!0,"brussel.museum":!0,"brussels.museum":!0,"bruxelles.museum":!0,"building.museum":!0,"burghof.museum":!0,"bus.museum":!0,"bushey.museum":!0,"cadaques.museum":!0,"california.museum":!0,"cambridge.museum":!0,"can.museum":!0,"canada.museum":!0,"capebreton.museum":!0,"carrier.museum":!0,"cartoonart.museum":!0,"casadelamoneda.museum":!0,"castle.museum":!0,"castres.museum":!0,"celtic.museum":!0,"center.museum":!0,"chattanooga.museum":!0,"cheltenham.museum":!0,"chesapeakebay.museum":!0,"chicago.museum":!0,"children.museum":!0,"childrens.museum":!0,"childrensgarden.museum":!0,"chiropractic.museum":!0,"chocolate.museum":!0,"christiansburg.museum":!0,"cincinnati.museum":!0,"cinema.museum":!0,"circus.museum":!0,"civilisation.museum":!0,"civilization.museum":!0,"civilwar.museum":!0,"clinton.museum":!0,"clock.museum":!0,"coal.museum":!0,"coastaldefence.museum":!0,"cody.museum":!0,"coldwar.museum":!0,"collection.museum":!0,"colonialwilliamsburg.museum":!0,"coloradoplateau.museum":!0,"columbia.museum":!0,"columbus.museum":!0,"communication.museum":!0,"communications.museum":!0,"community.museum":!0,"computer.museum":!0,"computerhistory.museum":!0,"xn--comunicaes-v6a2o.museum":!0,"contemporary.museum":!0,"contemporaryart.museum":!0,"convent.museum":!0,"copenhagen.museum":!0,"corporation.museum":!0,"xn--correios-e-telecomunicaes-ghc29a.museum":!0,"corvette.museum":!0,"costume.museum":!0,"countryestate.museum":!0,"county.museum":!0,"crafts.museum":!0,"cranbrook.museum":!0,"creation.museum":!0,"cultural.museum":!0,"culturalcenter.museum":!0,"culture.museum":!0,"cyber.museum":!0,"cymru.museum":!0,"dali.museum":!0,"dallas.museum":!0,"database.museum":!0,"ddr.museum":!0,"decorativearts.museum":!0,"delaware.museum":!0,"delmenhorst.museum":!0,"denmark.museum":!0,"depot.museum":!0,"design.museum":!0,"detroit.museum":!0,"dinosaur.museum":!0,"discovery.museum":!0,"dolls.museum":!0,"donostia.museum":!0,"durham.museum":!0,"eastafrica.museum":!0,"eastcoast.museum":!0,"education.museum":!0,"educational.museum":!0,"egyptian.museum":!0,"eisenbahn.museum":!0,"elburg.museum":!0,"elvendrell.museum":!0,"embroidery.museum":!0,"encyclopedic.museum":!0,"england.museum":!0,"entomology.museum":!0,"environment.museum":!0,"environmentalconservation.museum":!0,"epilepsy.museum":!0,"essex.museum":!0,"estate.museum":!0,"ethnology.museum":!0,"exeter.museum":!0,"exhibition.museum":!0,"family.museum":!0,"farm.museum":!0,"farmequipment.museum":!0,"farmers.museum":!0,"farmstead.museum":!0,"field.museum":!0,"figueres.museum":!0,"filatelia.museum":!0,"film.museum":!0,"fineart.museum":!0,"finearts.museum":!0,"finland.museum":!0,"flanders.museum":!0,"florida.museum":!0,"force.museum":!0,"fortmissoula.museum":!0,"fortworth.museum":!0,"foundation.museum":!0,"francaise.museum":!0,"frankfurt.museum":!0,"franziskaner.museum":!0,"freemasonry.museum":!0,"freiburg.museum":!0,"fribourg.museum":!0,"frog.museum":!0,"fundacio.museum":!0,"furniture.museum":!0,"gallery.museum":!0,"garden.museum":!0,"gateway.museum":!0,"geelvinck.museum":!0,"gemological.museum":!0,"geology.museum":!0,"georgia.museum":!0,"giessen.museum":!0,"glas.museum":!0,"glass.museum":!0,"gorge.museum":!0,"grandrapids.museum":!0,"graz.museum":!0,"guernsey.museum":!0,"halloffame.museum":!0,"hamburg.museum":!0,"handson.museum":!0,"harvestcelebration.museum":!0,"hawaii.museum":!0,"health.museum":!0,"heimatunduhren.museum":!0,"hellas.museum":!0,"helsinki.museum":!0,"hembygdsforbund.museum":!0,"heritage.museum":!0,"histoire.museum":!0,"historical.museum":!0,"historicalsociety.museum":!0,"historichouses.museum":!0,"historisch.museum":!0,"historisches.museum":!0,"history.museum":!0,"historyofscience.museum":!0,"horology.museum":!0,"house.museum":!0,"humanities.museum":!0,"illustration.museum":!0,"imageandsound.museum":!0,"indian.museum":!0,"indiana.museum":!0,"indianapolis.museum":!0,"indianmarket.museum":!0,"intelligence.museum":!0,"interactive.museum":!0,"iraq.museum":!0,"iron.museum":!0,"isleofman.museum":!0,"jamison.museum":!0,"jefferson.museum":!0,"jerusalem.museum":!0,"jewelry.museum":!0,"jewish.museum":!0,"jewishart.museum":!0,"jfk.museum":!0,"journalism.museum":!0,"judaica.museum":!0,"judygarland.museum":!0,"juedisches.museum":!0,"juif.museum":!0,"karate.museum":!0,"karikatur.museum":!0,"kids.museum":!0,"koebenhavn.museum":!0,"koeln.museum":!0,"kunst.museum":!0,"kunstsammlung.museum":!0,"kunstunddesign.museum":!0,"labor.museum":!0,"labour.museum":!0,"lajolla.museum":!0,"lancashire.museum":!0,"landes.museum":!0,"lans.museum":!0,"xn--lns-qla.museum":!0,"larsson.museum":!0,"lewismiller.museum":!0,"lincoln.museum":!0,"linz.museum":!0,"living.museum":!0,"livinghistory.museum":!0,"localhistory.museum":!0,"london.museum":!0,"losangeles.museum":!0,"louvre.museum":!0,"loyalist.museum":!0,"lucerne.museum":!0,"luxembourg.museum":!0,"luzern.museum":!0,"mad.museum":!0,"madrid.museum":!0,"mallorca.museum":!0,"manchester.museum":!0,"mansion.museum":!0,"mansions.museum":!0,"manx.museum":!0,"marburg.museum":!0,"maritime.museum":!0,"maritimo.museum":!0,"maryland.museum":!0,"marylhurst.museum":!0,"media.museum":!0,"medical.museum":!0,"medizinhistorisches.museum":!0,"meeres.museum":!0,"memorial.museum":!0,"mesaverde.museum":!0,"michigan.museum":!0,"midatlantic.museum":!0,"military.museum":!0,"mill.museum":!0,"miners.museum":!0,"mining.museum":!0,"minnesota.museum":!0,"missile.museum":!0,"missoula.museum":!0,"modern.museum":!0,"moma.museum":!0,"money.museum":!0,"monmouth.museum":!0,"monticello.museum":!0,"montreal.museum":!0,"moscow.museum":!0,"motorcycle.museum":!0,"muenchen.museum":!0,"muenster.museum":!0,"mulhouse.museum":!0,"muncie.museum":!0,"museet.museum":!0,"museumcenter.museum":!0,"museumvereniging.museum":!0,"music.museum":!0,"national.museum":!0,"nationalfirearms.museum":!0,"nationalheritage.museum":!0,"nativeamerican.museum":!0,"naturalhistory.museum":!0,"naturalhistorymuseum.museum":!0,"naturalsciences.museum":!0,"nature.museum":!0,"naturhistorisches.museum":!0,"natuurwetenschappen.museum":!0,"naumburg.museum":!0,"naval.museum":!0,"nebraska.museum":!0,"neues.museum":!0,"newhampshire.museum":!0,"newjersey.museum":!0,"newmexico.museum":!0,"newport.museum":!0,"newspaper.museum":!0,"newyork.museum":!0,"niepce.museum":!0,"norfolk.museum":!0,"north.museum":!0,"nrw.museum":!0,"nuernberg.museum":!0,"nuremberg.museum":!0,"nyc.museum":!0,"nyny.museum":!0,"oceanographic.museum":!0,"oceanographique.museum":!0,"omaha.museum":!0,"online.museum":!0,"ontario.museum":!0,"openair.museum":!0,"oregon.museum":!0,"oregontrail.museum":!0,"otago.museum":!0,"oxford.museum":!0,"pacific.museum":!0,"paderborn.museum":!0,"palace.museum":!0,"paleo.museum":!0,"palmsprings.museum":!0,"panama.museum":!0,"paris.museum":!0,"pasadena.museum":!0,"pharmacy.museum":!0,"philadelphia.museum":!0,"philadelphiaarea.museum":!0,"philately.museum":!0,"phoenix.museum":!0,"photography.museum":!0,"pilots.museum":!0,"pittsburgh.museum":!0,"planetarium.museum":!0,"plantation.museum":!0,"plants.museum":!0,"plaza.museum":!0,"portal.museum":!0,"portland.museum":!0,"portlligat.museum":!0,"posts-and-telecommunications.museum":!0,"preservation.museum":!0,"presidio.museum":!0,"press.museum":!0,"project.museum":!0,"public.museum":!0,"pubol.museum":!0,"quebec.museum":!0,"railroad.museum":!0,"railway.museum":!0,"research.museum":!0,"resistance.museum":!0,"riodejaneiro.museum":!0,"rochester.museum":!0,"rockart.museum":!0,"roma.museum":!0,"russia.museum":!0,"saintlouis.museum":!0,"salem.museum":!0,"salvadordali.museum":!0,"salzburg.museum":!0,"sandiego.museum":!0,"sanfrancisco.museum":!0,"santabarbara.museum":!0,"santacruz.museum":!0,"santafe.museum":!0,"saskatchewan.museum":!0,"satx.museum":!0,"savannahga.museum":!0,"schlesisches.museum":!0,"schoenbrunn.museum":!0,"schokoladen.museum":!0,"school.museum":!0,"schweiz.museum":!0,"science.museum":!0,"scienceandhistory.museum":!0,"scienceandindustry.museum":!0,"sciencecenter.museum":!0,"sciencecenters.museum":!0,"science-fiction.museum":!0,"sciencehistory.museum":!0,"sciences.museum":!0,"sciencesnaturelles.museum":!0,"scotland.museum":!0,"seaport.museum":!0,"settlement.museum":!0,"settlers.museum":!0,"shell.museum":!0,"sherbrooke.museum":!0,"sibenik.museum":!0,"silk.museum":!0,"ski.museum":!0,"skole.museum":!0,"society.museum":!0,"sologne.museum":!0,"soundandvision.museum":!0,"southcarolina.museum":!0,"southwest.museum":!0,"space.museum":!0,"spy.museum":!0,"square.museum":!0,"stadt.museum":!0,"stalbans.museum":!0,"starnberg.museum":!0,"state.museum":!0,"stateofdelaware.museum":!0,"station.museum":!0,"steam.museum":!0,"steiermark.museum":!0,"stjohn.museum":!0,"stockholm.museum":!0,"stpetersburg.museum":!0,"stuttgart.museum":!0,"suisse.museum":!0,"surgeonshall.museum":!0,"surrey.museum":!0,"svizzera.museum":!0,"sweden.museum":!0,"sydney.museum":!0,"tank.museum":!0,"tcm.museum":!0,"technology.museum":!0,"telekommunikation.museum":!0,"television.museum":!0,"texas.museum":!0,"textile.museum":!0,"theater.museum":!0,"time.museum":!0,"timekeeping.museum":!0,"topology.museum":!0,"torino.museum":!0,"touch.museum":!0,"town.museum":!0,"transport.museum":!0,"tree.museum":!0,"trolley.museum":!0,"trust.museum":!0,"trustee.museum":!0,"uhren.museum":!0,"ulm.museum":!0,"undersea.museum":!0,"university.museum":!0,"usa.museum":!0,"usantiques.museum":!0,"usarts.museum":!0,"uscountryestate.museum":!0,"usculture.museum":!0,"usdecorativearts.museum":!0,"usgarden.museum":!0,"ushistory.museum":!0,"ushuaia.museum":!0,"uslivinghistory.museum":!0,"utah.museum":!0,"uvic.museum":!0,"valley.museum":!0,"vantaa.museum":!0,"versailles.museum":!0,"viking.museum":!0,"village.museum":!0,"virginia.museum":!0,"virtual.museum":!0,"virtuel.museum":!0,"vlaanderen.museum":!0,"volkenkunde.museum":!0,"wales.museum":!0,"wallonie.museum":!0,"war.museum":!0,"washingtondc.museum":!0,"watchandclock.museum":!0,"watch-and-clock.museum":!0,"western.museum":!0,"westfalen.museum":!0,"whaling.museum":!0,"wildlife.museum":!0,"williamsburg.museum":!0,"windmill.museum":!0,"workshop.museum":!0,"york.museum":!0,"yorkshire.museum":!0,"yosemite.museum":!0,"youth.museum":!0,"zoological.museum":!0,"zoology.museum":!0,"xn--9dbhblg6di.museum":!0,"xn--h1aegh.museum":!0,mv:!0,"aero.mv":!0,"biz.mv":!0,"com.mv":!0,"coop.mv":!0,"edu.mv":!0,"gov.mv":!0,"info.mv":!0,"int.mv":!0,"mil.mv":!0,"museum.mv":!0,"name.mv":!0,"net.mv":!0,"org.mv":!0,"pro.mv":!0,mw:!0,"ac.mw":!0,"biz.mw":!0,"co.mw":!0,"com.mw":!0,"coop.mw":!0,"edu.mw":!0,"gov.mw":!0,"int.mw":!0,"museum.mw":!0,"net.mw":!0,"org.mw":!0,mx:!0,"com.mx":!0,"org.mx":!0,"gob.mx":!0,"edu.mx":!0,"net.mx":!0,my:!0,"com.my":!0,"net.my":!0,"org.my":!0,"gov.my":!0,"edu.my":!0,"mil.my":!0,"name.my":!0,"*.mz":!0,"teledata.mz":!1,na:!0,"info.na":!0,"pro.na":!0,"name.na":!0,"school.na":!0,"or.na":!0,"dr.na":!0,"us.na":!0,"mx.na":!0,"ca.na":!0,"in.na":!0,"cc.na":!0,"tv.na":!0,"ws.na":!0,"mobi.na":!0,"co.na":!0,"com.na":!0,"org.na":!0,name:!0,nc:!0,"asso.nc":!0,ne:!0,net:!0,nf:!0,"com.nf":!0,"net.nf":!0,"per.nf":!0,"rec.nf":!0,"web.nf":!0,"arts.nf":!0,"firm.nf":!0,"info.nf":!0,"other.nf":!0,"store.nf":!0,ng:!0,"com.ng":!0,"edu.ng":!0,"name.ng":!0,"net.ng":!0,"org.ng":!0,"sch.ng":!0,"gov.ng":!0,"mil.ng":!0,"mobi.ng":!0,"*.ni":!0,nl:!0,"bv.nl":!0,no:!0,"fhs.no":!0,"vgs.no":!0,"fylkesbibl.no":!0,"folkebibl.no":!0,"museum.no":!0,"idrett.no":!0,"priv.no":!0,"mil.no":!0,"stat.no":!0,"dep.no":!0,"kommune.no":!0,"herad.no":!0,"aa.no":!0,"ah.no":!0,"bu.no":!0,"fm.no":!0,"hl.no":!0,"hm.no":!0,"jan-mayen.no":!0,"mr.no":!0,"nl.no":!0,"nt.no":!0,"of.no":!0,"ol.no":!0,"oslo.no":!0,"rl.no":!0,"sf.no":!0,"st.no":!0,"svalbard.no":!0,"tm.no":!0,"tr.no":!0,"va.no":!0,"vf.no":!0,"gs.aa.no":!0,"gs.ah.no":!0,"gs.bu.no":!0,"gs.fm.no":!0,"gs.hl.no":!0,"gs.hm.no":!0,"gs.jan-mayen.no":!0,"gs.mr.no":!0,"gs.nl.no":!0,"gs.nt.no":!0,"gs.of.no":!0,"gs.ol.no":!0,"gs.oslo.no":!0,"gs.rl.no":!0,"gs.sf.no":!0,"gs.st.no":!0,"gs.svalbard.no":!0,"gs.tm.no":!0,"gs.tr.no":!0,"gs.va.no":!0,"gs.vf.no":!0,"akrehamn.no":!0,"xn--krehamn-dxa.no":!0,"algard.no":!0,"xn--lgrd-poac.no":!0,"arna.no":!0,"brumunddal.no":!0,"bryne.no":!0,"bronnoysund.no":!0,"xn--brnnysund-m8ac.no":!0,"drobak.no":!0,"xn--drbak-wua.no":!0,"egersund.no":!0,"fetsund.no":!0,"floro.no":!0,"xn--flor-jra.no":!0,"fredrikstad.no":!0,"hokksund.no":!0,"honefoss.no":!0,"xn--hnefoss-q1a.no":!0,"jessheim.no":!0,"jorpeland.no":!0,"xn--jrpeland-54a.no":!0,"kirkenes.no":!0,"kopervik.no":!0,"krokstadelva.no":!0,"langevag.no":!0,"xn--langevg-jxa.no":!0,"leirvik.no":!0,"mjondalen.no":!0,"xn--mjndalen-64a.no":!0,"mo-i-rana.no":!0,"mosjoen.no":!0,"xn--mosjen-eya.no":!0,"nesoddtangen.no":!0,"orkanger.no":!0,"osoyro.no":!0,"xn--osyro-wua.no":!0,"raholt.no":!0,"xn--rholt-mra.no":!0,"sandnessjoen.no":!0,"xn--sandnessjen-ogb.no":!0,"skedsmokorset.no":!0,"slattum.no":!0,"spjelkavik.no":!0,"stathelle.no":!0,"stavern.no":!0,"stjordalshalsen.no":!0,"xn--stjrdalshalsen-sqb.no":!0,"tananger.no":!0,"tranby.no":!0,"vossevangen.no":!0,"afjord.no":!0,"xn--fjord-lra.no":!0,"agdenes.no":!0,"al.no":!0,"xn--l-1fa.no":!0,"alesund.no":!0,"xn--lesund-hua.no":!0,"alstahaug.no":!0,"alta.no":!0,"xn--lt-liac.no":!0,"alaheadju.no":!0,"xn--laheadju-7ya.no":!0,"alvdal.no":!0,"amli.no":!0,"xn--mli-tla.no":!0,"amot.no":!0,"xn--mot-tla.no":!0,"andebu.no":!0,"andoy.no":!0,"xn--andy-ira.no":!0,"andasuolo.no":!0,"ardal.no":!0,"xn--rdal-poa.no":!0,"aremark.no":!0,"arendal.no":!0,"xn--s-1fa.no":!0,"aseral.no":!0,"xn--seral-lra.no":!0,"asker.no":!0,"askim.no":!0,"askvoll.no":!0,"askoy.no":!0,"xn--asky-ira.no":!0,"asnes.no":!0,"xn--snes-poa.no":!0,"audnedaln.no":!0,"aukra.no":!0,"aure.no":!0,"aurland.no":!0,"aurskog-holand.no":!0,"xn--aurskog-hland-jnb.no":!0,"austevoll.no":!0,"austrheim.no":!0,"averoy.no":!0,"xn--avery-yua.no":!0,"balestrand.no":!0,"ballangen.no":!0,"balat.no":!0,"xn--blt-elab.no":!0,"balsfjord.no":!0,"bahccavuotna.no":!0,"xn--bhccavuotna-k7a.no":!0,"bamble.no":!0,"bardu.no":!0,"beardu.no":!0,"beiarn.no":!0,"bajddar.no":!0,"xn--bjddar-pta.no":!0,"baidar.no":!0,"xn--bidr-5nac.no":!0,"berg.no":!0,"bergen.no":!0,"berlevag.no":!0,"xn--berlevg-jxa.no":!0,"bearalvahki.no":!0,"xn--bearalvhki-y4a.no":!0,"bindal.no":!0,"birkenes.no":!0,"bjarkoy.no":!0,"xn--bjarky-fya.no":!0,"bjerkreim.no":!0,"bjugn.no":!0,"bodo.no":!0,"xn--bod-2na.no":!0,"badaddja.no":!0,"xn--bdddj-mrabd.no":!0,"budejju.no":!0,"bokn.no":!0,"bremanger.no":!0,"bronnoy.no":!0,"xn--brnny-wuac.no":!0,"bygland.no":!0,"bykle.no":!0,"barum.no":!0,"xn--brum-voa.no":!0,"bo.telemark.no":!0,"xn--b-5ga.telemark.no":!0,"bo.nordland.no":!0,"xn--b-5ga.nordland.no":!0,"bievat.no":!0,"xn--bievt-0qa.no":!0,"bomlo.no":!0,"xn--bmlo-gra.no":!0,"batsfjord.no":!0,"xn--btsfjord-9za.no":!0,"bahcavuotna.no":!0,"xn--bhcavuotna-s4a.no":!0,"dovre.no":!0,"drammen.no":!0,"drangedal.no":!0,"dyroy.no":!0,"xn--dyry-ira.no":!0,"donna.no":!0,"xn--dnna-gra.no":!0,"eid.no":!0,"eidfjord.no":!0,"eidsberg.no":!0,"eidskog.no":!0,"eidsvoll.no":!0,"eigersund.no":!0,"elverum.no":!0,"enebakk.no":!0,"engerdal.no":!0,"etne.no":!0,"etnedal.no":!0,"evenes.no":!0,"evenassi.no":!0,"xn--eveni-0qa01ga.no":!0,"evje-og-hornnes.no":!0,"farsund.no":!0,"fauske.no":!0,"fuossko.no":!0,"fuoisku.no":!0,"fedje.no":!0,"fet.no":!0,"finnoy.no":!0,"xn--finny-yua.no":!0,"fitjar.no":!0,"fjaler.no":!0,"fjell.no":!0,"flakstad.no":!0,"flatanger.no":!0,"flekkefjord.no":!0,"flesberg.no":!0,"flora.no":!0,"fla.no":!0,"xn--fl-zia.no":!0,"folldal.no":!0,"forsand.no":!0,"fosnes.no":!0,"frei.no":!0,"frogn.no":!0,"froland.no":!0,"frosta.no":!0,"frana.no":!0,"xn--frna-woa.no":!0,"froya.no":!0,"xn--frya-hra.no":!0,"fusa.no":!0,"fyresdal.no":!0,"forde.no":!0,"xn--frde-gra.no":!0,"gamvik.no":!0,"gangaviika.no":!0,"xn--ggaviika-8ya47h.no":!0,"gaular.no":!0,"gausdal.no":!0,"gildeskal.no":!0,"xn--gildeskl-g0a.no":!0,"giske.no":!0,"gjemnes.no":!0,"gjerdrum.no":!0,"gjerstad.no":!0,"gjesdal.no":!0,"gjovik.no":!0,"xn--gjvik-wua.no":!0,"gloppen.no":!0,"gol.no":!0,"gran.no":!0,"grane.no":!0,"granvin.no":!0,"gratangen.no":!0,"grimstad.no":!0,"grong.no":!0,"kraanghke.no":!0,"xn--kranghke-b0a.no":!0,"grue.no":!0,"gulen.no":!0,"hadsel.no":!0,"halden.no":!0,"halsa.no":!0,"hamar.no":!0,"hamaroy.no":!0,"habmer.no":!0,"xn--hbmer-xqa.no":!0,"hapmir.no":!0,"xn--hpmir-xqa.no":!0,"hammerfest.no":!0,"hammarfeasta.no":!0,"xn--hmmrfeasta-s4ac.no":!0,"haram.no":!0,"hareid.no":!0,"harstad.no":!0,"hasvik.no":!0,"aknoluokta.no":!0,"xn--koluokta-7ya57h.no":!0,"hattfjelldal.no":!0,"aarborte.no":!0,"haugesund.no":!0,"hemne.no":!0,"hemnes.no":!0,"hemsedal.no":!0,"heroy.more-og-romsdal.no":!0,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":!0,"heroy.nordland.no":!0,"xn--hery-ira.nordland.no":!0,"hitra.no":!0,"hjartdal.no":!0,"hjelmeland.no":!0,"hobol.no":!0,"xn--hobl-ira.no":!0,"hof.no":!0,"hol.no":!0,"hole.no":!0,"holmestrand.no":!0,"holtalen.no":!0,"xn--holtlen-hxa.no":!0,"hornindal.no":!0,"horten.no":!0,"hurdal.no":!0,"hurum.no":!0,"hvaler.no":!0,"hyllestad.no":!0,"hagebostad.no":!0,"xn--hgebostad-g3a.no":!0,"hoyanger.no":!0,"xn--hyanger-q1a.no":!0,"hoylandet.no":!0,"xn--hylandet-54a.no":!0,"ha.no":!0,"xn--h-2fa.no":!0,"ibestad.no":!0,"inderoy.no":!0,"xn--indery-fya.no":!0,"iveland.no":!0,"jevnaker.no":!0,"jondal.no":!0,"jolster.no":!0,"xn--jlster-bya.no":!0,"karasjok.no":!0,"karasjohka.no":!0,"xn--krjohka-hwab49j.no":!0,"karlsoy.no":!0,"galsa.no":!0,"xn--gls-elac.no":!0,"karmoy.no":!0,"xn--karmy-yua.no":!0,"kautokeino.no":!0,"guovdageaidnu.no":!0,"klepp.no":!0,"klabu.no":!0,"xn--klbu-woa.no":!0,"kongsberg.no":!0,"kongsvinger.no":!0,"kragero.no":!0,"xn--krager-gya.no":!0,"kristiansand.no":!0,"kristiansund.no":!0,"krodsherad.no":!0,"xn--krdsherad-m8a.no":!0,"kvalsund.no":!0,"rahkkeravju.no":!0,"xn--rhkkervju-01af.no":!0,"kvam.no":!0,"kvinesdal.no":!0,"kvinnherad.no":!0,"kviteseid.no":!0,"kvitsoy.no":!0,"xn--kvitsy-fya.no":!0,"kvafjord.no":!0, "xn--kvfjord-nxa.no":!0,"giehtavuoatna.no":!0,"kvanangen.no":!0,"xn--kvnangen-k0a.no":!0,"navuotna.no":!0,"xn--nvuotna-hwa.no":!0,"kafjord.no":!0,"xn--kfjord-iua.no":!0,"gaivuotna.no":!0,"xn--givuotna-8ya.no":!0,"larvik.no":!0,"lavangen.no":!0,"lavagis.no":!0,"loabat.no":!0,"xn--loabt-0qa.no":!0,"lebesby.no":!0,"davvesiida.no":!0,"leikanger.no":!0,"leirfjord.no":!0,"leka.no":!0,"leksvik.no":!0,"lenvik.no":!0,"leangaviika.no":!0,"xn--leagaviika-52b.no":!0,"lesja.no":!0,"levanger.no":!0,"lier.no":!0,"lierne.no":!0,"lillehammer.no":!0,"lillesand.no":!0,"lindesnes.no":!0,"lindas.no":!0,"xn--linds-pra.no":!0,"lom.no":!0,"loppa.no":!0,"lahppi.no":!0,"xn--lhppi-xqa.no":!0,"lund.no":!0,"lunner.no":!0,"luroy.no":!0,"xn--lury-ira.no":!0,"luster.no":!0,"lyngdal.no":!0,"lyngen.no":!0,"ivgu.no":!0,"lardal.no":!0,"lerdal.no":!0,"xn--lrdal-sra.no":!0,"lodingen.no":!0,"xn--ldingen-q1a.no":!0,"lorenskog.no":!0,"xn--lrenskog-54a.no":!0,"loten.no":!0,"xn--lten-gra.no":!0,"malvik.no":!0,"masoy.no":!0,"xn--msy-ula0h.no":!0,"muosat.no":!0,"xn--muost-0qa.no":!0,"mandal.no":!0,"marker.no":!0,"marnardal.no":!0,"masfjorden.no":!0,"meland.no":!0,"meldal.no":!0,"melhus.no":!0,"meloy.no":!0,"xn--mely-ira.no":!0,"meraker.no":!0,"xn--merker-kua.no":!0,"moareke.no":!0,"xn--moreke-jua.no":!0,"midsund.no":!0,"midtre-gauldal.no":!0,"modalen.no":!0,"modum.no":!0,"molde.no":!0,"moskenes.no":!0,"moss.no":!0,"mosvik.no":!0,"malselv.no":!0,"xn--mlselv-iua.no":!0,"malatvuopmi.no":!0,"xn--mlatvuopmi-s4a.no":!0,"namdalseid.no":!0,"aejrie.no":!0,"namsos.no":!0,"namsskogan.no":!0,"naamesjevuemie.no":!0,"xn--nmesjevuemie-tcba.no":!0,"laakesvuemie.no":!0,"nannestad.no":!0,"narvik.no":!0,"narviika.no":!0,"naustdal.no":!0,"nedre-eiker.no":!0,"nes.akershus.no":!0,"nes.buskerud.no":!0,"nesna.no":!0,"nesodden.no":!0,"nesseby.no":!0,"unjarga.no":!0,"xn--unjrga-rta.no":!0,"nesset.no":!0,"nissedal.no":!0,"nittedal.no":!0,"nord-aurdal.no":!0,"nord-fron.no":!0,"nord-odal.no":!0,"norddal.no":!0,"nordkapp.no":!0,"davvenjarga.no":!0,"xn--davvenjrga-y4a.no":!0,"nordre-land.no":!0,"nordreisa.no":!0,"raisa.no":!0,"xn--risa-5na.no":!0,"nore-og-uvdal.no":!0,"notodden.no":!0,"naroy.no":!0,"xn--nry-yla5g.no":!0,"notteroy.no":!0,"xn--nttery-byae.no":!0,"odda.no":!0,"oksnes.no":!0,"xn--ksnes-uua.no":!0,"oppdal.no":!0,"oppegard.no":!0,"xn--oppegrd-ixa.no":!0,"orkdal.no":!0,"orland.no":!0,"xn--rland-uua.no":!0,"orskog.no":!0,"xn--rskog-uua.no":!0,"orsta.no":!0,"xn--rsta-fra.no":!0,"os.hedmark.no":!0,"os.hordaland.no":!0,"osen.no":!0,"osteroy.no":!0,"xn--ostery-fya.no":!0,"ostre-toten.no":!0,"xn--stre-toten-zcb.no":!0,"overhalla.no":!0,"ovre-eiker.no":!0,"xn--vre-eiker-k8a.no":!0,"oyer.no":!0,"xn--yer-zna.no":!0,"oygarden.no":!0,"xn--ygarden-p1a.no":!0,"oystre-slidre.no":!0,"xn--ystre-slidre-ujb.no":!0,"porsanger.no":!0,"porsangu.no":!0,"xn--porsgu-sta26f.no":!0,"porsgrunn.no":!0,"radoy.no":!0,"xn--rady-ira.no":!0,"rakkestad.no":!0,"rana.no":!0,"ruovat.no":!0,"randaberg.no":!0,"rauma.no":!0,"rendalen.no":!0,"rennebu.no":!0,"rennesoy.no":!0,"xn--rennesy-v1a.no":!0,"rindal.no":!0,"ringebu.no":!0,"ringerike.no":!0,"ringsaker.no":!0,"rissa.no":!0,"risor.no":!0,"xn--risr-ira.no":!0,"roan.no":!0,"rollag.no":!0,"rygge.no":!0,"ralingen.no":!0,"xn--rlingen-mxa.no":!0,"rodoy.no":!0,"xn--rdy-0nab.no":!0,"romskog.no":!0,"xn--rmskog-bya.no":!0,"roros.no":!0,"xn--rros-gra.no":!0,"rost.no":!0,"xn--rst-0na.no":!0,"royken.no":!0,"xn--ryken-vua.no":!0,"royrvik.no":!0,"xn--ryrvik-bya.no":!0,"rade.no":!0,"xn--rde-ula.no":!0,"salangen.no":!0,"siellak.no":!0,"saltdal.no":!0,"salat.no":!0,"xn--slt-elab.no":!0,"xn--slat-5na.no":!0,"samnanger.no":!0,"sande.more-og-romsdal.no":!0,"sande.xn--mre-og-romsdal-qqb.no":!0,"sande.vestfold.no":!0,"sandefjord.no":!0,"sandnes.no":!0,"sandoy.no":!0,"xn--sandy-yua.no":!0,"sarpsborg.no":!0,"sauda.no":!0,"sauherad.no":!0,"sel.no":!0,"selbu.no":!0,"selje.no":!0,"seljord.no":!0,"sigdal.no":!0,"siljan.no":!0,"sirdal.no":!0,"skaun.no":!0,"skedsmo.no":!0,"ski.no":!0,"skien.no":!0,"skiptvet.no":!0,"skjervoy.no":!0,"xn--skjervy-v1a.no":!0,"skierva.no":!0,"xn--skierv-uta.no":!0,"skjak.no":!0,"xn--skjk-soa.no":!0,"skodje.no":!0,"skanland.no":!0,"xn--sknland-fxa.no":!0,"skanit.no":!0,"xn--sknit-yqa.no":!0,"smola.no":!0,"xn--smla-hra.no":!0,"snillfjord.no":!0,"snasa.no":!0,"xn--snsa-roa.no":!0,"snoasa.no":!0,"snaase.no":!0,"xn--snase-nra.no":!0,"sogndal.no":!0,"sokndal.no":!0,"sola.no":!0,"solund.no":!0,"songdalen.no":!0,"sortland.no":!0,"spydeberg.no":!0,"stange.no":!0,"stavanger.no":!0,"steigen.no":!0,"steinkjer.no":!0,"stjordal.no":!0,"xn--stjrdal-s1a.no":!0,"stokke.no":!0,"stor-elvdal.no":!0,"stord.no":!0,"stordal.no":!0,"storfjord.no":!0,"omasvuotna.no":!0,"strand.no":!0,"stranda.no":!0,"stryn.no":!0,"sula.no":!0,"suldal.no":!0,"sund.no":!0,"sunndal.no":!0,"surnadal.no":!0,"sveio.no":!0,"svelvik.no":!0,"sykkylven.no":!0,"sogne.no":!0,"xn--sgne-gra.no":!0,"somna.no":!0,"xn--smna-gra.no":!0,"sondre-land.no":!0,"xn--sndre-land-0cb.no":!0,"sor-aurdal.no":!0,"xn--sr-aurdal-l8a.no":!0,"sor-fron.no":!0,"xn--sr-fron-q1a.no":!0,"sor-odal.no":!0,"xn--sr-odal-q1a.no":!0,"sor-varanger.no":!0,"xn--sr-varanger-ggb.no":!0,"matta-varjjat.no":!0,"xn--mtta-vrjjat-k7af.no":!0,"sorfold.no":!0,"xn--srfold-bya.no":!0,"sorreisa.no":!0,"xn--srreisa-q1a.no":!0,"sorum.no":!0,"xn--srum-gra.no":!0,"tana.no":!0,"deatnu.no":!0,"time.no":!0,"tingvoll.no":!0,"tinn.no":!0,"tjeldsund.no":!0,"dielddanuorri.no":!0,"tjome.no":!0,"xn--tjme-hra.no":!0,"tokke.no":!0,"tolga.no":!0,"torsken.no":!0,"tranoy.no":!0,"xn--trany-yua.no":!0,"tromso.no":!0,"xn--troms-zua.no":!0,"tromsa.no":!0,"romsa.no":!0,"trondheim.no":!0,"troandin.no":!0,"trysil.no":!0,"trana.no":!0,"xn--trna-woa.no":!0,"trogstad.no":!0,"xn--trgstad-r1a.no":!0,"tvedestrand.no":!0,"tydal.no":!0,"tynset.no":!0,"tysfjord.no":!0,"divtasvuodna.no":!0,"divttasvuotna.no":!0,"tysnes.no":!0,"tysvar.no":!0,"xn--tysvr-vra.no":!0,"tonsberg.no":!0,"xn--tnsberg-q1a.no":!0,"ullensaker.no":!0,"ullensvang.no":!0,"ulvik.no":!0,"utsira.no":!0,"vadso.no":!0,"xn--vads-jra.no":!0,"cahcesuolo.no":!0,"xn--hcesuolo-7ya35b.no":!0,"vaksdal.no":!0,"valle.no":!0,"vang.no":!0,"vanylven.no":!0,"vardo.no":!0,"xn--vard-jra.no":!0,"varggat.no":!0,"xn--vrggt-xqad.no":!0,"vefsn.no":!0,"vaapste.no":!0,"vega.no":!0,"vegarshei.no":!0,"xn--vegrshei-c0a.no":!0,"vennesla.no":!0,"verdal.no":!0,"verran.no":!0,"vestby.no":!0,"vestnes.no":!0,"vestre-slidre.no":!0,"vestre-toten.no":!0,"vestvagoy.no":!0,"xn--vestvgy-ixa6o.no":!0,"vevelstad.no":!0,"vik.no":!0,"vikna.no":!0,"vindafjord.no":!0,"volda.no":!0,"voss.no":!0,"varoy.no":!0,"xn--vry-yla5g.no":!0,"vagan.no":!0,"xn--vgan-qoa.no":!0,"voagat.no":!0,"vagsoy.no":!0,"xn--vgsy-qoa0j.no":!0,"vaga.no":!0,"xn--vg-yiab.no":!0,"valer.ostfold.no":!0,"xn--vler-qoa.xn--stfold-9xa.no":!0,"valer.hedmark.no":!0,"xn--vler-qoa.hedmark.no":!0,"*.np":!0,nr:!0,"biz.nr":!0,"info.nr":!0,"gov.nr":!0,"edu.nr":!0,"org.nr":!0,"net.nr":!0,"com.nr":!0,nu:!0,nz:!0,"ac.nz":!0,"co.nz":!0,"cri.nz":!0,"geek.nz":!0,"gen.nz":!0,"govt.nz":!0,"health.nz":!0,"iwi.nz":!0,"kiwi.nz":!0,"maori.nz":!0,"mil.nz":!0,"xn--mori-qsa.nz":!0,"net.nz":!0,"org.nz":!0,"parliament.nz":!0,"school.nz":!0,om:!0,"co.om":!0,"com.om":!0,"edu.om":!0,"gov.om":!0,"med.om":!0,"museum.om":!0,"net.om":!0,"org.om":!0,"pro.om":!0,org:!0,pa:!0,"ac.pa":!0,"gob.pa":!0,"com.pa":!0,"org.pa":!0,"sld.pa":!0,"edu.pa":!0,"net.pa":!0,"ing.pa":!0,"abo.pa":!0,"med.pa":!0,"nom.pa":!0,pe:!0,"edu.pe":!0,"gob.pe":!0,"nom.pe":!0,"mil.pe":!0,"org.pe":!0,"com.pe":!0,"net.pe":!0,pf:!0,"com.pf":!0,"org.pf":!0,"edu.pf":!0,"*.pg":!0,ph:!0,"com.ph":!0,"net.ph":!0,"org.ph":!0,"gov.ph":!0,"edu.ph":!0,"ngo.ph":!0,"mil.ph":!0,"i.ph":!0,pk:!0,"com.pk":!0,"net.pk":!0,"edu.pk":!0,"org.pk":!0,"fam.pk":!0,"biz.pk":!0,"web.pk":!0,"gov.pk":!0,"gob.pk":!0,"gok.pk":!0,"gon.pk":!0,"gop.pk":!0,"gos.pk":!0,"info.pk":!0,pl:!0,"com.pl":!0,"net.pl":!0,"org.pl":!0,"aid.pl":!0,"agro.pl":!0,"atm.pl":!0,"auto.pl":!0,"biz.pl":!0,"edu.pl":!0,"gmina.pl":!0,"gsm.pl":!0,"info.pl":!0,"mail.pl":!0,"miasta.pl":!0,"media.pl":!0,"mil.pl":!0,"nieruchomosci.pl":!0,"nom.pl":!0,"pc.pl":!0,"powiat.pl":!0,"priv.pl":!0,"realestate.pl":!0,"rel.pl":!0,"sex.pl":!0,"shop.pl":!0,"sklep.pl":!0,"sos.pl":!0,"szkola.pl":!0,"targi.pl":!0,"tm.pl":!0,"tourism.pl":!0,"travel.pl":!0,"turystyka.pl":!0,"gov.pl":!0,"ap.gov.pl":!0,"ic.gov.pl":!0,"is.gov.pl":!0,"us.gov.pl":!0,"kmpsp.gov.pl":!0,"kppsp.gov.pl":!0,"kwpsp.gov.pl":!0,"psp.gov.pl":!0,"wskr.gov.pl":!0,"kwp.gov.pl":!0,"mw.gov.pl":!0,"ug.gov.pl":!0,"um.gov.pl":!0,"umig.gov.pl":!0,"ugim.gov.pl":!0,"upow.gov.pl":!0,"uw.gov.pl":!0,"starostwo.gov.pl":!0,"pa.gov.pl":!0,"po.gov.pl":!0,"psse.gov.pl":!0,"pup.gov.pl":!0,"rzgw.gov.pl":!0,"sa.gov.pl":!0,"so.gov.pl":!0,"sr.gov.pl":!0,"wsa.gov.pl":!0,"sko.gov.pl":!0,"uzs.gov.pl":!0,"wiih.gov.pl":!0,"winb.gov.pl":!0,"pinb.gov.pl":!0,"wios.gov.pl":!0,"witd.gov.pl":!0,"wzmiuw.gov.pl":!0,"piw.gov.pl":!0,"wiw.gov.pl":!0,"griw.gov.pl":!0,"wif.gov.pl":!0,"oum.gov.pl":!0,"sdn.gov.pl":!0,"zp.gov.pl":!0,"uppo.gov.pl":!0,"mup.gov.pl":!0,"wuoz.gov.pl":!0,"konsulat.gov.pl":!0,"oirm.gov.pl":!0,"augustow.pl":!0,"babia-gora.pl":!0,"bedzin.pl":!0,"beskidy.pl":!0,"bialowieza.pl":!0,"bialystok.pl":!0,"bielawa.pl":!0,"bieszczady.pl":!0,"boleslawiec.pl":!0,"bydgoszcz.pl":!0,"bytom.pl":!0,"cieszyn.pl":!0,"czeladz.pl":!0,"czest.pl":!0,"dlugoleka.pl":!0,"elblag.pl":!0,"elk.pl":!0,"glogow.pl":!0,"gniezno.pl":!0,"gorlice.pl":!0,"grajewo.pl":!0,"ilawa.pl":!0,"jaworzno.pl":!0,"jelenia-gora.pl":!0,"jgora.pl":!0,"kalisz.pl":!0,"kazimierz-dolny.pl":!0,"karpacz.pl":!0,"kartuzy.pl":!0,"kaszuby.pl":!0,"katowice.pl":!0,"kepno.pl":!0,"ketrzyn.pl":!0,"klodzko.pl":!0,"kobierzyce.pl":!0,"kolobrzeg.pl":!0,"konin.pl":!0,"konskowola.pl":!0,"kutno.pl":!0,"lapy.pl":!0,"lebork.pl":!0,"legnica.pl":!0,"lezajsk.pl":!0,"limanowa.pl":!0,"lomza.pl":!0,"lowicz.pl":!0,"lubin.pl":!0,"lukow.pl":!0,"malbork.pl":!0,"malopolska.pl":!0,"mazowsze.pl":!0,"mazury.pl":!0,"mielec.pl":!0,"mielno.pl":!0,"mragowo.pl":!0,"naklo.pl":!0,"nowaruda.pl":!0,"nysa.pl":!0,"olawa.pl":!0,"olecko.pl":!0,"olkusz.pl":!0,"olsztyn.pl":!0,"opoczno.pl":!0,"opole.pl":!0,"ostroda.pl":!0,"ostroleka.pl":!0,"ostrowiec.pl":!0,"ostrowwlkp.pl":!0,"pila.pl":!0,"pisz.pl":!0,"podhale.pl":!0,"podlasie.pl":!0,"polkowice.pl":!0,"pomorze.pl":!0,"pomorskie.pl":!0,"prochowice.pl":!0,"pruszkow.pl":!0,"przeworsk.pl":!0,"pulawy.pl":!0,"radom.pl":!0,"rawa-maz.pl":!0,"rybnik.pl":!0,"rzeszow.pl":!0,"sanok.pl":!0,"sejny.pl":!0,"slask.pl":!0,"slupsk.pl":!0,"sosnowiec.pl":!0,"stalowa-wola.pl":!0,"skoczow.pl":!0,"starachowice.pl":!0,"stargard.pl":!0,"suwalki.pl":!0,"swidnica.pl":!0,"swiebodzin.pl":!0,"swinoujscie.pl":!0,"szczecin.pl":!0,"szczytno.pl":!0,"tarnobrzeg.pl":!0,"tgory.pl":!0,"turek.pl":!0,"tychy.pl":!0,"ustka.pl":!0,"walbrzych.pl":!0,"warmia.pl":!0,"warszawa.pl":!0,"waw.pl":!0,"wegrow.pl":!0,"wielun.pl":!0,"wlocl.pl":!0,"wloclawek.pl":!0,"wodzislaw.pl":!0,"wolomin.pl":!0,"wroclaw.pl":!0,"zachpomor.pl":!0,"zagan.pl":!0,"zarow.pl":!0,"zgora.pl":!0,"zgorzelec.pl":!0,pm:!0,pn:!0,"gov.pn":!0,"co.pn":!0,"org.pn":!0,"edu.pn":!0,"net.pn":!0,post:!0,pr:!0,"com.pr":!0,"net.pr":!0,"org.pr":!0,"gov.pr":!0,"edu.pr":!0,"isla.pr":!0,"pro.pr":!0,"biz.pr":!0,"info.pr":!0,"name.pr":!0,"est.pr":!0,"prof.pr":!0,"ac.pr":!0,pro:!0,"aca.pro":!0,"bar.pro":!0,"cpa.pro":!0,"jur.pro":!0,"law.pro":!0,"med.pro":!0,"eng.pro":!0,ps:!0,"edu.ps":!0,"gov.ps":!0,"sec.ps":!0,"plo.ps":!0,"com.ps":!0,"org.ps":!0,"net.ps":!0,pt:!0,"net.pt":!0,"gov.pt":!0,"org.pt":!0,"edu.pt":!0,"int.pt":!0,"publ.pt":!0,"com.pt":!0,"nome.pt":!0,pw:!0,"co.pw":!0,"ne.pw":!0,"or.pw":!0,"ed.pw":!0,"go.pw":!0,"belau.pw":!0,py:!0,"com.py":!0,"coop.py":!0,"edu.py":!0,"gov.py":!0,"mil.py":!0,"net.py":!0,"org.py":!0,qa:!0,"com.qa":!0,"edu.qa":!0,"gov.qa":!0,"mil.qa":!0,"name.qa":!0,"net.qa":!0,"org.qa":!0,"sch.qa":!0,re:!0,"com.re":!0,"asso.re":!0,"nom.re":!0,ro:!0,"com.ro":!0,"org.ro":!0,"tm.ro":!0,"nt.ro":!0,"nom.ro":!0,"info.ro":!0,"rec.ro":!0,"arts.ro":!0,"firm.ro":!0,"store.ro":!0,"www.ro":!0,rs:!0,"co.rs":!0,"org.rs":!0,"edu.rs":!0,"ac.rs":!0,"gov.rs":!0,"in.rs":!0,ru:!0,"ac.ru":!0,"com.ru":!0,"edu.ru":!0,"int.ru":!0,"net.ru":!0,"org.ru":!0,"pp.ru":!0,"adygeya.ru":!0,"altai.ru":!0,"amur.ru":!0,"arkhangelsk.ru":!0,"astrakhan.ru":!0,"bashkiria.ru":!0,"belgorod.ru":!0,"bir.ru":!0,"bryansk.ru":!0,"buryatia.ru":!0,"cbg.ru":!0,"chel.ru":!0,"chelyabinsk.ru":!0,"chita.ru":!0,"chukotka.ru":!0,"chuvashia.ru":!0,"dagestan.ru":!0,"dudinka.ru":!0,"e-burg.ru":!0,"grozny.ru":!0,"irkutsk.ru":!0,"ivanovo.ru":!0,"izhevsk.ru":!0,"jar.ru":!0,"joshkar-ola.ru":!0,"kalmykia.ru":!0,"kaluga.ru":!0,"kamchatka.ru":!0,"karelia.ru":!0,"kazan.ru":!0,"kchr.ru":!0,"kemerovo.ru":!0,"khabarovsk.ru":!0,"khakassia.ru":!0,"khv.ru":!0,"kirov.ru":!0,"koenig.ru":!0,"komi.ru":!0,"kostroma.ru":!0,"krasnoyarsk.ru":!0,"kuban.ru":!0,"kurgan.ru":!0,"kursk.ru":!0,"lipetsk.ru":!0,"magadan.ru":!0,"mari.ru":!0,"mari-el.ru":!0,"marine.ru":!0,"mordovia.ru":!0,"msk.ru":!0,"murmansk.ru":!0,"nalchik.ru":!0,"nnov.ru":!0,"nov.ru":!0,"novosibirsk.ru":!0,"nsk.ru":!0,"omsk.ru":!0,"orenburg.ru":!0,"oryol.ru":!0,"palana.ru":!0,"penza.ru":!0,"perm.ru":!0,"ptz.ru":!0,"rnd.ru":!0,"ryazan.ru":!0,"sakhalin.ru":!0,"samara.ru":!0,"saratov.ru":!0,"simbirsk.ru":!0,"smolensk.ru":!0,"spb.ru":!0,"stavropol.ru":!0,"stv.ru":!0,"surgut.ru":!0,"tambov.ru":!0,"tatarstan.ru":!0,"tom.ru":!0,"tomsk.ru":!0,"tsaritsyn.ru":!0,"tsk.ru":!0,"tula.ru":!0,"tuva.ru":!0,"tver.ru":!0,"tyumen.ru":!0,"udm.ru":!0,"udmurtia.ru":!0,"ulan-ude.ru":!0,"vladikavkaz.ru":!0,"vladimir.ru":!0,"vladivostok.ru":!0,"volgograd.ru":!0,"vologda.ru":!0,"voronezh.ru":!0,"vrn.ru":!0,"vyatka.ru":!0,"yakutia.ru":!0,"yamal.ru":!0,"yaroslavl.ru":!0,"yekaterinburg.ru":!0,"yuzhno-sakhalinsk.ru":!0,"amursk.ru":!0,"baikal.ru":!0,"cmw.ru":!0,"fareast.ru":!0,"jamal.ru":!0,"kms.ru":!0,"k-uralsk.ru":!0,"kustanai.ru":!0,"kuzbass.ru":!0,"magnitka.ru":!0,"mytis.ru":!0,"nakhodka.ru":!0,"nkz.ru":!0,"norilsk.ru":!0,"oskol.ru":!0,"pyatigorsk.ru":!0,"rubtsovsk.ru":!0,"snz.ru":!0,"syzran.ru":!0,"vdonsk.ru":!0,"zgrad.ru":!0,"gov.ru":!0,"mil.ru":!0,"test.ru":!0,rw:!0,"gov.rw":!0,"net.rw":!0,"edu.rw":!0,"ac.rw":!0,"com.rw":!0,"co.rw":!0,"int.rw":!0,"mil.rw":!0,"gouv.rw":!0,sa:!0,"com.sa":!0,"net.sa":!0,"org.sa":!0,"gov.sa":!0,"med.sa":!0,"pub.sa":!0,"edu.sa":!0,"sch.sa":!0,sb:!0,"com.sb":!0,"edu.sb":!0,"gov.sb":!0,"net.sb":!0,"org.sb":!0,sc:!0,"com.sc":!0,"gov.sc":!0,"net.sc":!0,"org.sc":!0,"edu.sc":!0,sd:!0,"com.sd":!0,"net.sd":!0,"org.sd":!0,"edu.sd":!0,"med.sd":!0,"tv.sd":!0,"gov.sd":!0,"info.sd":!0,se:!0,"a.se":!0,"ac.se":!0,"b.se":!0,"bd.se":!0,"brand.se":!0,"c.se":!0,"d.se":!0,"e.se":!0,"f.se":!0,"fh.se":!0,"fhsk.se":!0,"fhv.se":!0,"g.se":!0,"h.se":!0,"i.se":!0,"k.se":!0,"komforb.se":!0,"kommunalforbund.se":!0,"komvux.se":!0,"l.se":!0,"lanbib.se":!0,"m.se":!0,"n.se":!0,"naturbruksgymn.se":!0,"o.se":!0,"org.se":!0,"p.se":!0,"parti.se":!0,"pp.se":!0,"press.se":!0,"r.se":!0,"s.se":!0,"t.se":!0,"tm.se":!0,"u.se":!0,"w.se":!0,"x.se":!0,"y.se":!0,"z.se":!0,sg:!0,"com.sg":!0,"net.sg":!0,"org.sg":!0,"gov.sg":!0,"edu.sg":!0,"per.sg":!0,sh:!0,"com.sh":!0,"net.sh":!0,"gov.sh":!0,"org.sh":!0,"mil.sh":!0,si:!0,sj:!0,sk:!0,sl:!0,"com.sl":!0,"net.sl":!0,"edu.sl":!0,"gov.sl":!0,"org.sl":!0,sm:!0,sn:!0,"art.sn":!0,"com.sn":!0,"edu.sn":!0,"gouv.sn":!0,"org.sn":!0,"perso.sn":!0,"univ.sn":!0,so:!0,"com.so":!0,"net.so":!0,"org.so":!0,sr:!0,st:!0,"co.st":!0,"com.st":!0,"consulado.st":!0,"edu.st":!0,"embaixada.st":!0,"gov.st":!0,"mil.st":!0,"net.st":!0,"org.st":!0,"principe.st":!0,"saotome.st":!0,"store.st":!0,su:!0,"adygeya.su":!0,"arkhangelsk.su":!0,"balashov.su":!0,"bashkiria.su":!0,"bryansk.su":!0,"dagestan.su":!0,"grozny.su":!0,"ivanovo.su":!0,"kalmykia.su":!0,"kaluga.su":!0,"karelia.su":!0,"khakassia.su":!0,"krasnodar.su":!0,"kurgan.su":!0,"lenug.su":!0,"mordovia.su":!0,"msk.su":!0,"murmansk.su":!0,"nalchik.su":!0,"nov.su":!0,"obninsk.su":!0,"penza.su":!0,"pokrovsk.su":!0,"sochi.su":!0,"spb.su":!0,"togliatti.su":!0,"troitsk.su":!0,"tula.su":!0,"tuva.su":!0,"vladikavkaz.su":!0,"vladimir.su":!0,"vologda.su":!0,sv:!0,"com.sv":!0,"edu.sv":!0,"gob.sv":!0,"org.sv":!0,"red.sv":!0,sx:!0,"gov.sx":!0,sy:!0,"edu.sy":!0,"gov.sy":!0,"net.sy":!0,"mil.sy":!0,"com.sy":!0,"org.sy":!0,sz:!0,"co.sz":!0,"ac.sz":!0,"org.sz":!0,tc:!0,td:!0,tel:!0,tf:!0,tg:!0,th:!0,"ac.th":!0,"co.th":!0,"go.th":!0,"in.th":!0,"mi.th":!0,"net.th":!0,"or.th":!0,tj:!0,"ac.tj":!0,"biz.tj":!0,"co.tj":!0,"com.tj":!0,"edu.tj":!0,"go.tj":!0,"gov.tj":!0,"int.tj":!0,"mil.tj":!0,"name.tj":!0,"net.tj":!0,"nic.tj":!0,"org.tj":!0,"test.tj":!0,"web.tj":!0,tk:!0,tl:!0,"gov.tl":!0,tm:!0,"com.tm":!0,"co.tm":!0,"org.tm":!0,"net.tm":!0,"nom.tm":!0,"gov.tm":!0,"mil.tm":!0,"edu.tm":!0,tn:!0,"com.tn":!0,"ens.tn":!0,"fin.tn":!0,"gov.tn":!0,"ind.tn":!0,"intl.tn":!0,"nat.tn":!0,"net.tn":!0,"org.tn":!0,"info.tn":!0,"perso.tn":!0,"tourism.tn":!0,"edunet.tn":!0,"rnrt.tn":!0,"rns.tn":!0,"rnu.tn":!0,"mincom.tn":!0,"agrinet.tn":!0,"defense.tn":!0,"turen.tn":!0,to:!0,"com.to":!0,"gov.to":!0,"net.to":!0,"org.to":!0,"edu.to":!0,"mil.to":!0,tp:!0,tr:!0,"com.tr":!0,"info.tr":!0,"biz.tr":!0,"net.tr":!0,"org.tr":!0,"web.tr":!0,"gen.tr":!0,"tv.tr":!0,"av.tr":!0,"dr.tr":!0,"bbs.tr":!0,"name.tr":!0,"tel.tr":!0,"gov.tr":!0,"bel.tr":!0,"pol.tr":!0,"mil.tr":!0,"k12.tr":!0,"edu.tr":!0,"kep.tr":!0,"nc.tr":!0,"gov.nc.tr":!0,travel:!0,tt:!0,"co.tt":!0,"com.tt":!0,"org.tt":!0,"net.tt":!0,"biz.tt":!0,"info.tt":!0,"pro.tt":!0,"int.tt":!0,"coop.tt":!0,"jobs.tt":!0,"mobi.tt":!0,"travel.tt":!0,"museum.tt":!0,"aero.tt":!0,"name.tt":!0,"gov.tt":!0,"edu.tt":!0,tv:!0,tw:!0,"edu.tw":!0,"gov.tw":!0,"mil.tw":!0,"com.tw":!0,"net.tw":!0,"org.tw":!0,"idv.tw":!0,"game.tw":!0,"ebiz.tw":!0,"club.tw":!0,"xn--zf0ao64a.tw":!0,"xn--uc0atv.tw":!0,"xn--czrw28b.tw":!0,tz:!0,"ac.tz":!0,"co.tz":!0,"go.tz":!0,"hotel.tz":!0,"info.tz":!0,"me.tz":!0,"mil.tz":!0,"mobi.tz":!0,"ne.tz":!0,"or.tz":!0,"sc.tz":!0,"tv.tz":!0,ua:!0,"com.ua":!0,"edu.ua":!0,"gov.ua":!0,"in.ua":!0,"net.ua":!0,"org.ua":!0,"cherkassy.ua":!0,"cherkasy.ua":!0,"chernigov.ua":!0,"chernihiv.ua":!0,"chernivtsi.ua":!0,"chernovtsy.ua":!0,"ck.ua":!0,"cn.ua":!0,"cr.ua":!0,"crimea.ua":!0,"cv.ua":!0,"dn.ua":!0,"dnepropetrovsk.ua":!0,"dnipropetrovsk.ua":!0,"dominic.ua":!0,"donetsk.ua":!0,"dp.ua":!0,"if.ua":!0,"ivano-frankivsk.ua":!0,"kh.ua":!0,"kharkiv.ua":!0,"kharkov.ua":!0,"kherson.ua":!0,"khmelnitskiy.ua":!0,"khmelnytskyi.ua":!0,"kiev.ua":!0,"kirovograd.ua":!0,"km.ua":!0,"kr.ua":!0,"krym.ua":!0,"ks.ua":!0,"kv.ua":!0,"kyiv.ua":!0,"lg.ua":!0,"lt.ua":!0,"lugansk.ua":!0,"lutsk.ua":!0,"lv.ua":!0,"lviv.ua":!0,"mk.ua":!0,"mykolaiv.ua":!0,"nikolaev.ua":!0,"od.ua":!0,"odesa.ua":!0,"odessa.ua":!0,"pl.ua":!0,"poltava.ua":!0,"rivne.ua":!0,"rovno.ua":!0,"rv.ua":!0,"sb.ua":!0,"sebastopol.ua":!0,"sevastopol.ua":!0,"sm.ua":!0,"sumy.ua":!0,"te.ua":!0,"ternopil.ua":!0,"uz.ua":!0,"uzhgorod.ua":!0,"vinnica.ua":!0,"vinnytsia.ua":!0,"vn.ua":!0,"volyn.ua":!0,"yalta.ua":!0,"zaporizhzhe.ua":!0,"zaporizhzhia.ua":!0,"zhitomir.ua":!0,"zhytomyr.ua":!0,"zp.ua":!0,"zt.ua":!0,ug:!0,"co.ug":!0,"or.ug":!0,"ac.ug":!0,"sc.ug":!0,"go.ug":!0,"ne.ug":!0,"com.ug":!0,"org.ug":!0,uk:!0,"ac.uk":!0,"co.uk":!0,"gov.uk":!0,"ltd.uk":!0,"me.uk":!0,"net.uk":!0,"nhs.uk":!0,"org.uk":!0,"plc.uk":!0,"police.uk":!0,"*.sch.uk":!0,us:!0,"dni.us":!0,"fed.us":!0,"isa.us":!0,"kids.us":!0,"nsn.us":!0,"ak.us":!0,"al.us":!0,"ar.us":!0,"as.us":!0,"az.us":!0,"ca.us":!0,"co.us":!0,"ct.us":!0,"dc.us":!0,"de.us":!0,"fl.us":!0,"ga.us":!0,"gu.us":!0,"hi.us":!0,"ia.us":!0,"id.us":!0,"il.us":!0,"in.us":!0,"ks.us":!0,"ky.us":!0,"la.us":!0,"ma.us":!0,"md.us":!0,"me.us":!0,"mi.us":!0,"mn.us":!0,"mo.us":!0,"ms.us":!0,"mt.us":!0,"nc.us":!0,"nd.us":!0,"ne.us":!0,"nh.us":!0,"nj.us":!0,"nm.us":!0,"nv.us":!0,"ny.us":!0,"oh.us":!0,"ok.us":!0,"or.us":!0,"pa.us":!0,"pr.us":!0,"ri.us":!0,"sc.us":!0,"sd.us":!0,"tn.us":!0,"tx.us":!0,"ut.us":!0,"vi.us":!0,"vt.us":!0,"va.us":!0,"wa.us":!0,"wi.us":!0,"wv.us":!0,"wy.us":!0,"k12.ak.us":!0,"k12.al.us":!0,"k12.ar.us":!0,"k12.as.us":!0,"k12.az.us":!0,"k12.ca.us":!0,"k12.co.us":!0,"k12.ct.us":!0,"k12.dc.us":!0,"k12.de.us":!0,"k12.fl.us":!0,"k12.ga.us":!0,"k12.gu.us":!0,"k12.ia.us":!0,"k12.id.us":!0,"k12.il.us":!0,"k12.in.us":!0,"k12.ks.us":!0,"k12.ky.us":!0,"k12.la.us":!0,"k12.ma.us":!0,"k12.md.us":!0,"k12.me.us":!0,"k12.mi.us":!0,"k12.mn.us":!0,"k12.mo.us":!0,"k12.ms.us":!0,"k12.mt.us":!0,"k12.nc.us":!0,"k12.ne.us":!0,"k12.nh.us":!0,"k12.nj.us":!0,"k12.nm.us":!0,"k12.nv.us":!0,"k12.ny.us":!0,"k12.oh.us":!0,"k12.ok.us":!0,"k12.or.us":!0,"k12.pa.us":!0,"k12.pr.us":!0,"k12.ri.us":!0,"k12.sc.us":!0,"k12.tn.us":!0,"k12.tx.us":!0,"k12.ut.us":!0,"k12.vi.us":!0,"k12.vt.us":!0,"k12.va.us":!0,"k12.wa.us":!0,"k12.wi.us":!0,"k12.wy.us":!0,"cc.ak.us":!0,"cc.al.us":!0,"cc.ar.us":!0,"cc.as.us":!0,"cc.az.us":!0,"cc.ca.us":!0,"cc.co.us":!0,"cc.ct.us":!0,"cc.dc.us":!0,"cc.de.us":!0,"cc.fl.us":!0,"cc.ga.us":!0,"cc.gu.us":!0,"cc.hi.us":!0,"cc.ia.us":!0,"cc.id.us":!0,"cc.il.us":!0,"cc.in.us":!0,"cc.ks.us":!0,"cc.ky.us":!0,"cc.la.us":!0,"cc.ma.us":!0,"cc.md.us":!0,"cc.me.us":!0,"cc.mi.us":!0,"cc.mn.us":!0,"cc.mo.us":!0,"cc.ms.us":!0,"cc.mt.us":!0,"cc.nc.us":!0,"cc.nd.us":!0,"cc.ne.us":!0,"cc.nh.us":!0,"cc.nj.us":!0,"cc.nm.us":!0,"cc.nv.us":!0,"cc.ny.us":!0,"cc.oh.us":!0,"cc.ok.us":!0,"cc.or.us":!0,"cc.pa.us":!0,"cc.pr.us":!0,"cc.ri.us":!0,"cc.sc.us":!0,"cc.sd.us":!0,"cc.tn.us":!0,"cc.tx.us":!0,"cc.ut.us":!0,"cc.vi.us":!0,"cc.vt.us":!0,"cc.va.us":!0,"cc.wa.us":!0,"cc.wi.us":!0,"cc.wv.us":!0,"cc.wy.us":!0,"lib.ak.us":!0,"lib.al.us":!0,"lib.ar.us":!0,"lib.as.us":!0,"lib.az.us":!0,"lib.ca.us":!0,"lib.co.us":!0,"lib.ct.us":!0,"lib.dc.us":!0,"lib.de.us":!0,"lib.fl.us":!0,"lib.ga.us":!0,"lib.gu.us":!0,"lib.hi.us":!0,"lib.ia.us":!0,"lib.id.us":!0,"lib.il.us":!0,"lib.in.us":!0,"lib.ks.us":!0,"lib.ky.us":!0,"lib.la.us":!0,"lib.ma.us":!0,"lib.md.us":!0,"lib.me.us":!0,"lib.mi.us":!0,"lib.mn.us":!0,"lib.mo.us":!0,"lib.ms.us":!0,"lib.mt.us":!0,"lib.nc.us":!0,"lib.nd.us":!0,"lib.ne.us":!0,"lib.nh.us":!0,"lib.nj.us":!0,"lib.nm.us":!0,"lib.nv.us":!0,"lib.ny.us":!0,"lib.oh.us":!0,"lib.ok.us":!0,"lib.or.us":!0,"lib.pa.us":!0,"lib.pr.us":!0,"lib.ri.us":!0,"lib.sc.us":!0,"lib.sd.us":!0,"lib.tn.us":!0,"lib.tx.us":!0,"lib.ut.us":!0,"lib.vi.us":!0,"lib.vt.us":!0,"lib.va.us":!0,"lib.wa.us":!0,"lib.wi.us":!0,"lib.wy.us":!0,"pvt.k12.ma.us":!0,"chtr.k12.ma.us":!0,"paroch.k12.ma.us":!0,uy:!0,"com.uy":!0,"edu.uy":!0,"gub.uy":!0,"mil.uy":!0,"net.uy":!0,"org.uy":!0,uz:!0,"co.uz":!0,"com.uz":!0,"net.uz":!0,"org.uz":!0,va:!0,vc:!0,"com.vc":!0,"net.vc":!0,"org.vc":!0,"gov.vc":!0,"mil.vc":!0,"edu.vc":!0,ve:!0,"arts.ve":!0,"co.ve":!0,"com.ve":!0,"e12.ve":!0,"edu.ve":!0,"firm.ve":!0,"gob.ve":!0,"gov.ve":!0,"info.ve":!0,"int.ve":!0,"mil.ve":!0,"net.ve":!0,"org.ve":!0,"rec.ve":!0,"store.ve":!0,"tec.ve":!0,"web.ve":!0,vg:!0,vi:!0,"co.vi":!0,"com.vi":!0,"k12.vi":!0,"net.vi":!0,"org.vi":!0,vn:!0,"com.vn":!0,"net.vn":!0,"org.vn":!0,"edu.vn":!0,"gov.vn":!0,"int.vn":!0,"ac.vn":!0,"biz.vn":!0,"info.vn":!0,"name.vn":!0,"pro.vn":!0,"health.vn":!0,vu:!0,"com.vu":!0,"edu.vu":!0,"net.vu":!0,"org.vu":!0,wf:!0,ws:!0,"com.ws":!0,"net.ws":!0,"org.ws":!0,"gov.ws":!0,"edu.ws":!0,yt:!0,"xn--mgbaam7a8h":!0,"xn--y9a3aq":!0,"xn--54b7fta0cc":!0,"xn--90ais":!0,"xn--fiqs8s":!0,"xn--fiqz9s":!0,"xn--lgbbat1ad8j":!0,"xn--wgbh1c":!0,"xn--node":!0,"xn--qxam":!0,"xn--j6w193g":!0,"xn--h2brj9c":!0,"xn--mgbbh1a71e":!0,"xn--fpcrj9c3d":!0,"xn--gecrj9c":!0,"xn--s9brj9c":!0,"xn--45brj9c":!0,"xn--xkc2dl3a5ee0h":!0,"xn--mgba3a4f16a":!0,"xn--mgba3a4fra":!0,"xn--mgbtx2b":!0,"xn--mgbayh7gpa":!0,"xn--3e0b707e":!0,"xn--80ao21a":!0,"xn--fzc2c9e2c":!0,"xn--xkc2al3hye2a":!0,"xn--mgbc0a9azcg":!0,"xn--d1alf":!0,"xn--l1acc":!0,"xn--mix891f":!0,"xn--mix082f":!0,"xn--mgbx4cd0ab":!0,"xn--mgb9awbf":!0,"xn--mgbai9azgqp6j":!0,"xn--mgbai9a5eva00b":!0,"xn--ygbi2ammx":!0,"xn--90a3ac":!0,"xn--o1ac.xn--90a3ac":!0,"xn--c1avg.xn--90a3ac":!0,"xn--90azh.xn--90a3ac":!0,"xn--d1at.xn--90a3ac":!0,"xn--o1ach.xn--90a3ac":!0,"xn--80au.xn--90a3ac":!0,"xn--p1ai":!0,"xn--wgbl6a":!0,"xn--mgberp4a5d4ar":!0,"xn--mgberp4a5d4a87g":!0,"xn--mgbqly7c0a67fbc":!0,"xn--mgbqly7cvafr":!0,"xn--mgbpl2fh":!0,"xn--yfro4i67o":!0,"xn--clchc0ea0b2g2a9gcd":!0,"xn--ogbpf8fl":!0,"xn--mgbtf8fl":!0,"xn--o3cw4h":!0,"xn--pgbs0dh":!0,"xn--kpry57d":!0,"xn--kprw13d":!0,"xn--nnx388a":!0,"xn--j1amh":!0,"xn--mgb2ddes":!0,xxx:!0,"*.ye":!0,"ac.za":!0,"agrica.za":!0,"alt.za":!0,"co.za":!0,"edu.za":!0,"gov.za":!0,"grondar.za":!0,"law.za":!0,"mil.za":!0,"net.za":!0,"ngo.za":!0,"nis.za":!0,"nom.za":!0,"org.za":!0,"school.za":!0,"tm.za":!0,"web.za":!0,"*.zm":!0,"*.zw":!0,aaa:!0,aarp:!0,abarth:!0,abb:!0,abbott:!0,abbvie:!0,abc:!0,able:!0,abogado:!0,abudhabi:!0,academy:!0,accenture:!0,accountant:!0,accountants:!0,aco:!0,active:!0,actor:!0,adac:!0,ads:!0,adult:!0,aeg:!0,aetna:!0,afamilycompany:!0,afl:!0,africa:!0,africamagic:!0,agakhan:!0,agency:!0,aig:!0,aigo:!0,airbus:!0,airforce:!0,airtel:!0,akdn:!0,alfaromeo:!0,alibaba:!0,alipay:!0,allfinanz:!0,allstate:!0,ally:!0,alsace:!0,alstom:!0,americanexpress:!0,americanfamily:!0,amex:!0,amfam:!0,amica:!0,amsterdam:!0,analytics:!0,android:!0,anquan:!0,anz:!0,aol:!0,apartments:!0,app:!0,apple:!0,aquarelle:!0,aramco:!0,archi:!0,army:!0,arte:!0,asda:!0,associates:!0,athleta:!0,attorney:!0,auction:!0,audi:!0,audible:!0,audio:!0,auspost:!0,author:!0,auto:!0,autos:!0,avianca:!0,aws:!0,axa:!0,azure:!0,baby:!0,baidu:!0,banamex:!0,bananarepublic:!0,band:!0,bank:!0,bar:!0,barcelona:!0,barclaycard:!0,barclays:!0,barefoot:!0,bargains:!0,basketball:!0,bauhaus:!0,bayern:!0,bbc:!0,bbt:!0,bbva:!0,bcg:!0,bcn:!0,beats:!0,beer:!0,bentley:!0,berlin:!0,best:!0,bestbuy:!0,bet:!0,bharti:!0,bible:!0,bid:!0,bike:!0,bing:!0,bingo:!0,bio:!0,black:!0,blackfriday:!0,blanco:!0,blockbuster:!0,blog:!0,bloomberg:!0,blue:!0,bms:!0,bmw:!0,bnl:!0,bnpparibas:!0,boats:!0,boehringer:!0,bofa:!0,bom:!0,bond:!0,boo:!0,book:!0,booking:!0,boots:!0,bosch:!0,bostik:!0,bot:!0,boutique:!0,bradesco:!0,bridgestone:!0,broadway:!0,broker:!0,brother:!0,brussels:!0,budapest:!0,bugatti:!0,build:!0,builders:!0,business:!0,buy:!0,buzz:!0,bzh:!0,cab:!0,cafe:!0,cal:!0,call:!0,calvinklein:!0,camera:!0,camp:!0,cancerresearch:!0,canon:!0,capetown:!0,capital:!0,capitalone:!0,car:!0,caravan:!0,cards:!0,care:!0,career:!0,careers:!0,cars:!0,cartier:!0,casa:!0,"case":!0,caseih:!0,cash:!0,casino:!0,catering:!0,cba:!0,cbn:!0,cbre:!0,cbs:!0,ceb:!0,center:!0,ceo:!0,cern:!0,cfa:!0,cfd:!0,chanel:!0,channel:!0,chase:!0,chat:!0,cheap:!0,chintai:!0,chloe:!0,christmas:!0,chrome:!0,chrysler:!0,church:!0,cipriani:!0,circle:!0,cisco:!0,citadel:!0,citi:!0,citic:!0,city:!0,cityeats:!0,claims:!0,cleaning:!0,click:!0,clinic:!0,clothing:!0,cloud:!0,club:!0,clubmed:!0,coach:!0,codes:!0,coffee:!0,college:!0,cologne:!0,comcast:!0,commbank:!0,community:!0,company:!0,computer:!0,comsec:!0,condos:!0,construction:!0,consulting:!0,contact:!0,contractors:!0,cooking:!0,cookingchannel:!0,cool:!0,corsica:!0,country:!0,coupon:!0,coupons:!0,courses:!0,credit:!0,creditcard:!0,creditunion:!0,cricket:!0,crown:!0,crs:!0,cruises:!0,csc:!0,cuisinella:!0,cymru:!0,cyou:!0,dabur:!0,dad:!0,dance:!0,date:!0,dating:!0,datsun:!0,day:!0,dclk:!0,dds:!0,deal:!0,dealer:!0,deals:!0,degree:!0,delivery:!0,dell:!0,deloitte:!0,delta:!0,democrat:!0,dental:!0,dentist:!0,desi:!0,design:!0,dev:!0,dhl:!0,diamonds:!0,diet:!0,digital:!0,direct:!0,directory:!0,discount:!0,discover:!0,dish:!0,dnp:!0,docs:!0,dodge:!0,dog:!0,doha:!0,domains:!0,doosan:!0,dot:!0,download:!0,drive:!0,dstv:!0,dtv:!0,dubai:!0,duck:!0,dunlop:!0,duns:!0,dupont:!0,durban:!0,dvag:!0,dwg:!0,earth:!0,eat:!0,edeka:!0,education:!0,email:!0,emerck:!0,emerson:!0,energy:!0,engineer:!0,engineering:!0,enterprises:!0,epost:!0,epson:!0,equipment:!0,ericsson:!0,erni:!0,esq:!0,estate:!0,esurance:!0,etisalat:!0,eurovision:!0,eus:!0,events:!0,everbank:!0,exchange:!0,expert:!0,exposed:!0,express:!0,extraspace:!0,fage:!0,fail:!0,fairwinds:!0,faith:!0,family:!0,fan:!0,fans:!0,farm:!0,farmers:!0,fashion:!0,fast:!0,fedex:!0,feedback:!0,ferrari:!0,ferrero:!0,fiat:!0,fidelity:!0,fido:!0,film:!0,"final":!0,finance:!0,financial:!0,fire:!0,firestone:!0,firmdale:!0,fish:!0,fishing:!0,fit:!0,fitness:!0,flickr:!0,flights:!0,flir:!0,florist:!0,flowers:!0,flsmidth:!0,fly:!0,foo:!0,foodnetwork:!0,football:!0,ford:!0,forex:!0,forsale:!0,forum:!0,foundation:!0,fox:!0,fresenius:!0,frl:!0,frogans:!0,frontdoor:!0,frontier:!0,ftr:!0,fujitsu:!0,fujixerox:!0,fund:!0,furniture:!0,futbol:!0,fyi:!0,gal:!0,gallery:!0,gallo:!0,gallup:!0,game:!0,games:!0,gap:!0,garden:!0,gbiz:!0,gdn:!0,gea:!0,gent:!0,genting:!0,george:!0,ggee:!0,gift:!0,gifts:!0,gives:!0,giving:!0,glade:!0,glass:!0,gle:!0,global:!0,globo:!0,gmail:!0,gmo:!0,gmx:!0,godaddy:!0,gold:!0,goldpoint:!0,golf:!0,goo:!0,goodhands:!0,goodyear:!0,goog:!0,google:!0,gop:!0,got:!0,gotv:!0,grainger:!0,graphics:!0,gratis:!0,green:!0,gripe:!0,group:!0,guardian:!0,gucci:!0,guge:!0,guide:!0,guitars:!0,guru:!0,hamburg:!0,hangout:!0,haus:!0,hbo:!0,hdfc:!0,hdfcbank:!0,health:!0,healthcare:!0,help:!0,helsinki:!0,here:!0,hermes:!0,hgtv:!0,hiphop:!0,hisamitsu:!0,hitachi:!0,hiv:!0,hkt:!0,hockey:!0,holdings:!0,holiday:!0,homedepot:!0,homegoods:!0,homes:!0,homesense:!0,honda:!0,honeywell:!0,horse:!0,host:!0,hosting:!0,hot:!0,hoteles:!0,hotmail:!0,house:!0,how:!0,hsbc:!0,htc:!0,hughes:!0,hyatt:!0,hyundai:!0,ibm:!0,icbc:!0,ice:!0,icu:!0,ieee:!0,ifm:!0,iinet:!0,ikano:!0,imamat:!0,imdb:!0,immo:!0,immobilien:!0,industries:!0,infiniti:!0,ing:!0,ink:!0,institute:!0,insurance:!0,insure:!0,intel:!0,international:!0,intuit:!0,investments:!0,ipiranga:!0,irish:!0,iselect:!0,ismaili:!0,ist:!0,istanbul:!0,itau:!0,itv:!0,iveco:!0,iwc:!0,jaguar:!0,java:!0,jcb:!0,jcp:!0,jeep:!0,jetzt:!0,jewelry:!0,jio:!0,jlc:!0,jll:!0,jmp:!0,jnj:!0,joburg:!0,jot:!0,joy:!0,jpmorgan:!0,jprs:!0,juegos:!0,juniper:!0,kaufen:!0,kddi:!0,kerryhotels:!0,kerrylogistics:!0,kerryproperties:!0,kfh:!0,kia:!0,kim:!0,kinder:!0,kindle:!0,kitchen:!0,kiwi:!0,koeln:!0,komatsu:!0,kosher:!0,kpmg:!0,kpn:!0,krd:!0,kred:!0,kuokgroup:!0,kyknet:!0,kyoto:!0,lacaixa:!0,ladbrokes:!0,lamborghini:!0,lancaster:!0,lancia:!0,lancome:!0,land:!0,landrover:!0,lanxess:!0,lasalle:!0,lat:!0,latino:!0,latrobe:!0,law:!0,lawyer:!0,lds:!0,lease:!0,leclerc:!0,lefrak:!0,legal:!0,lego:!0,lexus:!0,lgbt:!0,liaison:!0,lidl:!0,life:!0,lifeinsurance:!0,lifestyle:!0,lighting:!0,like:!0,lilly:!0,limited:!0,limo:!0,lincoln:!0,linde:!0,link:!0,lipsy:!0,live:!0,living:!0,lixil:!0,loan:!0,loans:!0,locker:!0,locus:!0,loft:!0,lol:!0,london:!0,lotte:!0,lotto:!0,love:!0,lpl:!0,lplfinancial:!0,ltd:!0,ltda:!0,lundbeck:!0,lupin:!0,luxe:!0,luxury:!0,macys:!0,madrid:!0,maif:!0,maison:!0,makeup:!0,man:!0,management:!0,mango:!0,market:!0,marketing:!0,markets:!0,marriott:!0,marshalls:!0,maserati:!0,mattel:!0,mba:!0,mcd:!0,mcdonalds:!0,mckinsey:!0,med:!0,media:!0,meet:!0,melbourne:!0,meme:!0,memorial:!0,men:!0,menu:!0,meo:!0,metlife:!0,miami:!0,microsoft:!0,mini:!0,mint:!0,mit:!0,mitsubishi:!0,mlb:!0,mls:!0,mma:!0,mnet:!0,mobily:!0,moda:!0,moe:!0,moi:!0,mom:!0,monash:!0,money:!0,monster:!0,montblanc:!0,mopar:!0,mormon:!0,mortgage:!0,moscow:!0,moto:!0,motorcycles:!0,mov:!0,movie:!0,movistar:!0,msd:!0,mtn:!0,mtpc:!0,mtr:!0,multichoice:!0,mutual:!0,mutuelle:!0,mzansimagic:!0,nab:!0,nadex:!0,nagoya:!0,naspers:!0,nationwide:!0,natura:!0,navy:!0,nba:!0,nec:!0,netbank:!0,netflix:!0,network:!0,neustar:!0,"new":!0,newholland:!0,news:!0,next:!0,nextdirect:!0,nexus:!0,nfl:!0,ngo:!0,nhk:!0,nico:!0,nike:!0,nikon:!0,ninja:!0,nissan:!0,nokia:!0,northwesternmutual:!0,norton:!0,now:!0,nowruz:!0,nowtv:!0,nra:!0,nrw:!0,ntt:!0,nyc:!0,obi:!0,observer:!0,off:!0,office:!0,okinawa:!0,olayan:!0,olayangroup:!0,oldnavy:!0,ollo:!0,omega:!0,one:!0,ong:!0,onl:!0,online:!0,onyourside:!0,ooo:!0,open:!0,oracle:!0,orange:!0,organic:!0,orientexpress:!0,osaka:!0,otsuka:!0,ott:!0,ovh:!0,page:!0,pamperedchef:!0,panasonic:!0,panerai:!0,paris:!0,pars:!0,partners:!0,parts:!0,party:!0,passagens:!0,pay:!0,payu:!0,pccw:!0,pet:!0,pfizer:!0,pharmacy:!0,philips:!0,photo:!0,photography:!0,photos:!0,physio:!0,piaget:!0,pics:!0,pictet:!0,pictures:!0,pid:!0,pin:!0,ping:!0,pink:!0,pioneer:!0,pizza:!0,place:!0,play:!0,playstation:!0, plumbing:!0,plus:!0,pnc:!0,pohl:!0,poker:!0,politie:!0,porn:!0,pramerica:!0,praxi:!0,press:!0,prime:!0,prod:!0,productions:!0,prof:!0,progressive:!0,promo:!0,properties:!0,property:!0,protection:!0,pru:!0,prudential:!0,pub:!0,qpon:!0,quebec:!0,quest:!0,qvc:!0,racing:!0,raid:!0,read:!0,realestate:!0,realtor:!0,realty:!0,recipes:!0,red:!0,redstone:!0,redumbrella:!0,rehab:!0,reise:!0,reisen:!0,reit:!0,reliance:!0,ren:!0,rent:!0,rentals:!0,repair:!0,report:!0,republican:!0,rest:!0,restaurant:!0,review:!0,reviews:!0,rexroth:!0,rich:!0,richardli:!0,ricoh:!0,rightathome:!0,ril:!0,rio:!0,rip:!0,rocher:!0,rocks:!0,rodeo:!0,rogers:!0,room:!0,rsvp:!0,ruhr:!0,run:!0,rwe:!0,ryukyu:!0,saarland:!0,safe:!0,safety:!0,sakura:!0,sale:!0,salon:!0,samsclub:!0,samsung:!0,sandvik:!0,sandvikcoromant:!0,sanofi:!0,sap:!0,sapo:!0,sarl:!0,sas:!0,save:!0,saxo:!0,sbi:!0,sbs:!0,sca:!0,scb:!0,schaeffler:!0,schmidt:!0,scholarships:!0,school:!0,schule:!0,schwarz:!0,science:!0,scjohnson:!0,scor:!0,scot:!0,seat:!0,secure:!0,security:!0,seek:!0,sener:!0,services:!0,ses:!0,seven:!0,sew:!0,sex:!0,sexy:!0,sfr:!0,shangrila:!0,sharp:!0,shaw:!0,shell:!0,shia:!0,shiksha:!0,shoes:!0,shouji:!0,show:!0,showtime:!0,shriram:!0,silk:!0,sina:!0,singles:!0,site:!0,ski:!0,skin:!0,sky:!0,skype:!0,sling:!0,smart:!0,smile:!0,sncf:!0,soccer:!0,social:!0,softbank:!0,software:!0,sohu:!0,solar:!0,solutions:!0,song:!0,sony:!0,soy:!0,space:!0,spiegel:!0,spot:!0,spreadbetting:!0,srl:!0,srt:!0,stada:!0,staples:!0,star:!0,starhub:!0,statebank:!0,statefarm:!0,statoil:!0,stc:!0,stcgroup:!0,stockholm:!0,storage:!0,store:!0,studio:!0,study:!0,style:!0,sucks:!0,supersport:!0,supplies:!0,supply:!0,support:!0,surf:!0,surgery:!0,suzuki:!0,swatch:!0,swiftcover:!0,swiss:!0,sydney:!0,symantec:!0,systems:!0,tab:!0,taipei:!0,talk:!0,taobao:!0,target:!0,tatamotors:!0,tatar:!0,tattoo:!0,tax:!0,taxi:!0,tci:!0,tdk:!0,team:!0,tech:!0,technology:!0,telecity:!0,telefonica:!0,temasek:!0,tennis:!0,teva:!0,thd:!0,theater:!0,theatre:!0,theguardian:!0,tiaa:!0,tickets:!0,tienda:!0,tiffany:!0,tips:!0,tires:!0,tirol:!0,tjmaxx:!0,tjx:!0,tkmaxx:!0,tmall:!0,today:!0,tokyo:!0,tools:!0,top:!0,toray:!0,toshiba:!0,total:!0,tours:!0,town:!0,toyota:!0,toys:!0,trade:!0,trading:!0,training:!0,travelchannel:!0,travelers:!0,travelersinsurance:!0,trust:!0,trv:!0,tube:!0,tui:!0,tunes:!0,tushu:!0,tvs:!0,ubank:!0,ubs:!0,uconnect:!0,university:!0,uno:!0,uol:!0,ups:!0,vacations:!0,vana:!0,vanguard:!0,vegas:!0,ventures:!0,verisign:!0,versicherung:!0,vet:!0,viajes:!0,video:!0,vig:!0,viking:!0,villas:!0,vin:!0,vip:!0,virgin:!0,visa:!0,vision:!0,vista:!0,vistaprint:!0,viva:!0,vivo:!0,vlaanderen:!0,vodka:!0,volkswagen:!0,vote:!0,voting:!0,voto:!0,voyage:!0,vuelos:!0,wales:!0,walmart:!0,walter:!0,wang:!0,wanggou:!0,warman:!0,watch:!0,watches:!0,weather:!0,weatherchannel:!0,webcam:!0,weber:!0,website:!0,wed:!0,wedding:!0,weibo:!0,weir:!0,whoswho:!0,wien:!0,wiki:!0,williamhill:!0,win:!0,windows:!0,wine:!0,winners:!0,wme:!0,wolterskluwer:!0,woodside:!0,work:!0,works:!0,world:!0,wtc:!0,wtf:!0,xbox:!0,xerox:!0,xfinity:!0,xihuan:!0,xin:!0,"xn--11b4c3d":!0,"xn--1ck2e1b":!0,"xn--1qqw23a":!0,"xn--30rr7y":!0,"xn--3bst00m":!0,"xn--3ds443g":!0,"xn--3oq18vl8pn36a":!0,"xn--3pxu8k":!0,"xn--42c2d9a":!0,"xn--45q11c":!0,"xn--4gbrim":!0,"xn--4gq48lf9j":!0,"xn--55qw42g":!0,"xn--55qx5d":!0,"xn--5su34j936bgsg":!0,"xn--5tzm5g":!0,"xn--6frz82g":!0,"xn--6qq986b3xl":!0,"xn--80adxhks":!0,"xn--80asehdb":!0,"xn--80aswg":!0,"xn--8y0a063a":!0,"xn--9dbq2a":!0,"xn--9et52u":!0,"xn--9krt00a":!0,"xn--b4w605ferd":!0,"xn--bck1b9a5dre4c":!0,"xn--c1avg":!0,"xn--c2br7g":!0,"xn--cck2b3b":!0,"xn--cg4bki":!0,"xn--czr694b":!0,"xn--czrs0t":!0,"xn--czru2d":!0,"xn--d1acj3b":!0,"xn--eckvdtc9d":!0,"xn--efvy88h":!0,"xn--estv75g":!0,"xn--fct429k":!0,"xn--fhbei":!0,"xn--fiq228c5hs":!0,"xn--fiq64b":!0,"xn--fjq720a":!0,"xn--flw351e":!0,"xn--fzys8d69uvgm":!0,"xn--g2xx48c":!0,"xn--gckr3f0f":!0,"xn--hxt814e":!0,"xn--i1b6b1a6a2e":!0,"xn--imr513n":!0,"xn--io0a7i":!0,"xn--j1aef":!0,"xn--jlq61u9w7b":!0,"xn--jvr189m":!0,"xn--kcrx77d1x4a":!0,"xn--kpu716f":!0,"xn--kput3i":!0,"xn--mgba3a3ejt":!0,"xn--mgba7c0bbn0a":!0,"xn--mgbaakc7dvf":!0,"xn--mgbab2bd":!0,"xn--mgbb9fbpob":!0,"xn--mgbca7dzdo":!0,"xn--mgbt3dhd":!0,"xn--mk1bu44c":!0,"xn--mxtq1m":!0,"xn--ngbc5azd":!0,"xn--ngbe9e0a":!0,"xn--nqv7f":!0,"xn--nqv7fs00ema":!0,"xn--nyqy26a":!0,"xn--p1acf":!0,"xn--pbt977c":!0,"xn--pssy2u":!0,"xn--q9jyb4c":!0,"xn--qcka1pmc":!0,"xn--rhqv96g":!0,"xn--rovu88b":!0,"xn--ses554g":!0,"xn--t60b56a":!0,"xn--tckwe":!0,"xn--unup4y":!0,"xn--vermgensberater-ctb":!0,"xn--vermgensberatung-pwb":!0,"xn--vhquv":!0,"xn--vuq861b":!0,"xn--w4r85el8fhu5dnra":!0,"xn--w4rs40l":!0,"xn--xhq521b":!0,"xn--zfr164b":!0,xperia:!0,xyz:!0,yachts:!0,yahoo:!0,yamaxun:!0,yandex:!0,yodobashi:!0,yoga:!0,yokohama:!0,you:!0,youtube:!0,yun:!0,zappos:!0,zara:!0,zero:!0,zip:!0,zippo:!0,zone:!0,zuerich:!0,"cloudfront.net":!0,"ap-northeast-1.compute.amazonaws.com":!0,"ap-southeast-1.compute.amazonaws.com":!0,"ap-southeast-2.compute.amazonaws.com":!0,"cn-north-1.compute.amazonaws.cn":!0,"compute.amazonaws.cn":!0,"compute.amazonaws.com":!0,"compute-1.amazonaws.com":!0,"eu-west-1.compute.amazonaws.com":!0,"eu-central-1.compute.amazonaws.com":!0,"sa-east-1.compute.amazonaws.com":!0,"us-east-1.amazonaws.com":!0,"us-gov-west-1.compute.amazonaws.com":!0,"us-west-1.compute.amazonaws.com":!0,"us-west-2.compute.amazonaws.com":!0,"z-1.compute-1.amazonaws.com":!0,"z-2.compute-1.amazonaws.com":!0,"elasticbeanstalk.com":!0,"elb.amazonaws.com":!0,"s3.amazonaws.com":!0,"s3-ap-northeast-1.amazonaws.com":!0,"s3-ap-southeast-1.amazonaws.com":!0,"s3-ap-southeast-2.amazonaws.com":!0,"s3-external-1.amazonaws.com":!0,"s3-external-2.amazonaws.com":!0,"s3-fips-us-gov-west-1.amazonaws.com":!0,"s3-eu-central-1.amazonaws.com":!0,"s3-eu-west-1.amazonaws.com":!0,"s3-sa-east-1.amazonaws.com":!0,"s3-us-gov-west-1.amazonaws.com":!0,"s3-us-west-1.amazonaws.com":!0,"s3-us-west-2.amazonaws.com":!0,"s3.cn-north-1.amazonaws.com.cn":!0,"s3.eu-central-1.amazonaws.com":!0,"betainabox.com":!0,"ae.org":!0,"ar.com":!0,"br.com":!0,"cn.com":!0,"com.de":!0,"com.se":!0,"de.com":!0,"eu.com":!0,"gb.com":!0,"gb.net":!0,"hu.com":!0,"hu.net":!0,"jp.net":!0,"jpn.com":!0,"kr.com":!0,"mex.com":!0,"no.com":!0,"qc.com":!0,"ru.com":!0,"sa.com":!0,"se.com":!0,"se.net":!0,"uk.com":!0,"uk.net":!0,"us.com":!0,"uy.com":!0,"za.bz":!0,"za.com":!0,"africa.com":!0,"gr.com":!0,"in.net":!0,"us.org":!0,"co.com":!0,"c.la":!0,"cloudcontrolled.com":!0,"cloudcontrolapp.com":!0,"co.ca":!0,"c.cdn77.org":!0,"cdn77-ssl.net":!0,"r.cdn77.net":!0,"rsc.cdn77.org":!0,"ssl.origin.cdn77-secure.org":!0,"co.nl":!0,"co.no":!0,"*.platform.sh":!0,"cupcake.is":!0,"dreamhosters.com":!0,"duckdns.org":!0,"dyndns-at-home.com":!0,"dyndns-at-work.com":!0,"dyndns-blog.com":!0,"dyndns-free.com":!0,"dyndns-home.com":!0,"dyndns-ip.com":!0,"dyndns-mail.com":!0,"dyndns-office.com":!0,"dyndns-pics.com":!0,"dyndns-remote.com":!0,"dyndns-server.com":!0,"dyndns-web.com":!0,"dyndns-wiki.com":!0,"dyndns-work.com":!0,"dyndns.biz":!0,"dyndns.info":!0,"dyndns.org":!0,"dyndns.tv":!0,"at-band-camp.net":!0,"ath.cx":!0,"barrel-of-knowledge.info":!0,"barrell-of-knowledge.info":!0,"better-than.tv":!0,"blogdns.com":!0,"blogdns.net":!0,"blogdns.org":!0,"blogsite.org":!0,"boldlygoingnowhere.org":!0,"broke-it.net":!0,"buyshouses.net":!0,"cechire.com":!0,"dnsalias.com":!0,"dnsalias.net":!0,"dnsalias.org":!0,"dnsdojo.com":!0,"dnsdojo.net":!0,"dnsdojo.org":!0,"does-it.net":!0,"doesntexist.com":!0,"doesntexist.org":!0,"dontexist.com":!0,"dontexist.net":!0,"dontexist.org":!0,"doomdns.com":!0,"doomdns.org":!0,"dvrdns.org":!0,"dyn-o-saur.com":!0,"dynalias.com":!0,"dynalias.net":!0,"dynalias.org":!0,"dynathome.net":!0,"dyndns.ws":!0,"endofinternet.net":!0,"endofinternet.org":!0,"endoftheinternet.org":!0,"est-a-la-maison.com":!0,"est-a-la-masion.com":!0,"est-le-patron.com":!0,"est-mon-blogueur.com":!0,"for-better.biz":!0,"for-more.biz":!0,"for-our.info":!0,"for-some.biz":!0,"for-the.biz":!0,"forgot.her.name":!0,"forgot.his.name":!0,"from-ak.com":!0,"from-al.com":!0,"from-ar.com":!0,"from-az.net":!0,"from-ca.com":!0,"from-co.net":!0,"from-ct.com":!0,"from-dc.com":!0,"from-de.com":!0,"from-fl.com":!0,"from-ga.com":!0,"from-hi.com":!0,"from-ia.com":!0,"from-id.com":!0,"from-il.com":!0,"from-in.com":!0,"from-ks.com":!0,"from-ky.com":!0,"from-la.net":!0,"from-ma.com":!0,"from-md.com":!0,"from-me.org":!0,"from-mi.com":!0,"from-mn.com":!0,"from-mo.com":!0,"from-ms.com":!0,"from-mt.com":!0,"from-nc.com":!0,"from-nd.com":!0,"from-ne.com":!0,"from-nh.com":!0,"from-nj.com":!0,"from-nm.com":!0,"from-nv.com":!0,"from-ny.net":!0,"from-oh.com":!0,"from-ok.com":!0,"from-or.com":!0,"from-pa.com":!0,"from-pr.com":!0,"from-ri.com":!0,"from-sc.com":!0,"from-sd.com":!0,"from-tn.com":!0,"from-tx.com":!0,"from-ut.com":!0,"from-va.com":!0,"from-vt.com":!0,"from-wa.com":!0,"from-wi.com":!0,"from-wv.com":!0,"from-wy.com":!0,"ftpaccess.cc":!0,"fuettertdasnetz.de":!0,"game-host.org":!0,"game-server.cc":!0,"getmyip.com":!0,"gets-it.net":!0,"go.dyndns.org":!0,"gotdns.com":!0,"gotdns.org":!0,"groks-the.info":!0,"groks-this.info":!0,"ham-radio-op.net":!0,"here-for-more.info":!0,"hobby-site.com":!0,"hobby-site.org":!0,"home.dyndns.org":!0,"homedns.org":!0,"homeftp.net":!0,"homeftp.org":!0,"homeip.net":!0,"homelinux.com":!0,"homelinux.net":!0,"homelinux.org":!0,"homeunix.com":!0,"homeunix.net":!0,"homeunix.org":!0,"iamallama.com":!0,"in-the-band.net":!0,"is-a-anarchist.com":!0,"is-a-blogger.com":!0,"is-a-bookkeeper.com":!0,"is-a-bruinsfan.org":!0,"is-a-bulls-fan.com":!0,"is-a-candidate.org":!0,"is-a-caterer.com":!0,"is-a-celticsfan.org":!0,"is-a-chef.com":!0,"is-a-chef.net":!0,"is-a-chef.org":!0,"is-a-conservative.com":!0,"is-a-cpa.com":!0,"is-a-cubicle-slave.com":!0,"is-a-democrat.com":!0,"is-a-designer.com":!0,"is-a-doctor.com":!0,"is-a-financialadvisor.com":!0,"is-a-geek.com":!0,"is-a-geek.net":!0,"is-a-geek.org":!0,"is-a-green.com":!0,"is-a-guru.com":!0,"is-a-hard-worker.com":!0,"is-a-hunter.com":!0,"is-a-knight.org":!0,"is-a-landscaper.com":!0,"is-a-lawyer.com":!0,"is-a-liberal.com":!0,"is-a-libertarian.com":!0,"is-a-linux-user.org":!0,"is-a-llama.com":!0,"is-a-musician.com":!0,"is-a-nascarfan.com":!0,"is-a-nurse.com":!0,"is-a-painter.com":!0,"is-a-patsfan.org":!0,"is-a-personaltrainer.com":!0,"is-a-photographer.com":!0,"is-a-player.com":!0,"is-a-republican.com":!0,"is-a-rockstar.com":!0,"is-a-socialist.com":!0,"is-a-soxfan.org":!0,"is-a-student.com":!0,"is-a-teacher.com":!0,"is-a-techie.com":!0,"is-a-therapist.com":!0,"is-an-accountant.com":!0,"is-an-actor.com":!0,"is-an-actress.com":!0,"is-an-anarchist.com":!0,"is-an-artist.com":!0,"is-an-engineer.com":!0,"is-an-entertainer.com":!0,"is-by.us":!0,"is-certified.com":!0,"is-found.org":!0,"is-gone.com":!0,"is-into-anime.com":!0,"is-into-cars.com":!0,"is-into-cartoons.com":!0,"is-into-games.com":!0,"is-leet.com":!0,"is-lost.org":!0,"is-not-certified.com":!0,"is-saved.org":!0,"is-slick.com":!0,"is-uberleet.com":!0,"is-very-bad.org":!0,"is-very-evil.org":!0,"is-very-good.org":!0,"is-very-nice.org":!0,"is-very-sweet.org":!0,"is-with-theband.com":!0,"isa-geek.com":!0,"isa-geek.net":!0,"isa-geek.org":!0,"isa-hockeynut.com":!0,"issmarterthanyou.com":!0,"isteingeek.de":!0,"istmein.de":!0,"kicks-ass.net":!0,"kicks-ass.org":!0,"knowsitall.info":!0,"land-4-sale.us":!0,"lebtimnetz.de":!0,"leitungsen.de":!0,"likes-pie.com":!0,"likescandy.com":!0,"merseine.nu":!0,"mine.nu":!0,"misconfused.org":!0,"mypets.ws":!0,"myphotos.cc":!0,"neat-url.com":!0,"office-on-the.net":!0,"on-the-web.tv":!0,"podzone.net":!0,"podzone.org":!0,"readmyblog.org":!0,"saves-the-whales.com":!0,"scrapper-site.net":!0,"scrapping.cc":!0,"selfip.biz":!0,"selfip.com":!0,"selfip.info":!0,"selfip.net":!0,"selfip.org":!0,"sells-for-less.com":!0,"sells-for-u.com":!0,"sells-it.net":!0,"sellsyourhome.org":!0,"servebbs.com":!0,"servebbs.net":!0,"servebbs.org":!0,"serveftp.net":!0,"serveftp.org":!0,"servegame.org":!0,"shacknet.nu":!0,"simple-url.com":!0,"space-to-rent.com":!0,"stuff-4-sale.org":!0,"stuff-4-sale.us":!0,"teaches-yoga.com":!0,"thruhere.net":!0,"traeumtgerade.de":!0,"webhop.biz":!0,"webhop.info":!0,"webhop.net":!0,"webhop.org":!0,"worse-than.tv":!0,"writesthisblog.com":!0,"eu.org":!0,"al.eu.org":!0,"asso.eu.org":!0,"at.eu.org":!0,"au.eu.org":!0,"be.eu.org":!0,"bg.eu.org":!0,"ca.eu.org":!0,"cd.eu.org":!0,"ch.eu.org":!0,"cn.eu.org":!0,"cy.eu.org":!0,"cz.eu.org":!0,"de.eu.org":!0,"dk.eu.org":!0,"edu.eu.org":!0,"ee.eu.org":!0,"es.eu.org":!0,"fi.eu.org":!0,"fr.eu.org":!0,"gr.eu.org":!0,"hr.eu.org":!0,"hu.eu.org":!0,"ie.eu.org":!0,"il.eu.org":!0,"in.eu.org":!0,"int.eu.org":!0,"is.eu.org":!0,"it.eu.org":!0,"jp.eu.org":!0,"kr.eu.org":!0,"lt.eu.org":!0,"lu.eu.org":!0,"lv.eu.org":!0,"mc.eu.org":!0,"me.eu.org":!0,"mk.eu.org":!0,"mt.eu.org":!0,"my.eu.org":!0,"net.eu.org":!0,"ng.eu.org":!0,"nl.eu.org":!0,"no.eu.org":!0,"nz.eu.org":!0,"paris.eu.org":!0,"pl.eu.org":!0,"pt.eu.org":!0,"q-a.eu.org":!0,"ro.eu.org":!0,"ru.eu.org":!0,"se.eu.org":!0,"si.eu.org":!0,"sk.eu.org":!0,"tr.eu.org":!0,"uk.eu.org":!0,"us.eu.org":!0,"a.ssl.fastly.net":!0,"b.ssl.fastly.net":!0,"global.ssl.fastly.net":!0,"a.prod.fastly.net":!0,"global.prod.fastly.net":!0,"firebaseapp.com":!0,"flynnhub.com":!0,"service.gov.uk":!0,"github.io":!0,"githubusercontent.com":!0,"ro.com":!0,"appspot.com":!0,"blogspot.ae":!0,"blogspot.al":!0,"blogspot.am":!0,"blogspot.ba":!0,"blogspot.be":!0,"blogspot.bg":!0,"blogspot.bj":!0,"blogspot.ca":!0,"blogspot.cf":!0,"blogspot.ch":!0,"blogspot.cl":!0,"blogspot.co.at":!0,"blogspot.co.id":!0,"blogspot.co.il":!0,"blogspot.co.ke":!0,"blogspot.co.nz":!0,"blogspot.co.uk":!0,"blogspot.co.za":!0,"blogspot.com":!0,"blogspot.com.ar":!0,"blogspot.com.au":!0,"blogspot.com.br":!0,"blogspot.com.by":!0,"blogspot.com.co":!0,"blogspot.com.cy":!0,"blogspot.com.ee":!0,"blogspot.com.eg":!0,"blogspot.com.es":!0,"blogspot.com.mt":!0,"blogspot.com.ng":!0,"blogspot.com.tr":!0,"blogspot.com.uy":!0,"blogspot.cv":!0,"blogspot.cz":!0,"blogspot.de":!0,"blogspot.dk":!0,"blogspot.fi":!0,"blogspot.fr":!0,"blogspot.gr":!0,"blogspot.hk":!0,"blogspot.hr":!0,"blogspot.hu":!0,"blogspot.ie":!0,"blogspot.in":!0,"blogspot.is":!0,"blogspot.it":!0,"blogspot.jp":!0,"blogspot.kr":!0,"blogspot.li":!0,"blogspot.lt":!0,"blogspot.lu":!0,"blogspot.md":!0,"blogspot.mk":!0,"blogspot.mr":!0,"blogspot.mx":!0,"blogspot.my":!0,"blogspot.nl":!0,"blogspot.no":!0,"blogspot.pe":!0,"blogspot.pt":!0,"blogspot.qa":!0,"blogspot.re":!0,"blogspot.ro":!0,"blogspot.rs":!0,"blogspot.ru":!0,"blogspot.se":!0,"blogspot.sg":!0,"blogspot.si":!0,"blogspot.sk":!0,"blogspot.sn":!0,"blogspot.td":!0,"blogspot.tw":!0,"blogspot.ug":!0,"blogspot.vn":!0,"codespot.com":!0,"googleapis.com":!0,"googlecode.com":!0,"pagespeedmobilizer.com":!0,"withgoogle.com":!0,"withyoutube.com":!0,"herokuapp.com":!0,"herokussl.com":!0,"iki.fi":!0,"biz.at":!0,"info.at":!0,"co.pl":!0,"azurewebsites.net":!0,"azure-mobile.net":!0,"cloudapp.net":!0,"bmoattachments.org":!0,"4u.com":!0,"nfshost.com":!0,"nyc.mn":!0,"nid.io":!0,"operaunite.com":!0,"outsystemscloud.com":!0,"art.pl":!0,"gliwice.pl":!0,"krakow.pl":!0,"poznan.pl":!0,"wroc.pl":!0,"zakopane.pl":!0,"pantheon.io":!0,"gotpantheon.com":!0,"priv.at":!0,"qa2.com":!0,"rhcloud.com":!0,"sandcats.io":!0,"biz.ua":!0,"co.ua":!0,"pp.ua":!0,"sinaapp.com":!0,"vipsinaapp.com":!0,"1kapp.com":!0,"gda.pl":!0,"gdansk.pl":!0,"gdynia.pl":!0,"med.pl":!0,"sopot.pl":!0,"hk.com":!0,"hk.org":!0,"ltd.hk":!0,"inc.hk":!0,"yolasite.com":!0,"za.net":!0,"za.org":!0})},{punycode:393}],567:[function(a,b,c){"use strict";function d(){}c.Store=d,d.prototype.synchronous=!1,d.prototype.findCookie=function(a,b,c,d){throw new Error("findCookie is not implemented")},d.prototype.findCookies=function(a,b,c){throw new Error("findCookies is not implemented")},d.prototype.putCookie=function(a,b){throw new Error("putCookie is not implemented")},d.prototype.updateCookie=function(a,b,c){throw new Error("updateCookie is not implemented")},d.prototype.removeCookie=function(a,b,c,d){throw new Error("removeCookie is not implemented")},d.prototype.removeCookies=function(a,b,c){throw new Error("removeCookies is not implemented")},d.prototype.getAllCookies=function(a){throw new Error("getAllCookies is not implemented (therefore jar cannot be serialized)")}},{}],568:[function(a,b,c){b.exports={author:{name:"Jeremy Stashewsky",email:"jstashewsky@salesforce.com"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],license:"BSD-3-Clause",name:"tough-cookie",description:"RFC6265 Cookies and Cookie Jar for node.js",keywords:["HTTP","cookie","cookies","set-cookie","cookiejar","jar","RFC6265","RFC2965"],version:"2.3.1",homepage:"https://github.com/SalesforceEng/tough-cookie",repository:{type:"git",url:"git://github.com/SalesforceEng/tough-cookie.git"},bugs:{url:"https://github.com/SalesforceEng/tough-cookie/issues"},main:"./lib/cookie",files:["lib"],scripts:{suffixup:"curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js",test:"vows test/*_test.js"},engines:{node:">=0.8"},devDependencies:{async:"^1.4.2","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},gitHead:"c11a2d11d12348a35ef595c809e30e641a804a7d",_id:"tough-cookie@2.3.1",_shasum:"99c77dfbb7d804249e8a299d4cb0fd81fef083fd",_from:"tough-cookie@>=2.3.0 <2.4.0",_npmVersion:"3.10.3",_nodeVersion:"6.3.1",_npmUser:{name:"jstash",email:"jstash@gmail.com"},dist:{shasum:"99c77dfbb7d804249e8a299d4cb0fd81fef083fd",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz"},maintainers:[{name:"jstash",email:"jstash@gmail.com"},{name:"nexxy",email:"emily@contactvibe.com"}],_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/tough-cookie-2.3.1.tgz_1469494891088_0.8524557144846767"},directories:{},_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz",readme:"ERROR: No README data found!"}},{}],569:[function(a,b,c){(function(b,d){"use strict";function e(a){var b=new i(a);return b.request=m.request,b}function f(a){var b=new i(a);return b.request=m.request,b.createSocket=j,b.defaultPort=443,b}function g(a){var b=new i(a);return b.request=n.request,b}function h(a){var b=new i(a);return b.request=n.request,b.createSocket=j,b.defaultPort=443,b}function i(a){var b=this;b.options=a||{},b.proxyOptions=b.options.proxy||{},b.maxSockets=b.options.maxSockets||m.Agent.defaultMaxSockets,b.requests=[],b.sockets=[],b.on("free",function(a,c,d){for(var e=0,f=b.requests.length;f>e;++e){var g=b.requests[e];if(g.host===c&&g.port===d)return b.requests.splice(e,1),void g.request.onSocket(a)}a.destroy(),b.removeSocket(a)})}function j(a,b){var c=this;i.prototype.createSocket.call(c,a,function(d){var e=l.connect(0,k({},c.options,{servername:a.host,socket:d}));c.sockets[c.sockets.indexOf(d)]=e,b(e)})}function k(a){for(var b=1,c=arguments.length;c>b;++b){var d=arguments[b];if("object"==typeof d)for(var e=Object.keys(d),f=0,g=e.length;g>f;++f){var h=e[f];void 0!==d[h]&&(a[h]=d[h])}}return a}var l=(a("net"),a("tls")),m=a("http"),n=a("https"),o=a("events"),p=a("assert"),q=a("util");c.httpOverHttp=e,c.httpsOverHttp=f,c.httpOverHttps=g,c.httpsOverHttps=h,q.inherits(i,o.EventEmitter),i.prototype.addRequest=function(a,b){var c=this;return"string"==typeof b&&(b={host:b,port:arguments[2],path:arguments[3]}),c.sockets.length>=this.maxSockets?void c.requests.push({host:b.host,port:b.port,request:a}):void c.createConnection({host:b.host,port:b.port,request:a})},i.prototype.createConnection=function(a){var b=this;b.createSocket(a,function(c){function d(){b.emit("free",c,a.host,a.port)}function e(a){b.removeSocket(c),c.removeListener("free",d),c.removeListener("close",e),c.removeListener("agentRemove",e)}c.on("free",d),c.on("close",e),c.on("agentRemove",e),a.request.onSocket(c)})},i.prototype.createSocket=function(a,c){function e(a){a.upgrade=!0}function f(a,c,d){b.nextTick(function(){g(a,c,d)})}function g(b,d,e){if(m.removeAllListeners(),d.removeAllListeners(),200===b.statusCode)p.equal(e.length,0),r("tunneling connection has established"),i.sockets[i.sockets.indexOf(j)]=d,c(d);else{r("tunneling socket could not be established, statusCode=%d",b.statusCode);var f=new Error("tunneling socket could not be established, statusCode="+b.statusCode);f.code="ECONNRESET",a.request.emit("error",f),i.removeSocket(j)}}function h(b){m.removeAllListeners(),r("tunneling socket could not be established, cause=%s\n",b.message,b.stack);var c=new Error("tunneling socket could not be established, cause="+b.message);c.code="ECONNRESET",a.request.emit("error",c),i.removeSocket(j)}var i=this,j={};i.sockets.push(j);var l=k({},i.proxyOptions,{method:"CONNECT",path:a.host+":"+a.port,agent:!1});l.proxyAuth&&(l.headers=l.headers||{},l.headers["Proxy-Authorization"]="Basic "+new d(l.proxyAuth).toString("base64")),r("making CONNECT request");var m=i.request(l);m.useChunkedEncodingByDefault=!1,m.once("response",e),m.once("upgrade",f),m.once("connect",g),m.once("error",h),m.end()},i.prototype.removeSocket=function(a){var b=this.sockets.indexOf(a);if(-1!==b){this.sockets.splice(b,1);var c=this.requests.shift();c&&this.createConnection(c)}};var r;r=b.env.NODE_DEBUG&&/\btunnel\b/.test(b.env.NODE_DEBUG)?function(){var a=Array.prototype.slice.call(arguments);"string"==typeof a[0]?a[0]="TUNNEL: "+a[0]:a.unshift("TUNNEL:"),console.error.apply(console,a)}:function(){},c.debug=r}).call(this,a("_process"),a("buffer").Buffer)},{_process:392,assert:176,buffer:191,events:387,http:414,https:388,net:175,tls:175,util:424}],570:[function(a,b,c){(function(c,d){"use strict";function e(a,b){var c={};for(var d in b){var e=-1===a.indexOf(d);e&&(c[d]=b[d])}return c}function f(a,b){var c={};for(var d in b){var e=!(-1===a.indexOf(d)),f="function"==typeof b[d];e&&f||(c[d]=b[d])}return c}function g(){var a=this;return{uri:a.uri,method:a.method,headers:a.headers}}function h(){var a=this;return{statusCode:a.statusCode,body:a.body,headers:a.headers,request:g.call(a.request)}}function i(a){var b=this;a.har&&(b._har=new H(b),a=b._har.options(a)),o.Stream.call(b);var c=Object.keys(i.prototype),d=e(c,a);A(b,d),a=f(c,a),b.readable=!0,b.writable=!0,a.method&&(b.explicitMethod=!0),b._qs=new G(b),b._auth=new I(b),b._oauth=new J(b),b._multipart=new K(b),b._redirect=new L(b),b._tunnel=new M(b),b.init(a)}function j(){i.debug&&console.error("REQUEST %s",n.format.apply(n,arguments))}var k=a("http"),l=a("https"),m=a("url"),n=a("util"),o=a("stream"),p=a("zlib"),q=a("bl"),r=a("hawk"),s=a("aws-sign2"),t=a("aws4"),u=a("http-signature"),v=a("mime-types"),w=a("stringstream"),x=a("caseless"),y=a("forever-agent"),z=a("form-data"),A=a("extend"),B=a("isstream"),C=a("is-typedarray").strict,D=a("./lib/helpers"),E=a("./lib/cookies"),F=a("./lib/getProxyFromURI"),G=a("./lib/querystring").Querystring,H=a("./lib/har").Har,I=a("./lib/auth").Auth,J=a("./lib/oauth").OAuth,K=a("./lib/multipart").Multipart,L=a("./lib/redirect").Redirect,M=a("./lib/tunnel").Tunnel,N=D.safeStringify,O=D.isReadStream,P=D.toBase64,Q=D.defer,R=D.copy,S=D.version,T=E.jar(),U={};n.inherits(i,o.Stream),i.debug=c.env.NODE_DEBUG&&/\brequest\b/.test(c.env.NODE_DEBUG),i.prototype.debug=j,i.prototype.init=function(a){function b(){if(C(c.body)&&(c.body=new d(c.body)),!c.hasHeader("content-length")){var a;a="string"==typeof c.body?d.byteLength(c.body):Array.isArray(c.body)?c.body.reduce(function(a,b){return a+b.length},0):c.body.length,a?c.setHeader("content-length",a):c.emit("error",new Error("Argument error, options.body."))}}var c=this;a||(a={}),c.headers=c.headers?R(c.headers):{};for(var e in c.headers)"undefined"==typeof c.headers[e]&&delete c.headers[e];if(x.httpify(c,c.headers),c.method||(c.method=a.method||"GET"),c.localAddress||(c.localAddress=a.localAddress),c._qs.init(a),j(a),c.pool||c.pool===!1||(c.pool=U),c.dests=c.dests||[],c.__isRequestRequest=!0,!c._callback&&c.callback&&(c._callback=c.callback,c.callback=function(){c._callbackCalled||(c._callbackCalled=!0,c._callback.apply(c,arguments))},c.on("error",c.callback.bind()),c.on("complete",c.callback.bind(c,null))),!c.uri&&c.url&&(c.uri=c.url,delete c.url),c.baseUrl){if("string"!=typeof c.baseUrl)return c.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof c.uri)return c.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===c.uri.indexOf("//")||-1!==c.uri.indexOf("://"))return c.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var f=c.baseUrl.lastIndexOf("/")===c.baseUrl.length-1,g=0===c.uri.indexOf("/");f&&g?c.uri=c.baseUrl+c.uri.slice(1):f||g?c.uri=c.baseUrl+c.uri:""===c.uri?c.uri=c.baseUrl:c.uri=c.baseUrl+"/"+c.uri,delete c.baseUrl}if(!c.uri)return c.emit("error",new Error("options.uri is a required argument"));if("string"==typeof c.uri&&(c.uri=m.parse(c.uri)),c.uri.href||(c.uri.href=m.format(c.uri)),"unix:"===c.uri.protocol)return c.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===c.uri.host&&c.enableUnixSocket(),c.strictSSL===!1&&(c.rejectUnauthorized=!1),c.uri.pathname||(c.uri.pathname="/"),!(c.uri.host||c.uri.hostname&&c.uri.port||c.uri.isUnix)){var h=m.format(c.uri),i='Invalid URI "'+h+'"';return 0===Object.keys(a).length&&(i+=". This can be caused by a crappy redirection."),c.abort(),c.emit("error",new Error(i))}if(c.hasOwnProperty("proxy")||(c.proxy=F(c.uri)),c.tunnel=c._tunnel.isEnabled(),c.proxy&&c._tunnel.setup(a),c._redirect.onRequest(a),c.setHost=!1,!c.hasHeader("host")){var n=c.originalHostHeaderName||"host";c.setHeader(n,c.uri.hostname),c.uri.port&&(80===c.uri.port&&"http:"===c.uri.protocol||443===c.uri.port&&"https:"===c.uri.protocol||c.setHeader(n,c.getHeader("host")+(":"+c.uri.port))),c.setHost=!0}if(c.jar(c._jar||a.jar),c.uri.port||("http:"===c.uri.protocol?c.uri.port=80:"https:"===c.uri.protocol&&(c.uri.port=443)),c.proxy&&!c.tunnel?(c.port=c.proxy.port,c.host=c.proxy.hostname):(c.port=c.uri.port,c.host=c.uri.hostname),a.form&&c.form(a.form),a.formData){var o=a.formData,p=c.form(),q=function(a,b){b&&b.hasOwnProperty("value")&&b.hasOwnProperty("options")?p.append(a,b.value,b.options):p.append(a,b)};for(var r in o)if(o.hasOwnProperty(r)){var s=o[r];if(s instanceof Array)for(var t=0;t=100&&200>a||204===a||304===a};if(b.gzip&&!i(a.statusCode)){var k=a.headers["content-encoding"]||"identity";k=k.trim().toLowerCase(),"gzip"===k?(g=p.createGunzip(),a.pipe(g)):"deflate"===k?(g=p.createInflate(),a.pipe(g)):("identity"!==k&&j("ignoring unrecognized Content-Encoding "+k),g=a)}else g=a;b.encoding&&(0!==b.dests.length?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):g.setEncoding?g.setEncoding(b.encoding):g=g.pipe(w(b.encoding))),b._paused&&g.pause(),b.responseContent=g,b.emit("response",a),b.dests.forEach(function(a){b.pipeDest(a)}),g.on("data",function(a){b._destdata=!0,b.emit("data",a)}),g.on("end",function(a){b.emit("end",a)}),g.on("error",function(a){b.emit("error",a)}),g.on("close",function(){b.emit("close")}),b.callback?b.readResponseBody(a):b.on("end",function(){return b._aborted?void j("aborted",b.uri.href):void b.emit("complete",a)}),j("finish init function",b.uri.href)}},i.prototype.readResponseBody=function(a){var b=this;j("reading response's body");var c=q(),e=[];b.on("data",function(a){d.isBuffer(a)?c.append(a):e.push(a)}),b.on("end",function(){if(j("end event",b.uri.href),b._aborted)return j("aborted",b.uri.href),void c.destroy();if(c.length?(j("has body",b.uri.href,c.length),null===b.encoding?a.body=c.slice():a.body=c.toString(b.encoding),c.destroy()):e.length&&("utf8"===b.encoding&&e[0].length>0&&"\ufeff"===e[0][0]&&(e[0]=e[0].substring(1)),a.body=e.join("")),b._json)try{a.body=JSON.parse(a.body,b._jsonReviver)}catch(f){j("invalid JSON received",b.uri.href)}j("emitting complete",b.uri.href),"undefined"!=typeof a.body||b._json||(a.body=null===b.encoding?new d(0):""),b.emit("complete",a,a.body)})},i.prototype.abort=function(){var a=this;a._aborted=!0,a.req?a.req.abort():a.response&&a.response.destroy(),a.emit("abort")},i.prototype.pipeDest=function(a){var b=this,c=b.response;if(a.headers&&!a.headersSent){if(c.caseless.has("content-type")){var d=c.caseless.has("content-type");a.setHeader?a.setHeader(d,c.headers[d]):a.headers[d]=c.headers[d]}if(c.caseless.has("content-length")){var e=c.caseless.has("content-length");a.setHeader?a.setHeader(e,c.headers[e]):a.headers[e]=c.headers[e]}}if(a.setHeader&&!a.headersSent){for(var f in c.headers)b.gzip&&"content-encoding"===f||a.setHeader(f,c.headers[f]);a.statusCode=c.statusCode}b.pipefilter&&b.pipefilter(c,a)},i.prototype.qs=function(a,b){var c,d=this;c=!b&&d.uri.query?d._qs.parse(d.uri.query):{};for(var e in a)c[e]=a[e];var f=d._qs.stringify(c);return""===f?d:(d.uri=m.parse(d.uri.href.split("?")[0]+"?"+f),d.url=d.uri,d.path=d.uri.path,"unix"===d.uri.host&&d.enableUnixSocket(),d)},i.prototype.form=function(a){var b=this;return a?(/^application\/x-www-form-urlencoded\b/.test(b.getHeader("content-type"))||b.setHeader("content-type","application/x-www-form-urlencoded"),b.body="string"==typeof a?b._qs.rfc3986(a.toString("utf8")):b._qs.stringify(a).toString("utf8"),b):(b._form=new z,b._form.on("error",function(a){a.message="form-data: "+a.message,b.emit("error",a),b.abort()}),b._form)},i.prototype.multipart=function(a){var b=this;return b._multipart.onRequest(a),b._multipart.chunked||(b.body=b._multipart.body),b},i.prototype.json=function(a){var b=this;return b.hasHeader("accept")||b.setHeader("accept","application/json"),"function"==typeof b.jsonReplacer&&(b._jsonReplacer=b.jsonReplacer),b._json=!0,"boolean"==typeof a?void 0!==b.body&&(/^application\/x-www-form-urlencoded\b/.test(b.getHeader("content-type"))?b.body=b._qs.rfc3986(b.body):b.body=N(b.body,b._jsonReplacer),b.hasHeader("content-type")||b.setHeader("content-type","application/json")):(b.body=N(a,b._jsonReplacer),b.hasHeader("content-type")||b.setHeader("content-type","application/json")),"function"==typeof b.jsonReviver&&(b._jsonReviver=b.jsonReviver),b},i.prototype.getHeader=function(a,b){var c,d,e,f=this;return b||(b=f.headers),Object.keys(b).forEach(function(f){f.length===a.length&&(d=new RegExp(a,"i"),e=f.match(d),e&&(c=b[f]))}),c},i.prototype.enableUnixSocket=function(){var a=this.uri.path.split(":"),b=a[0],c=a[1];this.socketPath=b,this.uri.pathname=c,this.uri.path=c,this.uri.host=b,this.uri.hostname=b,this.uri.isUnix=!0},i.prototype.auth=function(a,b,c,d){var e=this;return e._auth.onRequest(a,b,c,d),e},i.prototype.aws=function(a,b){var c=this;if(!b)return c._aws=a,c;if(4==a.sign_version||"4"==a.sign_version){var d={host:c.uri.host,path:c.uri.path,method:c.method,headers:{"content-type":c.getHeader("content-type")||""},body:c.body},e=t.sign(d,{accessKeyId:a.key,secretAccessKey:a.secret});c.setHeader("authorization",e.headers.Authorization),c.setHeader("x-amz-date",e.headers["X-Amz-Date"])}else{var f=new Date;c.setHeader("date",f.toUTCString());var g={key:a.key,secret:a.secret,verb:c.method.toUpperCase(),date:f,contentType:c.getHeader("content-type")||"",md5:c.getHeader("content-md5")||"",amazonHeaders:s.canonicalizeHeaders(c.headers)},h=c.uri.path;a.bucket&&h?g.resource="/"+a.bucket+h:a.bucket&&!h?g.resource="/"+a.bucket:!a.bucket&&h?g.resource=h:a.bucket||h||(g.resource="/"),g.resource=s.canonicalizeResource(g.resource),c.setHeader("authorization",s.authorization(g))}return c},i.prototype.httpSignature=function(a){var b=this;return u.signRequest({getHeader:function(a){return b.getHeader(a,b.headers)},setHeader:function(a,c){b.setHeader(a,c)},method:b.method,path:b.path},a),j("httpSignature authorization",b.getHeader("authorization")),b},i.prototype.hawk=function(a){var b=this;b.setHeader("Authorization",r.client.header(b.uri,b.method,a).field)},i.prototype.oauth=function(a){var b=this;return b._oauth.onRequest(a),b},i.prototype.jar=function(a){var b,c=this;if(0===c._redirect.redirectsFollowed&&(c.originalCookieHeader=c.getHeader("cookie")),a){var d=a&&a.getCookieString?a:T,e=c.uri.href;d&&(b=d.getCookieString(e))}else b=!1,c._disableCookies=!0;return b&&b.length&&(c.originalCookieHeader?c.setHeader("cookie",c.originalCookieHeader+"; "+b):c.setHeader("cookie",b)),c._jar=a,c},i.prototype.pipe=function(a,b){var c=this;if(!c.response)return c.dests.push(a),o.Stream.prototype.pipe.call(c,a,b),a;if(c._destdata)c.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else{if(!c._ended)return o.Stream.prototype.pipe.call(c,a,b),c.pipeDest(a),a;c.emit("error",new Error("You cannot pipe after the response has been ended."))}},i.prototype.write=function(){var a=this;if(!a._aborted)return a._started||a.start(),a.req?a.req.write.apply(a.req,arguments):void 0},i.prototype.end=function(a){var b=this;b._aborted||(a&&b.write(a),b._started||b.start(),b.req&&b.req.end())},i.prototype.pause=function(){var a=this;a.responseContent?a.responseContent.pause.apply(a.responseContent,arguments):a._paused=!0},i.prototype.resume=function(){var a=this;a.responseContent?a.responseContent.resume.apply(a.responseContent,arguments):a._paused=!1},i.prototype.destroy=function(){var a=this;a._ended?a.response&&a.response.destroy():a.end()},i.defaultProxyHeaderWhiteList=M.defaultProxyHeaderWhiteList.slice(),i.defaultProxyHeaderExclusiveList=M.defaultProxyHeaderExclusiveList.slice(),i.prototype.toJSON=g,b.exports=i}).call(this,a("_process"),a("buffer").Buffer)},{"./lib/auth":439,"./lib/cookies":440,"./lib/getProxyFromURI":441,"./lib/har":442,"./lib/helpers":443,"./lib/multipart":444,"./lib/oauth":445,"./lib/querystring":446,"./lib/redirect":447,"./lib/tunnel":448,_process:392,"aws-sign2":449,aws4:450,bl:452,buffer:191,caseless:463,extend:466,"forever-agent":467,"form-data":468,hawk:497,http:414,"http-signature":498,https:388,"is-typedarray":549,isstream:550,"mime-types":552,stream:413,stringstream:561,url:421,util:424,zlib:190}],571:[function(a,b,c){"use strict";function d(a){throw a}function e(a,b,c){4!==b.length&&d(new n.exception.invalid("invalid aes block size"));var e=a.b[c],f=b[0]^e[0],g=b[c?3:1]^e[1],h=b[2]^e[2];b=b[c?1:3]^e[3];var i,j,k,l,m=e.length/4-2,o=4,p=[0,0,0,0];i=a.k[c],a=i[0];var q=i[1],r=i[2],s=i[3],t=i[4];for(l=0;m>l;l++)i=a[f>>>24]^q[g>>16&255]^r[h>>8&255]^s[255&b]^e[o],j=a[g>>>24]^q[h>>16&255]^r[b>>8&255]^s[255&f]^e[o+1],k=a[h>>>24]^q[b>>16&255]^r[f>>8&255]^s[255&g]^e[o+2],b=a[b>>>24]^q[f>>16&255]^r[g>>8&255]^s[255&h]^e[o+3],o+=4,f=i,g=j,h=k;for(l=0;4>l;l++)p[c?3&-l:l]=t[f>>>24]<<24^t[g>>16&255]<<16^t[h>>8&255]<<8^t[255&b]^e[o++],i=f,f=g,g=h,h=b,b=i;return p}function f(a,b){var c,d,e,f=b.slice(0),g=a.r,h=a.b,i=g[0],j=g[1],k=g[2],l=g[3],m=g[4],n=g[5],o=g[6],p=g[7];for(c=0;64>c;c++)16>c?d=f[c]:(d=f[c+1&15],e=f[c+14&15],d=f[15&c]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+f[15&c]+f[c+9&15]|0),d=d+p+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(o^m&(n^o))+h[c],p=o,o=n,n=m,m=l+d|0,l=k,k=j,j=i,i=d+(j&k^l&(j^k))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;g[0]=g[0]+i|0,g[1]=g[1]+j|0,g[2]=g[2]+k|0,g[3]=g[3]+l|0,g[4]=g[4]+m|0,g[5]=g[5]+n|0,g[6]=g[6]+o|0,g[7]=g[7]+p|0}function g(a,b){var c,d=n.random.w[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;cb&&(a.f[b]=a.f[b]+1|0,!a.f[b]);b++);return a.A.encrypt(a.f)}function k(a,b){return function(){b.apply(a,arguments)}}var l=void 0,m=!1,n={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message},this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message},this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message},this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message},this.message=a}}};"undefined"!=typeof b&&b.exports&&(b.exports=n),"function"==typeof define&&define([],function(){return n}),n.cipher.aes=function(a){this.k[0][0][0]||this.D();var b,c,e,f,g=this.k[0][4],h=this.k[1];b=a.length;var i=1;for(4!==b&&6!==b&&8!==b&&d(new n.exception.invalid("invalid aes key size")),this.b=[e=a.slice(0),f=[]],a=b;4*b+28>a;a++)c=e[a-1],(0===a%b||8===b&&4===a%b)&&(c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[255&c],0===a%b&&(c=c<<8^c>>>24^i<<24,i=i<<1^283*(i>>7))),e[a]=e[a-b]^c;for(b=0;a;b++,a--)c=e[3&b?a:a-4],f[b]=4>=a||4>b?c:h[0][g[c>>>24]]^h[1][g[c>>16&255]]^h[2][g[c>>8&255]]^h[3][g[255&c]]},n.cipher.aes.prototype={encrypt:function(a){return e(this,a,0)},decrypt:function(a){return e(this,a,1)},k:[[[],[],[],[],[]],[[],[],[],[],[]]],D:function(){var a,b,c,d,e,f,g,h=this.k[0],i=this.k[1],j=h[4],k=i[4],l=[],m=[];for(a=0;256>a;a++)m[(l[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!j[b];b^=d||1,c=m[c]||1)for(f=c^c<<1^c<<2^c<<3^c<<4,f=f>>8^255&f^99,j[b]=f,k[f]=b,e=l[a=l[d=l[b]]],g=16843009*e^65537*a^257*d^16843008*b,e=257*l[f]^16843008*f,a=0;4>a;a++)h[a][b]=e=e<<24^e>>>8,i[a][f]=g=g<<24^g>>>8;for(a=0;5>a;a++)h[a]=h[a].slice(0),i[a]=i[a].slice(0)}},n.bitArray={bitSlice:function(a,b,c){return a=n.bitArray.P(a.slice(b/32),32-(31&b)).slice(1),c===l?a:n.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return(-32&(b+c-1^b)?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<0&&b&&(a[c-1]=n.bitArray.partial(b,a[c-1]&2147483648>>b-1,1)),a},partial:function(a,b,c){return 32===a?b:(c?0|b:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(n.bitArray.bitLength(a)!==n.bitArray.bitLength(b))return m;var c,d=0;for(c=0;c=32;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e>>b),c=a[e]<<32-b;return e=a.length?a[a.length-1]:0,a=n.bitArray.getPartial(e),d.push(n.bitArray.partial(b+a&31,b+a>32?c:d.pop(),1)),d},l:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b>>24|c>>>8&65280|(65280&c)<<8|c<<24;return a}},n.codec.utf8String={fromBits:function(a){var b,c,d="",e=n.bitArray.bitLength(a);for(b=0;e/8>b;b++)0===(3&b)&&(c=a[b/4]),d+=String.fromCharCode(c>>>24),c<<=8;return decodeURIComponent(escape(d))},toBits:function(a){a=unescape(encodeURIComponent(a));var b,c=[],d=0;for(b=0;b>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;3&d.length&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c,e,f=[],g=0,h=n.codec.base64.J,i=0;for(b&&(h=h.substr(0,62)+"-_"),c=0;ce&&d(new n.exception.invalid("this isn't base64!")),g>26?(g-=26,f.push(i^e>>>g),i=e<<32-g):(g+=6,i^=e<<32-g);return 56&g&&f.push(n.bitArray.partial(56&g,i,1)),f}},n.codec.base64url={fromBits:function(a){return n.codec.base64.fromBits(a,1,1)},toBits:function(a){return n.codec.base64.toBits(a,1)}},n.hash.sha256=function(a){this.b[0]||this.D(),a?(this.r=a.r.slice(0),this.o=a.o.slice(0),this.h=a.h):this.reset()},n.hash.sha256.hash=function(a){return(new n.hash.sha256).update(a).finalize()},n.hash.sha256.prototype={blockSize:512,reset:function(){return this.r=this.N.slice(0),this.o=[],this.h=0,this},update:function(a){"string"==typeof a&&(a=n.codec.utf8String.toBits(a));var b,c=this.o=n.bitArray.concat(this.o,a);for(b=this.h,a=this.h=b+n.bitArray.bitLength(a),b=512+b&-512;a>=b;b+=512)f(this,c.splice(0,16));return this},finalize:function(){var a,b=this.o,c=this.r,b=n.bitArray.concat(b,[n.bitArray.partial(1,1)]);for(a=b.length+2;15&a;a++)b.push(0);for(b.push(Math.floor(this.h/4294967296)),b.push(0|this.h);b.length;)f(this,b.splice(0,16));return this.reset(),c},N:[],b:[],D:function(){function a(a){return 4294967296*(a-Math.floor(a))|0}var b,c=0,d=2;a:for(;64>c;d++){for(b=2;d>=b*b;b++)if(0===d%b)continue a;8>c&&(this.N[c]=a(Math.pow(d,.5))),this.b[c]=a(Math.pow(d,1/3)),c++}}},n.mode.ccm={name:"ccm",encrypt:function(a,b,c,e,f){var g,h=b.slice(0),i=n.bitArray,j=i.bitLength(c)/8,k=i.bitLength(h)/8;for(f=f||64,e=e||[],7>j&&d(new n.exception.invalid("ccm: iv must be at least 7 bytes")),g=2;4>g&&k>>>8*g;g++);return 15-j>g&&(g=15-j),c=i.clamp(c,8*(15-g)),b=n.mode.ccm.L(a,b,c,e,f,g),h=n.mode.ccm.p(a,h,c,b,f,g),i.concat(h.data,h.tag)},decrypt:function(a,b,c,e,f){f=f||64,e=e||[];var g=n.bitArray,h=g.bitLength(c)/8,i=g.bitLength(b),j=g.clamp(b,i-f),k=g.bitSlice(b,i-f),i=(i-f)/8;for(7>h&&d(new n.exception.invalid("ccm: iv must be at least 7 bytes")),b=2;4>b&&i>>>8*b;b++);return 15-h>b&&(b=15-h),c=g.clamp(c,8*(15-b)),j=n.mode.ccm.p(a,j,c,k,f,b),a=n.mode.ccm.L(a,j.data,c,e,f,b),g.equal(j.tag,a)||d(new n.exception.corrupt("ccm: tag doesn't match")),j.data},L:function(a,b,c,e,f,g){var h=[],i=n.bitArray,j=i.l;if(f/=8,(f%2||4>f||f>16)&&d(new n.exception.invalid("ccm: invalid tag length")),(4294967295=c?h=[i.partial(16,c)]:4294967295>=c&&(h=i.concat([i.partial(16,65534)],[c])),h=i.concat(h,e),e=0;eg;g+=4)c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,j)}}},n.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,e,f,g){128!==n.bitArray.bitLength(c)&&d(new n.exception.invalid("ocb iv must be 128 bits"));var h,i=n.mode.ocb2.H,j=n.bitArray,k=j.l,l=[0,0,0,0];c=i(a.encrypt(c));var m,o=[];for(e=e||[],f=f||64,h=0;h+4c+4;c+=4)h=l(o,a.decrypt(l(o,b.slice(c,c+4)))),m=l(m,h),q=q.concat(h),o=j(o);return i=p-32*c,h=a.encrypt(l(o,[0,0,0,i])),h=l(h,k.clamp(b.slice(c),i).concat([0,0,0])),m=l(m,h),m=a.encrypt(l(m,l(o,j(o)))),e.length&&(m=l(m,g?e:n.mode.ocb2.pmac(a,e))),k.equal(k.clamp(m,f),k.bitSlice(b,p))||d(new n.exception.corrupt("ocb: tag doesn't match")),q.concat(k.clamp(h,i))},pmac:function(a,b){var c,d=n.mode.ocb2.H,e=n.bitArray,f=e.l,g=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=f(h,d(d(h)));for(c=0;c+4e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0])),g=f(g,c),a.encrypt(f(d(f(h,d(h))),g))},H:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}},n.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);return b=n.bitArray,d=d||[],a=n.mode.gcm.p(!0,a,f,d,c,e||128),b.concat(a.data,a.tag)},decrypt:function(a,b,c,e,f){var g=b.slice(0),h=n.bitArray,i=h.bitLength(g);return f=f||128,e=e||[],i>=f?(b=h.bitSlice(g,i-f),g=h.bitSlice(g,0,i-f)):(b=g,g=[]),a=n.mode.gcm.p(m,a,g,e,c,f),h.equal(a.tag,b)||d(new n.exception.corrupt("gcm: tag doesn't match")),a.data},Z:function(a,b){var c,d,e,f,g,h=n.bitArray.l;for(e=[0,0,0,0],f=b.slice(0),c=0;128>c;c++){for((d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f)),g=0!==(1&f[3]),d=3;d>0;d--)f[d]=f[d]>>>1|(1&f[d-1])<<31;f[0]>>>=1,g&&(f[0]^=-520093696)}return e},g:function(a,b,c){var d,e=c.length;for(b=b.slice(0),d=0;e>d;d+=4)b[0]^=4294967295&c[d],b[1]^=4294967295&c[d+1],b[2]^=4294967295&c[d+2],b[3]^=4294967295&c[d+3],b=n.mode.gcm.Z(b,a);return b},p:function(a,b,c,d,e,f){var g,h,i,j,k,l,m,o,p=n.bitArray;for(l=c.length,m=p.bitLength(c),o=p.bitLength(d),h=p.bitLength(e),g=b.encrypt([0,0,0,0]),96===h?(e=e.slice(0),e=p.concat(e,[1])):(e=n.mode.gcm.g(g,[0,0,0,0],e),e=n.mode.gcm.g(g,e,[0,0,Math.floor(h/4294967296),4294967295&h])),h=n.mode.gcm.g(g,[0,0,0,0],d),k=e.slice(0),d=h.slice(0),a||(d=n.mode.gcm.g(g,h,c)),j=0;l>j;j+=4)k[3]++,i=b.encrypt(k),c[j]^=i[0],c[j+1]^=i[1],c[j+2]^=i[2],c[j+3]^=i[3];return c=p.clamp(c,m),a&&(d=n.mode.gcm.g(g,h,c)),a=[Math.floor(o/4294967296),4294967295&o,Math.floor(m/4294967296),4294967295&m],d=n.mode.gcm.g(g,d,a),i=b.encrypt(e),d[0]^=i[0],d[1]^=i[1],d[2]^=i[2],d[3]^=i[3],{tag:p.bitSlice(d,0,f),data:c}}},n.misc.hmac=function(a,b){this.M=b=b||n.hash.sha256;var c,d=[[],[]],e=b.prototype.blockSize/32;for(this.n=[new b,new b],a.length>e&&(a=b.hash(a)),c=0;e>c;c++)d[0][c]=909522486^a[c],d[1][c]=1549556828^a[c];this.n[0].update(d[0]),this.n[1].update(d[1]),this.G=new b(this.n[0])},n.misc.hmac.prototype.encrypt=n.misc.hmac.prototype.mac=function(a){return this.Q&&d(new n.exception.invalid("encrypt on already updated hmac called!")),this.update(a),this.digest(a)},n.misc.hmac.prototype.reset=function(){this.G=new this.M(this.n[0]),this.Q=m},n.misc.hmac.prototype.update=function(a){this.Q=!0,this.G.update(a)},n.misc.hmac.prototype.digest=function(){var a=this.G.finalize(),a=new this.M(this.n[1]).update(a).finalize();return this.reset(),a},n.misc.pbkdf2=function(a,b,c,e,f){c=c||1e3,(0>e||0>c)&&d(n.exception.invalid("invalid params to pbkdf2")),"string"==typeof a&&(a=n.codec.utf8String.toBits(a)),"string"==typeof b&&(b=n.codec.utf8String.toBits(b)),f=f||n.misc.hmac,a=new f(a);var g,h,i,j,k=[],l=n.bitArray;for(j=1;32*k.length<(e||1);j++){for(f=g=a.encrypt(l.concat(b,[j])),h=1;c>h;h++)for(g=a.encrypt(g),i=0;ig;g++)f.push(4294967296*Math.random()|0);for(g=0;g=1<this.j&&(this.j=h),this.F++,this.b=n.hash.sha256.hash(this.b.concat(f)),this.A=new n.cipher.aes(this.b),c=0;4>c&&(this.f[c]=this.f[c]+1|0,!this.f[c]);c++);}for(c=0;a>c;c+=4)0===(c+1)%this.S&&i(this),f=j(this),e.push(f[0],f[1],f[2],f[3]);return i(this),e.slice(0,a)},setDefaultParanoia:function(a,b){0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b&&d("Setting paranoia=0 will ruin your security; use it only for testing"),this.B=a},addEntropy:function(a,b,c){c=c||"user";var e,f,h=(new Date).valueOf(),i=this.s[c],j=this.isReady(),k=0;switch(e=this.K[c],e===l&&(e=this.K[c]=this.W++),i===l&&(i=this.s[c]=0),this.s[c]=(this.s[c]+1)%this.c.length,typeof a){case"number":b===l&&(b=1),this.c[i].update([e,this.C++,1,b,h,1,0|a]);break;case"object":if(c=Object.prototype.toString.call(a),"[object Uint32Array]"===c){for(f=[],c=0;c0;)b++,f>>>=1;this.c[i].update([e,this.C++,2,b,h,a.length].concat(a))}break;case"string":b===l&&(b=a.length),this.c[i].update([e,this.C++,3,b,h,a.length]),this.c[i].update(a);break;default:k=1}k&&d(new n.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.i[i]+=b,this.d+=b,j===this.m&&(this.isReady()!==this.m&&g("seeded",Math.max(this.j,this.d)),g("progress",this.getProgress()))},isReady:function(a){return a=this.I[a!==l?a:this.B],this.j&&this.j>=a?this.i[0]>this.R&&(new Date).valueOf()>this.O?this.u|this.t:this.t:this.d>=a?this.u|this.m:this.m},getProgress:function(a){return a=this.I[a?a:this.B],this.j>=a?1:this.d>a?1:this.d/a},startCollectors:function(){this.q||(this.a={loadTimeCollector:k(this,this.aa),mouseCollector:k(this,this.ba),keyboardCollector:k(this,this.$),accelerometerCollector:k(this,this.U),touchCollector:k(this,this.da)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,m),window.addEventListener("mousemove",this.a.mouseCollector,m),window.addEventListener("keypress",this.a.keyboardCollector,m),window.addEventListener("devicemotion",this.a.accelerometerCollector,m),window.addEventListener("touchmove",this.a.touchCollector,m)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):d(new n.exception.bug("can't attach event")),this.q=!0)},stopCollectors:function(){this.q&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,m),window.removeEventListener("mousemove",this.a.mouseCollector,m),window.removeEventListener("keypress",this.a.keyboardCollector,m),window.removeEventListener("devicemotion",this.a.accelerometerCollector,m),window.removeEventListener("touchmove",this.a.touchCollector,m)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.q=m)},addEventListener:function(a,b){this.w[a][this.V++]=b},removeEventListener:function(a,b){var c,d,e=this.w[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;c=h.iter||64!==h.ts&&96!==h.ts&&128!==h.ts||128!==h.ks&&192!==h.ks&&256!==h.ks||2>h.iv.length||4=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&256!==b.ks||!b.iv||2>b.iv.length||4= 0.12.0",main:"index.js",repository:{url:"git@github.com:bitpay/bitcore-wallet-client.git",type:"git"},bugs:{ +b.timeoutTimer=null),b.emit("error",a)}},i.prototype.onRequestResponse=function(a){var b=this;if(j("onRequestResponse",b.uri.href,a.statusCode,a.headers),a.on("end",function(){b.timing&&(b.elapsedTime+=(new Date).getTime()-b.startTime,j("elapsed time",b.elapsedTime),a.elapsedTime=b.elapsedTime),j("response end",b.uri.href,a.statusCode,a.headers)}),b._aborted)return j("aborted",b.uri.href),void a.resume();if(b.response=a,a.request=b,a.toJSON=h,b.httpModule===l&&b.strictSSL&&(!a.hasOwnProperty("socket")||!a.socket.authorized)){j("strict ssl error",b.uri.href);var c=a.hasOwnProperty("socket")?a.socket.authorizationError:b.uri.href+" does not support SSL";return void b.emit("error",new Error("SSL Error: "+c))}b.originalHost=b.getHeader("host"),b.originalHostHeaderName||(b.originalHostHeaderName=b.hasHeader("host")),b.setHost&&b.removeHeader("host"),b.timeout&&b.timeoutTimer&&(clearTimeout(b.timeoutTimer),b.timeoutTimer=null);var d=b._jar&&b._jar.setCookie?b._jar:T,e=function(a){try{d.setCookie(a,b.uri.href,{ignoreError:!0})}catch(c){b.emit("error",c)}};if(a.caseless=x(a.headers),a.caseless.has("set-cookie")&&!b._disableCookies){var f=a.caseless.has("set-cookie");Array.isArray(a.headers[f])?a.headers[f].forEach(e):e(a.headers[f])}if(!b._redirect.onResponse(a)){a.on("close",function(){b._ended||b.response.emit("end")}),a.on("end",function(){b._ended=!0});var g,i=function(a){return"HEAD"===b.method||a>=100&&200>a||204===a||304===a};if(b.gzip&&!i(a.statusCode)){var k=a.headers["content-encoding"]||"identity";k=k.trim().toLowerCase(),"gzip"===k?(g=p.createGunzip(),a.pipe(g)):"deflate"===k?(g=p.createInflate(),a.pipe(g)):("identity"!==k&&j("ignoring unrecognized Content-Encoding "+k),g=a)}else g=a;b.encoding&&(0!==b.dests.length?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):g.setEncoding?g.setEncoding(b.encoding):g=g.pipe(w(b.encoding))),b._paused&&g.pause(),b.responseContent=g,b.emit("response",a),b.dests.forEach(function(a){b.pipeDest(a)}),g.on("data",function(a){b._destdata=!0,b.emit("data",a)}),g.on("end",function(a){b.emit("end",a)}),g.on("error",function(a){b.emit("error",a)}),g.on("close",function(){b.emit("close")}),b.callback?b.readResponseBody(a):b.on("end",function(){return b._aborted?void j("aborted",b.uri.href):void b.emit("complete",a)}),j("finish init function",b.uri.href)}},i.prototype.readResponseBody=function(a){var b=this;j("reading response's body");var c=q(),e=[];b.on("data",function(a){d.isBuffer(a)?c.append(a):e.push(a)}),b.on("end",function(){if(j("end event",b.uri.href),b._aborted)return j("aborted",b.uri.href),void c.destroy();if(c.length?(j("has body",b.uri.href,c.length),null===b.encoding?a.body=c.slice():a.body=c.toString(b.encoding),c.destroy()):e.length&&("utf8"===b.encoding&&e[0].length>0&&"\ufeff"===e[0][0]&&(e[0]=e[0].substring(1)),a.body=e.join("")),b._json)try{a.body=JSON.parse(a.body,b._jsonReviver)}catch(f){j("invalid JSON received",b.uri.href)}j("emitting complete",b.uri.href),"undefined"!=typeof a.body||b._json||(a.body=null===b.encoding?new d(0):""),b.emit("complete",a,a.body)})},i.prototype.abort=function(){var a=this;a._aborted=!0,a.req?a.req.abort():a.response&&a.response.destroy(),a.emit("abort")},i.prototype.pipeDest=function(a){var b=this,c=b.response;if(a.headers&&!a.headersSent){if(c.caseless.has("content-type")){var d=c.caseless.has("content-type");a.setHeader?a.setHeader(d,c.headers[d]):a.headers[d]=c.headers[d]}if(c.caseless.has("content-length")){var e=c.caseless.has("content-length");a.setHeader?a.setHeader(e,c.headers[e]):a.headers[e]=c.headers[e]}}if(a.setHeader&&!a.headersSent){for(var f in c.headers)b.gzip&&"content-encoding"===f||a.setHeader(f,c.headers[f]);a.statusCode=c.statusCode}b.pipefilter&&b.pipefilter(c,a)},i.prototype.qs=function(a,b){var c,d=this;c=!b&&d.uri.query?d._qs.parse(d.uri.query):{};for(var e in a)c[e]=a[e];var f=d._qs.stringify(c);return""===f?d:(d.uri=m.parse(d.uri.href.split("?")[0]+"?"+f),d.url=d.uri,d.path=d.uri.path,"unix"===d.uri.host&&d.enableUnixSocket(),d)},i.prototype.form=function(a){var b=this;return a?(/^application\/x-www-form-urlencoded\b/.test(b.getHeader("content-type"))||b.setHeader("content-type","application/x-www-form-urlencoded"),b.body="string"==typeof a?b._qs.rfc3986(a.toString("utf8")):b._qs.stringify(a).toString("utf8"),b):(b._form=new z,b._form.on("error",function(a){a.message="form-data: "+a.message,b.emit("error",a),b.abort()}),b._form)},i.prototype.multipart=function(a){var b=this;return b._multipart.onRequest(a),b._multipart.chunked||(b.body=b._multipart.body),b},i.prototype.json=function(a){var b=this;return b.hasHeader("accept")||b.setHeader("accept","application/json"),"function"==typeof b.jsonReplacer&&(b._jsonReplacer=b.jsonReplacer),b._json=!0,"boolean"==typeof a?void 0!==b.body&&(/^application\/x-www-form-urlencoded\b/.test(b.getHeader("content-type"))?b.body=b._qs.rfc3986(b.body):b.body=N(b.body,b._jsonReplacer),b.hasHeader("content-type")||b.setHeader("content-type","application/json")):(b.body=N(a,b._jsonReplacer),b.hasHeader("content-type")||b.setHeader("content-type","application/json")),"function"==typeof b.jsonReviver&&(b._jsonReviver=b.jsonReviver),b},i.prototype.getHeader=function(a,b){var c,d,e,f=this;return b||(b=f.headers),Object.keys(b).forEach(function(f){f.length===a.length&&(d=new RegExp(a,"i"),e=f.match(d),e&&(c=b[f]))}),c},i.prototype.enableUnixSocket=function(){var a=this.uri.path.split(":"),b=a[0],c=a[1];this.socketPath=b,this.uri.pathname=c,this.uri.path=c,this.uri.host=b,this.uri.hostname=b,this.uri.isUnix=!0},i.prototype.auth=function(a,b,c,d){var e=this;return e._auth.onRequest(a,b,c,d),e},i.prototype.aws=function(a,b){var c=this;if(!b)return c._aws=a,c;if(4==a.sign_version||"4"==a.sign_version){var d={host:c.uri.host,path:c.uri.path,method:c.method,headers:{"content-type":c.getHeader("content-type")||""},body:c.body},e=t.sign(d,{accessKeyId:a.key,secretAccessKey:a.secret});c.setHeader("authorization",e.headers.Authorization),c.setHeader("x-amz-date",e.headers["X-Amz-Date"])}else{var f=new Date;c.setHeader("date",f.toUTCString());var g={key:a.key,secret:a.secret,verb:c.method.toUpperCase(),date:f,contentType:c.getHeader("content-type")||"",md5:c.getHeader("content-md5")||"",amazonHeaders:s.canonicalizeHeaders(c.headers)},h=c.uri.path;a.bucket&&h?g.resource="/"+a.bucket+h:a.bucket&&!h?g.resource="/"+a.bucket:!a.bucket&&h?g.resource=h:a.bucket||h||(g.resource="/"),g.resource=s.canonicalizeResource(g.resource),c.setHeader("authorization",s.authorization(g))}return c},i.prototype.httpSignature=function(a){var b=this;return u.signRequest({getHeader:function(a){return b.getHeader(a,b.headers)},setHeader:function(a,c){b.setHeader(a,c)},method:b.method,path:b.path},a),j("httpSignature authorization",b.getHeader("authorization")),b},i.prototype.hawk=function(a){var b=this;b.setHeader("Authorization",r.client.header(b.uri,b.method,a).field)},i.prototype.oauth=function(a){var b=this;return b._oauth.onRequest(a),b},i.prototype.jar=function(a){var b,c=this;if(0===c._redirect.redirectsFollowed&&(c.originalCookieHeader=c.getHeader("cookie")),a){var d=a&&a.getCookieString?a:T,e=c.uri.href;d&&(b=d.getCookieString(e))}else b=!1,c._disableCookies=!0;return b&&b.length&&(c.originalCookieHeader?c.setHeader("cookie",c.originalCookieHeader+"; "+b):c.setHeader("cookie",b)),c._jar=a,c},i.prototype.pipe=function(a,b){var c=this;if(!c.response)return c.dests.push(a),o.Stream.prototype.pipe.call(c,a,b),a;if(c._destdata)c.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else{if(!c._ended)return o.Stream.prototype.pipe.call(c,a,b),c.pipeDest(a),a;c.emit("error",new Error("You cannot pipe after the response has been ended."))}},i.prototype.write=function(){var a=this;if(!a._aborted)return a._started||a.start(),a.req?a.req.write.apply(a.req,arguments):void 0},i.prototype.end=function(a){var b=this;b._aborted||(a&&b.write(a),b._started||b.start(),b.req&&b.req.end())},i.prototype.pause=function(){var a=this;a.responseContent?a.responseContent.pause.apply(a.responseContent,arguments):a._paused=!0},i.prototype.resume=function(){var a=this;a.responseContent?a.responseContent.resume.apply(a.responseContent,arguments):a._paused=!1},i.prototype.destroy=function(){var a=this;a._ended?a.response&&a.response.destroy():a.end()},i.defaultProxyHeaderWhiteList=M.defaultProxyHeaderWhiteList.slice(),i.defaultProxyHeaderExclusiveList=M.defaultProxyHeaderExclusiveList.slice(),i.prototype.toJSON=g,b.exports=i}).call(this,a("_process"),a("buffer").Buffer)},{"./lib/auth":439,"./lib/cookies":440,"./lib/getProxyFromURI":441,"./lib/har":442,"./lib/helpers":443,"./lib/multipart":444,"./lib/oauth":445,"./lib/querystring":446,"./lib/redirect":447,"./lib/tunnel":448,_process:392,"aws-sign2":449,aws4:450,bl:452,buffer:191,caseless:463,extend:466,"forever-agent":467,"form-data":468,hawk:497,http:414,"http-signature":498,https:388,"is-typedarray":549,isstream:550,"mime-types":552,stream:413,stringstream:561,url:421,util:424,zlib:190}],571:[function(a,b,c){"use strict";function d(a){throw a}function e(a,b,c){4!==b.length&&d(new n.exception.invalid("invalid aes block size"));var e=a.b[c],f=b[0]^e[0],g=b[c?3:1]^e[1],h=b[2]^e[2];b=b[c?1:3]^e[3];var i,j,k,l,m=e.length/4-2,o=4,p=[0,0,0,0];i=a.k[c],a=i[0];var q=i[1],r=i[2],s=i[3],t=i[4];for(l=0;m>l;l++)i=a[f>>>24]^q[g>>16&255]^r[h>>8&255]^s[255&b]^e[o],j=a[g>>>24]^q[h>>16&255]^r[b>>8&255]^s[255&f]^e[o+1],k=a[h>>>24]^q[b>>16&255]^r[f>>8&255]^s[255&g]^e[o+2],b=a[b>>>24]^q[f>>16&255]^r[g>>8&255]^s[255&h]^e[o+3],o+=4,f=i,g=j,h=k;for(l=0;4>l;l++)p[c?3&-l:l]=t[f>>>24]<<24^t[g>>16&255]<<16^t[h>>8&255]<<8^t[255&b]^e[o++],i=f,f=g,g=h,h=b,b=i;return p}function f(a,b){var c,d,e,f=b.slice(0),g=a.r,h=a.b,i=g[0],j=g[1],k=g[2],l=g[3],m=g[4],n=g[5],o=g[6],p=g[7];for(c=0;64>c;c++)16>c?d=f[c]:(d=f[c+1&15],e=f[c+14&15],d=f[15&c]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+f[15&c]+f[c+9&15]|0),d=d+p+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(o^m&(n^o))+h[c],p=o,o=n,n=m,m=l+d|0,l=k,k=j,j=i,i=d+(j&k^l&(j^k))+(j>>>2^j>>>13^j>>>22^j<<30^j<<19^j<<10)|0;g[0]=g[0]+i|0,g[1]=g[1]+j|0,g[2]=g[2]+k|0,g[3]=g[3]+l|0,g[4]=g[4]+m|0,g[5]=g[5]+n|0,g[6]=g[6]+o|0,g[7]=g[7]+p|0}function g(a,b){var c,d=n.random.w[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;cb&&(a.f[b]=a.f[b]+1|0,!a.f[b]);b++);return a.A.encrypt(a.f)}function k(a,b){return function(){b.apply(a,arguments)}}var l=void 0,m=!1,n={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message},this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message},this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message},this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message},this.message=a}}};"undefined"!=typeof b&&b.exports&&(b.exports=n),"function"==typeof define&&define([],function(){return n}),n.cipher.aes=function(a){this.k[0][0][0]||this.D();var b,c,e,f,g=this.k[0][4],h=this.k[1];b=a.length;var i=1;for(4!==b&&6!==b&&8!==b&&d(new n.exception.invalid("invalid aes key size")),this.b=[e=a.slice(0),f=[]],a=b;4*b+28>a;a++)c=e[a-1],(0===a%b||8===b&&4===a%b)&&(c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[255&c],0===a%b&&(c=c<<8^c>>>24^i<<24,i=i<<1^283*(i>>7))),e[a]=e[a-b]^c;for(b=0;a;b++,a--)c=e[3&b?a:a-4],f[b]=4>=a||4>b?c:h[0][g[c>>>24]]^h[1][g[c>>16&255]]^h[2][g[c>>8&255]]^h[3][g[255&c]]},n.cipher.aes.prototype={encrypt:function(a){return e(this,a,0)},decrypt:function(a){return e(this,a,1)},k:[[[],[],[],[],[]],[[],[],[],[],[]]],D:function(){var a,b,c,d,e,f,g,h=this.k[0],i=this.k[1],j=h[4],k=i[4],l=[],m=[];for(a=0;256>a;a++)m[(l[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!j[b];b^=d||1,c=m[c]||1)for(f=c^c<<1^c<<2^c<<3^c<<4,f=f>>8^255&f^99,j[b]=f,k[f]=b,e=l[a=l[d=l[b]]],g=16843009*e^65537*a^257*d^16843008*b,e=257*l[f]^16843008*f,a=0;4>a;a++)h[a][b]=e=e<<24^e>>>8,i[a][f]=g=g<<24^g>>>8;for(a=0;5>a;a++)h[a]=h[a].slice(0),i[a]=i[a].slice(0)}},n.bitArray={bitSlice:function(a,b,c){return a=n.bitArray.P(a.slice(b/32),32-(31&b)).slice(1),c===l?a:n.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return(-32&(b+c-1^b)?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<0&&b&&(a[c-1]=n.bitArray.partial(b,a[c-1]&2147483648>>b-1,1)),a},partial:function(a,b,c){return 32===a?b:(c?0|b:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(n.bitArray.bitLength(a)!==n.bitArray.bitLength(b))return m;var c,d=0;for(c=0;c=32;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e>>b),c=a[e]<<32-b;return e=a.length?a[a.length-1]:0,a=n.bitArray.getPartial(e),d.push(n.bitArray.partial(b+a&31,b+a>32?c:d.pop(),1)),d},l:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b>>24|c>>>8&65280|(65280&c)<<8|c<<24;return a}},n.codec.utf8String={fromBits:function(a){var b,c,d="",e=n.bitArray.bitLength(a);for(b=0;e/8>b;b++)0===(3&b)&&(c=a[b/4]),d+=String.fromCharCode(c>>>24),c<<=8;return decodeURIComponent(escape(d))},toBits:function(a){a=unescape(encodeURIComponent(a));var b,c=[],d=0;for(b=0;b>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;3&d.length&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c,e,f=[],g=0,h=n.codec.base64.J,i=0;for(b&&(h=h.substr(0,62)+"-_"),c=0;ce&&d(new n.exception.invalid("this isn't base64!")),g>26?(g-=26,f.push(i^e>>>g),i=e<<32-g):(g+=6,i^=e<<32-g);return 56&g&&f.push(n.bitArray.partial(56&g,i,1)),f}},n.codec.base64url={fromBits:function(a){return n.codec.base64.fromBits(a,1,1)},toBits:function(a){return n.codec.base64.toBits(a,1)}},n.hash.sha256=function(a){this.b[0]||this.D(),a?(this.r=a.r.slice(0),this.o=a.o.slice(0),this.h=a.h):this.reset()},n.hash.sha256.hash=function(a){return(new n.hash.sha256).update(a).finalize()},n.hash.sha256.prototype={blockSize:512,reset:function(){return this.r=this.N.slice(0),this.o=[],this.h=0,this},update:function(a){"string"==typeof a&&(a=n.codec.utf8String.toBits(a));var b,c=this.o=n.bitArray.concat(this.o,a);for(b=this.h,a=this.h=b+n.bitArray.bitLength(a),b=512+b&-512;a>=b;b+=512)f(this,c.splice(0,16));return this},finalize:function(){var a,b=this.o,c=this.r,b=n.bitArray.concat(b,[n.bitArray.partial(1,1)]);for(a=b.length+2;15&a;a++)b.push(0);for(b.push(Math.floor(this.h/4294967296)),b.push(0|this.h);b.length;)f(this,b.splice(0,16));return this.reset(),c},N:[],b:[],D:function(){function a(a){return 4294967296*(a-Math.floor(a))|0}var b,c=0,d=2;a:for(;64>c;d++){for(b=2;d>=b*b;b++)if(0===d%b)continue a;8>c&&(this.N[c]=a(Math.pow(d,.5))),this.b[c]=a(Math.pow(d,1/3)),c++}}},n.mode.ccm={name:"ccm",encrypt:function(a,b,c,e,f){var g,h=b.slice(0),i=n.bitArray,j=i.bitLength(c)/8,k=i.bitLength(h)/8;for(f=f||64,e=e||[],7>j&&d(new n.exception.invalid("ccm: iv must be at least 7 bytes")),g=2;4>g&&k>>>8*g;g++);return 15-j>g&&(g=15-j),c=i.clamp(c,8*(15-g)),b=n.mode.ccm.L(a,b,c,e,f,g),h=n.mode.ccm.p(a,h,c,b,f,g),i.concat(h.data,h.tag)},decrypt:function(a,b,c,e,f){f=f||64,e=e||[];var g=n.bitArray,h=g.bitLength(c)/8,i=g.bitLength(b),j=g.clamp(b,i-f),k=g.bitSlice(b,i-f),i=(i-f)/8;for(7>h&&d(new n.exception.invalid("ccm: iv must be at least 7 bytes")),b=2;4>b&&i>>>8*b;b++);return 15-h>b&&(b=15-h),c=g.clamp(c,8*(15-b)),j=n.mode.ccm.p(a,j,c,k,f,b),a=n.mode.ccm.L(a,j.data,c,e,f,b),g.equal(j.tag,a)||d(new n.exception.corrupt("ccm: tag doesn't match")),j.data},L:function(a,b,c,e,f,g){var h=[],i=n.bitArray,j=i.l;if(f/=8,(f%2||4>f||f>16)&&d(new n.exception.invalid("ccm: invalid tag length")),(4294967295=c?h=[i.partial(16,c)]:4294967295>=c&&(h=i.concat([i.partial(16,65534)],[c])),h=i.concat(h,e),e=0;eg;g+=4)c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,j)}}},n.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,e,f,g){128!==n.bitArray.bitLength(c)&&d(new n.exception.invalid("ocb iv must be 128 bits"));var h,i=n.mode.ocb2.H,j=n.bitArray,k=j.l,l=[0,0,0,0];c=i(a.encrypt(c));var m,o=[];for(e=e||[],f=f||64,h=0;h+4c+4;c+=4)h=l(o,a.decrypt(l(o,b.slice(c,c+4)))),m=l(m,h),q=q.concat(h),o=j(o);return i=p-32*c,h=a.encrypt(l(o,[0,0,0,i])),h=l(h,k.clamp(b.slice(c),i).concat([0,0,0])),m=l(m,h),m=a.encrypt(l(m,l(o,j(o)))),e.length&&(m=l(m,g?e:n.mode.ocb2.pmac(a,e))),k.equal(k.clamp(m,f),k.bitSlice(b,p))||d(new n.exception.corrupt("ocb: tag doesn't match")),q.concat(k.clamp(h,i))},pmac:function(a,b){var c,d=n.mode.ocb2.H,e=n.bitArray,f=e.l,g=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=f(h,d(d(h)));for(c=0;c+4e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0])),g=f(g,c),a.encrypt(f(d(f(h,d(h))),g))},H:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}},n.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);return b=n.bitArray,d=d||[],a=n.mode.gcm.p(!0,a,f,d,c,e||128),b.concat(a.data,a.tag)},decrypt:function(a,b,c,e,f){var g=b.slice(0),h=n.bitArray,i=h.bitLength(g);return f=f||128,e=e||[],i>=f?(b=h.bitSlice(g,i-f),g=h.bitSlice(g,0,i-f)):(b=g,g=[]),a=n.mode.gcm.p(m,a,g,e,c,f),h.equal(a.tag,b)||d(new n.exception.corrupt("gcm: tag doesn't match")),a.data},Z:function(a,b){var c,d,e,f,g,h=n.bitArray.l;for(e=[0,0,0,0],f=b.slice(0),c=0;128>c;c++){for((d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f)),g=0!==(1&f[3]),d=3;d>0;d--)f[d]=f[d]>>>1|(1&f[d-1])<<31;f[0]>>>=1,g&&(f[0]^=-520093696)}return e},g:function(a,b,c){var d,e=c.length;for(b=b.slice(0),d=0;e>d;d+=4)b[0]^=4294967295&c[d],b[1]^=4294967295&c[d+1],b[2]^=4294967295&c[d+2],b[3]^=4294967295&c[d+3],b=n.mode.gcm.Z(b,a);return b},p:function(a,b,c,d,e,f){var g,h,i,j,k,l,m,o,p=n.bitArray;for(l=c.length,m=p.bitLength(c),o=p.bitLength(d),h=p.bitLength(e),g=b.encrypt([0,0,0,0]),96===h?(e=e.slice(0),e=p.concat(e,[1])):(e=n.mode.gcm.g(g,[0,0,0,0],e),e=n.mode.gcm.g(g,e,[0,0,Math.floor(h/4294967296),4294967295&h])),h=n.mode.gcm.g(g,[0,0,0,0],d),k=e.slice(0),d=h.slice(0),a||(d=n.mode.gcm.g(g,h,c)),j=0;l>j;j+=4)k[3]++,i=b.encrypt(k),c[j]^=i[0],c[j+1]^=i[1],c[j+2]^=i[2],c[j+3]^=i[3];return c=p.clamp(c,m),a&&(d=n.mode.gcm.g(g,h,c)),a=[Math.floor(o/4294967296),4294967295&o,Math.floor(m/4294967296),4294967295&m],d=n.mode.gcm.g(g,d,a),i=b.encrypt(e),d[0]^=i[0],d[1]^=i[1],d[2]^=i[2],d[3]^=i[3],{tag:p.bitSlice(d,0,f),data:c}}},n.misc.hmac=function(a,b){this.M=b=b||n.hash.sha256;var c,d=[[],[]],e=b.prototype.blockSize/32;for(this.n=[new b,new b],a.length>e&&(a=b.hash(a)),c=0;e>c;c++)d[0][c]=909522486^a[c],d[1][c]=1549556828^a[c];this.n[0].update(d[0]),this.n[1].update(d[1]),this.G=new b(this.n[0])},n.misc.hmac.prototype.encrypt=n.misc.hmac.prototype.mac=function(a){return this.Q&&d(new n.exception.invalid("encrypt on already updated hmac called!")),this.update(a),this.digest(a)},n.misc.hmac.prototype.reset=function(){this.G=new this.M(this.n[0]),this.Q=m},n.misc.hmac.prototype.update=function(a){this.Q=!0,this.G.update(a)},n.misc.hmac.prototype.digest=function(){var a=this.G.finalize(),a=new this.M(this.n[1]).update(a).finalize();return this.reset(),a},n.misc.pbkdf2=function(a,b,c,e,f){c=c||1e3,(0>e||0>c)&&d(n.exception.invalid("invalid params to pbkdf2")),"string"==typeof a&&(a=n.codec.utf8String.toBits(a)),"string"==typeof b&&(b=n.codec.utf8String.toBits(b)),f=f||n.misc.hmac,a=new f(a);var g,h,i,j,k=[],l=n.bitArray;for(j=1;32*k.length<(e||1);j++){for(f=g=a.encrypt(l.concat(b,[j])),h=1;c>h;h++)for(g=a.encrypt(g),i=0;ig;g++)f.push(4294967296*Math.random()|0);for(g=0;g=1<this.j&&(this.j=h),this.F++,this.b=n.hash.sha256.hash(this.b.concat(f)),this.A=new n.cipher.aes(this.b),c=0;4>c&&(this.f[c]=this.f[c]+1|0,!this.f[c]);c++);}for(c=0;a>c;c+=4)0===(c+1)%this.S&&i(this),f=j(this),e.push(f[0],f[1],f[2],f[3]);return i(this),e.slice(0,a)},setDefaultParanoia:function(a,b){0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b&&d("Setting paranoia=0 will ruin your security; use it only for testing"),this.B=a},addEntropy:function(a,b,c){c=c||"user";var e,f,h=(new Date).valueOf(),i=this.s[c],j=this.isReady(),k=0;switch(e=this.K[c],e===l&&(e=this.K[c]=this.W++),i===l&&(i=this.s[c]=0),this.s[c]=(this.s[c]+1)%this.c.length,typeof a){case"number":b===l&&(b=1),this.c[i].update([e,this.C++,1,b,h,1,0|a]);break;case"object":if(c=Object.prototype.toString.call(a),"[object Uint32Array]"===c){for(f=[],c=0;c0;)b++,f>>>=1;this.c[i].update([e,this.C++,2,b,h,a.length].concat(a))}break;case"string":b===l&&(b=a.length),this.c[i].update([e,this.C++,3,b,h,a.length]),this.c[i].update(a);break;default:k=1}k&&d(new n.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.i[i]+=b,this.d+=b,j===this.m&&(this.isReady()!==this.m&&g("seeded",Math.max(this.j,this.d)),g("progress",this.getProgress()))},isReady:function(a){return a=this.I[a!==l?a:this.B],this.j&&this.j>=a?this.i[0]>this.R&&(new Date).valueOf()>this.O?this.u|this.t:this.t:this.d>=a?this.u|this.m:this.m},getProgress:function(a){return a=this.I[a?a:this.B],this.j>=a?1:this.d>a?1:this.d/a},startCollectors:function(){this.q||(this.a={loadTimeCollector:k(this,this.aa),mouseCollector:k(this,this.ba),keyboardCollector:k(this,this.$),accelerometerCollector:k(this,this.U),touchCollector:k(this,this.da)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,m),window.addEventListener("mousemove",this.a.mouseCollector,m),window.addEventListener("keypress",this.a.keyboardCollector,m),window.addEventListener("devicemotion",this.a.accelerometerCollector,m),window.addEventListener("touchmove",this.a.touchCollector,m)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):d(new n.exception.bug("can't attach event")),this.q=!0)},stopCollectors:function(){this.q&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,m),window.removeEventListener("mousemove",this.a.mouseCollector,m),window.removeEventListener("keypress",this.a.keyboardCollector,m),window.removeEventListener("devicemotion",this.a.accelerometerCollector,m),window.removeEventListener("touchmove",this.a.touchCollector,m)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.q=m)},addEventListener:function(a,b){this.w[a][this.V++]=b},removeEventListener:function(a,b){var c,d,e=this.w[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;c=h.iter||64!==h.ts&&96!==h.ts&&128!==h.ts||128!==h.ks&&192!==h.ks&&256!==h.ks||2>h.iv.length||4=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&256!==b.ks||!b.iv||2>b.iv.length||4= 0.12.0",main:"index.js",repository:{url:"git@github.com:bitpay/bitcore-wallet-client.git",type:"git"},bugs:{ url:"https://github.com/bitpay/bitcore-wallet-client/issues"},dependencies:{async:"^0.9.0",bip38:"^1.3.0","bitcore-lib":"^0.13.15","bitcore-mnemonic":"^1.1.1","bitcore-payment-protocol":"^1.1.0","browser-request":"^0.3.3","json-stable-stringify":"^1.0.0",lodash:"^3.3.1",preconditions:"^1.0.8",request:"^2.53.0",sjcl:"^1.0.2"},devDependencies:{"bitcore-wallet-service":"~1.11.0",browserify:"^13.1.0",chai:"^1.9.1",coveralls:"^2.11.2",grunt:"~0.4.0","grunt-jsdox":"^0.1.7",istanbul:"*",mocha:"^1.18.2",sinon:"^1.10.3",supertest:"*",tingodb:"^0.3.4",uglify:"^0.1.1",uuid:"^2.0.1"},scripts:{start:"node app.js",coverage:"./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter spec test",test:"./node_modules/.bin/mocha",coveralls:"./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",docs:"./node_modules/.bin/jsdox lib/* lib/common lib/errors -o docs && cat README.header.md docs/*.md LICENSE > README.md"},contributors:[{name:"Ivan Socolsky",email:"ivan@bitpay.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"}]}},{}]},{},[1]); \ No newline at end of file diff --git a/package.json b/package.json index 50e998b9..e8163d8f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bitcore-wallet-client", "description": "Client for bitcore-wallet-service", "author": "BitPay Inc", - "version": "4.1.0", + "version": "4.2.0", "license": "MIT", "keywords": [ "bitcoin",