diff --git a/packages/cita-sdk/lib/bundle.js b/packages/cita-sdk/lib/bundle.js index cdee14f..c485f51 100644 --- a/packages/cita-sdk/lib/bundle.js +++ b/packages/cita-sdk/lib/bundle.js @@ -1 +1 @@ -(function(){function s(d,e,r){function t(o,i){if(!e[o]){if(!d[o]){var l="function"==typeof require&&require;if(!i&&l)return l(o,!0);if(n)return n(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var a=e[o]={exports:{}};d[o][0].call(a.exports,function(e){var r=d[o][1][e];return t(r||e)},a,a.exports,s,d,e,r)}return e[o].exports}for(var n="function"==typeof require&&require,a=0;a{e.base=e.base||{},e.extend({property:"base",methods:[d.peerCount,d.getMetaData,d.getAbi,d.getCode,d.getBalance,d.getTransactionReceipt,d.getAccounts,d.getBlock,d.getBlockByHash,d.getBlockByNumber,d.getBlockNumber,d.getBlockTransactionCount,d.getTransaction,d.getTransactionCount,d.getTransactionProof,d.sendSignedTransaction,d.signTransaction,d.sendTransaction,d.sign,d.call,d.newMessageFilter,d.newBlockFilter,d.getFilterLogs,d.getFilterChanges,d.deleteMessageFilter,d.getLogs,p.getAccounts,p.newAccount,p.sign,p.ecRecover]}),e.base.accounts=e.eth.accounts,u.default.setProvider(e.currentProvider),u.default.accounts=e.base.accounts,e.base.Contract=u.default,e=c.default(e),e.base.signer=i.default,e.base.unsigner=i.unsigner,e.base.deploy=(t,r)=>n(this,void 0,void 0,function*(){const n=yield e.base.getBlockNumber().catch(e=>{console.error(e)});let s="",o=[],i=[],d="";"string"==typeof t?s=t:t.code&&(s=t.code,o=t.args||[],i=t.initTypes||[]),o.length&&(d=e.eth.abi.encodeParameters(i,o));const p=Object.assign({version:0,value:0,nonce:a(10*Math.random())},r,{data:s.replace(/^0x/,"")+d,validUntilBlock:+n+88}),c=l.default(e.eth.accounts.wallet)(p),u=yield e.base.sendTransaction(c).catch(e=>{throw new Error(e)});return u.hash?e.listeners.listenToTransactionReceipt(u.hash):new Error("No Transaction Hash Received")}),e.base._abiAddress=b.ReservedAddr.abiAddress.replace(/^0x/,""),Object.defineProperty(e.base,"abiAddress",{get:()=>e.base._abiAddress,set:t=>{if(e.utils.isAddress(t))e.base._abiAddress=t.replace(/^0x/,"");else throw new Error("Not valid address")}}),e.base.storeAbi=(t,r,s)=>n(this,void 0,void 0,function*(){if(!t)throw new Error("Store ABI needs contract address");if(!Array.isArray(r))throw new Error("ABI should be Array type");const n=Object.assign({version:0,value:0,nonce:a(10*Math.random())},s,{to:e.base.abiAddress}),o=l.default(e.eth.accounts.wallet)(n);try{const a=e.utils.utf8ToHex(JSON.stringify(r)).slice(2);o.data=t.replace(/^0x/i,"")+a}catch(e){throw new Error(e)}const i=yield e.base.sendTransaction(o),d=yield e.listeners.listenToTransactionReceipt(i.hash);return d});const t={sign:e.base.neuron_sign};return e.base.personal=t,Object.assign(e.utils,y.default),f.default(e)}},{"../contract":8,"../systems/config":24,"../utils/addPrivateKey":26,"../utils/validators":31,"./listener":2,"./neuron":3,"./proxy":4,"./rpc":6,"@cryptape/cita-signer":316}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=["getTransactionReceipt","getTransaction","getTransactionProof","getFilterChanges"];r.default=e=>{let t={};return a.forEach(r=>{t[`listenTo${r.slice(3)}`]=(t,a=10)=>new Promise((n,s)=>{let o=a,i=null;const d=()=>{clearInterval(i)};i=setInterval(()=>{o||(d(),s("No Result Received")),e.base[r](t).then(e=>{o--,("getFilterChanges"===r&&e.length||e)&&(clearInterval(i),n(e))})},1e3)})}),e.listeners=t,e}},{}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("web3-core-helpers").formatters,n=e("web3-utils");r.getAccounts={name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:n.toChecksumAddress},r.newAccount={name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:n.toChecksumAddress},r.unlockAccount={name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[a.inputAddressFormatter,null,null]},r.lockAccount={name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[a.inputAddressFormatter]},r.sign={name:"neuron_sign",call:"neuron_sign",params:3,inputFormatter:[a.inputSignFormatter,a.inputAddressFormatter,null],transformPayload:function(e){return e.params.reverse(),e}},r.ecRecover={name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[a.inputSignFormatter,null]}},{"web3-core-helpers":255,"web3-utils":295}],4:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=a(e("./proxyHandlers"));r.default=e=>(e.base.sendTransaction=new Proxy(e.base.sendTransaction,n.default.sendTransactionHandler),e.base.getLogs=new Proxy(e.base.getLogs,n.default.getLogsHandler),e)},{"./proxyHandlers":5}],5:[function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))(function(n,s){function o(e){try{d(a.next(e))}catch(t){s(t)}}function i(e){try{d(a["throw"](e))}catch(t){s(t)}}function d(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(o,i)}d((a=a.apply(e,t||[])).next())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const s=n(e("../../utils/addPrivateKey")),o=e("../../utils/parsers");r.sendTransactionHandler={apply:function(e,t,r){return a(this,void 0,void 0,function*(){const a=r[0],n=s.default(t.accounts.wallet)(a);return e(n)})}},r.getLogsHandler={apply:function(e,t,r){return a(this,void 0,void 0,function*(){const t=r[0],a=r[1];return e(t).then(t=>{if(!a)return t;try{const e=[...t].map(e=>o.LogParser(e,a));return e}catch(r){return console.warn(r.message),t}})})}},r.default={sendTransactionHandler:r.sendTransactionHandler,getLogsHandler:r.getLogsHandler}},{"../../utils/addPrivateKey":26,"../../utils/parsers":28}],6:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(r,"__esModule",{value:!0});const s=a(e("@cryptape/cita-signer")),o=e("underscore"),i=e("web3-core-helpers").formatters,d=e("web3-utils"),p=n(e("../utils/outputFormatters"));r.peerCount={name:"peerCount",call:"peerCount",params:0},r.getMetaData={name:"getMetaData",call:"getMetaData",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]},r.getAbi={name:"getAbi",call:"getAbi",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:p.outputAbiFormatter},r.getTransactionReceipt={name:"getTransactionReceipt",call:"getTransactionReceipt",params:1,outputFormatter:i.outputTransactionReceiptFormatter},r.getCode={name:"getCode",call:"getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]},r.getAccounts={name:"getAccounts",call:"accounts",params:0,outputFormatter:d.toChecksumAddress},r.getBalance={name:"getBalance",call:"getBalance",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:d.hexToNumberString};r.getBlock={name:"getBlock",call:function(e){return o.isString(e[0])&&0===e[0].indexOf("0x")?"getBlockByHash":"getBlockByNumber"},params:2,inputFormatter:[i.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:i.outputBlockFormatter},r.getBlockByHash={name:"getBlockByHash",call:"getBlockByHash",params:2,inputFormatter:[i.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:i.outputBlockFormatter},r.getBlockByNumber={name:"getBlockByNumber",call:"getBlockByNumber",params:2,inputFormatter:[i.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:i.outputBlockFormatter},r.getBlockNumber={name:"getBlockNumber",call:"blockNumber",params:0,outputFormatter:d.hexToNumber};r.getBlockTransactionCount={name:"getBlockTransactionCount",call:function(e){return o.isString(e[0])&&0===e[0].indexOf("0x")?"getBlockTransactionCountByHash":"getBlockTransactionCountByNumber"},params:1,inputFormatter:[i.inputBlockNumberFormatter],outputFormatter:d.hexToNumber},r.getTransaction={name:"getTransaction",call:"getTransaction",params:1,inputFormatter:[null],outputFormatter:p.outputTransactionFormatter},r.getTransactionCount={name:"getTransactionCount",call:"getTransactionCount",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:d.hexToNumber},r.getTransactionProof={name:"getTransactionProof",call:"getTransactionProof",params:1},r.sendSignedTransaction={name:"sendSignedTransaction",call:"sendRawTransaction",params:1,inputFormatter:[null]},r.signTransaction={name:"signTransaction",call:"signTransaction",params:1,inputFormatter:[s.default]};r.sendTransaction={name:"sendTransaction",call:e=>e&&e.length&&e[0]&&e[0].privateKey?"sendRawTransaction":"sendTransaction",params:1,inputFormatter:[s.default]},r.newMessageFilter={name:"newMessageFilter",call:"newFilter",params:1},r.newBlockFilter={name:"newBlockFilter",call:"newBlockFilter",params:0},r.getFilterChanges={name:"getFilterChanges",call:"getFilterChanges",params:1},r.getFilterLogs={name:"getFilterLogs",call:"getFilterLogs",params:1},r.deleteMessageFilter={name:"deleteMessageFilter",call:"uninstallFilter",params:1},r.sign={name:"sign",call:"sign",params:2,inputFormatter:[i.inputSignFormatter,i.inputAddressFormatter],transformPayload:function(e){return e.params.reverse(),e}},r.call={name:"call",call:"call",params:2,inputFormatter:[i.inputCallFormatter,i.inputDefaultBlockNumberFormatter]},r.getLogs={name:"getLogs",call:"getLogs",params:1}},{"../utils/outputFormatters":27,"@cryptape/cita-signer":316,underscore:245,"web3-core-helpers":255,"web3-utils":295}],7:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=a(e("./index"));window&&(window.CITASDK=n.default)},{"./index":9}],8:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(r,"__esModule",{value:!0});const s=a(e("@cryptape/cita-signer")),o=a(e("../utils/addPrivateKey")),i=n(e("underscore")),d=e("web3-eth-contract"),p=e("web3-core-method"),c=e("web3-utils"),{formatters:l}=e("web3-core-helpers"),u=e("web3-core-promievent");var f;(function(e){e.NONE="",e.CALL="call",e.SEND="send",e.SEND_TRANSACTION="sendTransaction"})(f||(f={}));const y=e=>{const t=o.default(d.accounts.wallet)(e);return s.default(t)};d.prototype._executeMethod=function(){const e=this;let t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),void 0);var r=u("send"!==t.type);const a=e.constructor._ethAccounts||e._ethAccounts;if(t.generateRequest){const e={params:[l.inputCallFormatter.call(this._parent,t.options)],callback:t.callback,method:"",format:null};return t.type===f.CALL?(e.params.push(l.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),e.method=f.CALL,e.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):e.method=f.SEND_TRANSACTION,e}switch(t.type){case f.CALL:const n=new p({name:"call",call:f.CALL,params:2,inputFormatter:[l.inputCallFormatter,l.inputDefaultBlockNumberFormatter],outputFormatter:function(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:a,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return n(t.options,t.defaultBlock,t.callback);case f.SEND:if(!c.isAddress(t.options.from))return c._fireError(new Error("No \"from\" address specified in neither the given options, nor the default options."),r.eventEmitter,r.reject,t.callback);if(i.isBoolean(this._method.payable)&&!this._method.payable&&t.options.value&&0{if(i.isArray(t.logs)){const r=i.map(t.logs,function(t){return e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)});t.events={};let a=0;r.forEach(e=>{e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[a]=e,a++)}),delete t.logs}return t},contractDeployFormatter:t=>{const r=e._parent.clone();return r.options.address=t.contractAddress,r}}}).createFunction();return s(t.options,t.callback);}},d.prototype.getPastEvents=function(){const e=this._generateEventOptions.apply(this,arguments);let t=new p({name:"getPastLogs",call:"getLogs",params:1,inputFormatter:[l.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);const r=t.buildCall();return t=null,r(e.params,e.callback)},r.default=d},{"../utils/addPrivateKey":26,"@cryptape/cita-signer":316,underscore:245,"web3-core-helpers":255,"web3-core-method":256,"web3-core-promievent":257,"web3-eth-contract":276,"web3-utils":295}],9:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=e("web3"),s=a(e("./systems")),o=a(e("./base")),i=a(e("./utils/patchHexToBytes")),d=a(e("./utils/patchPrivateKeyToAccount"));r.default=(e,t=n)=>{const r=new t(e);i.default(r),d.default(r);const a=o.default(r),p=s.default(a);return p}},{"./base":1,"./systems":25,"./utils/patchHexToBytes":29,"./utils/patchPrivateKeyToAccount":30,web3:299}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_account",type:"address"}],name:"update",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"isAdmin",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"admin",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_account",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_old",type:"address"},{indexed:!0,name:"_sender",type:"address"}],name:"AdminUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"}]},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"cancelAuth",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"createContractAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"checkPermission",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_permission",type:"address"}],name:"queryAccounts",outputs:[{name:"_accounts",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"rootGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"groupCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"}],name:"clearAuthOfPermission",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"permissionCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allGroupsAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sysConfigAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"adminAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"}],name:"queryPermissions",outputs:[{name:"_permissions",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"userManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"uint256"}],name:"builtInPermissions",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"clearAuth",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"permissionManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"authorizationAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sendTxAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"queryAllAccounts",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"address"},{name:"",type:"bytes4"}],name:"checkResource",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"roleAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"setAuth",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{name:"_superAdmin",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_permission",type:"address"}],name:"AuthSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_permission",type:"address"}],name:"AuthCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"}],name:"AuthCleared",type:"event"}]},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"",type:"bytes"}],name:"multiTxs",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getChainId",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"id",type:"uint32"}],name:"getAuthorities",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"getParentChainId",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint32"}],name:"enableSideChain",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"sideChainId",type:"uint32"},{name:"addrs",type:"address[]"}],name:"newSideChain",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint32"}],name:"disableSideChain",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"",type:"uint32"}],name:"sideChains",outputs:[{name:"status",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_pid",type:"uint32"},{name:"_addrs",type:"address[]"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"}]},{}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"state",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_state",type:"bool"}],name:"setState",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"},{name:"_accounts",type:"address[]"}],name:"addAccounts",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"queryGroups",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"},{name:"_name",type:"bytes32"}],name:"updateGroupName",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"}],name:"deleteGroup",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_name",type:"bytes32"},{name:"_accounts",type:"address[]"}],name:"newGroup",outputs:[{name:"new_group",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"},{name:"_accounts",type:"address[]"}],name:"deleteAccounts",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"}],name:"checkScope",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,name:"_group",type:"address"}],name:"GroupDeleted",type:"event"}]},{}],16:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=a(e("./admin")),s=a(e("./authorization")),o=a(e("./batchTx")),i=a(e("./chainManager")),d=a(e("./emergencyBrake")),p=a(e("./groupManagement")),c=a(e("./nodeManager")),l=a(e("./permissionManagement")),u=a(e("./priceManager")),f=a(e("./quotaManager")),y=a(e("./roleManagement")),b=a(e("./sysConfig")),g=a(e("./versionManager")),h={admin:n.default,authorization:s.default,batchTx:o.default,chainManager:i.default,emergencyBrake:d.default,groupManagement:p.default,nodeManager:c.default,permissionManagement:l.default,priceManager:u.default,quotaManager:f.default,roleManagement:y.default,sysConfig:b.default,versionManager:g.default};r.default=h},{"./admin":10,"./authorization":11,"./batchTx":12,"./chainManager":13,"./emergencyBrake":14,"./groupManagement":15,"./nodeManager":17,"./permissionManagement":18,"./priceManager":19,"./quotaManager":20,"./roleManagement":21,"./sysConfig":22,"./versionManager":23}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"deleteRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_node",type:"address"}],name:"stakePermillage",outputs:[{name:"",type:"uint64"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"createContractAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_node",type:"address"}],name:"deleteNode",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"rootGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_node",type:"address"}],name:"getStatus",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"groupCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newPermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"permissionCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deleteGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_node",type:"address"},{name:"stake",type:"uint64"}],name:"setStake",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"newRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"listNode",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"status",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"listStake",outputs:[{name:"_stakes",type:"uint64[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deletePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"adminAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"userManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"permissionManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"authorizationAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sendTxAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_node",type:"address"}],name:"approveNode",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"roleAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updatePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_nodes",type:"address[]"},{name:"_stakes",type:"uint64[]"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_node",type:"address"}],name:"ApproveNode",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_node",type:"address"}],name:"DeleteNode",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_node",type:"address"},{indexed:!1,name:"_stake",type:"uint256"}],name:"SetStake",type:"event"}]},{}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"setAuthorization",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"cancelAuthorization",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permissions",type:"address[]"}],name:"setAuthorizations",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"},{name:"_name",type:"bytes32"}],name:"updatePermissionName",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"},{name:"_conts",type:"address[]"},{name:"_funcs",type:"bytes4[]"}],name:"deleteResources",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"}],name:"deletePermission",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"clearAuthorization",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permissions",type:"address[]"}],name:"cancelAuthorizations",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"},{name:"_conts",type:"address[]"},{name:"_funcs",type:"bytes4[]"}],name:"addResources",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_conts",type:"address[]"},{name:"_funcs",type:"bytes4[]"}],name:"newPermission",outputs:[{name:"id",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!1,name:"_permission",type:"address"}],name:"PermissionDeleted",type:"event"}]},{}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getQuotaPrice",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_quotaPrice",type:"uint256"}],name:"setQuotaPrice",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"deleteRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getBQL",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"createContractAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"rootGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"groupCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newPermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"permissionCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deleteGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_value",type:"uint256"}],name:"setAQL",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"newRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deletePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"adminAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getAccounts",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_value",type:"uint256"}],name:"setBQL",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"}],name:"getAQL",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"userManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_value",type:"uint256"}],name:"setDefaultAQL",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"permissionManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getDefaultAQL",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"authorizationAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sendTxAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getQuotas",outputs:[{name:"",type:"uint256[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updatePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_admin",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_value",type:"uint256"},{indexed:!0,name:"_sender",type:"address"}],name:"DefaultAqlSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_value",type:"uint256"},{indexed:!0,name:"_sender",type:"address"}],name:"BqlSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!1,name:"_value",type:"uint256"},{indexed:!0,name:"_sender",type:"address"}],name:"AqlSetted",type:"event"}]},{}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_roleid",type:"address"},{name:"_permissions",type:"address[]"}],name:"addPermissions",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_roleid",type:"address"},{name:"_permissions",type:"address[]"}],name:"deletePermissions",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_roleId",type:"address"}],name:"queryAccounts",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_roleid",type:"address"}],name:"deleteRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_permissions",type:"address[]"}],name:"newRole",outputs:[{name:"roleid",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_role",type:"address"}],name:"queryPermissions",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_role",type:"address"}],name:"setRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_role",type:"address"}],name:"cancelRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"clearRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_roleid",type:"address"},{name:"_name",type:"bytes32"}],name:"updateRoleName",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"}],name:"queryRoles",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_role",type:"address"}],name:"RoleSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_role",type:"address"}],name:"RoleCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"}],name:"RoleCleared",type:"event"}]},{}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getChainId",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getEconomicalModel",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_operator",type:"string"}],name:"setOperator",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getDelayBlockNumber",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getFeeBackPlatformCheck",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getTokenInfo",outputs:[{name:"name",type:"string"},{name:"symbol",type:"string"},{name:"avatar",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getQuotaCheck",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_chainName",type:"string"}],name:"setChainName",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getBlockInterval",outputs:[{name:"",type:"uint64"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getChainName",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getPermissionCheck",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getWebsite",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getChainOwner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getOperator",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_website",type:"string"}],name:"setWebsite",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{name:"_delayBlockNumber",type:"uint256"},{name:"_checkPermission",type:"bool"},{name:"_checkQuota",type:"bool"},{name:"_checkFeeBackPlatform",type:"bool"},{name:"_chainOwner",type:"address"},{name:"_chainName",type:"string"},{name:"_chainId",type:"uint32"},{name:"_operator",type:"string"},{name:"_website",type:"string"},{name:"_blockInterval",type:"uint64"},{name:"_economicalModel",type:"uint8"},{name:"_name",type:"string"},{name:"_symbol",type:"string"},{name:"_avatar",type:"string"}],payable:!1,stateMutability:"nonpayable",type:"constructor"}]},{}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getVersion",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_version",type:"uint32"}],name:"setVersion",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ReservedAddr={admin:"0xffffffffffffffffffffffffffffffffff02000c",authorization:"0xffffffffffffffffffffffffffffffffff020006",batchTx:"0xffffffffffffffffffffffffffffffffff02000e",chainManager:"0xffffffffffffffffffffffffffffffffff020002",emergencyBrake:"0xffffffffffffffffffffffffffffffffff02000f",group:"0xffffffffffffffffffffffffffffffffff020009",groupManagement:"0xffffffffffffffffffffffffffffffffff02000a",nodeManager:"0xffffffffffffffffffffffffffffffffff020001",permissionManagement:"0xffffffffffffffffffffffffffffffffff020004",priceManager:"0xffffffffffffffffffffffffffffffffff020010",quotaManager:"0xffffffffffffffffffffffffffffffffff020003",roleManagement:"0xffffffffffffffffffffffffffffffffff020007",sysConfig:"0xffffffffffffffffffffffffffffffffff020000",versionManager:"0xffffffffffffffffffffffffffffffffff020011",abiAddress:"0xffffffffffffffffffffffffffffffffff010001"}},{}],25:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=e("./config"),s=a(e("./abis")),o=["admin","authorization","batchTx","chainManager","emergencyBrake","groupManagement","nodeManager","permissionManagement","priceManager","quotaManager","roleManagement","sysConfig","versionManager"],i=(e,t)=>new e.base.Contract(s.default[t],n.ReservedAddr[t]);r.default=e=>{const t={};return o.forEach(r=>{t[r]=i(e,r)}),Object.assign(e,{system:t})}},{"./abis":16,"./config":24}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=e=>t=>!e.length||t.privateKey&&(66===t.privateKey.length||64===t.privateKey.length)?t:(t.privateKey||(t.privateKey=e[0].privateKey,t.from=e[0].from),t)},{}],27:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const{unsigner:a}=e("@cryptape/cita-signer"),n=e("web3-utils");r.outputTransactionFormatter=e=>Object.assign({},e,{unsignedTransaction:a(e.content)}),r.outputAbiFormatter=e=>{if("string"!=typeof e)throw new Error("Malformed ABI");const t=n.hexToUtf8(e);try{const e=JSON.parse(t);return e}catch(e){throw new Error("Malformed ABI")}}},{"@cryptape/cita-signer":316,"web3-utils":295}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("web3-eth-abi");r.LogParser=(e,t)=>{if("string"==typeof e)return e;if(!t)throw new Error("ABI Missed");const r=a.decodeLog(t,e.data||"",e.topics||[]);return Object.assign({},e,{decodedLogs:r})}},{"web3-eth-abi":266}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=e=>{e.utils.hexToBytes=new Proxy(e.utils.hexToBytes,{apply:(e,t,r)=>{let a=(""+r[0]||"").replace(/^0x/,"");return a.length%2&&(a="0"+a),e("0x"+a)}})}},{}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=e=>{e.eth.accounts.privateKeyToAccount=new Proxy(e.eth.accounts.privateKeyToAccount,{apply:(e,t,r)=>{let a=r[0];return a&&64===a.length&&(a="0x"+a),e.call(t,a)}})}},{}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("web3-utils");r.isPrivateKey=e=>{if(!e)return console.warn("No Private Key"),!1;if("string"!=typeof e)return console.warn("Invalid Type of Private Key"),!1;const t=e.replace(/^0x/,"");return 64===t.length?!!a.isHex(t)||(console.warn("Invalid Hex of Private Key"),!1):(console.warn("Invalid Length of Private Key"),!1)},r.default={isPrivateKey:r.isPrivateKey}},{"web3-utils":295}],32:[function(e,t){t.exports=e("./register")().Promise},{"./register":34}],33:[function(e,t){"use strict";var r=null;t.exports=function(e,t){return function(a,n){a=a||null,n=n||{};var s=!1!==n.global;if(null===r&&s&&(r=e["@@any-promise/REGISTRATION"]||null),null!==r&&null!==a&&r.implementation!==a)throw new Error("any-promise already defined as \""+r.implementation+"\". You can only register an implementation before the first call to require(\"any-promise\") and an implementation cannot be changed");return null===r&&(r=null!==a&&"undefined"!=typeof n.Promise?{Promise:n.Promise,implementation:a}:t(a),s&&(e["@@any-promise/REGISTRATION"]=r)),r}}},{}],34:[function(e,t){"use strict";t.exports=e("./loader")(window,function(){if("undefined"==typeof window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}})},{"./loader":33}],35:[function(e,t,r){var a=r;a.bignum=e("bn.js"),a.define=e("./asn1/api").define,a.base=e("./asn1/base"),a.constants=e("./asn1/constants"),a.decoders=e("./asn1/decoders"),a.encoders=e("./asn1/encoders")},{"./asn1/api":36,"./asn1/base":38,"./asn1/constants":42,"./asn1/decoders":44,"./asn1/encoders":47,"bn.js":50}],36:[function(e,t,r){function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}var n=e("../asn1"),s=e("inherits");r.define=function(e,t){return new a(e,t)};a.prototype._createNamed=function(t){var r;try{r=e("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){r=function(e){this._initNamed(e)}}return s(r,t),r.prototype._initNamed=function(e){t.call(this,e)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"../asn1":35,inherits:162,vm:251}],37:[function(e,t,r){function a(e,t){return o.call(this,t),i.isBuffer(e)?void(this.base=e,this.offset=0,this.length=e.length):void this.error("Input not Buffer")}function n(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof n||(e=new n(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&255>=e))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=i.byteLength(e);else if(i.isBuffer(e))this.value=e,this.length=e.length;else return t.error("Unsupported type: "+typeof e)}var s=e("inherits"),o=e("../base").Reporter,i=e("buffer").Buffer;s(a,o),r.DecoderBuffer=a,a.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},a.prototype.restore=function(e){var t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},r.EncoderBuffer=n,n.prototype.join=function(e,t){return(e||(e=new i(this.length)),t||(t=0),0===this.length)?e:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},{"../base":38,buffer:83,inherits:162}],38:[function(e,t,r){var a=r;a.Reporter=e("./reporter").Reporter,a.DecoderBuffer=e("./buffer").DecoderBuffer,a.EncoderBuffer=e("./buffer").EncoderBuffer,a.Node=e("./node")},{"./buffer":37,"./node":39,"./reporter":40}],39:[function(e,t){function r(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r["default"]=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var a=e("../base").Reporter,n=e("../base").EncoderBuffer,s=e("../base").DecoderBuffer,o=e("minimalistic-assert"),i=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],d=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(i);t.exports=r;var p=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];r.prototype.clone=function(){var e=this._baseState,t={};p.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},r.prototype._wrap=function(){var e=this._baseState;d.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},r.prototype._init=function(e){var t=this._baseState;o(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),o.equal(t.children.length,1,"Root node can have only one child")},r.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(o(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(o(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var a=e[r];t[a]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){r.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),i.forEach(function(e){r.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===t.tag),t.tag=e,this._useArgs(r),this}}),r.prototype.use=function(e){o(e);var t=this._baseState;return o(null===t.use),t.use=e,this},r.prototype.optional=function(){var e=this._baseState;return e.optional=!0,this},r.prototype.def=function(e){var t=this._baseState;return o(null===t["default"]),t["default"]=e,t.optional=!0,this},r.prototype.explicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.explicit=e,this},r.prototype.implicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.implicit=e,this},r.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},r.prototype.key=function(e){var t=this._baseState;return o(null===t.key),t.key=e,this},r.prototype.any=function(){var e=this._baseState;return e.any=!0,this},r.prototype.choice=function(e){var t=this._baseState;return o(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},r.prototype.contains=function(e){var t=this._baseState;return o(null===t.use),t.contains=e,this},r.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var a=r["default"],n=!0,o=null;if(null!==r.key&&(o=e.enterKey(r.key)),r.optional){var i=null;if(null===r.explicit?null===r.implicit?null!==r.tag&&(i=r.tag):i=r.implicit:i=r.explicit,null===i&&!r.any){var d=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),n=!0}catch(t){n=!1}e.restore(d)}else if(n=this._peekTag(e,i,r.any),e.isError(n))return n}var p;if(r.obj&&n&&(p=e.enterObject()),n){if(null!==r.explicit){var c=this._decodeTag(e,r.explicit);if(e.isError(c))return c;e=c}var l=e.offset;if(null===r.use&&null===r.choice){if(r.any)var d=e.save();var u=this._decodeTag(e,null===r.implicit?r.tag:r.implicit,r.any);if(e.isError(u))return u;r.any?a=e.raw(d):e=u}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),a=r.any?a:null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),e.isError(a))return a;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var f=new s(a);a=this._getUse(r.contains,e._reporterState.obj)._decode(f,t)}}return r.obj&&n&&(a=e.leaveObject(p)),null!==r.key&&(null!==a||!0===n)?e.leaveKey(o,r.key,a):null!==o&&e.exitKey(o),a},r.prototype._decodeGeneric=function(e,t,r){var a=this._baseState;if("seq"===e||"set"===e)return null;return"seqof"===e||"setof"===e?this._decodeList(t,e,a.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&a.args?this._decodeObjid(t,a.args[0],a.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,a.args&&a.args[0],r):null===a.use?t.error("unknown tag: "+e):this._getUse(a.use,t._reporterState.obj)._decode(t,r)},r.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},r.prototype._decodeChoice=function(t,e){var r=this._baseState,a=null,n=!1;return Object.keys(r.choice).some(function(s){var o=t.save(),i=r.choice[s];try{var d=i._decode(t,e);if(t.isError(d))return!1;a={type:s,value:d},n=!0}catch(r){return t.restore(o),!1}return!0},this),n?a:t.error("Choice not matched")},r.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},r.prototype._encode=function(e,t,r){var a=this._baseState;if(null===a["default"]||a["default"]!==e){var n=this._encodeValue(e,t,r);return void 0===n||this._skipDefault(n,t,r)?void 0:n}},r.prototype._encodeValue=function(e,t,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new a);var s=null;if(this.reporter=t,n.optional&&void 0===e)if(null!==n["default"])e=n["default"];else return;var o=null,i=!1;if(n.any)s=this._createEncoderBuffer(e);else if(n.choice)s=this._encodeChoice(e,t);else if(n.contains)o=this._getUse(n.contains,r)._encode(e,t),i=!0;else if(n.children)o=n.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var a=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(a),n},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!(n.args&&1===n.args.length))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var d=this.clone();d._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(r){var a=this._baseState;return this._getUse(a.args[0],e)._encode(r,t)},d))}else null===n.use?(o=this._encodePrimitive(n.tag,e),i=!0):s=this._getUse(n.use,r)._encode(e,t);var s;if(!n.any&&null===n.choice){var p=null===n.implicit?n.tag:n.implicit,c=null===n.implicit?"universal":"context";null===p?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(s=this._encodeComposite(p,i,c,o))}return null!==n.explicit&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s},r.prototype._encodeChoice=function(e,t){var r=this._baseState,a=r.choice[e.type];return a||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),a._encode(e.value,t)},r.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},r.prototype._isNumstr=function(e){return /^[0-9 ]*$/.test(e)},r.prototype._isPrintstr=function(e){return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},{"../base":38,"minimalistic-assert":170}],40:[function(e,t,r){function a(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function n(e,t){this.path=e,this.rethrow(t)}var s=e("inherits");r.Reporter=a,a.prototype.isError=function(e){return e instanceof n},a.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},a.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},a.prototype.enterKey=function(e){return this._reporterState.path.push(e)},a.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},a.prototype.leaveKey=function(e,t,r){var a=this._reporterState;this.exitKey(e),null!==a.obj&&(a.obj[t]=r)},a.prototype.path=function(){return this._reporterState.path.join("/")},a.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},a.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},a.prototype.error=function(e){var t=this._reporterState,r=e instanceof n,a;if(a=r?e:new n(t.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!t.options.partial)throw a;return r||t.errors.push(a),a},a.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};s(n,Error),n.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,n),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:162}],41:[function(e,t,r){var a=e("../constants");r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=a._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=a._reverse(r.tag)},{"../constants":42}],42:[function(e,t,r){var a=r;a._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);var a=e[r];t[a]=r}),t},a.der=e("./der")},{"./der":41}],43:[function(e,t){function r(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new a,this.tree._init(e.body)}function a(e){d.Node.call(this,"der",e)}function n(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var a=c.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){var s=r;for(r=0;128==(128&s);){if(s=e.readUInt8(t),e.isError(s))return s;r<<=7,r|=127&s}}else r&=31;var o=c.tag[r];return{cls:a,primitive:n,tag:r,tagStr:o}}function s(e,t,r){var a=e.readUInt8(r);if(e.isError(a))return a;if(!t&&128===a)return null;if(0==(128&a))return a;var n=127&a;if(4a?2e3+a:1900+a}else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(a,n-1,s,o,i,d,0)},a.prototype._decodeNull=function(){return null},a.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},a.prototype._decodeInt=function(e,t){var r=e.raw(),a=new p(r);return t&&(a=t[a.toString(10)]||a),a},a.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},{"../../asn1":35,inherits:162}],44:[function(e,t,r){var a=r;a.der=e("./der"),a.pem=e("./pem")},{"./der":43,"./pem":45}],45:[function(e,t){function r(e){s.call(this,e),this.enc="pem"}var a=e("inherits"),n=e("buffer").Buffer,s=e("./der");a(r,s),t.exports=r,r.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),a=t.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,d=-1,p=-1,c=0,l;ce?"0"+e:e}function s(e,t,r,a){var n;if("seqof"===e?e="seq":"setof"==e&&(e="set"),c.tagByName.hasOwnProperty(e))n=c.tagByName[e];else if("number"==typeof e&&(0|e)===e)n=e;else return a.error("Unknown tag: "+e);return 31<=n?a.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=c.tagClassByName[r||"universal"]<<6,n)}var o=e("inherits"),d=e("buffer").Buffer,i=e("../../asn1"),p=i.base,c=i.constants.der;t.exports=r,r.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},o(a,p.Node),a.prototype._encodeComposite=function(e,t,r,a){var n=s(e,t,r,this.reporter);if(128>a.length){var o=new d(2);return o[0]=n,o[1]=a.length,this._createEncoderBuffer([o,a])}for(var p=1,c=a.length;256<=c;c>>=8)p++;var o=new d(2+p);o[0]=n,o[1]=128|p;for(var c=1+p,l=a.length;0>=8)o[c]=255&l;return this._createEncoderBuffer([o,a])},a.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new d(2*e.length),a=0;a>=7)n++;for(var o=new d(n),p=o.length-1,a=e.length-1,s;0<=a;a--)for(s=e[a],o[p--]=127&s;0<(s>>=7);)o[p--]=128|127&s;return this._createEncoderBuffer(o)},a.prototype._encodeTime=function(e,t){var r=new Date(e),a;return"gentime"===t?a=[n(r.getFullYear()),n(r.getUTCMonth()+1),n(r.getUTCDate()),n(r.getUTCHours()),n(r.getUTCMinutes()),n(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?a=[n(r.getFullYear()%100),n(r.getUTCMonth()+1),n(r.getUTCDate()),n(r.getUTCHours()),n(r.getUTCMinutes()),n(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(a,"octstr")},a.prototype._encodeNull=function(){return this._createEncoderBuffer("")},a.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!d.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new d(r)}if(d.isBuffer(e)){var a=e.length;0===e.length&&a++;var n=new d(a);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(128>e)return this._createEncoderBuffer(e);if(256>e)return this._createEncoderBuffer([0,e]);for(var a=1,s=e;256<=s;s>>=8)a++;for(var n=Array(a),s=n.length-1;0<=s;s--)n[s]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new d(n))},a.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},a.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},a.prototype._skipDefault=function(e,t,r){var a=this._baseState,n;if(null===a["default"])return!1;var s=e.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a["default"],t,r).join()),s.length!==a.defaultBuffer.length)return!1;for(n=0;n>16,o[d++]=255&f>>8,o[d++]=255&f;return 2===s&&(f=l[e.charCodeAt(c)]<<2|l[e.charCodeAt(c+1)]>>4,o[d++]=255&f),1===s&&(f=l[e.charCodeAt(c)]<<10|l[e.charCodeAt(c+1)]<<4|l[e.charCodeAt(c+2)]>>2,o[d++]=255&f>>8,o[d++]=255&f),o}function o(e){return c[63&e>>18]+c[63&e>>12]+c[63&e>>6]+c[63&e]}function d(e,t,r){for(var a=[],n=t,s;no?o:s+n));return 1===r?(p=e[t-1],a.push(c[p>>2]+c[63&p<<4]+"==")):2===r&&(p=(e[t-2]<<8)+e[t-1],a.push(c[p>>10]+c[63&p>>4]+c[63&p<<2]+"=")),a.join("")}r.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=s,r.fromByteArray=p;for(var c=[],l=[],u="undefined"==typeof Uint8Array?Array:Uint8Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=0,b=f.length;y=p?p-49+10:17<=p&&22>=p?p-17+10:15&p;return n}function y(e,t,a,n){for(var s=0,o=d(e.length,a),p=t,l;p>>n}return t}function g(e,t,n){n.negative=t.negative^e.negative;var s=0|e.length+t.length;n.length=s,s=0|s-1;var p=0|e.words[0],c=0|t.words[0],l=p*c,u=67108863&l,f=0|l/67108864;n.words[0]=u;for(var y=1;y>>26,h=67108863&f,m=d(y,t.length-1),_=o(0,y-e.length+1),v;_<=m;_++)v=0|y-_,p=0|e.words[v],c=0|t.words[_],l=p*c+h,g+=0|l/67108864,h=67108863&l;n.words[y]=0|h,f=0|g}return 0===f?n.length--:n.words[y]=0|f,n.strip()}function h(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var s=0,p=0,c=0,l;c>>26),p+=l>>>26,l&=67108863}n.words[c]=u,s=l,l=p}return 0===s?n.length--:n.words[c]=s,n.strip()}function m(e,t,r){var a=new _;return a.mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}function v(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=f._prime(e);this.m=t.p,this.prime=t}else l(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),0!=this.shift%26&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=f:i.BN=f,f.BN=f,f.wordSize=26;var E;try{E=e("buffer").Buffer}catch(t){}f.isBN=function(e){return!!(e instanceof f)||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return 0e.cmp(t)?e:t},f.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),l(t===(0|t)&&2<=t&&36>=t),e=e.toString().replace(/\s+/g,"");var a=0;"-"===e[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip();"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initNumber=function(e,t,r){0>e&&(this.negative=1,e=-e),67108864>e?(this.words=[67108863&e],this.length=1):4503599627370496>e?(this.words=[67108863&e,67108863&e/67108864],this.length=2):(l(9007199254740992>e),this.words=[67108863&e,67108863&e/67108864,1],this.length=3);"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initArray=function(e,t,r){if(l("number"==typeof e.length),0>=e.length)return this.words=[0],this.length=1,this;this.length=s(e.length/3),this.words=Array(this.length);for(var a=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);else if("le"===r)for(a=0,o=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=s((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=6)o=u(e,r,r+6),this.words[n]|=67108863&o<>>26-a,a+=24,26<=a&&(a-=26,n++);r+6!==t&&(o=u(e,t,r+6),this.words[n]|=67108863&o<>>26-a),this.strip()},f.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;67108863>=n;n*=t)a++;a--,n=0|n/t;for(var s=e.length-r,o=s%a,p=d(s,s-o)+r,c=0,l=r;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c);if(0!==o){var u=1;for(c=y(e,l,e.length,t),l=0;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c)}},f.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t"};var T=["","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"],I=[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],M=[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];f.prototype.toString=function(e,t){e=e||10,t=0|t||1;var a;if(16===e||"hex"===e){a="";for(var n=0,s=0,o=0;o>>24-n,a=0!==s||o!=this.length-1?T[6-p.length]+p+a:p+a,n+=2,26<=n&&(n-=26,o--)}for(0!==s&&(a=s.toString(16)+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&2<=e&&36>=e){var u=I[e],f=M[e];a="";var y=this.clone();for(y.negative=0;!y.isZero();){var b=y.modn(f).toString(e);y=y.idivn(f),a=y.isZero()?b+a:T[u-b.length]+b+a}for(this.isZero()&&(a="0"+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}l(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=a&&(n+=7,a>>>=7),8<=a&&(n+=4,a>>>=4),2<=a&&(n+=2,a>>>=2),n+a},f.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,n=0;return 0==(8191&a)&&(n+=13,a>>>=13),0==(127&a)&&(n+=7,a>>>=7),0==(15&a)&&(n+=4,a>>>=4),0==(3&a)&&(n+=2,a>>>=2),0==(1&a)&&n++,n},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0,a;te.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.prototype.iuand=function(e){var t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.prototype.inotn=function(e){l("number"==typeof e&&0<=e);var t=0|s(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.prototype.setn=function(e,t){l("number"==typeof e&&0<=e);var r=0|e/26,a=e%26;return this._expand(r+1),t?this.words[r]|=1<e.length?(n=this,s=e):(n=e,s=this);for(var o=0,d=0;d>>26;for(;0!==o&&d>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},f.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;var s,d;0>26,this.words[c]=67108863&t;for(;0!==p&&c>26,this.words[c]=67108863&t;if(0===p&&c>>13,u=0|s[1],f=8191&u,y=u>>>13,b=0|s[2],g=8191&b,h=b>>>13,m=0|s[3],_=8191&m,v=m>>>13,S=0|s[4],w=8191&S,A=S>>>13,B=0|s[5],x=8191&B,k=B>>>13,E=0|s[6],T=8191&E,I=E>>>13,M=0|s[7],C=8191&M,R=M>>>13,N=0|s[8],P=8191&N,F=N>>>13,O=0|s[9],j=8191&O,L=O>>>13,U=0|a[0],D=8191&U,W=U>>>13,H=0|a[1],q=8191&H,z=H>>>13,V=0|a[2],G=8191&V,K=V>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,$=J>>>13,ee=0|a[5],te=8191&ee,re=ee>>>13,ae=0|a[6],ne=8191&ae,se=ae>>>13,oe=0|a[7],ie=8191&oe,de=oe>>>13,pe=0|a[8],ce=8191&pe,le=pe>>>13,ue=0|a[9],fe=8191&ue,ye=ue>>>13,be,ge,he;r.negative=e.negative^t.negative,r.length=19,be=n(p,D),ge=n(p,W),ge=0|ge+n(l,D),he=n(l,W);var me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(me>>>26),me&=67108863,be=n(f,D),ge=n(f,W),ge=0|ge+n(y,D),he=n(y,W),be=0|be+n(p,q),ge=0|ge+n(p,z),ge=0|ge+n(l,q),he=0|he+n(l,z);var _e=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(_e>>>26),_e&=67108863,be=n(g,D),ge=n(g,W),ge=0|ge+n(h,D),he=n(h,W),be=0|be+n(f,q),ge=0|ge+n(f,z),ge=0|ge+n(y,q),he=0|he+n(y,z),be=0|be+n(p,G),ge=0|ge+n(p,K),ge=0|ge+n(l,G),he=0|he+n(l,K);var ve=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ve>>>26),ve&=67108863,be=n(_,D),ge=n(_,W),ge=0|ge+n(v,D),he=n(v,W),be=0|be+n(g,q),ge=0|ge+n(g,z),ge=0|ge+n(h,q),he=0|he+n(h,z),be=0|be+n(f,G),ge=0|ge+n(f,K),ge=0|ge+n(y,G),he=0|he+n(y,K),be=0|be+n(p,Y),ge=0|ge+n(p,Z),ge=0|ge+n(l,Y),he=0|he+n(l,Z);var Se=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Se>>>26),Se&=67108863,be=n(w,D),ge=n(w,W),ge=0|ge+n(A,D),he=n(A,W),be=0|be+n(_,q),ge=0|ge+n(_,z),ge=0|ge+n(v,q),he=0|he+n(v,z),be=0|be+n(g,G),ge=0|ge+n(g,K),ge=0|ge+n(h,G),he=0|he+n(h,K),be=0|be+n(f,Y),ge=0|ge+n(f,Z),ge=0|ge+n(y,Y),he=0|he+n(y,Z),be=0|be+n(p,Q),ge=0|ge+n(p,$),ge=0|ge+n(l,Q),he=0|he+n(l,$);var we=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(we>>>26),we&=67108863,be=n(x,D),ge=n(x,W),ge=0|ge+n(k,D),he=n(k,W),be=0|be+n(w,q),ge=0|ge+n(w,z),ge=0|ge+n(A,q),he=0|he+n(A,z),be=0|be+n(_,G),ge=0|ge+n(_,K),ge=0|ge+n(v,G),he=0|he+n(v,K),be=0|be+n(g,Y),ge=0|ge+n(g,Z),ge=0|ge+n(h,Y),he=0|he+n(h,Z),be=0|be+n(f,Q),ge=0|ge+n(f,$),ge=0|ge+n(y,Q),he=0|he+n(y,$),be=0|be+n(p,te),ge=0|ge+n(p,re),ge=0|ge+n(l,te),he=0|he+n(l,re);var Ae=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ae>>>26),Ae&=67108863,be=n(T,D),ge=n(T,W),ge=0|ge+n(I,D),he=n(I,W),be=0|be+n(x,q),ge=0|ge+n(x,z),ge=0|ge+n(k,q),he=0|he+n(k,z),be=0|be+n(w,G),ge=0|ge+n(w,K),ge=0|ge+n(A,G),he=0|he+n(A,K),be=0|be+n(_,Y),ge=0|ge+n(_,Z),ge=0|ge+n(v,Y),he=0|he+n(v,Z),be=0|be+n(g,Q),ge=0|ge+n(g,$),ge=0|ge+n(h,Q),he=0|he+n(h,$),be=0|be+n(f,te),ge=0|ge+n(f,re),ge=0|ge+n(y,te),he=0|he+n(y,re),be=0|be+n(p,ne),ge=0|ge+n(p,se),ge=0|ge+n(l,ne),he=0|he+n(l,se);var Be=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Be>>>26),Be&=67108863,be=n(C,D),ge=n(C,W),ge=0|ge+n(R,D),he=n(R,W),be=0|be+n(T,q),ge=0|ge+n(T,z),ge=0|ge+n(I,q),he=0|he+n(I,z),be=0|be+n(x,G),ge=0|ge+n(x,K),ge=0|ge+n(k,G),he=0|he+n(k,K),be=0|be+n(w,Y),ge=0|ge+n(w,Z),ge=0|ge+n(A,Y),he=0|he+n(A,Z),be=0|be+n(_,Q),ge=0|ge+n(_,$),ge=0|ge+n(v,Q),he=0|he+n(v,$),be=0|be+n(g,te),ge=0|ge+n(g,re),ge=0|ge+n(h,te),he=0|he+n(h,re),be=0|be+n(f,ne),ge=0|ge+n(f,se),ge=0|ge+n(y,ne),he=0|he+n(y,se),be=0|be+n(p,ie),ge=0|ge+n(p,de),ge=0|ge+n(l,ie),he=0|he+n(l,de);var xe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(xe>>>26),xe&=67108863,be=n(P,D),ge=n(P,W),ge=0|ge+n(F,D),he=n(F,W),be=0|be+n(C,q),ge=0|ge+n(C,z),ge=0|ge+n(R,q),he=0|he+n(R,z),be=0|be+n(T,G),ge=0|ge+n(T,K),ge=0|ge+n(I,G),he=0|he+n(I,K),be=0|be+n(x,Y),ge=0|ge+n(x,Z),ge=0|ge+n(k,Y),he=0|he+n(k,Z),be=0|be+n(w,Q),ge=0|ge+n(w,$),ge=0|ge+n(A,Q),he=0|he+n(A,$),be=0|be+n(_,te),ge=0|ge+n(_,re),ge=0|ge+n(v,te),he=0|he+n(v,re),be=0|be+n(g,ne),ge=0|ge+n(g,se),ge=0|ge+n(h,ne),he=0|he+n(h,se),be=0|be+n(f,ie),ge=0|ge+n(f,de),ge=0|ge+n(y,ie),he=0|he+n(y,de),be=0|be+n(p,ce),ge=0|ge+n(p,le),ge=0|ge+n(l,ce),he=0|he+n(l,le);var ke=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ke>>>26),ke&=67108863,be=n(j,D),ge=n(j,W),ge=0|ge+n(L,D),he=n(L,W),be=0|be+n(P,q),ge=0|ge+n(P,z),ge=0|ge+n(F,q),he=0|he+n(F,z),be=0|be+n(C,G),ge=0|ge+n(C,K),ge=0|ge+n(R,G),he=0|he+n(R,K),be=0|be+n(T,Y),ge=0|ge+n(T,Z),ge=0|ge+n(I,Y),he=0|he+n(I,Z),be=0|be+n(x,Q),ge=0|ge+n(x,$),ge=0|ge+n(k,Q),he=0|he+n(k,$),be=0|be+n(w,te),ge=0|ge+n(w,re),ge=0|ge+n(A,te),he=0|he+n(A,re),be=0|be+n(_,ne),ge=0|ge+n(_,se),ge=0|ge+n(v,ne),he=0|he+n(v,se),be=0|be+n(g,ie),ge=0|ge+n(g,de),ge=0|ge+n(h,ie),he=0|he+n(h,de),be=0|be+n(f,ce),ge=0|ge+n(f,le),ge=0|ge+n(y,ce),he=0|he+n(y,le),be=0|be+n(p,fe),ge=0|ge+n(p,ye),ge=0|ge+n(l,fe),he=0|he+n(l,ye);var Ee=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ee>>>26),Ee&=67108863,be=n(j,q),ge=n(j,z),ge=0|ge+n(L,q),he=n(L,z),be=0|be+n(P,G),ge=0|ge+n(P,K),ge=0|ge+n(F,G),he=0|he+n(F,K),be=0|be+n(C,Y),ge=0|ge+n(C,Z),ge=0|ge+n(R,Y),he=0|he+n(R,Z),be=0|be+n(T,Q),ge=0|ge+n(T,$),ge=0|ge+n(I,Q),he=0|he+n(I,$),be=0|be+n(x,te),ge=0|ge+n(x,re),ge=0|ge+n(k,te),he=0|he+n(k,re),be=0|be+n(w,ne),ge=0|ge+n(w,se),ge=0|ge+n(A,ne),he=0|he+n(A,se),be=0|be+n(_,ie),ge=0|ge+n(_,de),ge=0|ge+n(v,ie),he=0|he+n(v,de),be=0|be+n(g,ce),ge=0|ge+n(g,le),ge=0|ge+n(h,ce),he=0|he+n(h,le),be=0|be+n(f,fe),ge=0|ge+n(f,ye),ge=0|ge+n(y,fe),he=0|he+n(y,ye);var Te=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Te>>>26),Te&=67108863,be=n(j,G),ge=n(j,K),ge=0|ge+n(L,G),he=n(L,K),be=0|be+n(P,Y),ge=0|ge+n(P,Z),ge=0|ge+n(F,Y),he=0|he+n(F,Z),be=0|be+n(C,Q),ge=0|ge+n(C,$),ge=0|ge+n(R,Q),he=0|he+n(R,$),be=0|be+n(T,te),ge=0|ge+n(T,re),ge=0|ge+n(I,te),he=0|he+n(I,re),be=0|be+n(x,ne),ge=0|ge+n(x,se),ge=0|ge+n(k,ne),he=0|he+n(k,se),be=0|be+n(w,ie),ge=0|ge+n(w,de),ge=0|ge+n(A,ie),he=0|he+n(A,de),be=0|be+n(_,ce),ge=0|ge+n(_,le),ge=0|ge+n(v,ce),he=0|he+n(v,le),be=0|be+n(g,fe),ge=0|ge+n(g,ye),ge=0|ge+n(h,fe),he=0|he+n(h,ye);var Ie=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ie>>>26),Ie&=67108863,be=n(j,Y),ge=n(j,Z),ge=0|ge+n(L,Y),he=n(L,Z),be=0|be+n(P,Q),ge=0|ge+n(P,$),ge=0|ge+n(F,Q),he=0|he+n(F,$),be=0|be+n(C,te),ge=0|ge+n(C,re),ge=0|ge+n(R,te),he=0|he+n(R,re),be=0|be+n(T,ne),ge=0|ge+n(T,se),ge=0|ge+n(I,ne),he=0|he+n(I,se),be=0|be+n(x,ie),ge=0|ge+n(x,de),ge=0|ge+n(k,ie),he=0|he+n(k,de),be=0|be+n(w,ce),ge=0|ge+n(w,le),ge=0|ge+n(A,ce),he=0|he+n(A,le),be=0|be+n(_,fe),ge=0|ge+n(_,ye),ge=0|ge+n(v,fe),he=0|he+n(v,ye);var Me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Me>>>26),Me&=67108863,be=n(j,Q),ge=n(j,$),ge=0|ge+n(L,Q),he=n(L,$),be=0|be+n(P,te),ge=0|ge+n(P,re),ge=0|ge+n(F,te),he=0|he+n(F,re),be=0|be+n(C,ne),ge=0|ge+n(C,se),ge=0|ge+n(R,ne),he=0|he+n(R,se),be=0|be+n(T,ie),ge=0|ge+n(T,de),ge=0|ge+n(I,ie),he=0|he+n(I,de),be=0|be+n(x,ce),ge=0|ge+n(x,le),ge=0|ge+n(k,ce),he=0|he+n(k,le),be=0|be+n(w,fe),ge=0|ge+n(w,ye),ge=0|ge+n(A,fe),he=0|he+n(A,ye);var Ce=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ce>>>26),Ce&=67108863,be=n(j,te),ge=n(j,re),ge=0|ge+n(L,te),he=n(L,re),be=0|be+n(P,ne),ge=0|ge+n(P,se),ge=0|ge+n(F,ne),he=0|he+n(F,se),be=0|be+n(C,ie),ge=0|ge+n(C,de),ge=0|ge+n(R,ie),he=0|he+n(R,de),be=0|be+n(T,ce),ge=0|ge+n(T,le),ge=0|ge+n(I,ce),he=0|he+n(I,le),be=0|be+n(x,fe),ge=0|ge+n(x,ye),ge=0|ge+n(k,fe),he=0|he+n(k,ye);var Re=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Re>>>26),Re&=67108863,be=n(j,ne),ge=n(j,se),ge=0|ge+n(L,ne),he=n(L,se),be=0|be+n(P,ie),ge=0|ge+n(P,de),ge=0|ge+n(F,ie),he=0|he+n(F,de),be=0|be+n(C,ce),ge=0|ge+n(C,le),ge=0|ge+n(R,ce),he=0|he+n(R,le),be=0|be+n(T,fe),ge=0|ge+n(T,ye),ge=0|ge+n(I,fe),he=0|he+n(I,ye);var Ne=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ne>>>26),Ne&=67108863,be=n(j,ie),ge=n(j,de),ge=0|ge+n(L,ie),he=n(L,de),be=0|be+n(P,ce),ge=0|ge+n(P,le),ge=0|ge+n(F,ce),he=0|he+n(F,le),be=0|be+n(C,fe),ge=0|ge+n(C,ye),ge=0|ge+n(R,fe),he=0|he+n(R,ye);var Pe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Pe>>>26),Pe&=67108863,be=n(j,ce),ge=n(j,le),ge=0|ge+n(L,ce),he=n(L,le),be=0|be+n(P,fe),ge=0|ge+n(P,ye),ge=0|ge+n(F,fe),he=0|he+n(F,ye);var Fe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Fe>>>26),Fe&=67108863,be=n(j,fe),ge=n(j,ye),ge=0|ge+n(L,fe),he=n(L,ye);var Oe=0|(0|o+be)+((8191&ge)<<13);return o=0|(0|he+(ge>>>13))+(Oe>>>26),Oe&=67108863,i[0]=me,i[1]=_e,i[2]=ve,i[3]=Se,i[4]=we,i[5]=Ae,i[6]=Be,i[7]=xe,i[8]=ke,i[9]=Ee,i[10]=Te,i[11]=Ie,i[12]=Me,i[13]=Ce,i[14]=Re,i[15]=Ne,i[16]=Pe,i[17]=Fe,i[18]=Oe,0!==o&&(i[19]=o,r.length++),r};n||(C=g),f.prototype.mulTo=function(e,t){var r=this.length+e.length,a;return a=10===this.length&&10===e.length?C(this,e,t):63>r?g(this,e,t):1024>r?h(this,e,t):m(this,e,t),a},_.prototype.makeRBT=function(e){for(var r=Array(e),t=f.prototype._countBits(e)-1,a=0;a>=1;return a},_.prototype.permute=function(e,t,r,a,n,s){for(var o=0;o>>=1)n++;return 1<=a))for(var n=0,s;nn?0:0|n/67108864;return e},_.prototype.convert13b=function(e,t,r,a){for(var n=0,s=0;s>>=13,r[2*s+1]=8191&n,n>>>=13;for(s=2*t;se);for(var t=0,r=0;r>=26,t+=0|a/67108864,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(e){var t=b(e);if(0===t.length)return new f(1);for(var r=this,a=0;a>>26-t<<26-t,o=(0|this.words[a])-s<>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;ar)for(this.length-=r,c=0;c=n);c--){var f=0|this.words[c];this.words[c]=u<<26-p|f>>>p,u=f&(67108863^67108863>>>p<>>t<e),0>e?this.isubn(-e):0===this.negative?this._iaddn(e):1===this.length&&(0|this.words[0])e),0>e)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&0>this.words[0])this.words[0]=-this.words[0],this.negative=1;else for(var t=0;tthis.words[t];t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var a=e.length+r,n;this._expand(a);var s=0,o;for(n=0;n>26)-(0|d/67108864),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(l(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),s=e,o=0|s.words[s.length-1],p=this._countBits(o);r=26-p,0!=r&&(s=s.ushln(r),n.iushln(r),o=0|s.words[s.length-1]);var c=n.length-s.length,l;if("mod"!==t){l=new f(null),l.length=c+1,l.words=Array(l.length);for(var u=0;uthis.length||0>this.cmp(e)?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),"div"!==t&&(n=s.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:s.div,mod:n})},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0===t.div.negative?t.mod:t.mod.isub(e),a=e.ushrn(1),n=e.andln(1),s=r.cmp(a);return 0>s||1===n&&0===s?t.div:0===t.div.negative?t.div.iaddn(1):t.div.isubn(1)},f.prototype.modn=function(e){l(67108863>=e);for(var t=0,r=this.length-1;0<=r;r--)t=(67108864%e*t+(0|this.words[r]))%e;return t},f.prototype.idivn=function(e){l(67108863>=e);for(var t=0,r=this.length-1,a;0<=r;r--)a=(0|this.words[r])+67108864*t,this.words[r]=0|a/e,t=a%e;return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.prototype.egcd=function(e){l(0===e.negative),l(!e.isZero());var t=this,r=e.clone();t=0===t.negative?t.clone():t.umod(e);for(var a=new f(1),n=new f(0),s=new f(0),o=new f(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var p=r.clone(),c=t.clone();!t.isZero();){for(var u=0,y=1;0==(t.words[0]&y)&&26>u;++u,y<<=1);if(0b;++b,h<<=1);if(0d;++d,p<<=1);if(0c;++c,u<<=1);if(0y.cmpn(0)&&y.iadd(e),y},f.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var n=this.clone(),s=e.clone();n.negative=0,s.negative=0;for(var o=0;n.isEven()&&s.isEven();o++)n.iushrn(1),s.iushrn(1);do{for(;n.isEven();)n.iushrn(1);for(;s.isEven();)s.iushrn(1);var i=n.cmp(s);if(0>i){var r=n;n=s,s=r}else if(0===i||0===s.cmpn(1))break;n.isub(s)}while(!0);return s.iushln(o)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.prototype.bincn=function(e){l("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,o&=67108863,this.words[s]=o;return 0!==n&&(this.words[s]=n,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(e){var t=0>e;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(1=e,"Number is too big");var a=0|this.words[0];r=a===e?0:ae.length)return 1;if(this.lengtha&&(t=1);break}}return t},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return 0<=this.cmpn(e)},f.prototype.gte=function(e){return 0<=this.cmp(e)},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return 0>=this.cmpn(e)},f.prototype.lte=function(e){return 0>=this.cmp(e)},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new x(e)},f.prototype.toRed=function(e){return l(!this.red,"Already a number in reduction context"),l(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},f.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return l(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return l(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var R={k256:null,p224:null,p192:null,p25519:null};v.prototype._tmp=function(){var e=new f(null);return e.words=Array(s(this.n/13)),e},v.prototype.ireduce=function(e){var t=e,a;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),a=t.bitLength();while(a>this.n);var n=a=e.length)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(t.words[t.length++]=s&r,n=10;n>>22,s=o}s>>>=22,e.words[n-10]=s,e.length-=0===s&&10>>=26,e.words[r]=n,t=a}return 0!==t&&(e.words[e.length++]=t),e},f._prime=function e(t){if(R[t])return R[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new w;else if("p192"===t)e=new A;else if("p25519"===t)e=new B;else throw new Error("Unknown prime "+t);return R[t]=e,e},x.prototype._verify1=function(e){l(0===e.negative,"red works only with positives"),l(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){l(0==(e.negative|t.negative),"red works only with positives"),l(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(l(1==a%2),3===a){var n=this.m.add(new f(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),d=0;!o.isZero()&&0===o.andln(1);)d++,o.iushrn(1);l(!o.isZero());var p=new f(1).toRed(this),u=p.redNeg(),y=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new f(2*g*g).toRed(this);0!==this.pow(g,y).cmp(u);)g.redIAdd(u);for(var h=this.pow(g,o),_=this.pow(e,o.addn(1).iushrn(1)),v=this.pow(e,o),S=d;0!==v.cmp(p);){for(var w=v,A=0;0!==w.cmp(p);A++)w=w.redSqr();l(A>c,n!==r[0]&&(n=this.sqr(n)),0===l&&0===s){o=0;continue}s<<=1,s|=l,o++,4!==o&&(0!=a||0!=c)||(n=this.mul(n,r[s]),o=0,s=0)}d=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},f.mont=function(e){return new k(e)},c(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),s=n;return 0<=n.cmp(this.m)?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},k.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new f(0)._forceRed(this);var a=e.mul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),s=n;return 0<=n.cmp(this.m)?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})("undefined"==typeof t||t,this)},{buffer:52}],51:[function(e,t){function a(e){this.rand=e}var n;if(t.exports=function(e){return n||(n=new a(null)),n.generate(e)},t.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^o[255&c>>>16]^i[255&l>>>8]^d[255&u]^t[f++],g=s[c>>>24]^o[255&l>>>16]^i[255&u>>>8]^d[255&p]^t[f++],h=s[l>>>24]^o[255&u>>>16]^i[255&p>>>8]^d[255&c]^t[f++],m=s[u>>>24]^o[255&p>>>16]^i[255&c>>>8]^d[255&l]^t[f++],p=b,c=g,l=h,u=m;return b=(a[p>>>24]<<24|a[255&c>>>16]<<16|a[255&l>>>8]<<8|a[255&u])^t[f++],g=(a[c>>>24]<<24|a[255&l>>>16]<<16|a[255&u>>>8]<<8|a[255&p])^t[f++],h=(a[l>>>24]<<24|a[255&u>>>16]<<16|a[255&p>>>8]<<8|a[255&c])^t[f++],m=(a[u>>>24]<<24|a[255&p>>>16]<<16|a[255&c>>>8]<<8|a[255&l])^t[f++],b>>>=0,g>>>=0,h>>>=0,m>>>=0,[b,g,h,m]}function s(e){this._key=r(e),this._reset()}var o=e("safe-buffer").Buffer,i=[0,1,2,4,8,16,32,64,128,27,54],d=function(){for(var e=Array(256),r=0;256>r;r++)e[r]=128>r?r<<1:283^r<<1;for(var a=[],n=[],s=[[],[],[],[]],o=[[],[],[],[]],d=0,p=0,c=0,l;256>c;++c){l=p^p<<1^p<<2^p<<3^p<<4,l=99^(l>>>8^255&l),a[d]=l,n[l]=d;var u=e[d],f=e[u],y=e[f],b=257*e[l]^16843008*l;s[0][d]=b<<24|b>>>8,s[1][d]=b<<16|b>>>16,s[2][d]=b<<8|b>>>24,s[3][d]=b,b=16843009*y^65537*f^257*u^16843008*d,o[0][l]=b<<24|b>>>8,o[1][l]=b<<16|b>>>16,o[2][l]=b<<8|b>>>24,o[3][l]=b,0===d?d=p=1:(d=u^e[e[e[y^u]]],p^=e[e[p]])}return{SBOX:a,INV_SBOX:n,SUB_MIX:s,INV_SUB_MIX:o}}();s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,r=e.length,a=r+6,n=4*(a+1),s=[],o=0;o>>24,p=d.SBOX[p>>>24]<<24|d.SBOX[255&p>>>16]<<16|d.SBOX[255&p>>>8]<<8|d.SBOX[255&p],p^=i[0|o/r]<<24):6>>24]<<24|d.SBOX[255&p>>>16]<<16|d.SBOX[255&p>>>8]<<8|d.SBOX[255&p]),s[o]=s[o-r]^p}for(var c=[],l=0;ll||4>=u?f:d.INV_SUB_MIX[0][d.SBOX[f>>>24]]^d.INV_SUB_MIX[1][d.SBOX[255&f>>>16]]^d.INV_SUB_MIX[2][d.SBOX[255&f>>>8]]^d.INV_SUB_MIX[3][d.SBOX[255&f]]}this._nRounds=a,this._keySchedule=s,this._invKeySchedule=c},s.prototype.encryptBlockRaw=function(e){return e=r(e),n(e,this._keySchedule,d.SUB_MIX,d.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=o.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){e=r(e);var t=e[1];e[1]=e[3],e[3]=t;var a=n(e,this._invKeySchedule,d.INV_SUB_MIX,d.INV_SBOX,this._nRounds),s=o.allocUnsafe(16);return s.writeUInt32BE(a[0],0),s.writeUInt32BE(a[3],4),s.writeUInt32BE(a[2],8),s.writeUInt32BE(a[1],12),s},s.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},t.exports.AES=s},{"safe-buffer":218}],54:[function(e,t){function r(e,t){var r=0;e.length!==t.length&&r++;for(var a=Math.min(e.length,t.length),n=0;nt&&(t=o.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&r(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},n.prototype.getAuthTag=function(){if(this._decrypt||!o.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},n.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},n.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=n},{"./aes":53,"./ghash":58,"./incr32":59,"buffer-xor":82,"cipher-base":85,inherits:162,"safe-buffer":218}],55:[function(e,t,r){var a=e("./encrypter"),n=e("./decrypter"),s=e("./modes/list.json");r.createCipher=r.Cipher=a.createCipher,r.createCipheriv=r.Cipheriv=a.createCipheriv,r.createDecipher=r.Decipher=n.createDecipher,r.createDecipheriv=r.Decipheriv=n.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(s)}},{"./decrypter":56,"./encrypter":57,"./modes/list.json":67}],56:[function(e,t,r){function a(e,t,r){l.call(this),this._cache=new n,this._last=void 0,this._cipher=new u.AES(t),this._prev=d.from(r),this._mode=e,this._autopadding=!0}function n(){this.cache=d.allocUnsafe(0)}function s(e){var t=e[15];if(1>t||16>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function n(e){this.h=e,this.state=s.alloc(16,0),this.cache=s.allocUnsafe(0)}var s=e("safe-buffer").Buffer,o=s.alloc(16,0);n.prototype.ghash=function(e){for(var t=-1;++t++n;){for(o=0!=(this.state[~~(n/8)]&1<<7-n%8),o&&(t[0]^=e[0],t[1]^=e[1],t[2]^=e[2],t[3]^=e[3]),d=0!=(1&e[3]),s=3;0>>1|(1&e[s-1])<<31;e[0]>>>=1,d&&(e[0]^=-520093696)}this.state=a(t)},n.prototype.update=function(e){this.cache=s.concat([this.cache,e]);for(var t;16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},n.prototype.final=function(e,t){return this.cache.length&&this.ghash(s.concat([this.cache,o],16)),this.ghash(a([0,e,0,t])),this.state},t.exports=n},{"safe-buffer":218}],59:[function(e,t){t.exports=function(e){for(var t=e.length,r;t--;)if(r=e.readUInt8(t),255===r)e.writeUInt8(0,t);else{r++,e.writeUInt8(r,t);break}}},{}],60:[function(e,t,r){var a=e("buffer-xor");r.encrypt=function(e,t){var r=a(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return a(n,r)}},{"buffer-xor":82}],61:[function(e,t,r){function a(e,t,r){var a=t.length,o=s(t,e._cache);return e._cache=e._cache.slice(a),e._prev=n.concat([e._prev,r?t:o]),o}var n=e("safe-buffer").Buffer,s=e("buffer-xor");r.encrypt=function(e,t,r){for(var s=n.allocUnsafe(0),o;t.length;)if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),e._cache.length<=t.length)o=e._cache.length,s=n.concat([s,a(e,t.slice(0,o),r)]),t=t.slice(o);else{s=n.concat([s,a(e,t,r)]);break}return s}},{"buffer-xor":82,"safe-buffer":218}],62:[function(e,t,r){function a(e,t,r){for(var a=-1,s=0,o,d,p;++a<8;)o=e._cipher.encryptBlock(e._prev),d=t&1<<7-a?128:0,p=o[0]^d,s+=(128&p)>>a%8,e._prev=n(e._prev,r?d:p);return s}function n(e,t){var r=e.length,a=-1,n=s.allocUnsafe(e.length);for(e=s.concat([e,s.from([t])]);++a>7;return n}var s=e("safe-buffer").Buffer;r.encrypt=function(e,t,r){for(var n=t.length,o=s.allocUnsafe(n),d=-1;++d=e.cmpn(0))throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}var d=e("bn.js"),s=e("elliptic").ec,c=e("parse-asn1"),i=e("./curves.json");t.exports=function(e,t,s,o,p){var l=c(s);if("ec"===l.type){if("ecdsa"!==o&&"ecdsa/rsa"!==o)throw new Error("wrong public key type");return a(e,t,l)}if("dsa"===l.type){if("dsa"!==o)throw new Error("wrong public key type");return n(e,t,l)}if("rsa"!==o&&"ecdsa/rsa"!==o)throw new Error("wrong public key type");t=r.concat([p,t]);for(var u=l.modulus.byteLength(),f=[1],y=0;t.length+f.length+2y?1:0;for(u=Math.min(e.length,f.length),e.length!==f.length&&(h=1),b=-1;++b=n&&r>>10),e=56320|1023&e),t+=w(e),t}).join("")}function p(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:36}function c(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function l(e,t,r){var a=0;for(e=r?S(e/700):e>>1,e+=S(e/t);455y&&(y=0),b=0;b=a&&s("invalid-input"),v=p(e.charCodeAt(g++)),(36<=v||v>S((2147483647-o)/m))&&s("overflow"),o+=v*m,A=_<=u?1:_>=u+26?26:_-u,vS(2147483647/B)&&s("overflow"),m*=B}f=r.length+1,u=l(o-h,f,0==h),S(o/f)>2147483647-c&&s("overflow"),c+=S(o/f),o%=f,r.splice(o++,0,c)}return d(r)}function f(e){var r=[],a,o,d,p,u,f,y,b,g,h,_,v,A,B,x;for(e=i(e),v=e.length,a=128,o=0,u=72,f=0;f_&&r.push(w(_));for(d=p=r.length,p&&r.push("-");d=a&&_S((2147483647-o)/A)&&s("overflow"),o+=(y-a)*A,a=y,f=0;f=u+26?26:g-u,b= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=Math.floor,w=String.fromCharCode,A,B;if(A={version:"1.4.1",ucs2:{decode:i,encode:d},decode:u,encode:f,toASCII:function(e){return o(e,function(e){return m.test(e)?"xn--"+f(e):e})},toUnicode:function(e){return o(e,function(e){return h.test(e)?u(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return A});else if(!(y&&b))a.punycode=A;else if(t.exports==y)b.exports=A;else for(B in A)A.hasOwnProperty(B)&&(y[B]=A[B])})(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],82:[function(e,t){(function(e){t.exports=function(t,r){for(var a=Math.min(t.length,r.length),n=new e(a),s=0;se)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"")}function i(e,t,r){return o(e),0>=e?a(e):void 0===t?a(e):"string"==typeof r?a(e).fill(t,r):a(e).fill(t)}function d(e){return o(e),a(0>e?0:0|f(e))}function p(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!n.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),s=a(r),o=s.write(e,t);return o!==r&&(s=s.slice(0,o)),s}function c(e){for(var t=0>e.length?0:0|f(e.length),r=a(t),n=0;nt||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|e}function y(e,t){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof e);var r=e.length,a=2>>1;case"base64":return H(e).length;default:if(s)return a?-1:U(e).length;t=(""+t).toLowerCase(),s=!0;}}function b(e,t,r){var a=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0;}}function g(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function h(e,t,r,a,s){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):2147483647r&&(r=-2147483648),r=+r,V(r)&&(r=s?0:e.length-1),0>r&&(r=e.length+r),r>=e.length){if(s)return-1;r=e.length-1}else if(0>r)if(s)r=0;else return-1;if("string"==typeof t&&(t=n.from(t,a)),n.isBuffer(t))return 0===t.length?-1:m(e,t,r,a,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,a,s);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,a,n){function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,d=e.length,p=t.length;if(void 0!==a&&(a=(a+"").toLowerCase(),"ucs2"===a||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(2>e.length||2>t.length)return-1;o=2,d/=2,p/=2,r/=2}var c;if(n){var l=-1;for(c=r;cd&&(r=d-p),c=r;0<=c;c--){for(var u=!0,f=0;fn&&(a=n)):a=n;var s=t.length;a>s/2&&(a=s/2);for(var o=0,d;os&&(o=s):2===d?(p=e[n+1],128==(192&p)&&(u=(31&s)<<6|63&p,127u||57343u&&(o=u))):void 0}null===o?(o=65533,d=1):65535>>10),o=56320|1023&o),a.push(o),n+=d}return E(a)}function E(e){var t=e.length;if(t<=4096)return X.apply(String,e);for(var r="",a=0;at)&&(t=0),(!r||0>r||r>a)&&(r=a);for(var n="",s=t;se)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,a,s,o){if(!n.isBuffer(e))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(t>s||te.length)throw new RangeError("Index out of range")}function P(e,t,r,a){if(r+a>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function F(e,t,r,a,n){return t=+t,r>>>=0,n||P(e,t,r,4,34028234663852886e22,-34028234663852886e22),Z.write(e,t,r,a,23,4),r+4}function O(e,t,r,a,n){return t=+t,r>>>=0,n||P(e,t,r,8,17976931348623157e292,-17976931348623157e292),Z.write(e,t,r,a,52,8),r+8}function j(e){if(e=e.split("=")[0],e=e.trim().replace(J,""),2>e.length)return"";for(;0!=e.length%4;)e+="=";return e}function L(e){return 16>e?"0"+e.toString(16):e.toString(16)}function U(e,t){t=t||1/0;for(var r=e.length,a=null,n=[],s=0,o;so){if(!a){if(56319o){-1<(t-=3)&&n.push(239,191,189),a=o;continue}o=(a-55296<<10|o-56320)+65536}else a&&-1<(t-=3)&&n.push(239,191,189);if(a=null,128>o){if(0>(t-=1))break;n.push(o)}else if(2048>o){if(0>(t-=2))break;n.push(192|o>>6,128|63&o)}else if(65536>o){if(0>(t-=3))break;n.push(224|o>>12,128|63&o>>6,128|63&o)}else if(1114112>o){if(0>(t-=4))break;n.push(240|o>>18,128|63&o>>12,128|63&o>>6,128|63&o)}else throw new Error("Invalid code point")}return n}function D(e){for(var t=[],r=0;r(t-=2));++a)n=e.charCodeAt(a),s=n>>8,o=n%256,r.push(o),r.push(s);return r}function H(e){return Y.toByteArray(j(e))}function q(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!==e}var G=Math.pow,K=Math.min,X=String.fromCharCode,Y=e("base64-js"),Z=e("ieee754");r.Buffer=n,r.SlowBuffer=function(e){return+e!=e&&(e=0),n.alloc(+e)},r.INSPECT_MAX_BYTES=50;r.kMaxLength=2147483647,n.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),n.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){return n.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){return n.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.poolSize=8192,n.from=function(e,t,r){return s(e,t,r)},n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,n.alloc=function(e,t,r){return i(e,t,r)},n.allocUnsafe=function(e){return d(e)},n.allocUnsafeSlow=function(e){return d(e)},n.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==n.prototype},n.compare=function(e,t){if(z(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");if(e===t)return 0;for(var r=e.length,s=t.length,o=0,d=K(r,s);ot&&(e+=" ... "),""},n.prototype.compare=function(e,t,r,a,s){if(z(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(e))throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type "+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===s&&(s=this.length),0>t||r>e.length||0>a||s>this.length)throw new RangeError("out of range index");if(a>=s&&t>=r)return 0;if(a>=s)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,s>>>=0,this===e)return 0;for(var o=s-a,d=r-t,p=K(o,d),c=this.slice(a,s),l=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===a&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n=this.length-t;if((void 0===r||r>n)&&(r=n),0r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0;}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};n.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);for(var a=this[e],n=1,s=0;++s>>=0,t>>>=0,r||R(e,t,this.length);for(var a=this[e+--t],n=1;0>>=0,t||R(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var a=this[e],n=1,s=0;++s=n&&(a-=G(2,8*t)),a},n.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var a=t,n=1,s=this[e+--a];0=n&&(s-=G(2,8*t)),s},n.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),Z.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),Z.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),Z.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),Z.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var n=G(2,8*r)-1;N(this,e,t,r,n,0)}var s=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!a){var n=G(2,8*r)-1;N(this,e,t,r,n,0)}var s=r-1,o=1;for(this[t+s]=255&e;0<=--s&&(o*=256);)this[t+s]=255&e/o;return t+r},n.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=G(2,8*r-1);N(this,e,t,r,n-1,-n)}var s=0,o=1,d=0;for(this[t]=255&e;++se&&0===d&&0!==this[t+s-1]&&(d=1),this[t+s]=255&(e/o>>0)-d;return t+r},n.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=G(2,8*r-1);N(this,e,t,r,n-1,-n)}var s=r-1,o=1,d=0;for(this[t+s]=255&e;0<=--s&&(o*=256);)0>e&&0===d&&0!==this[t+s+1]&&(d=1),this[t+s]=255&(e/o>>0)-d;return t+r},n.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},n.prototype.copy=function(e,t,r,a){if(!n.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),0t)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("Index out of range");if(0>a)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-ts||"latin1"===a)&&(e=s)}}else"number"==typeof e&&(e&=255);if(0>t||this.length>>=0,r=r===void 0?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;or){var a="rmd160"===e?new d:p(e);t=a.update(t).digest()}else t.length64?t=e(t):t.length<64&&(t=n.concat([t,o],64));for(var r=this._ipad=n.allocUnsafe(64),a=this._opad=n.allocUnsafe(64),d=0;d<64;d++)r[d]=54^t[d],a[d]=92^t[d];this._hash=[r]}var a=e("inherits"),n=e("safe-buffer").Buffer,s=e("cipher-base"),o=n.alloc(128);a(r,s),r.prototype._update=function(e){this._hash.push(e)},r.prototype._final=function(){var e=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,e]))},t.exports=r},{"cipher-base":85,inherits:162,"safe-buffer":218}],93:[function(e,t,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var a=e("browserify-sign/algos"),n=Object.keys(a),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);r.getHashes=function(){return s};var o=e("pbkdf2");r.pbkdf2=o.pbkdf2,r.pbkdf2Sync=o.pbkdf2Sync;var i=e("browserify-cipher");r.Cipher=i.Cipher,r.createCipher=i.createCipher,r.Cipheriv=i.Cipheriv,r.createCipheriv=i.createCipheriv,r.Decipher=i.Decipher,r.createDecipher=i.createDecipher,r.Decipheriv=i.Decipheriv,r.createDecipheriv=i.createDecipheriv,r.getCiphers=i.getCiphers,r.listCiphers=i.listCiphers;var d=e("diffie-hellman");r.DiffieHellmanGroup=d.DiffieHellmanGroup,r.createDiffieHellmanGroup=d.createDiffieHellmanGroup,r.getDiffieHellman=d.getDiffieHellman,r.createDiffieHellman=d.createDiffieHellman,r.DiffieHellman=d.DiffieHellman;var p=e("browserify-sign");r.createSign=p.createSign,r.Sign=p.Sign,r.createVerify=p.createVerify,r.Verify=p.Verify,r.createECDH=e("create-ecdh");var c=e("public-encrypt");r.publicEncrypt=c.publicEncrypt,r.privateEncrypt=c.privateEncrypt,r.publicDecrypt=c.publicDecrypt,r.privateDecrypt=c.privateDecrypt;var l=e("randomfill");r.randomFill=l.randomFill,r.randomFillSync=l.randomFillSync,r.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/crypto-browserify/crypto-browserify")},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":70,"browserify-sign":77,"browserify-sign/algos":74,"create-ecdh":88,"create-hash":89,"create-hmac":91,"diffie-hellman":101,pbkdf2:183,"public-encrypt":189,randombytes:199,randomfill:200}],94:[function(e,t){"use strict";function r(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var a=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],r(a),r(n))}function a(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(s),a=1;a>>1],r=d.r28shl(r,o),a=d.r28shl(a,o),d.pc2(r,a,e.keys,s)},a.prototype._update=function(e,t,a,n){var s=this._desState,o=d.readUInt32BE(e,t),i=d.readUInt32BE(e,t+4);d.ip(o,i,s.tmp,0),o=s.tmp[0],i=s.tmp[1],"encrypt"===this.type?this._encrypt(s,o,i,s.tmp,0):this._decrypt(s,o,i,s.tmp,0),o=s.tmp[0],i=s.tmp[1],d.writeUInt32BE(a,o,n),d.writeUInt32BE(a,i,n+4)},a.prototype._pad=function(e,t){for(var r=e.length-t,a=t;a>>0,c=f}d.rip(u,c,o,p)},a.prototype._decrypt=function(e,a,n,o,p){for(var c=n,u=a,y=e.keys.length-2;0<=y;y-=2){var b=e.keys[y],g=e.keys[y+1];d.expand(c,e.tmp,0),b^=e.tmp[0],g^=e.tmp[1];var h=d.substitute(b,g),s=d.permute(h),f=c;c=(u^s)>>>0,u=f}d.rip(c,u,o,p)}},{"../des":95,inherits:162,"minimalistic-assert":170}],99:[function(e,t){"use strict";function r(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),a=t.slice(8,16),s=t.slice(16,24);this.ciphers="encrypt"===e?[d.create({type:"encrypt",key:r}),d.create({type:"decrypt",key:a}),d.create({type:"encrypt",key:s})]:[d.create({type:"decrypt",key:s}),d.create({type:"encrypt",key:a}),d.create({type:"decrypt",key:r})]}function a(e){i.call(this,e);var t=new r(this.type,this.options.key);this._edeState=t}var n=e("minimalistic-assert"),s=e("inherits"),o=e("../des"),i=o.Cipher,d=o.DES;s(a,i),t.exports=a,a.create=function(e){return new a(e)},a.prototype._update=function(e,t,r,a){var n=this._edeState;n.ciphers[0]._update(e,t,r,a),n.ciphers[1]._update(r,a,r,a),n.ciphers[2]._update(r,a,r,a)},a.prototype._pad=d.prototype._pad,a.prototype._unpad=d.prototype._unpad},{"../des":95,inherits:162,"minimalistic-assert":170}],100:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=255&t>>>16,e[2+r]=255&t>>>8,e[3+r]=255&t},r.ip=function(e,t,r,a){for(var n=0,s=0,o=6;0<=o;o-=2){for(var d=0;24>=d;d+=8)n<<=1,n|=1&t>>>d+o;for(var d=0;24>=d;d+=8)n<<=1,n|=1&e>>>d+o}for(var o=6;0<=o;o-=2){for(var d=1;25>=d;d+=8)s<<=1,s|=1&t>>>d+o;for(var d=1;25>=d;d+=8)s<<=1,s|=1&e>>>d+o}r[a+0]=n>>>0,r[a+1]=s>>>0},r.rip=function(e,t,r,a){for(var n=0,s=0,o=0;4>o;o++)for(var d=24;0<=d;d-=8)n<<=1,n|=1&t>>>d+o,n<<=1,n|=1&e>>>d+o;for(var o=4;8>o;o++)for(var d=24;0<=d;d-=8)s<<=1,s|=1&t>>>d+o,s<<=1,s|=1&e>>>d+o;r[a+0]=n>>>0,r[a+1]=s>>>0},r.pc1=function(e,t,r,a){for(var n=0,s=0,o=7;5<=o;o--){for(var d=0;24>=d;d+=8)n<<=1,n|=1&t>>d+o;for(var d=0;24>=d;d+=8)n<<=1,n|=1&e>>d+o}for(var d=0;24>=d;d+=8)n<<=1,n|=1&t>>d+o;for(var o=1;3>=o;o++){for(var d=0;24>=d;d+=8)s<<=1,s|=1&t>>d+o;for(var d=0;24>=d;d+=8)s<<=1,s|=1&e>>d+o}for(var d=0;24>=d;d+=8)s<<=1,s|=1&e>>d+o;r[a+0]=n>>>0,r[a+1]=s>>>0},r.r28shl=function(e,t){return 268435455&e<>>28-t};var a=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,n){for(var s=0,o=0,d=a.length>>>1,p=0;p>>a[p];for(var p=d;p>>a[p];r[n+0]=s>>>0,r[n+1]=o>>>0},r.expand=function(e,t,r){var a=0,n=0;a=(1&e)<<5|e>>>27;for(var s=23;15<=s;s-=4)a<<=6,a|=63&e>>>s;for(var s=11;3<=s;s-=4)n|=63&e>>>s,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=a>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,a=0;4>a;a++){var s=63&e>>>18-6*a,o=n[64*a+s];r<<=4,r|=o}for(var a=0;4>a;a++){var s=63&t>>>18-6*a,o=n[256+64*a+s];r<<=4,r|=o}return r>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>s[r];return t>>>0},r.padSplit=function(e,t,r){for(var a=e.toString(2);a.lengthr;r+=2){a=o(Math.sqrt(r));for(var n=0;ne)return 2===t||5===t?new d([140,123]):new d([140,39]);t=new d(t);for(var r,s;;){for(r=new d(i(o(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(f),!t.cmp(f))for(;r.mod(p).cmp(v);)r.iadd(S);else if(!t.cmp(y))for(;r.mod(h).cmp(m);)r.iadd(S);if(s=r.shrn(1),a(s)&&a(r)&&n(s)&&n(r)&&l.test(s)&&l.test(r))return r}}var o=Math.ceil,i=e("randombytes");t.exports=s,s.simpleSieve=a,s.fermatTest=n;var d=e("bn.js"),p=new d(24),c=e("miller-rabin"),l=new c,u=new d(1),f=new d(2),y=new d(5),b=new d(16),g=new d(8),h=new d(10),m=new d(3),_=new d(7),v=new d(11),S=new d(4),w=new d(12),A=null},{"bn.js":50,"miller-rabin":169,randombytes:199}],104:[function(e,t){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],105:[function(e,t,r){"use strict";var a=r;a.version=e("../package.json").version,a.utils=e("./elliptic/utils"),a.rand=e("brorand"),a.curve=e("./elliptic/curve"),a.curves=e("./elliptic/curves"),a.ec=e("./elliptic/ec"),a.eddsa=e("./elliptic/eddsa")},{"../package.json":120,"./elliptic/curve":108,"./elliptic/curves":111,"./elliptic/ec":112,"./elliptic/eddsa":115,"./elliptic/utils":119,brorand:51}],106:[function(e,t){"use strict";function r(e,t){this.type=e,this.p=new s(t.p,16),this.red=t.prime?s.red(t.prime):s.mont(this.p),this.zero=new s(0).toRed(this.red),this.one=new s(1).toRed(this.red),this.two=new s(2).toRed(this.red),this.n=t.n&&new s(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,];var r=this.n&&this.p.div(this.n);!r||0=p;t--)l=(l<<1)+n[t];o.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),y=s;0p)break;var l=s[p];c(0!==l),o="affine"===e.type?0>1]):o.mixedAdd(n[-l-1>>1].neg()):0>1]):o.add(n[-l-1>>1].neg())}return"affine"===e.type?o.toP():o},r.prototype._wnafMulAdd=function(e,t,r,s,o){for(var c=this._wnafT1,l=this._wnafT2,u=this._wnafT3,f=0,y=0;yy)break;for(var S=0;S>1]:0>I&&(g=l[S][-I-1>>1].neg());B="affine"===g.type?B.mixedAdd(g):B.add(g)}}for(var y=0;y=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],a=this,n=0;n":""},a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},a.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),a=this.z.redSqr();a=a.redIAdd(a);var n=this.curve._mulA(t),s=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),e=n.redAdd(r),o=e.redSub(a),i=n.redSub(r),d=s.redMul(o),p=e.redMul(i),l=s.redMul(i),u=o.redMul(e);return this.curve.point(d,p,u,l)},a.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),a=this.y.redSqr(),n,s,o;if(this.curve.twisted){var i=this.curve._mulA(r),d=i.redAdd(a);if(this.zOne)n=t.redSub(r).redSub(a).redMul(d.redSub(this.curve.two)),s=d.redMul(i.redSub(a)),o=d.redSqr().redSub(d).redSub(d);else{var p=this.z.redSqr(),c=d.redSub(p).redISub(p);n=t.redSub(r).redISub(a).redMul(c),s=d.redMul(i.redSub(a)),o=d.redMul(c)}}else{var i=r.redAdd(a),p=this.curve._mulC(this.z).redSqr(),c=i.redSub(p).redSub(p);n=this.curve._mulC(t.redISub(i)).redMul(c),s=this.curve._mulC(i).redMul(r.redISub(a)),o=i.redMul(c)}return this.curve.point(n,s,o)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),a=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),s=this.z.redMul(t.z.redAdd(t.z)),o=a.redSub(r),e=s.redSub(n),i=s.redAdd(n),d=a.redAdd(r),p=o.redMul(e),c=i.redMul(d),l=o.redMul(d),u=e.redMul(i);return this.curve.point(p,c,u,l)},a.prototype._projAdd=function(t){var r=this.z.redMul(t.z),a=r.redSqr(),n=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(n).redMul(s),e=a.redSub(o),i=a.redAdd(o),d=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(n).redISub(s),p=r.redMul(e).redMul(d),c,l;return this.curve.twisted?(c=r.redMul(i).redMul(s.redSub(this.curve._mulA(n))),l=e.redMul(i)):(c=r.redMul(i).redMul(s.redSub(n)),l=this.curve._mulC(e).redMul(i)),this.curve.point(p,c,l)},a.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},a.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},a.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},a.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(r))return!0;for(var a=e.clone(),n=this.curve.redN.redMul(this.z);;){if(a.iadd(this.curve.n),0<=a.cmp(this.curve.p))return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add},{"../../elliptic":105,"../curve":108,"bn.js":50,inherits:162}],108:[function(e,t,r){"use strict";var a=r;a.base=e("./base"),a.short=e("./short"),a.mont=e("./mont"),a.edwards=e("./edwards")},{"./base":106,"./edwards":107,"./mont":109,"./short":110}],109:[function(e,t){"use strict";function r(e){i.call(this,"mont",e),this.a=new s(e.a,16).toRed(this.red),this.b=new s(e.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function a(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(t,16),this.z=new s(r,16),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),!this.z.red&&(this.z=this.z.toRed(this.curve.red)))}var n=e("../curve"),s=e("bn.js"),o=e("inherits"),i=n.base,d=e("../../elliptic"),p=d.utils;o(r,i),t.exports=r,r.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),a=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t),n=a.redSqrt();return 0===n.redSqr().cmp(a)},o(a,i.BasePoint),r.prototype.decodePoint=function(e,t){return this.point(p.toArray(e,t),1)},r.prototype.point=function(e,t){return new a(this,e,t)},r.prototype.pointFromJSON=function(e){return a.fromJSON(this,e)},a.prototype.precompute=function(){},a.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},a.fromJSON=function(e,t){return new a(e,t[0],t[1]||e.one)},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},a.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),a=r.redSqr(),n=t.redSub(a),s=t.redMul(a),o=n.redMul(a.redAdd(this.curve.a24.redMul(n)));return this.curve.point(s,o)},a.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),a=this.x.redSub(this.z),n=e.x.redAdd(e.z),s=e.x.redSub(e.z),o=s.redMul(r),i=n.redMul(a),d=t.z.redMul(o.redAdd(i).redSqr()),p=t.x.redMul(o.redISub(i).redSqr());return this.curve.point(d,p)},a.prototype.mul=function(e){for(var r=e.clone(),t=this,n=this.curve.point(null,null),s=this,o=[];0!==r.cmpn(0);r.iushrn(1))o.push(r.andln(1));for(var d=o.length-1;0<=d;d--)0===o[d]?(t=t.diffAdd(n,s),n=n.dbl()):(n=t.diffAdd(n,s),t=t.dbl());return n},a.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},a.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":105,"../curve":108,"bn.js":50,inherits:162}],110:[function(e,t){"use strict";function r(e){p.call(this,"short",e),this.a=new d(e.a,16).toRed(this.red),this.b=new d(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function a(e,t,r,a){p.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new d(t,16),this.y=new d(r,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),!this.y.red&&(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function n(e,t,r,a){p.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===a?(this.x=this.curve.one,this.y=this.curve.one,this.z=new d(0)):(this.x=new d(t,16),this.y=new d(r,16),this.z=new d(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var s=e("../curve"),o=e("../../elliptic"),d=e("bn.js"),i=e("inherits"),p=s.base,c=o.utils.assert;i(r,p),t.exports=r,r.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new d(e.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);t=0>a[0].cmp(a[1])?a[0]:a[1],t=t.toRed(this.red)}if(e.lambda)r=new d(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}var s;return s=e.basis?e.basis.map(function(e){return{a:new d(e.a,16),b:new d(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:s}}},r.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:d.mont(e),r=new d(2).toRed(t).redInvm(),a=r.redNeg(),n=new d(3).toRed(t).redNeg().redSqrt().redMul(r),s=a.redAdd(n).fromRed(),o=a.redSub(n).fromRed();return[s,o]},r.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,n=this.n.clone(),s=new d(1),o=new d(0),p=new d(0),c=new d(1),l=0,f,b,g,h,m,_,S,w,A,B;0!==a.cmpn(0);){B=n.div(a),w=n.sub(B.mul(a)),A=p.sub(B.mul(s));var k=c.sub(B.mul(o));if(!g&&0>w.cmp(t))f=S.neg(),b=s,g=w.neg(),h=A;else if(g&&2==++l)break;S=w,n=a,a=w,p=s,s=A,c=o,o=k}m=w.neg(),_=A;var y=g.sqr().add(h.sqr()),E=m.sqr().add(_.sqr());return 0<=E.cmp(y)&&(m=f,_=b),g.negative&&(g=g.neg(),h=h.neg()),m.negative&&(m=m.neg(),_=_.neg()),[{a:g,b:h},{a:m,b:_}]},r.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],a=t[1],n=a.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),i=s.mul(a.a),d=n.mul(r.b),p=s.mul(a.b),c=e.sub(o).sub(i),l=d.add(p).neg();return{k1:c,k2:l}},r.prototype.pointFromX=function(e,t){e=new d(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),a=r.redSqrt();if(0!==a.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=a.fromRed().isOdd();return(t&&!n||!t&&n)&&(a=a.redNeg()),this.point(e,a)},r.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,a=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(a).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},r.prototype._endoWnafMulAdd=function(e,t,r){for(var a=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),a=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,a)},a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),a=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(a),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(e){return e=new d(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n):this.curve._wnafMulAdd(1,a,n,2)},a.prototype.jmulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n,!0):this.curve._wnafMulAdd(1,a,n,2,!0)},a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,a=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(a)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(a)}}}return t},a.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},i(n,p.BasePoint),r.prototype.jpoint=function(e,t,r){return new n(this,e,t,r)},n.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),a=this.y.redMul(t).redMul(e);return this.curve.point(r,a)},n.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},n.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),a=this.z.redSqr(),n=this.x.redMul(t),s=e.x.redMul(a),o=this.y.redMul(t.redMul(e.z)),i=e.y.redMul(a.redMul(this.z)),d=n.redSub(s),p=o.redSub(i);if(0===d.cmpn(0))return 0===p.cmpn(0)?this.dbl():this.curve.jpoint(null,null,null);var r=d.redSqr(),c=r.redMul(d),l=n.redMul(r),u=p.redSqr().redIAdd(c).redISub(l).redISub(l),f=p.redMul(l.redISub(u)).redISub(o.redMul(c)),y=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(u,f,y)},n.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),a=this.x,n=e.x.redMul(t),s=this.y,o=e.y.redMul(t).redMul(this.z),i=a.redSub(n),d=s.redSub(o);if(0===i.cmpn(0))return 0===d.cmpn(0)?this.dbl():this.curve.jpoint(null,null,null);var r=i.redSqr(),p=r.redMul(i),c=a.redMul(r),l=d.redSqr().redIAdd(p).redISub(c).redISub(c),u=d.redMul(c.redISub(l)).redISub(s.redMul(p)),f=this.z.redMul(i);return this.curve.jpoint(l,u,f)},n.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n":""},n.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":105,"../curve":108,"bn.js":50,inherits:162}],111:[function(e,t,r){"use strict";function a(e){this.curve="short"===e.type?new i.curve.short(e):"edwards"===e.type?new i.curve.edwards(e):new i.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function n(e,t){Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(s,e,{configurable:!0,enumerable:!0,value:r}),r}})}var s=r,o=e("hash.js"),i=e("../elliptic"),d=i.utils.assert;s.PresetCurve=a,n("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),n("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),n("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),n("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),n("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),n("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),n("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var p;try{p=e("./precomputed/secp256k1")}catch(t){p=void 0}n("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",p]})},{"../elliptic":105,"./precomputed/secp256k1":118,"hash.js":145}],112:[function(e,t){"use strict";function r(e){return this instanceof r?void("string"==typeof e&&(i(s.curves.hasOwnProperty(e),"Unknown curve "+e),e=s.curves[e]),e instanceof s.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash):new r(e)}var a=e("bn.js"),n=e("hmac-drbg"),s=e("../../elliptic"),o=s.utils,i=o.assert,d=e("./key"),c=e("./signature");t.exports=r,r.prototype.keyPair=function(e){return new d(this,e)},r.prototype.keyFromPrivate=function(e,t){return d.fromPrivate(this,e,t)},r.prototype.keyFromPublic=function(e,t){return d.fromPublic(this,e,t)},r.prototype.genKeyPair=function(e){e||(e={});var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new a(2));do{var i=new a(t.generate(r));if(0=b.cmpn(1)||0<=b.cmp(f))){var g=this.g.mul(b);if(!g.isInfinity()){var h=g.getX(),m=h.umod(this.n);if(0!==m.cmpn(0)){var r=b.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(r=r.umod(this.n),0!==r.cmpn(0)){var _=(g.getY().isOdd()?1:0)|(0===h.cmp(m)?0:2);return i.canonical&&0i.cmpn(1)||0<=i.cmp(this.n))return!1;if(0>r.cmpn(1)||0<=r.cmp(this.n))return!1;var s=r.invm(this.n),d=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);if(!this.curve._maxwellTrick){var u=this.g.mulAdd(d,n.getPublic(),l);return!u.isInfinity()&&0===u.getX().umod(this.n).cmp(i)}var u=this.g.jmulAdd(d,n.getPublic(),l);return!u.isInfinity()&&u.eqXToP(i)},r.prototype.recoverPubKey=function(t,o,d,p){i((3&d)===d,"The recovery param is more than two bits"),o=new c(o,p);var l=this.n,n=new a(t),e=o.r,u=o.s,s=1&d,f=d>>1;if(0<=e.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");e=f?this.curve.pointFromX(e.add(this.curve.n),s):this.curve.pointFromX(e,s);var y=o.r.invm(l),b=l.sub(n).mul(y).umod(l),g=u.mul(y).umod(l);return this.g.mulAdd(b,e,g)},r.prototype.getKeyRecoveryParam=function(t,e,r,a){if(e=new c(e,a),null!==e.recoveryParam)return e.recoveryParam;for(var n=0;4>n;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":105,"./key":113,"./signature":114,"bn.js":50,"hmac-drbg":157}],113:[function(e,t){"use strict";function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var a=e("bn.js"),n=e("../../elliptic"),s=n.utils,o=s.assert;t.exports=r,r.fromPublic=function(e,t,a){return t instanceof r?t:new r(e,{pub:t,pubEnc:a})},r.fromPrivate=function(e,t,a){return t instanceof r?t:new r(e,{priv:t,privEnc:a})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(e,t){this.priv=new a(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,t){return e.x||e.y?("mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y))):void(this.pub=this.ec.curve.decodePoint(e,t))},r.prototype.derive=function(e){return e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},r.prototype.inspect=function(){return""}},{"../../elliptic":105,"bn.js":50}],114:[function(e,t){"use strict";function r(e,t){return e instanceof r?e:void(this._importDER(e,t)||(p(e.r&&e.s,"Signature without r or s"),this.r=new d(e.r,16),this.s=new d(e.s,16),this.recoveryParam=void 0===e.recoveryParam?null:e.recoveryParam))}function a(){this.place=0}function n(e,t){var r=e[t.place++];if(!(128&r))return r;for(var a=0,n=0,s=t.place;n<(15&r);n++,s++)a<<=8,a|=e[s];return t.place=s,a}function o(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&tt)return void e.push(t);var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(255&t>>>(r<<3));e.push(t)}var d=e("bn.js"),s=e("../../elliptic"),c=s.utils,p=c.assert;t.exports=r,r.prototype._importDER=function(e,t){e=c.toArray(e,t);var o=new a;if(48!==e[o.place++])return!1;var i=n(e,o);if(i+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var p=n(e,o),l=e.slice(o.place,p+o.place);if(o.place+=p,2!==e[o.place++])return!1;var u=n(e,o);if(e.length!==u+o.place)return!1;var f=e.slice(o.place,u+o.place);return 0===l[0]&&128&l[1]&&(l=l.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new d(l),this.s=new d(f),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var t=this.r.toArray(),a=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&a[0]&&(a=[0].concat(a)),t=o(t),a=o(a);!a[0]&&!(128&a[1]);)a=a.slice(1);var n=[2];i(n,t.length),n=n.concat(t),n.push(2),i(n,a.length);var d=n.concat(a),p=[48];return i(p,d.length),p=p.concat(d),c.encode(p,e)}},{"../../elliptic":105,"bn.js":50}],115:[function(e,t){"use strict";function r(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof r))return new r(e);var e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=a.sha512}var a=e("hash.js"),n=e("../../elliptic"),s=n.utils,o=s.assert,i=s.parseBytes,d=e("./key"),p=e("./signature");t.exports=r,r.prototype.sign=function(e,t){e=i(e);var a=this.keyFromSecret(t),n=this.hashInt(a.messagePrefix(),e),r=this.g.mul(n),s=this.encodePoint(r),o=this.hashInt(s,a.pubBytes(),e).mul(a.priv()),d=n.add(o).umod(this.curve.n);return this.makeSignature({R:r,S:d,Rencoded:s})},r.prototype.verify=function(e,t,r){e=i(e),t=this.makeSignature(t);var a=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),a.pubBytes(),e),s=this.g.mul(t.S()),o=t.R().add(a.pub().mul(n));return o.eq(s)},r.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(a>>1)-1?(a>>1)-o:o,n.isubn(s)}else s=0;r.push(s);for(var d=0!==n.cmpn(0)&&0===n.andln(a-1)?t+1:1,p=1;ps;s++)r+="00";if(name=a(e),name)for(var o=name.split("."),s=o.length-1,d;0<=s;s--)d=n(o[s]),r=n(new t(r+d,"hex"));return"0x"+r},r.normalize=a}).call(this,e("buffer").Buffer)},{buffer:83,"idna-uts46-hx":160,"js-sha3":122}],122:[function(e,t){(function(e,r){(function(){"use strict";function a(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var a=0;50>a;++a)this.s[a]=0}var n="object"==typeof window?window:{},s=!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node;s&&(n=r);for(var o=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,d=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],p=[31,7936,2031616,520093696],c=[1,256,65536,16777216],l=[6,1536,393216,100663296],u=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],g=[128,256],h=["hex","buffer","arrayBuffer","array"],m=function(e,t,r){return function(n){return new a(e,t,e).update(n)[r]()}},_=function(e,t,r){return function(n,s){return new a(e,t,s).update(n)[r]()}},v=function(e,t){var r=m(e,t,"hex");r.create=function(){return new a(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0,s;n>2]|=e[d]<c?a[s>>2]|=c<c?(a[s>>2]|=(192|c>>6)<>2]|=(128|63&c)<c||57344<=c?(a[s>>2]|=(224|c>>12)<>2]|=(128|63&c>>6)<>2]|=(128|63&c)<>2]|=(240|c>>18)<>2]|=(128|63&c>>12)<>2]|=(128|63&c>>6)<>2]|=(128|63&c)<=n){for(this.start=s-n,this.block=a[o],s=0;s>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4]+d[15&p]+d[15&p>>12]+d[15&p>>8]+d[15&p>>20]+d[15&p>>16]+d[15&p>>28]+d[15&p>>24];0==s%e&&(M(t),n=0)}return a&&(p=t[n],0>4]+d[15&p]),1>12]+d[15&p>>8]),2>20]+d[15&p>>16])),o},a.prototype.arrayBuffer=function(){this.finalize();var e=this.blockCount,t=this.s,r=this.outputBlocks,a=this.extraBytes,n=0,s=0,o=this.outputBits>>3,d;d=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(o);for(var p=new Uint32Array(d);s>8,o[d+2]=255&p>>16,o[d+3]=255&p>>24;0==s%e&&M(t)}return a&&(d=s<<2,p=t[n],0>8),2>16)),o};var M=function(e){var t,r,a,s,o,i,d,p,c,u,f,b,g,m,_,v,S,w,A,B,x,k,E,T,I,M,C,R,N,P,F,O,j,L,U,D,W,H,q,z,V,G,K,X,Y,Z,J,Q,$,ee,te,re,ae,ne,se,oe,ie,de,pe,ce,le,ue,fe;for(a=0;48>a;a+=2)s=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],d=e[3]^e[13]^e[23]^e[33]^e[43],p=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49],t=b^(i<<1|d>>>31),r=g^(d<<1|i>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=s^(p<<1|c>>>31),r=o^(c<<1|p>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=i^(u<<1|f>>>31),r=d^(f<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=p^(b<<1|g>>>31),r=c^(g<<1|b>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(s<<1|o>>>31),r=f^(o<<1|s>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],_=e[1],Z=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,N=e[21]<<3|e[20]>>>29,ce=e[31]<<9|e[30]>>>23,le=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,S=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,F=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,ne=e[5]<<30|e[4]>>>2,se=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,W=e[15]<<6|e[14]>>>26,w=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,ee=e[34]<<15|e[35]>>>17,te=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,j=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,oe=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,B=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,re=e[47]<<24|e[46]>>>8,ae=e[46]<<24|e[47]>>>8,X=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,M=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,pe=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=m^~v&w,e[1]=_^~S&A,e[10]=T^~M&R,e[11]=I^~C&N,e[20]=L^~D&H,e[21]=U^~W&q,e[30]=X^~Z&Q,e[31]=Y^~J&$,e[40]=ne^~oe&de,e[41]=se^~ie&pe,e[2]=v^~w&B,e[3]=S^~A&x,e[12]=M^~R&P,e[13]=C^~N&F,e[22]=D^~H&z,e[23]=W^~q&V,e[32]=Z^~Q&ee,e[33]=J^~$&te,e[42]=oe^~de&ce,e[43]=ie^~pe&le,e[4]=w^~B&k,e[5]=A^~x&E,e[14]=R^~P&O,e[15]=N^~F&j,e[24]=H^~z&G,e[25]=q^~V&K,e[34]=Q^~ee&re,e[35]=$^~te&ae,e[44]=de^~ce&ue,e[45]=pe^~le&fe,e[6]=B^~k&m,e[7]=x^~E&_,e[16]=P^~O&T,e[17]=F^~j&I,e[26]=z^~G&L,e[27]=V^~K&U,e[36]=ee^~re&X,e[37]=te^~ae&Y,e[46]=ce^~ue&ne,e[47]=le^~fe&se,e[8]=k^~m&v,e[9]=E^~_&S,e[18]=O^~T&M,e[19]=j^~I&C,e[28]=G^~L&D,e[29]=K^~U&W,e[38]=re^~X&Z,e[39]=ae^~Y&J,e[48]=ue^~ne&oe,e[49]=fe^~se&ie,e[0]^=y[a],e[1]^=y[a+1]};if(o)t.exports=A;else for(var x=0;xn?"0":"")+n.toString(16);return t};t.exports={random:function(t){var r;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues)r=window.crypto.getRandomValues(new Uint8Array(t));else if("undefined"!=typeof e)r=e("crypto").randomBytes(t);else throw"Safe random numbers not available.";for(var a="0x",n=0;nt.length?"0"+t:t},r="0x",a=0,n;a!=e.length;a++){if(n=e.charCodeAt(a),128>n){r+=t(n);continue}if(2048>n)r+=t(192|n>>6);else{if(55295n){if(++a==e.length)return null;var s=e.charCodeAt(a);if(56320>s||57343>18),r+=t(128|63&n>>12)}else r+=t(224|n>>12);r+=t(128|63&n>>6)}r+=t(128|63&n)}return r},toString:function(e){for(var t="",a=0,o=s(e);ad){if(a>=o)return null;d=(31&d)<<6|63&n(e,a)}else if(223d){if(a+1>=o)return null;d=(15&d)<<12|(63&n(e,a))<<6|63&n(e,++a)}else if(239d){if(a+2>=o)return null;d=(7&d)<<18|(63&n(e,a))<<12|(63&n(e,++a))<<6|63&n(e,++a)}else return null;++a}if(65535>=d)t+=r(d);else if(1114111>=d)d-=65536,t+=r(55296|d>>10),t+=r(56320|1023&d);else return null}return t},fromNumber:function(e){var t=e.toString(16);return 0==t.length%2?"0x"+t:"0x0"+t},toNumber:function(e){return parseInt(e.slice(2),16)},fromNat:function(e){return"0x0"===e?"0x":0==e.length%2?e:"0x0"+e.slice(2)},toNat:function(e){return"0"===e[2]?"0x"+e.slice(3):e},fromArray:i,toArray:o,fromUint8Array:function(e){return i([].slice.call(e,0))},toUint8Array:function(e){return new Uint8Array(o(e))}}},{"./array.js":123}],125:[function(e,t){var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],a=[1,256,65536,16777216],n=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],s=function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:function(e){return[].concat(e,e,e,e,e)}([0,0,0,0,0,0,0,0,0,0])}},d=function(e,t){for(var o=t.length,d=e.blocks,c=e.blockCount<<2,l=e.blockCount,u=e.outputBlocks,f=e.s,s=0,y,b;s>2]|=t[s]<b?d[y>>2]|=b<b?(d[y>>2]|=(192|b>>6)<>2]|=(128|63&b)<b||57344<=b?(d[y>>2]|=(224|b>>12)<>2]|=(128|63&b>>6)<>2]|=(128|63&b)<>2]|=(240|b>>18)<>2]|=(128|63&b>>12)<>2]|=(128|63&b>>6)<>2]|=(128|63&b)<=c){for(e.start=y-c,e.block=d[l],y=0;y>2]|=a[3&y],e.lastByteIndex===c)for(d[0]=d[l],y=1;y>4]+r[15&m]+r[15&m>>12]+r[15&m>>8]+r[15&m>>20]+r[15&m>>16]+r[15&m>>28]+r[15&m>>24];0==h%l&&(p(f),y=0)}return"0x"+g},p=function(e){var t,r,a,s,i,d,p,c,u,f,y,b,g,m,_,v,S,w,A,B,x,k,E,T,I,M,C,R,N,P,F,O,j,L,U,D,W,H,q,z,V,G,K,X,Y,Z,J,Q,$,ee,te,re,ae,ne,se,oe,ie,de,pe,ce,le,ue,fe;for(a=0;48>a;a+=2)s=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],d=e[2]^e[12]^e[22]^e[32]^e[42],p=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],y=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49],t=b^(d<<1|p>>>31),r=g^(p<<1|d>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=s^(c<<1|u>>>31),r=i^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=d^(f<<1|y>>>31),r=p^(y<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(b<<1|g>>>31),r=u^(g<<1|b>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(s<<1|i>>>31),r=y^(i<<1|s>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],_=e[1],Z=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,N=e[21]<<3|e[20]>>>29,ce=e[31]<<9|e[30]>>>23,le=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,S=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,F=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,ne=e[5]<<30|e[4]>>>2,se=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,W=e[15]<<6|e[14]>>>26,w=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,ee=e[34]<<15|e[35]>>>17,te=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,j=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,oe=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,B=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,re=e[47]<<24|e[46]>>>8,ae=e[46]<<24|e[47]>>>8,X=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,M=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,pe=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=m^~v&w,e[1]=_^~S&A,e[10]=T^~M&R,e[11]=I^~C&N,e[20]=L^~D&H,e[21]=U^~W&q,e[30]=X^~Z&Q,e[31]=Y^~J&$,e[40]=ne^~oe&de,e[41]=se^~ie&pe,e[2]=v^~w&B,e[3]=S^~A&x,e[12]=M^~R&P,e[13]=C^~N&F,e[22]=D^~H&z,e[23]=W^~q&V,e[32]=Z^~Q&ee,e[33]=J^~$&te,e[42]=oe^~de&ce,e[43]=ie^~pe&le,e[4]=w^~B&k,e[5]=A^~x&E,e[14]=R^~P&O,e[15]=N^~F&j,e[24]=H^~z&G,e[25]=q^~V&K,e[34]=Q^~ee&re,e[35]=$^~te&ae,e[44]=de^~ce&ue,e[45]=pe^~le&fe,e[6]=B^~k&m,e[7]=x^~E&_,e[16]=P^~O&T,e[17]=F^~j&I,e[26]=z^~G&L,e[27]=V^~K&U,e[36]=ee^~re&X,e[37]=te^~ae&Y,e[46]=ce^~ue&ne,e[47]=le^~fe&se,e[8]=k^~m&v,e[9]=E^~_&S,e[18]=O^~T&M,e[19]=j^~I&C,e[28]=G^~L&D,e[29]=K^~U&W,e[38]=re^~X&Z,e[39]=ae^~Y&J,e[48]=ue^~ne&oe,e[49]=fe^~se&ie,e[0]^=o[a],e[1]^=o[a+1]},i=function(e){return function(t){var r;if("0x"===t.slice(0,2)){r=[];for(var a=2,n=t.length;a=parseInt(r[2])?t.toNumber():t};var T=/^([^)(]*)\((.*)\)([^)(]*)$/,I=/^[A-Za-z_][A-Za-z0-9_]*$/;r.parseParamType=function(e){return n(e,!0)},r.formatParamType=d,r.formatSignature=function(e){return e.name+"("+e.inputs.map(function(e){return d(e)}).join(",")+")"},r.parseSignature=function(e){if("string"==typeof e)return e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),"event "===e.substring(0,6)?s(e.substring(6).trim()):("function "===e.substring(0,9)&&(e=e.substring(9)),o(e.trim()));throw new Error("unknown signature")};var M=function(){return function(e,t,r,a,n){this.coerceFunc=e,this.name=t,this.type=r,this.localName=a,this.dynamic=n}}(),C=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return A.defineReadOnly(r,"coder",t),r}return h(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(M),R=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return h(t,e),t.prototype.encode=function(){return w.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(M),N=function(e){function t(t,r,a,n){var s=this,o=(a?"int":"uint")+8*r;return s=e.call(this,t,o,o,n,!1)||this,s.size=r,s.signed=a,s}return h(t,e),t.prototype.encode=function(e){try{var t=S.bigNumberify(e);return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),w.padZeros(w.arrayify(t),32)}catch(t){B.throwError("invalid number value",B.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.lengtha;a++)r[a]=t[a].charCodeAt(0);r=p.arrayify(c.keccak256(r));for(var n=0;40>n;n+=2)8<=r[n>>1]>>4&&(t[n]=t[n].toUpperCase()),8<=(15&r[n>>1])&&(t[n+1]=t[n+1].toUpperCase());return"0x"+t.join("")}function n(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach(function(e){t+=y[e]});t.length>=g;){var r=t.substring(0,g);t=parseInt(r,10)%97+t.substring(r.length)}for(var a=98-parseInt(t,10)%97+"";2>a.length;)a="0"+a;return a}function s(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=a(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==n(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new d.default.BN(e.substring(4),36).toString(16);40>t.length;)t="0"+t;t=a("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});for(var d=o(e("bn.js")),p=e("./bytes"),c=e("./keccak256"),l=e("./rlp"),u=e("./errors"),f=9007199254740991,y={},b=0;10>b;b++)y[b+""]=b+"";for(var b=0;26>b;b++)y[String.fromCharCode(65+b)]=10+b+"";var g=Math.floor(function(e){var t=Math.log10;return t?t(e):Math.log(e)/Math.LN10}(f));r.getAddress=s,r.getIcapAddress=function(e){for(var t=new d.default.BN(s(e).substring(2),16).toString(36).toUpperCase();30>t.length;)t="0"+t;return"XE"+n("XE00"+t)+t},r.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return s("0x"+c.keccak256(l.encode([s(e.from),p.stripZeros(p.hexlify(t))])).substring(26))}},{"./bytes":130,"./errors":131,"./keccak256":132,"./rlp":134,"bn.js":50}],129:[function(e,t,r){"use strict";function a(e){var t=e.toString(16);return"-"===t[0]?0==t.length%2?"-0x0"+t.substring(1):"-0x"+t.substring(1):1==t.length%2?"0x0"+t:"0x"+t}function n(e){return i(e)._bn}function s(e){return new g(a(e))}function i(e){return e instanceof g?e:new g(e)}var o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},p=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(r,"__esModule",{value:!0});var c=d(e("bn.js")),l=e("./bytes"),u=e("./properties"),f=e("./types"),y=p(e("./errors")),b=new c.default.BN(-1),g=function(e){function t(r){var s=e.call(this)||this;if(y.checkNew(s,t),"string"==typeof r)l.isHexString(r)?("0x"==r&&(r="0x0"),u.defineReadOnly(s,"_hex",r)):"-"===r[0]&&l.isHexString(r.substring(1))?u.defineReadOnly(s,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),u.defineReadOnly(s,"_hex",a(new c.default.BN(r)))):y.throwError("invalid BigNumber string value",y.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(r+"")!==r&&y.throwError("underflow",y.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(r+"")});try{u.defineReadOnly(s,"_hex",a(new c.default.BN(r)))}catch(e){y.throwError("overflow",y.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else r instanceof t?u.defineReadOnly(s,"_hex",r._hex):r.toHexString?u.defineReadOnly(s,"_hex",a(n(r.toHexString()))):l.isArrayish(r)?u.defineReadOnly(s,"_hex",a(new c.default.BN(l.hexlify(r).substring(2),16))):y.throwError("invalid BigNumber value",y.INVALID_ARGUMENT,{arg:"value",value:r});return s}return o(t,e),Object.defineProperty(t.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new c.default.BN(this._hex.substring(3),16).mul(b):new c.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),t.prototype.fromTwos=function(e){return s(this._bn.fromTwos(e))},t.prototype.toTwos=function(e){return s(this._bn.toTwos(e))},t.prototype.add=function(e){return s(this._bn.add(n(e)))},t.prototype.sub=function(e){return s(this._bn.sub(n(e)))},t.prototype.div=function(e){var t=i(e);return t.isZero()&&y.throwError("division by zero",y.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),s(this._bn.div(n(e)))},t.prototype.mul=function(e){return s(this._bn.mul(n(e)))},t.prototype.mod=function(e){return s(this._bn.mod(n(e)))},t.prototype.pow=function(e){return s(this._bn.pow(n(e)))},t.prototype.maskn=function(e){return s(this._bn.maskn(e))},t.prototype.eq=function(e){return this._bn.eq(n(e))},t.prototype.lt=function(e){return this._bn.lt(n(e))},t.prototype.lte=function(e){return this._bn.lte(n(e))},t.prototype.gt=function(e){return this._bn.gt(n(e))},t.prototype.gte=function(e){return this._bn.gte(n(e))},t.prototype.isZero=function(){return this._bn.isZero()},t.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(e){y.throwError("overflow",y.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},t.prototype.toString=function(){return this._bn.toString(10)},t.prototype.toHexString=function(){return this._hex},t}(f.BigNumber);r.bigNumberify=i,r.ConstantNegativeOne=i(-1),r.ConstantZero=i(0),r.ConstantOne=i(1),r.ConstantTwo=i(2),r.ConstantWeiPerEther=i("1000000000000000000")},{"./bytes":130,"./errors":131,"./properties":133,"./types":135,"bn.js":50}],130:[function(e,t,r){"use strict";function a(e){return!!e._bn}function n(e){return e.slice?e:(e.slice=function(){var t=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(e,t))},e)}function s(e){if(!e||parseInt(e.length+"")!=e.length||"string"==typeof e)return!1;for(var t=0,r;tr||256<=r||parseInt(r+"")!=r)return!1;return!0}function o(e){if(null==e&&f.throwError("cannot convert null value to array",f.INVALID_ARGUMENT,{arg:"value",value:e}),a(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||f.throwError("invalid hexidecimal string",f.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&f.throwError("hex string must have 0x prefix",f.INVALID_ARGUMENT,{arg:"value",value:e}),e=e.substring(2),e.length%2&&(e="0"+e);for(var r=[],o=0;oe&&f.throwError("cannot hexlify negative value",f.INVALID_ARGUMENT,{arg:"value",value:e});for(var t="";e;)t="0123456789abcdef"[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||f.throwError("invalid hexidecimal string",f.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&f.throwError("hex string must have 0x prefix",f.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(s(e)){for(var n=[],o=0,d;o>4]+"0123456789abcdef"[15&d]);return"0x"+n.join("")}return f.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function c(e,t){for(d(e)||f.throwError("invalid hex string",f.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function l(e){return e&&null!=e.r&&null!=e.s}function u(e){var t=0,a="0x",n="0x";if(l(e)){null==e.v&&null==e.recoveryParam&&f.throwError("at least on of recoveryParam or v must be specified",f.INVALID_ARGUMENT,{argument:"signature",value:e}),a=c(e.r,32),n=c(e.s,32),t=e.v,"string"==typeof t&&(t=parseInt(t,16));var i=e.recoveryParam;null==i&&null!=e.v&&(i=1-t%2),t=27+i}else{var d=o(e);if(65!==d.length)throw new Error("invalid signature");a=p(d.slice(0,32)),n=p(d.slice(32,64)),t=d[64],27!==t&&28!==t&&(t=27+t%2)}return{r:a,s:n,recoveryParam:t-27,v:t}}Object.defineProperty(r,"__esModule",{value:!0});var f=e("./errors");r.AddressZero="0x0000000000000000000000000000000000000000",r.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",r.isArrayish=s,r.arrayify=o,r.concat=i,r.stripZeros=function(e){var t=o(e);if(0===t.length)return t;for(var r=0;0===t[r];)r++;return r&&(t=t.slice(r)),t},r.padZeros=function(e,t){if(e=o(e),tt&&a("too many arguments"+n,r.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})},r.setCensorship=n},{}],132:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("js-sha3"),n=e("./bytes");r.keccak256=function(e){return"0x"+a.keccak_256(n.arrayify(e))}},{"./bytes":130,"js-sha3":126}],133:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defineReadOnly=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})},r.defineFrozen=function(e,t,r){var a=JSON.stringify(r);Object.defineProperty(e,t,{enumerable:!0,get:function(){return JSON.parse(a)}})},r.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach(function(a){var n=e[a];n instanceof Promise?r.push(n.then(function(e){return t[a]=e,null})):t[a]=n}),Promise.all(r).then(function(){return t})},r.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t},r.jsonCopy=function(e){return JSON.parse(JSON.stringify(e))}},{}],134:[function(e,t,r){"use strict";function a(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function n(e,t,r){for(var a=0,n=0;n=t.length)return t.unshift(192+t.length),t;var r=a(t.length);return r.unshift(247+r.length),r.concat(t)}var n=Array.prototype.slice.call(d.arrayify(e));if(1===n.length&&127>=n[0])return n;if(55>=n.length)return n.unshift(128+n.length),n;var r=a(n.length);return r.unshift(183+r.length),r.concat(n)}function o(e,t,r,a){for(var n=[],s;rt+1+a)throw new Error("invalid rlp");return{consumed:1+a,result:n}}function i(e,t){if(0===e.length)throw new Error("invalid rlp data");if(248<=e[t]){var r=e[t]-247;if(t+1+r>e.length)throw new Error("too short");var a=n(e,t+1,r);if(t+1+r+a>e.length)throw new Error("to short");return o(e,t,t+1+r,r+a)}if(192<=e[t]){var a=e[t]-192;if(t+1+a>e.length)throw new Error("invalid rlp data");return o(e,t,t+1,a)}if(184<=e[t]){var r=e[t]-183;if(t+1+r>e.length)throw new Error("invalid rlp data");var a=n(e,t+1,r);if(t+1+r+a>e.length)throw new Error("invalid rlp data");var s=d.hexlify(e.slice(t+1+r,t+1+r+a));return{consumed:1+r+a,result:s}}if(128<=e[t]){var a=e[t]-128;if(t+1+a>e.length)throw new Error("invlaid rlp data");var s=d.hexlify(e.slice(t+1,t+1+a));return{consumed:1+a,result:s}}return{consumed:1,result:d.hexlify(e[t])}}Object.defineProperty(r,"__esModule",{value:!0});var d=e("./bytes");r.encode=function(e){return d.hexlify(s(e))},r.decode=function(e){var t=d.arrayify(e),r=i(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":130}],135:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=function(){return function(){}}();r.BigNumber=a;var n=function(){return function(){}}();r.Indexed=n;var s=function(){return function(){}}();r.MinimalProvider=s;var o=function(){return function(){}}();r.Signer=o;var i=function(){return function(){}}();r.HDNode=i},{}],136:[function(e,t,r){"use strict";function a(e,t){void 0===t&&(t=o.current),t!=o.current&&(e=e.normalize(t));for(var r=[],a=0,n=0,d;nd?r[a++]=d:2048>d?(r[a++]=192|d>>6,r[a++]=128|63&d):55296==(64512&d)&&n+1>18,r[a++]=128|63&d>>12,r[a++]=128|63&d>>6,r[a++]=128|63&d):(r[a++]=224|d>>12,r[a++]=128|63&d>>6,r[a++]=128|63&d);return s.arrayify(r)}var n=String.fromCharCode;Object.defineProperty(r,"__esModule",{value:!0});var s=e("./bytes"),o;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(o=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={}));r.toUtf8Bytes=a;r.toUtf8String=function(e){e=s.arrayify(e);for(var t="",r=0;r>7){t+=n(a);continue}if(2!=a>>6){var o=null;if(6==a>>5)o=1;else if(14==a>>4)o=2;else if(30==a>>3)o=3;else if(62==a>>2)o=4;else if(126==a>>1)o=5;else continue;if(r+o>e.length){for(;r>6;r++);if(r!=e.length)continue;return t}var d=a&(1<<8-o-1)-1,p;for(p=0;p>6)break;d=d<<6|63&c}if(p!=o){r--;continue}if(65535>=d){t+=n(d);continue}d-=65536,t+=n((1023&d>>10)+55296,(1023&d)+56320)}}return t}},{"./bytes":130}],137:[function(e,t){"use strict";function r(e){var t=e?e.toLowerCase():"ether",r=d[t];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(d,null,2));return new n(r,10)}function a(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"==typeof e)return e+"";if("object"==typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?e.toPrecision()+"":e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}var n=e("bn.js"),s=e("number-to-bn"),o=new n(0),i=new n(-1),d={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};t.exports={unitMap:d,numberToString:a,getValueOfUnit:r,fromWei:function(e,t,a){var n=s(e),p=n.lt(o),c=r(t),l=d[t].length-1||1,u=a||{};p&&(n=n.mul(i));for(var f=n.mod(c).toString(10);f.lengthp)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;f.length=p?p-49+10:17<=p&&22>=p?p-17+10:15&p;return n}function y(e,t,a,n){for(var s=0,o=d(e.length,a),p=t,l;p>>n}return t}function g(e,t,n){n.negative=t.negative^e.negative;var s=0|e.length+t.length;n.length=s,s=0|s-1;var p=0|e.words[0],c=0|t.words[0],l=p*c,u=67108863&l,f=0|l/67108864;n.words[0]=u;for(var y=1;y>>26,h=67108863&f,m=d(y,t.length-1),_=o(0,y-e.length+1),v;_<=m;_++)v=0|y-_,p=0|e.words[v],c=0|t.words[_],l=p*c+h,g+=0|l/67108864,h=67108863&l;n.words[y]=0|h,f=0|g}return 0===f?n.length--:n.words[y]=0|f,n.strip()}function h(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var s=0,p=0,c=0,l;c>>26),p+=l>>>26,l&=67108863}n.words[c]=u,s=l,l=p}return 0===s?n.length--:n.words[c]=s,n.strip()}function m(e,t,r){var a=new _;return a.mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}function v(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=f._prime(e);this.m=t.p,this.prime=t}else l(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),0!=this.shift%26&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=f:i.BN=f,f.BN=f,f.wordSize=26;var E;try{E=e("buffer").Buffer}catch(t){}f.isBN=function(e){return!!(e instanceof f)||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return 0e.cmp(t)?e:t},f.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),l(t===(0|t)&&2<=t&&36>=t),e=e.toString().replace(/\s+/g,"");var a=0;"-"===e[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip();"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initNumber=function(e,t,r){0>e&&(this.negative=1,e=-e),67108864>e?(this.words=[67108863&e],this.length=1):4503599627370496>e?(this.words=[67108863&e,67108863&e/67108864],this.length=2):(l(9007199254740992>e),this.words=[67108863&e,67108863&e/67108864,1],this.length=3);"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initArray=function(e,t,r){if(l("number"==typeof e.length),0>=e.length)return this.words=[0],this.length=1,this;this.length=s(e.length/3),this.words=Array(this.length);for(var a=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);else if("le"===r)for(a=0,o=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=s((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=6)o=u(e,r,r+6),this.words[n]|=67108863&o<>>26-a,a+=24,26<=a&&(a-=26,n++);r+6!==t&&(o=u(e,t,r+6),this.words[n]|=67108863&o<>>26-a),this.strip()},f.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;67108863>=n;n*=t)a++;a--,n=0|n/t;for(var s=e.length-r,o=s%a,p=d(s,s-o)+r,c=0,l=r;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c);if(0!==o){var u=1;for(c=y(e,l,e.length,t),l=0;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c)}},f.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t"};var T=["","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"],I=[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],M=[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];f.prototype.toString=function(e,t){e=e||10,t=0|t||1;var a;if(16===e||"hex"===e){a="";for(var n=0,s=0,o=0;o>>24-n,a=0!==s||o!=this.length-1?T[6-p.length]+p+a:p+a,n+=2,26<=n&&(n-=26,o--)}for(0!==s&&(a=s.toString(16)+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&2<=e&&36>=e){var u=I[e],f=M[e];a="";var y=this.clone();for(y.negative=0;!y.isZero();){var b=y.modn(f).toString(e);y=y.idivn(f),a=y.isZero()?b+a:T[u-b.length]+b+a}for(this.isZero()&&(a="0"+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}l(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=a&&(n+=7,a>>>=7),8<=a&&(n+=4,a>>>=4),2<=a&&(n+=2,a>>>=2),n+a},f.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,n=0;return 0==(8191&a)&&(n+=13,a>>>=13),0==(127&a)&&(n+=7,a>>>=7),0==(15&a)&&(n+=4,a>>>=4),0==(3&a)&&(n+=2,a>>>=2),0==(1&a)&&n++,n},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0,a;te.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.prototype.iuand=function(e){var t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.prototype.inotn=function(e){l("number"==typeof e&&0<=e);var t=0|s(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.prototype.setn=function(e,t){l("number"==typeof e&&0<=e);var r=0|e/26,a=e%26;return this._expand(r+1),t?this.words[r]|=1<e.length?(n=this,s=e):(n=e,s=this);for(var o=0,d=0;d>>26;for(;0!==o&&d>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},f.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;var s,d;0>26,this.words[c]=67108863&t;for(;0!==p&&c>26,this.words[c]=67108863&t;if(0===p&&c>>13,u=0|s[1],f=8191&u,y=u>>>13,b=0|s[2],g=8191&b,h=b>>>13,m=0|s[3],_=8191&m,v=m>>>13,S=0|s[4],w=8191&S,A=S>>>13,B=0|s[5],x=8191&B,k=B>>>13,E=0|s[6],T=8191&E,I=E>>>13,M=0|s[7],C=8191&M,R=M>>>13,N=0|s[8],P=8191&N,F=N>>>13,O=0|s[9],j=8191&O,L=O>>>13,U=0|a[0],D=8191&U,W=U>>>13,H=0|a[1],q=8191&H,z=H>>>13,V=0|a[2],G=8191&V,K=V>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,$=J>>>13,ee=0|a[5],te=8191&ee,re=ee>>>13,ae=0|a[6],ne=8191&ae,se=ae>>>13,oe=0|a[7],ie=8191&oe,de=oe>>>13,pe=0|a[8],ce=8191&pe,le=pe>>>13,ue=0|a[9],fe=8191&ue,ye=ue>>>13,be,ge,he;r.negative=e.negative^t.negative,r.length=19,be=n(p,D),ge=n(p,W),ge=0|ge+n(l,D),he=n(l,W);var me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(me>>>26),me&=67108863,be=n(f,D),ge=n(f,W),ge=0|ge+n(y,D),he=n(y,W),be=0|be+n(p,q),ge=0|ge+n(p,z),ge=0|ge+n(l,q),he=0|he+n(l,z);var _e=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(_e>>>26),_e&=67108863,be=n(g,D),ge=n(g,W),ge=0|ge+n(h,D),he=n(h,W),be=0|be+n(f,q),ge=0|ge+n(f,z),ge=0|ge+n(y,q),he=0|he+n(y,z),be=0|be+n(p,G),ge=0|ge+n(p,K),ge=0|ge+n(l,G),he=0|he+n(l,K);var ve=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ve>>>26),ve&=67108863,be=n(_,D),ge=n(_,W),ge=0|ge+n(v,D),he=n(v,W),be=0|be+n(g,q),ge=0|ge+n(g,z),ge=0|ge+n(h,q),he=0|he+n(h,z),be=0|be+n(f,G),ge=0|ge+n(f,K),ge=0|ge+n(y,G),he=0|he+n(y,K),be=0|be+n(p,Y),ge=0|ge+n(p,Z),ge=0|ge+n(l,Y),he=0|he+n(l,Z);var Se=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Se>>>26),Se&=67108863,be=n(w,D),ge=n(w,W),ge=0|ge+n(A,D),he=n(A,W),be=0|be+n(_,q),ge=0|ge+n(_,z),ge=0|ge+n(v,q),he=0|he+n(v,z),be=0|be+n(g,G),ge=0|ge+n(g,K),ge=0|ge+n(h,G),he=0|he+n(h,K),be=0|be+n(f,Y),ge=0|ge+n(f,Z),ge=0|ge+n(y,Y),he=0|he+n(y,Z),be=0|be+n(p,Q),ge=0|ge+n(p,$),ge=0|ge+n(l,Q),he=0|he+n(l,$);var we=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(we>>>26),we&=67108863,be=n(x,D),ge=n(x,W),ge=0|ge+n(k,D),he=n(k,W),be=0|be+n(w,q),ge=0|ge+n(w,z),ge=0|ge+n(A,q),he=0|he+n(A,z),be=0|be+n(_,G),ge=0|ge+n(_,K),ge=0|ge+n(v,G),he=0|he+n(v,K),be=0|be+n(g,Y),ge=0|ge+n(g,Z),ge=0|ge+n(h,Y),he=0|he+n(h,Z),be=0|be+n(f,Q),ge=0|ge+n(f,$),ge=0|ge+n(y,Q),he=0|he+n(y,$),be=0|be+n(p,te),ge=0|ge+n(p,re),ge=0|ge+n(l,te),he=0|he+n(l,re);var Ae=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ae>>>26),Ae&=67108863,be=n(T,D),ge=n(T,W),ge=0|ge+n(I,D),he=n(I,W),be=0|be+n(x,q),ge=0|ge+n(x,z),ge=0|ge+n(k,q),he=0|he+n(k,z),be=0|be+n(w,G),ge=0|ge+n(w,K),ge=0|ge+n(A,G),he=0|he+n(A,K),be=0|be+n(_,Y),ge=0|ge+n(_,Z),ge=0|ge+n(v,Y),he=0|he+n(v,Z),be=0|be+n(g,Q),ge=0|ge+n(g,$),ge=0|ge+n(h,Q),he=0|he+n(h,$),be=0|be+n(f,te),ge=0|ge+n(f,re),ge=0|ge+n(y,te),he=0|he+n(y,re),be=0|be+n(p,ne),ge=0|ge+n(p,se),ge=0|ge+n(l,ne),he=0|he+n(l,se);var Be=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Be>>>26),Be&=67108863,be=n(C,D),ge=n(C,W),ge=0|ge+n(R,D),he=n(R,W),be=0|be+n(T,q),ge=0|ge+n(T,z),ge=0|ge+n(I,q),he=0|he+n(I,z),be=0|be+n(x,G),ge=0|ge+n(x,K),ge=0|ge+n(k,G),he=0|he+n(k,K),be=0|be+n(w,Y),ge=0|ge+n(w,Z),ge=0|ge+n(A,Y),he=0|he+n(A,Z),be=0|be+n(_,Q),ge=0|ge+n(_,$),ge=0|ge+n(v,Q),he=0|he+n(v,$),be=0|be+n(g,te),ge=0|ge+n(g,re),ge=0|ge+n(h,te),he=0|he+n(h,re),be=0|be+n(f,ne),ge=0|ge+n(f,se),ge=0|ge+n(y,ne),he=0|he+n(y,se),be=0|be+n(p,ie),ge=0|ge+n(p,de),ge=0|ge+n(l,ie),he=0|he+n(l,de);var xe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(xe>>>26),xe&=67108863,be=n(P,D),ge=n(P,W),ge=0|ge+n(F,D),he=n(F,W),be=0|be+n(C,q),ge=0|ge+n(C,z),ge=0|ge+n(R,q),he=0|he+n(R,z),be=0|be+n(T,G),ge=0|ge+n(T,K),ge=0|ge+n(I,G),he=0|he+n(I,K),be=0|be+n(x,Y),ge=0|ge+n(x,Z),ge=0|ge+n(k,Y),he=0|he+n(k,Z),be=0|be+n(w,Q),ge=0|ge+n(w,$),ge=0|ge+n(A,Q),he=0|he+n(A,$),be=0|be+n(_,te),ge=0|ge+n(_,re),ge=0|ge+n(v,te),he=0|he+n(v,re),be=0|be+n(g,ne),ge=0|ge+n(g,se),ge=0|ge+n(h,ne),he=0|he+n(h,se),be=0|be+n(f,ie),ge=0|ge+n(f,de),ge=0|ge+n(y,ie),he=0|he+n(y,de),be=0|be+n(p,ce),ge=0|ge+n(p,le),ge=0|ge+n(l,ce),he=0|he+n(l,le);var ke=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ke>>>26),ke&=67108863,be=n(j,D),ge=n(j,W),ge=0|ge+n(L,D),he=n(L,W),be=0|be+n(P,q),ge=0|ge+n(P,z),ge=0|ge+n(F,q),he=0|he+n(F,z),be=0|be+n(C,G),ge=0|ge+n(C,K),ge=0|ge+n(R,G),he=0|he+n(R,K),be=0|be+n(T,Y),ge=0|ge+n(T,Z),ge=0|ge+n(I,Y),he=0|he+n(I,Z),be=0|be+n(x,Q),ge=0|ge+n(x,$),ge=0|ge+n(k,Q),he=0|he+n(k,$),be=0|be+n(w,te),ge=0|ge+n(w,re),ge=0|ge+n(A,te),he=0|he+n(A,re),be=0|be+n(_,ne),ge=0|ge+n(_,se),ge=0|ge+n(v,ne),he=0|he+n(v,se),be=0|be+n(g,ie),ge=0|ge+n(g,de),ge=0|ge+n(h,ie),he=0|he+n(h,de),be=0|be+n(f,ce),ge=0|ge+n(f,le),ge=0|ge+n(y,ce),he=0|he+n(y,le),be=0|be+n(p,fe),ge=0|ge+n(p,ye),ge=0|ge+n(l,fe),he=0|he+n(l,ye);var Ee=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ee>>>26),Ee&=67108863,be=n(j,q),ge=n(j,z),ge=0|ge+n(L,q),he=n(L,z),be=0|be+n(P,G),ge=0|ge+n(P,K),ge=0|ge+n(F,G),he=0|he+n(F,K),be=0|be+n(C,Y),ge=0|ge+n(C,Z),ge=0|ge+n(R,Y),he=0|he+n(R,Z),be=0|be+n(T,Q),ge=0|ge+n(T,$),ge=0|ge+n(I,Q),he=0|he+n(I,$),be=0|be+n(x,te),ge=0|ge+n(x,re),ge=0|ge+n(k,te),he=0|he+n(k,re),be=0|be+n(w,ne),ge=0|ge+n(w,se),ge=0|ge+n(A,ne),he=0|he+n(A,se),be=0|be+n(_,ie),ge=0|ge+n(_,de),ge=0|ge+n(v,ie),he=0|he+n(v,de),be=0|be+n(g,ce),ge=0|ge+n(g,le),ge=0|ge+n(h,ce),he=0|he+n(h,le),be=0|be+n(f,fe),ge=0|ge+n(f,ye),ge=0|ge+n(y,fe),he=0|he+n(y,ye);var Te=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Te>>>26),Te&=67108863,be=n(j,G),ge=n(j,K),ge=0|ge+n(L,G),he=n(L,K),be=0|be+n(P,Y),ge=0|ge+n(P,Z),ge=0|ge+n(F,Y),he=0|he+n(F,Z),be=0|be+n(C,Q),ge=0|ge+n(C,$),ge=0|ge+n(R,Q),he=0|he+n(R,$),be=0|be+n(T,te),ge=0|ge+n(T,re),ge=0|ge+n(I,te),he=0|he+n(I,re),be=0|be+n(x,ne),ge=0|ge+n(x,se),ge=0|ge+n(k,ne),he=0|he+n(k,se),be=0|be+n(w,ie),ge=0|ge+n(w,de),ge=0|ge+n(A,ie),he=0|he+n(A,de),be=0|be+n(_,ce),ge=0|ge+n(_,le),ge=0|ge+n(v,ce),he=0|he+n(v,le),be=0|be+n(g,fe),ge=0|ge+n(g,ye),ge=0|ge+n(h,fe),he=0|he+n(h,ye);var Ie=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ie>>>26),Ie&=67108863,be=n(j,Y),ge=n(j,Z),ge=0|ge+n(L,Y),he=n(L,Z),be=0|be+n(P,Q),ge=0|ge+n(P,$),ge=0|ge+n(F,Q),he=0|he+n(F,$),be=0|be+n(C,te),ge=0|ge+n(C,re),ge=0|ge+n(R,te),he=0|he+n(R,re),be=0|be+n(T,ne),ge=0|ge+n(T,se),ge=0|ge+n(I,ne),he=0|he+n(I,se),be=0|be+n(x,ie),ge=0|ge+n(x,de),ge=0|ge+n(k,ie),he=0|he+n(k,de),be=0|be+n(w,ce),ge=0|ge+n(w,le),ge=0|ge+n(A,ce),he=0|he+n(A,le),be=0|be+n(_,fe),ge=0|ge+n(_,ye),ge=0|ge+n(v,fe),he=0|he+n(v,ye);var Me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Me>>>26),Me&=67108863,be=n(j,Q),ge=n(j,$),ge=0|ge+n(L,Q),he=n(L,$),be=0|be+n(P,te),ge=0|ge+n(P,re),ge=0|ge+n(F,te),he=0|he+n(F,re),be=0|be+n(C,ne),ge=0|ge+n(C,se),ge=0|ge+n(R,ne),he=0|he+n(R,se),be=0|be+n(T,ie),ge=0|ge+n(T,de),ge=0|ge+n(I,ie),he=0|he+n(I,de),be=0|be+n(x,ce),ge=0|ge+n(x,le),ge=0|ge+n(k,ce),he=0|he+n(k,le),be=0|be+n(w,fe),ge=0|ge+n(w,ye),ge=0|ge+n(A,fe),he=0|he+n(A,ye);var Ce=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ce>>>26),Ce&=67108863,be=n(j,te),ge=n(j,re),ge=0|ge+n(L,te),he=n(L,re),be=0|be+n(P,ne),ge=0|ge+n(P,se),ge=0|ge+n(F,ne),he=0|he+n(F,se),be=0|be+n(C,ie),ge=0|ge+n(C,de),ge=0|ge+n(R,ie),he=0|he+n(R,de),be=0|be+n(T,ce),ge=0|ge+n(T,le),ge=0|ge+n(I,ce),he=0|he+n(I,le),be=0|be+n(x,fe),ge=0|ge+n(x,ye),ge=0|ge+n(k,fe),he=0|he+n(k,ye);var Re=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Re>>>26),Re&=67108863,be=n(j,ne),ge=n(j,se),ge=0|ge+n(L,ne),he=n(L,se),be=0|be+n(P,ie),ge=0|ge+n(P,de),ge=0|ge+n(F,ie),he=0|he+n(F,de),be=0|be+n(C,ce),ge=0|ge+n(C,le),ge=0|ge+n(R,ce),he=0|he+n(R,le),be=0|be+n(T,fe),ge=0|ge+n(T,ye),ge=0|ge+n(I,fe),he=0|he+n(I,ye);var Ne=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ne>>>26),Ne&=67108863,be=n(j,ie),ge=n(j,de),ge=0|ge+n(L,ie),he=n(L,de),be=0|be+n(P,ce),ge=0|ge+n(P,le),ge=0|ge+n(F,ce),he=0|he+n(F,le),be=0|be+n(C,fe),ge=0|ge+n(C,ye),ge=0|ge+n(R,fe),he=0|he+n(R,ye);var Pe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Pe>>>26),Pe&=67108863,be=n(j,ce),ge=n(j,le),ge=0|ge+n(L,ce),he=n(L,le),be=0|be+n(P,fe),ge=0|ge+n(P,ye),ge=0|ge+n(F,fe),he=0|he+n(F,ye);var Fe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Fe>>>26),Fe&=67108863,be=n(j,fe),ge=n(j,ye),ge=0|ge+n(L,fe),he=n(L,ye);var Oe=0|(0|o+be)+((8191&ge)<<13);return o=0|(0|he+(ge>>>13))+(Oe>>>26),Oe&=67108863,i[0]=me,i[1]=_e,i[2]=ve,i[3]=Se,i[4]=we,i[5]=Ae,i[6]=Be,i[7]=xe,i[8]=ke,i[9]=Ee,i[10]=Te,i[11]=Ie,i[12]=Me,i[13]=Ce,i[14]=Re,i[15]=Ne,i[16]=Pe,i[17]=Fe,i[18]=Oe,0!==o&&(i[19]=o,r.length++),r};n||(C=g),f.prototype.mulTo=function(e,t){var r=this.length+e.length,a;return a=10===this.length&&10===e.length?C(this,e,t):63>r?g(this,e,t):1024>r?h(this,e,t):m(this,e,t),a},_.prototype.makeRBT=function(e){for(var r=Array(e),t=f.prototype._countBits(e)-1,a=0;a>=1;return a},_.prototype.permute=function(e,t,r,a,n,s){for(var o=0;o>>=1)n++;return 1<=a))for(var n=0,s;nn?0:0|n/67108864;return e},_.prototype.convert13b=function(e,t,r,a){for(var n=0,s=0;s>>=13,r[2*s+1]=8191&n,n>>>=13;for(s=2*t;se);for(var t=0,r=0;r>=26,t+=0|a/67108864,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(e){var t=b(e);if(0===t.length)return new f(1);for(var r=this,a=0;a>>26-t<<26-t,o=(0|this.words[a])-s<>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;ar)for(this.length-=r,c=0;c=n);c--){var f=0|this.words[c];this.words[c]=u<<26-p|f>>>p,u=f&(67108863^67108863>>>p<>>t<e),0>e?this.isubn(-e):0===this.negative?this._iaddn(e):1===this.length&&(0|this.words[0])e),0>e)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&0>this.words[0])this.words[0]=-this.words[0],this.negative=1;else for(var t=0;tthis.words[t];t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var a=e.length+r,n;this._expand(a);var s=0,o;for(n=0;n>26)-(0|d/67108864),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(l(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),s=e,o=0|s.words[s.length-1],p=this._countBits(o);r=26-p,0!=r&&(s=s.ushln(r),n.iushln(r),o=0|s.words[s.length-1]);var c=n.length-s.length,l;if("mod"!==t){l=new f(null),l.length=c+1,l.words=Array(l.length);for(var u=0;uthis.length||0>this.cmp(e)?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),"div"!==t&&(n=s.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:s.div,mod:n})},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0===t.div.negative?t.mod:t.mod.isub(e),a=e.ushrn(1),n=e.andln(1),s=r.cmp(a);return 0>s||1===n&&0===s?t.div:0===t.div.negative?t.div.iaddn(1):t.div.isubn(1)},f.prototype.modn=function(e){l(67108863>=e);for(var t=0,r=this.length-1;0<=r;r--)t=(67108864%e*t+(0|this.words[r]))%e;return t},f.prototype.idivn=function(e){l(67108863>=e);for(var t=0,r=this.length-1,a;0<=r;r--)a=(0|this.words[r])+67108864*t,this.words[r]=0|a/e,t=a%e;return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.prototype.egcd=function(e){l(0===e.negative),l(!e.isZero());var t=this,r=e.clone();t=0===t.negative?t.clone():t.umod(e);for(var a=new f(1),n=new f(0),s=new f(0),o=new f(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var p=r.clone(),c=t.clone();!t.isZero();){for(var u=0,y=1;0==(t.words[0]&y)&&26>u;++u,y<<=1);if(0b;++b,h<<=1);if(0d;++d,p<<=1);if(0c;++c,u<<=1);if(0y.cmpn(0)&&y.iadd(e),y},f.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var n=this.clone(),s=e.clone();n.negative=0,s.negative=0;for(var o=0;n.isEven()&&s.isEven();o++)n.iushrn(1),s.iushrn(1);do{for(;n.isEven();)n.iushrn(1);for(;s.isEven();)s.iushrn(1);var i=n.cmp(s);if(0>i){var r=n;n=s,s=r}else if(0===i||0===s.cmpn(1))break;n.isub(s)}while(!0);return s.iushln(o)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.prototype.bincn=function(e){l("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,o&=67108863,this.words[s]=o;return 0!==n&&(this.words[s]=n,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(e){var t=0>e;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(1=e,"Number is too big");var a=0|this.words[0];r=a===e?0:ae.length)return 1;if(this.lengtha&&(t=1);break}}return t},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return 0<=this.cmpn(e)},f.prototype.gte=function(e){return 0<=this.cmp(e)},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return 0>=this.cmpn(e)},f.prototype.lte=function(e){return 0>=this.cmp(e)},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new x(e)},f.prototype.toRed=function(e){return l(!this.red,"Already a number in reduction context"),l(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},f.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return l(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return l(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var R={k256:null,p224:null,p192:null,p25519:null};v.prototype._tmp=function(){var e=new f(null);return e.words=Array(s(this.n/13)),e},v.prototype.ireduce=function(e){var t=e,a;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),a=t.bitLength();while(a>this.n);var n=a=e.length)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(t.words[t.length++]=s&r,n=10;n>>22,s=o}s>>>=22,e.words[n-10]=s,e.length-=0===s&&10>>=26,e.words[r]=n,t=a}return 0!==t&&(e.words[e.length++]=t),e},f._prime=function e(t){if(R[t])return R[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new w;else if("p192"===t)e=new A;else if("p25519"===t)e=new B;else throw new Error("Unknown prime "+t);return R[t]=e,e},x.prototype._verify1=function(e){l(0===e.negative,"red works only with positives"),l(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){l(0==(e.negative|t.negative),"red works only with positives"),l(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(l(1==a%2),3===a){var n=this.m.add(new f(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),d=0;!o.isZero()&&0===o.andln(1);)d++,o.iushrn(1);l(!o.isZero());var p=new f(1).toRed(this),u=p.redNeg(),y=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new f(2*g*g).toRed(this);0!==this.pow(g,y).cmp(u);)g.redIAdd(u);for(var h=this.pow(g,o),_=this.pow(e,o.addn(1).iushrn(1)),v=this.pow(e,o),S=d;0!==v.cmp(p);){for(var w=v,A=0;0!==w.cmp(p);A++)w=w.redSqr();l(A>c,n!==r[0]&&(n=this.sqr(n)),0===l&&0===s){o=0;continue}s<<=1,s|=l,o++,4!==o&&(0!=a||0!=c)||(n=this.mul(n,r[s]),o=0,s=0)}d=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},f.mont=function(e){return new k(e)},c(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),s=n;return 0<=n.cmp(this.m)?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},k.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new f(0)._forceRed(this);var a=e.mul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),s=n;return 0<=n.cmp(this.m)?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})("undefined"==typeof t||t,this)},{}],139:[function(e,t){"use strict";function r(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(){}var n="function"!=typeof Object.create&&"~";a.prototype._events=void 0,a.prototype.listeners=function(e,t){var r=n?n+e:e,a=this._events&&this._events[r];if(t)return!!a;if(!a)return[];if(a.fn)return[a.fn];for(var s=0,o=a.length,d=Array(o);ss)){i.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+i.length+" \""+(t+"\" listeners added. Use emitter.setMaxListeners() to increase limit."));d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=i.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",d.name,d.message)}return e}function l(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=Array(arguments.length),t=0;te||e!==e)throw new TypeError("\"defaultMaxListeners\" must be a positive number");S=e}}):r.defaultMaxListeners=S,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError("\"n\" argument must be a positive number");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(e){var t="error"===e,r,a,o,l,u,f;if(f=this._events,f)t=t&&null==f.error;else if(!t)return!1;if(t){if(1n)return this;0===n?r.shift():b(r,n),1===r.length&&(a[e]=r[0]),a.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.removeAllListeners=function(e){var t,r,a;if(r=this._events,!r)return this;if(!r.removeListener)return 0===arguments.length?(this._events=_(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=_(null):delete r[e]),this;if(0===arguments.length){var n=m(r),s;for(a=0;a=this._blockSize;){for(var o=this._blockOffset;or;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=a},{inherits:162,"safe-buffer":218,stream:229}],145:[function(e,t,r){var a=r;a.utils=e("./hash/utils"),a.common=e("./hash/common"),a.sha=e("./hash/sha"),a.ripemd=e("./hash/ripemd"),a.hmac=e("./hash/hmac"),a.sha1=a.sha.sha1,a.sha256=a.sha.sha256,a.sha224=a.sha.sha224,a.sha384=a.sha.sha384,a.sha512=a.sha.sha512,a.ripemd160=a.ripemd.ripemd160},{"./hash/common":146,"./hash/hmac":147,"./hash/ripemd":148,"./hash/sha":149,"./hash/utils":156}],146:[function(e,t,r){"use strict";function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var n=e("./utils"),s=e("minimalistic-assert");r.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending=this.pending?this.pending.concat(e):e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var a=e.length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-a,this.endian);for(var r=0;r>>24,n[s++]=255&e>>>16,n[s++]=255&e>>>8,n[s++]=255&e}else for(n[s++]=255&e,n[s++]=255&e>>>8,n[s++]=255&e>>>16,n[s++]=255&e>>>24,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,o=8;othis.blockSize&&(e=new this.Hash().update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t=e?t^r^a:31>=e?t&r|~t&a:47>=e?(t|~r)^a:63>=e?t&a|r&~a:t^(r|~a)}function i(e){return 15>=e?0:31>=e?1518500249:47>=e?1859775393:63>=e?2400959708:2840853838}function d(e){return 15>=e?1352829926:31>=e?1548603684:47>=e?1836072691:63>=e?2053994217:0}var p=e("./utils"),c=e("./common"),l=p.rotl32,u=p.sum32,f=p.sum32_3,y=p.sum32_4,b=c.BlockHash;p.inherits(n,b),a.ripemd160=n,n.blockSize=512,n.outSize=160,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var a=this.h[0],n=this.h[1],p=this.h[2],c=this.h[3],b=this.h[4],m=a,_=n,v=p,S=c,w=b,x=0,k;80>x;x++)k=u(l(y(a,o(x,n,p,c),e[g[x]+t],i(x)),h[x]),b),a=b,b=c,c=l(p,10),p=n,n=k,k=u(l(y(m,o(79-x,_,v,S),e[r[x]+t],d(x)),s[x]),w),m=w,w=S,S=l(v,10),v=_,_=k;k=f(this.h[1],p,S),this.h[1]=f(this.h[2],c,w),this.h[2]=f(this.h[3],b,m),this.h[3]=f(this.h[4],a,_),this.h[4]=f(this.h[0],n,v),this.h[0]=k},n.prototype._digest=function(e){return"hex"===e?p.toHex32(this.h,"little"):p.split32(this.h,"little")};var g=[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],r=[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],h=[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],s=[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]},{"./common":146,"./utils":156}],149:[function(e,t,r){"use strict";r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":150,"./sha/224":151,"./sha/256":152,"./sha/384":153,"./sha/512":154}],150:[function(e,t){"use strict";function r(){return this instanceof r?void(i.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)):new r}var a=e("../utils"),n=e("../common"),s=e("./common"),o=a.rotl32,p=a.sum32,l=a.sum32_5,u=s.ft_1,i=n.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];a.inherits(r,i),t.exports=r,r.blockSize=512,r.outSize=160,r.hmacStrength=80,r.padLength=64,r.prototype._update=function(r,n){for(var y=this.W,g=0;16>g;g++)y[g]=r[n+g];for(;gs;s++)n[s]=t[r+s];for(;so&&(o+=4294967296),o}function n(e,t,a,n,s,o){var i=t&n^~t&o;return 0>i&&(i+=4294967296),i}function s(e,t,a,n,s){var o=e&a^e&s^a&s;return 0>o&&(o+=4294967296),o}function o(e,t,a,n,s,o){var i=t&n^t&o^n&o;return 0>i&&(i+=4294967296),i}function d(e,t){var a=m(e,t,28),n=m(t,e,2),s=m(t,e,7),o=a^n^s;return 0>o&&(o+=4294967296),o}function p(e,t){var a=_(e,t,28),n=_(t,e,2),s=_(t,e,7),o=a^n^s;return 0>o&&(o+=4294967296),o}function c(e,t){var a=m(e,t,14),n=m(e,t,18),s=m(t,e,9),o=a^n^s;return 0>o&&(o+=4294967296),o}function l(e,t){var a=_(e,t,14),n=_(e,t,18),s=_(t,e,9),o=a^n^s;return 0>o&&(o+=4294967296),o}function u(e,t){var a=m(e,t,1),n=m(e,t,8),s=v(e,t,7),o=a^n^s;return 0>o&&(o+=4294967296),o}function f(e,t){var a=_(e,t,1),n=_(e,t,8),s=S(e,t,7),o=a^n^s;return 0>o&&(o+=4294967296),o}function y(e,t){var a=m(e,t,19),n=m(t,e,29),s=v(e,t,6),o=a^n^s;return 0>o&&(o+=4294967296),o}function b(e,t){var a=_(e,t,19),n=_(t,e,29),s=S(e,t,6),o=a^n^s;return 0>o&&(o+=4294967296),o}var i=e("../utils"),g=e("../common"),h=e("minimalistic-assert"),m=i.rotr64_hi,_=i.rotr64_lo,v=i.shr64_hi,S=i.shr64_lo,w=i.sum64,A=i.sum64_hi,B=i.sum64_lo,x=i.sum64_4_hi,k=i.sum64_4_lo,E=i.sum64_5_hi,T=i.sum64_5_lo,I=g.BlockHash,M=[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];i.inherits(r,I),t.exports=r,r.blockSize=1024,r.outSize=512,r.hmacStrength=192,r.padLength=128,r.prototype._prepareBlock=function(e,t){for(var r=this.W,a=0;32>a;a++)r[a]=e[t+a];for(;a>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":156}],156:[function(e,t,r){"use strict";function a(e){return(e>>>24|65280&e>>>8|16711680&e<<8|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var o=e("minimalistic-assert"),i=e("inherits");r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(!("string"==typeof e))for(a=0;a>8,o=255&n;s?r.push(s,o):r.push(o)}else if("hex"===t)for(e=e.replace(/[^a-z0-9]+/ig,""),0!=e.length%2&&(e="0"+e),a=0;a>>0}return s},r.split32=function(e,t){for(var r=Array(4*e.length),a=0,n=0,s;a>>24,r[n+1]=255&s>>>16,r[n+2]=255&s>>>8,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=255&s>>>16,r[n+1]=255&s>>>8,r[n]=255&s);return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,a){return e+t+r+a>>>0},r.sum32_5=function(t,r,a,n,s){return t+r+a+n+s>>>0},r.sum64=function(e,t,r,a){var n=e[t],s=e[t+1],o=a+s>>>0,i=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,a){var n=(t+a>>>0>>0},r.sum64_lo=function(e,t,r,a){return t+a>>>0},r.sum64_4_hi=function(e,t,r,a,n,s,o,i){var d=0,p=t;p=p+a>>>0,d+=p>>0,d+=p>>0,d+=p>>0},r.sum64_4_lo=function(e,t,r,a,n,s,o,i){return t+a+s+i>>>0},r.sum64_5_hi=function(e,t,r,a,n,s,o,i,d,p){var c=0,l=t;l=l+a>>>0,c+=l>>0,c+=l>>0,c+=l>>0,c+=l>>0},r.sum64_5_lo=function(e,t,r,a,n,s,o,i,d,p){return t+a+s+i+p>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:162,"minimalistic-assert":170}],157:[function(e,t){"use strict";function r(e){if(!(this instanceof r))return new r(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),a=n.toArray(e.nonce,e.nonceEnc||"hex"),o=n.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,a,o)}var a=e("hash.js"),n=e("minimalistic-crypto-utils"),s=e("minimalistic-assert");t.exports=r,r.prototype._init=function(e,t,r){var a=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},r.prototype.generate=function(e,t,r,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(a=r,r=t,t=null),r&&(r=n.toArray(r,a||"hex"),this._update(r));for(var s=[];s.length\\$%@\u0621\u0624\u0629\"'^|~\u2985\u2986\u30FB\u30A5\u30E3\xA2\xA3\xAC\xA6\xA5\u20A9\u2502\u2190\u2191\u2192\u2193\u25A0\u25CB\uD801\uDC28\uD801\uDC29\uD801\uDC2A\uD801\uDC2B\uD801\uDC2C\uD801\uDC2D\uD801\uDC2E\uD801\uDC2F\uD801\uDC30\uD801\uDC31\uD801\uDC32\uD801\uDC33\uD801\uDC34\uD801\uDC35\uD801\uDC36\uD801\uDC37\uD801\uDC38\uD801\uDC39\uD801\uDC3A\uD801\uDC3B\uD801\uDC3C\uD801\uDC3D\uD801\uDC3E\uD801\uDC3F\uD801\uDC40\uD801\uDC41\uD801\uDC42\uD801\uDC43\uD801\uDC44\uD801\uDC45\uD801\uDC46\uD801\uDC47\uD801\uDC48\uD801\uDC49\uD801\uDC4A\uD801\uDC4B\uD801\uDC4C\uD801\uDC4D\uD801\uDC4E\uD801\uDC4F\uD801\uDCD8\uD801\uDCD9\uD801\uDCDA\uD801\uDCDB\uD801\uDCDC\uD801\uDCDD\uD801\uDCDE\uD801\uDCDF\uD801\uDCE0\uD801\uDCE1\uD801\uDCE2\uD801\uDCE3\uD801\uDCE4\uD801\uDCE5\uD801\uDCE6\uD801\uDCE7\uD801\uDCE8\uD801\uDCE9\uD801\uDCEA\uD801\uDCEB\uD801\uDCEC\uD801\uDCED\uD801\uDCEE\uD801\uDCEF\uD801\uDCF0\uD801\uDCF1\uD801\uDCF2\uD801\uDCF3\uD801\uDCF4\uD801\uDCF5\uD801\uDCF6\uD801\uDCF7\uD801\uDCF8\uD801\uDCF9\uD801\uDCFA\uD801\uDCFB\uD803\uDCC0\uD803\uDCC1\uD803\uDCC2\uD803\uDCC3\uD803\uDCC4\uD803\uDCC5\uD803\uDCC6\uD803\uDCC7\uD803\uDCC8\uD803\uDCC9\uD803\uDCCA\uD803\uDCCB\uD803\uDCCC\uD803\uDCCD\uD803\uDCCE\uD803\uDCCF\uD803\uDCD0\uD803\uDCD1\uD803\uDCD2\uD803\uDCD3\uD803\uDCD4\uD803\uDCD5\uD803\uDCD6\uD803\uDCD7\uD803\uDCD8\uD803\uDCD9\uD803\uDCDA\uD803\uDCDB\uD803\uDCDC\uD803\uDCDD\uD803\uDCDE\uD803\uDCDF\uD803\uDCE0\uD803\uDCE1\uD803\uDCE2\uD803\uDCE3\uD803\uDCE4\uD803\uDCE5\uD803\uDCE6\uD803\uDCE7\uD803\uDCE8\uD803\uDCE9\uD803\uDCEA\uD803\uDCEB\uD803\uDCEC\uD803\uDCED\uD803\uDCEE\uD803\uDCEF\uD803\uDCF0\uD803\uDCF1\uD803\uDCF2\uD806\uDCC0\uD806\uDCC1\uD806\uDCC2\uD806\uDCC3\uD806\uDCC4\uD806\uDCC5\uD806\uDCC6\uD806\uDCC7\uD806\uDCC8\uD806\uDCC9\uD806\uDCCA\uD806\uDCCB\uD806\uDCCC\uD806\uDCCD\uD806\uDCCE\uD806\uDCCF\uD806\uDCD0\uD806\uDCD1\uD806\uDCD2\uD806\uDCD3\uD806\uDCD4\uD806\uDCD5\uD806\uDCD6\uD806\uDCD7\uD806\uDCD8\uD806\uDCD9\uD806\uDCDA\uD806\uDCDB\uD806\uDCDC\uD806\uDCDD\uD806\uDCDE\uD806\uDCDF\u0131\u0237\u2207\u2202\uD83A\uDD22\uD83A\uDD23\uD83A\uDD24\uD83A\uDD25\uD83A\uDD26\uD83A\uDD27\uD83A\uDD28\uD83A\uDD29\uD83A\uDD2A\uD83A\uDD2B\uD83A\uDD2C\uD83A\uDD2D\uD83A\uDD2E\uD83A\uDD2F\uD83A\uDD30\uD83A\uDD31\uD83A\uDD32\uD83A\uDD33\uD83A\uDD34\uD83A\uDD35\uD83A\uDD36\uD83A\uDD37\uD83A\uDD38\uD83A\uDD39\uD83A\uDD3A\uD83A\uDD3B\uD83A\uDD3C\uD83A\uDD3D\uD83A\uDD3E\uD83A\uDD3F\uD83A\uDD40\uD83A\uDD41\uD83A\uDD42\uD83A\uDD43\u066E\u06A1\u066F\u5B57\u53CC\u591A\u89E3\u4EA4\u6620\u7121\u524D\u5F8C\u518D\u65B0\u521D\u7D42\u8CA9\u58F0\u5439\u6F14\u6295\u6355\u904A\u6307\u7981\u7A7A\u5408\u6E80\u7533\u5272\u55B6\u914D\u5F97\u53EF\u4E3D\u4E38\u4E41\uD840\uDD22\u4F60\u4FBB\u5002\u507A\u5099\u50CF\u349E\uD841\uDE3A\u5154\u5164\u5177\uD841\uDD1C\u34B9\u5167\uD841\uDD4B\u5197\u51A4\u4ECC\u51AC\uD864\uDDDF\u5203\u34DF\u523B\u5246\u5277\u3515\u5305\u5306\u5349\u535A\u5373\u537D\u537F\uD842\uDE2C\u7070\u53CA\u53DF\uD842\uDF63\u53EB\u53F1\u5406\u549E\u5438\u5448\u5468\u54A2\u54F6\u5510\u5553\u5563\u5584\u55AB\u55B3\u55C2\u5716\u5717\u5651\u5674\u58EE\u57CE\u57F4\u580D\u578B\u5832\u5831\u58AC\uD845\uDCE4\u58F2\u58F7\u5906\u5922\u5962\uD845\uDEA8\uD845\uDEEA\u59EC\u5A1B\u5A27\u59D8\u5A66\u36EE\u5B08\u5B3E\uD846\uDDC8\u5BC3\u5BD8\u5BF3\uD846\uDF18\u5BFF\u5C06\u3781\u5C60\u5CC0\u5C8D\uD847\uDDE4\u5D43\uD847\uDDE6\u5D6E\u5D6B\u5D7C\u5DE1\u5DE2\u382F\u5DFD\u5E28\u5E3D\u5E69\u3862\uD848\uDD83\u387C\u5EB0\u5EB3\u5EB6\uD868\uDF92\uD848\uDF31\u8201\u5F22\u38C7\uD84C\uDEB8\uD858\uDDDA\u5F62\u5F6B\u38E3\u5F9A\u5FCD\u5FD7\u5FF9\u6081\u393A\u391C\uD849\uDED4\u60C7\u6148\u614C\u617A\u61B2\u61A4\u61AF\u61DE\u621B\u625D\u62B1\u62D4\u6350\uD84A\uDF0C\u633D\u62FC\u6368\u6383\u63E4\uD84A\uDFF1\u6422\u63C5\u63A9\u3A2E\u6469\u647E\u649D\u6477\u3A6C\u656C\uD84C\uDC0A\u65E3\u66F8\u6649\u3B19\u3B08\u3AE4\u5192\u5195\u6700\u669C\u80AD\u43D9\u6721\u675E\u6753\uD84C\uDFC3\u3B49\u67FA\u6785\u6852\uD84D\uDC6D\u688E\u681F\u6914\u6942\u69A3\u69EA\u6AA8\uD84D\uDEA3\u6ADB\u3C18\u6B21\uD84E\uDCA7\u6B54\u3C4E\u6B72\u6B9F\u6BBB\uD84E\uDE8D\uD847\uDD0B\uD84E\uDEFA\u6C4E\uD84F\uDCBC\u6CBF\u6CCD\u6C67\u6D16\u6D3E\u6D69\u6D78\u6D85\uD84F\uDD1E\u6D34\u6E2F\u6E6E\u3D33\u6EC7\uD84F\uDED1\u6DF9\u6F6E\uD84F\uDF5E\uD84F\uDF8E\u6FC6\u7039\u701B\u3D96\u704A\u707D\u7077\u70AD\uD841\uDD25\u7145\uD850\uDE63\u719C\u7228\u7250\uD851\uDE08\u7280\u7295\uD851\uDF35\uD852\uDC14\u737A\u738B\u3EAC\u73A5\u3EB8\u7447\u745C\u7485\u74CA\u3F1B\u7524\uD853\uDC36\u753E\uD853\uDC92\uD848\uDD9F\u7610\uD853\uDFA1\uD853\uDFB8\uD854\uDC44\u3FFC\u4008\uD854\uDCF3\uD854\uDCF2\uD854\uDD19\uD854\uDD33\u771E\u771F\u778B\u4046\u4096\uD855\uDC1D\u784E\u40E3\uD855\uDE26\uD855\uDE9A\uD855\uDEC5\u79EB\u412F\u7A4A\u7A4F\uD856\uDD7C\uD856\uDEA7\u4202\uD856\uDFAB\u7BC6\u7BC9\u4227\uD857\uDC80\u7CD2\u42A0\u7CE8\u7CE3\u7D00\uD857\uDF86\u7D63\u4301\u7DC7\u7E02\u7E45\u4334\uD858\uDE28\uD858\uDE47\u4359\uD858\uDED9\u7F7A\uD858\uDF3E\u7F95\u7FFA\uD859\uDCDA\uD859\uDD23\u8060\uD859\uDDA8\u8070\uD84C\uDF5F\u43D5\u80B2\u8103\u440B\u813E\u5AB5\uD859\uDFA7\uD859\uDFB5\uD84C\uDF93\uD84C\uDF9C\u8204\u8F9E\u446B\u8291\u828B\u829D\u52B3\u82B1\u82B3\u82BD\u82E6\uD85A\uDF3C\u831D\u8363\u83AD\u8323\u83BD\u83E7\u8353\u83CA\u83CC\u83DC\uD85B\uDC36\uD85B\uDD6B\uD85B\uDCD5\u452B\u84F1\u84F3\u8516\uD85C\uDFCA\u8564\uD85B\uDF2C\u455D\u4561\uD85B\uDFB1\uD85C\uDCD2\u456B\u8650\u8667\u8669\u86A9\u8688\u870E\u86E2\u8728\u876B\u8786\u87E1\u8801\u45F9\u8860\uD85D\uDE67\u88D7\u88DE\u4635\u88FA\u34BB\uD85E\uDCAE\uD85E\uDD66\u46BE\u46C7\u8AA0\uD85F\uDCA8\u8CAB\u8CC1\u8D1B\u8D77\uD85F\uDF2F\uD842\uDC04\u8DCB\u8DBC\u8DF0\uD842\uDCDE\u8ED4\uD861\uDDD2\uD861\uDDED\u9094\u90F1\u9111\uD861\uDF2E\u911B\u9238\u92D7\u92D8\u927C\u93F9\u9415\uD862\uDFFA\u958B\u4995\u95B7\uD863\uDD77\u49E6\u96C3\u5DB2\u9723\uD864\uDD45\uD864\uDE1A\u4A6E\u4A76\u97E0\uD865\uDC0A\u4AB2\uD865\uDC96\u9829\uD865\uDDB6\u98E2\u4B33\u9929\u99A7\u99C2\u99FE\u4BCE\uD866\uDF30\u9C40\u9CFD\u4CCE\u4CED\u9D67\uD868\uDCCE\u4CF8\uD868\uDD05\uD868\uDE0E\uD868\uDE91\u4D56\u9EFE\u9F05\u9F0F\u9F16\uD869\uDE00",mapChar:function(r){return 196608<=r?917760<=r&&917999>=r?18874368:0:e[t[r>>4]][15&r]}}})},{}],160:[function(e,t,r){(function(a,n){"function"==typeof define&&define.amd?define(["punycode","./idna-map"],function(e,t){return n(e,t)}):"object"==typeof r?t.exports=n(e("punycode"),e("./idna-map")):a.uts46=n(a.punycode,a.idna_map)})(this,function(e,t){function r(r,a,n){for(var s=[],o=e.ucs2.decode(r),d=0;d>21,f=t.mapStr.substr(65535&l>>5,31&l);if(0===u||a&&1&l>>23)throw new Error("Illegal char "+c);else 1===u?s.push(f):2===u?s.push(n?f:c):3===u&&s.push(c)}var y=s.join("").normalize("NFC");return y}function a(t,a,s){void 0===s&&(s=!1);var o=r(t,s,a),i=o.split(".");return i=i.map(function(t){return t.startsWith("xn--")?(t=e.decode(t.substring(4)),n(t,s,!1)):n(t,s,a),t}),i.join(".")}function n(e,a,n){if("-"===e[2]&&"-"===e[3])throw new Error("Failed to validate "+e);if(e.startsWith("-")||e.endsWith("-"))throw new Error("Failed to validate "+e);if(e.includes("."))throw new Error("Failed to validate "+e);if(r(e,a,n)!==e)throw new Error("Failed to validate "+e);var s=e.codePointAt(0);if(t.mapChar(s)&16777216)throw new Error("Label contains illegal character: "+s)}function s(t,r){r===void 0&&(r={});var n=!("transitional"in r)||r.transitional,s=!!("useStd3ASCII"in r)&&r.useStd3ASCII,o=!!("verifyDnsLength"in r)&&r.verifyDnsLength,d=a(t,n,s).split("."),p=d.map(e.toASCII),c=p.join("."),l;if(o){if(1>c.length||253u.length||63>1,f=-7,y=n?p-1:0,b=n?-1:1,d=t[r+y],g,h;for(y+=b,g=d&(1<<-f)-1,d>>=-f,f+=c;0>=-f,f+=o;0>1,b=23===p?5.960464477539063e-8-6.617444900424222e-24:0,g=o?0:l-1,h=o?1:-1,d=0>r||0===r&&0>1/r?1:0,s,_,v;for(r=Math.abs(r),isNaN(r)||r===1/0?(_=isNaN(r)?1:0,s=f):(s=Math.floor(Math.log(r)/Math.LN2),1>r*(v=a(2,-s))&&(s--,v*=2),r+=1<=s+y?b/v:b*a(2,1-y),2<=r*v&&(s++,v/=2),s+y>=f?(_=0,s=f):1<=s+y?(_=(r*v-1)*a(2,p),s+=y):(_=r*a(2,y-1)*a(2,p),s=0));8<=p;t[n+g]=255&_,g+=h,_/=256,p-=8);for(s=s<>>32-t}function s(e,t,r,a,o,i,d){return 0|n(0|e+(t&r|~t&a)+o+i,d)+t}function o(e,t,r,a,o,i,d){return 0|n(0|e+(t&a|r&~a)+o+i,d)+t}function p(e,t,r,a,o,i,d){return 0|n(0|e+(t^r^a)+o+i,d)+t}function l(e,t,r,a,o,i,d){return 0|n(0|e+(r^(t|~a))+o+i,d)+t}var a=e("inherits"),i=e("hash-base"),d=e("safe-buffer").Buffer,c=Array(16);a(r,i),r.prototype._update=function(){for(var e=c,t=0;16>t;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,u=this._c,f=this._d;r=s(r,n,u,f,e[0],3614090360,7),f=s(f,r,n,u,e[1],3905402710,12),u=s(u,f,r,n,e[2],606105819,17),n=s(n,u,f,r,e[3],3250441966,22),r=s(r,n,u,f,e[4],4118548399,7),f=s(f,r,n,u,e[5],1200080426,12),u=s(u,f,r,n,e[6],2821735955,17),n=s(n,u,f,r,e[7],4249261313,22),r=s(r,n,u,f,e[8],1770035416,7),f=s(f,r,n,u,e[9],2336552879,12),u=s(u,f,r,n,e[10],4294925233,17),n=s(n,u,f,r,e[11],2304563134,22),r=s(r,n,u,f,e[12],1804603682,7),f=s(f,r,n,u,e[13],4254626195,12),u=s(u,f,r,n,e[14],2792965006,17),n=s(n,u,f,r,e[15],1236535329,22),r=o(r,n,u,f,e[1],4129170786,5),f=o(f,r,n,u,e[6],3225465664,9),u=o(u,f,r,n,e[11],643717713,14),n=o(n,u,f,r,e[0],3921069994,20),r=o(r,n,u,f,e[5],3593408605,5),f=o(f,r,n,u,e[10],38016083,9),u=o(u,f,r,n,e[15],3634488961,14),n=o(n,u,f,r,e[4],3889429448,20),r=o(r,n,u,f,e[9],568446438,5),f=o(f,r,n,u,e[14],3275163606,9),u=o(u,f,r,n,e[3],4107603335,14),n=o(n,u,f,r,e[8],1163531501,20),r=o(r,n,u,f,e[13],2850285829,5),f=o(f,r,n,u,e[2],4243563512,9),u=o(u,f,r,n,e[7],1735328473,14),n=o(n,u,f,r,e[12],2368359562,20),r=p(r,n,u,f,e[5],4294588738,4),f=p(f,r,n,u,e[8],2272392833,11),u=p(u,f,r,n,e[11],1839030562,16),n=p(n,u,f,r,e[14],4259657740,23),r=p(r,n,u,f,e[1],2763975236,4),f=p(f,r,n,u,e[4],1272893353,11),u=p(u,f,r,n,e[7],4139469664,16),n=p(n,u,f,r,e[10],3200236656,23),r=p(r,n,u,f,e[13],681279174,4),f=p(f,r,n,u,e[0],3936430074,11),u=p(u,f,r,n,e[3],3572445317,16),n=p(n,u,f,r,e[6],76029189,23),r=p(r,n,u,f,e[9],3654602809,4),f=p(f,r,n,u,e[12],3873151461,11),u=p(u,f,r,n,e[15],530742520,16),n=p(n,u,f,r,e[2],3299628645,23),r=l(r,n,u,f,e[0],4096336452,6),f=l(f,r,n,u,e[7],1126891415,10),u=l(u,f,r,n,e[14],2878612391,15),n=l(n,u,f,r,e[5],4237533241,21),r=l(r,n,u,f,e[12],1700485571,6),f=l(f,r,n,u,e[3],2399980690,10),u=l(u,f,r,n,e[10],4293915773,15),n=l(n,u,f,r,e[1],2240044497,21),r=l(r,n,u,f,e[8],1873313359,6),f=l(f,r,n,u,e[15],4264355552,10),u=l(u,f,r,n,e[6],2734768916,15),n=l(n,u,f,r,e[13],1309151649,21),r=l(r,n,u,f,e[4],4149444226,6),f=l(f,r,n,u,e[11],3174756917,10),u=l(u,f,r,n,e[2],718787259,15),n=l(n,u,f,r,e[9],3951481745,21),this._a=0|this._a+r,this._b=0|this._b+n,this._c=0|this._c+u,this._d=0|this._d+f},r.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;s?r.push(s,o):r.push(o)}return r},s.zero2=a,s.toHex=n,s.encode=function(e,t){return"hex"===t?n(e):e}},{}],172:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{dup:138}],173:[function(e,t){var r=e("bn.js"),a=e("strip-hex-prefix");t.exports=function(e){if("string"==typeof e||"number"==typeof e){var t=new r(1),n=(e+"").toLowerCase().trim(),s="0x"===n.substr(0,2)||"-0x"===n.substr(0,3),o=a(n);if("-"===o.substr(0,1)&&(o=a(o.slice(1)),t=new r(-1,10)),o=""===o?"0":o,!o.match(/^-?[0-9]+$/)&&o.match(/^[0-9A-Fa-f]+$/)||o.match(/^[a-fA-F]+$/)||!0===s&&o.match(/^[0-9A-Fa-f]+$/))return new r(o,16).mul(t);if((o.match(/^-?[0-9]+$/)||""===o)&&!1===s)return new r(o,10).mul(t)}else if("object"==typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new r(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},{"bn.js":172,"strip-hex-prefix":236}],174:[function(e,t){"use strict";function r(e){if(null===e||e===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;10>r;r++)t["_"+String.fromCharCode(r)]=r;var a=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==a.join(""))return!1;var n={};return["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"].forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e){for(var t=r(e),o=1,d,p;o65536&&(r("Max buffer length exceeded: textNode"),e=a(e,$.length)),L.length>65536&&(r("Max buffer length exceeded: numberNode"),e=a(e,L.length)),j=65536-e+K}function r(e){$!==void 0&&(l($),u(),$=void 0),Z=o(e+"\nLn: "+Y+"\nCol: "+X+"\nChr: "+J),f(W(void 0,void 0,Z))}function n(){return H==g?(l({}),u(),void(D=!0)):void((H!==h||0!==G)&&r("Unexpected end"),$!==void 0&&(l($),u(),$=void 0),D=!0)}function s(e){return"\r"==e||"\n"==e||" "==e||"\t"==e}function i(e){if(!Z){if(D)return r("Cannot write after close");var a=0;for(J=e[0];J&&(Q=J,J=e[a++],!!J);)switch(K++,"\n"==J?(Y++,X=0):X++,H){case g:if("{"===J)H=m;else if("["===J)H=v;else if(!s(J))return r("Non-whitespace before {[.");continue;case A:case m:if(s(J))continue;if(H===A)q.push(B);else if("}"===J){l({}),u(),H=q.pop()||h;continue}else q.push(_);if("\""===J)H=w;else return r("Malformed object key should start with \" ");continue;case B:case _:if(s(J))continue;if(":"===J)H===_?(q.push(_),void 0!==$&&(l({}),d($),$=void 0),G++):void 0!==$&&(d($),$=void 0),H=h;else if("}"===J)void 0!==$&&(l($),u(),$=void 0),u(),G--,H=q.pop()||h;else if(","===J)H===_&&q.push(_),void 0!==$&&(l($),u(),$=void 0),H=A;else return r("Bad object");continue;case v:case h:if(s(J))continue;if(H===v)if(l([]),G++,H=h,"]"===J){u(),G--,H=q.pop()||h;continue}else q.push(S);if("\""===J)H=w;else if("{"===J)H=m;else if("["===J)H=v;else if("t"===J)H=x;else if("f"===J)H=T;else if("n"===J)H=R;else if("-"===J)L+=J;else if("0"===J)L+=J,H=O;else if(-1!=="123456789".indexOf(J))L+=J,H=O;else return r("Bad value");continue;case S:if(","===J)q.push(S),void 0!==$&&(l($),u(),$=void 0),H=h;else if("]"===J)void 0!==$&&(l($),u(),$=void 0),u(),G--,H=q.pop()||h;else if(s(J))continue;else return r("Bad array");continue;case w:void 0===$&&($="");var n=a-1;STRING_BIGLOOP:for(;;){for(;0=j&&t()}}var d=e(_e).emit,l=e(ve).emit,u=e(Se).emit,f=e(ue).emit,y=/[\\"\n]/g,b=0,g=b++,h=b++,m=b++,_=b++,v=b++,S=b++,w=b++,A=b++,B=b++,x=b++,k=b++,E=b++,T=b++,I=b++,M=b++,C=b++,R=b++,N=b++,P=b++,F=b++,O=b,j=65536,L="",U=!1,D=!1,H=g,q=[],z=null,V=0,G=0,K=0,X=0,Y=1,Z,J,Q,$;e(ge).on(i),e(he).on(n)}function C(e,t){"use strict";function r(e){return function(t){n=e(n,t)}}var a={},n;for(var s in t)e(s).on(r(t[s]),a);e(ce).on(function(e){var t=$(n),r=ae(t),a=ee(n),s;a&&(s=ne($(a)),s[r]=e)}),e(le).on(function(){var e=$(n),t=ae(e),r=ee(n),a;r&&(a=ne($(r)),delete a[t])}),e(me).on(function(){for(var r in t)e(r).un(a)})}function R(e){var t={};return e&&e.split("\r\n").forEach(function(e){var r=e.indexOf(": ");t[e.substring(0,r)]=e.substring(r+2)}),t}function N(e,t){function r(e){return{"http:":80,"https:":443}[e]}function a(t){return t.port||r(t.protocol||e.protocol)}return!!(t.protocol&&t.protocol!=e.protocol||t.host&&t.host!=e.host||t.host&&a(t)!=a(e))}function P(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,r=t.exec(e)||[];return{protocol:r[1]||"",host:r[2]||"",port:r[3]||""}}function F(){return new XMLHttpRequest}function O(e,t,r,a,s,o,i){"use strict";function d(){var e=t.responseText,r=e.substr(l);r&&p(r),l=Z(e)}var p=e(ge).emit,c=e(ue).emit,l=0,u=!0;e(me).on(function(){t.onreadystatechange=null,t.abort()}),"onprogress"in t&&(t.onprogress=d),t.onreadystatechange=function(){function r(){try{u&&e(be).emit(t.status,R(t.getAllResponseHeaders())),u=!1}catch(t){}}switch(t.readyState){case 2:case 3:return r();case 4:r();var a=2==(t.status+"")[0];a?(d(),e(he).emit()):c(W(t.status,t.responseText));}};try{for(var f in t.open(r,a,!0),o)t.setRequestHeader(f,o[f]);N(n.location,P(a))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=i,t.send(s)}catch(t){n.setTimeout(K(c,W(void 0,void 0,t)),0)}}function j(e,t){return{key:e,node:t}}function L(e){function t(e,t){var r=ne($(e));return h(s,r)?a(e,Z(r),t):e}function r(e,t,r){ne($(e))[t]=r}function a(e,t,a){e&&r(e,t,a);var s=v(j(t,a),e);return n(s),s}var n=e(de).emit,o=e(pe).emit,i=e(ye).emit,d=e(fe).emit,p={};return p[ve]=function(e,n){if(!e)return i(n),a(e,se,n);var s=t(e,n),o=ee(s),d=ae($(s));return r(o,d,n),v(j(d,n),o)},p[Se]=function(e){return o(e),ee(e)||d(ne($(e)))},p[_e]=a,p}function U(e,t,r){function a(e){return function(t){return t.id==e}}var n,s;return{on:function(r,a){var o={listener:r,id:a||r};return t&&t.emit(e,r,o.id),n=v(o,n),s=v(r,s),this},emit:function(){E(s,arguments)},un:function(t){var o;n=x(n,a(t),function(e){o=e}),o&&(s=x(s,function(e){return e==o.listener}),r&&r.emit(e,o.listener,o.id))},listeners:function(){return s},hasListener:function(e){var t=e?a(e):b;return m(I(t,n))}}}function D(){function e(e){return r[e]=U(e,a,n)}function t(t){return r[t]||e(t)}var r={},a=e("newListener"),n=e("removeListener");return["emit","on","un"].forEach(function(e){t[e]=l(function(r,a){c(a,t(r)[e])})}),t}function W(e,t,r){try{var a=i.parse(t)}catch(t){}return{statusCode:e,body:t,jsonBody:a,thrown:r}}function H(e,t){function r(e,t,r){var a=T(r);e(t,w(ee(A(ae,a))),w(A(ne,a)))}function a(t,a,n){var s=e(t).emit;a.on(function(e){var t=n(e);!1!==t&&r(s,ne(t),e)},t),e("removeListener").on(function(r){r!=t||e(r).listeners()||a.un(t)})}var n={node:e(pe),path:e(de)};e("newListener").on(function(e){var r=/(node|path):(.*)/.exec(e);if(r){var s=n[r[1]];s.hasListener(e)||a(e,s,t(r[2]))}})}function q(e,t){function r(t,r){return e(t).on(n(r),r),S}function a(e,t,r){r=r||t;var a=n(t);return e.on(function(){var t=!1;S.forget=function(){t=!0},c(arguments,a),delete S.forget,t&&e.un(r)},r),S}function n(e){return function(){try{return e.apply(S,arguments)}catch(t){setTimeout(function(){throw t})}}}function s(t,r){return e(t+":"+r)}function o(e){return function(){var t=e.apply(this,arguments);m(t)&&(t==G.drop?b():h(t))}}function i(e,t,r){var n;n="node"==e?o(r):r,a(s(e,t),n,r)}function d(e,t){for(var r in t)i(e,r,t[r])}function p(e,t,r){return J(t)?i(e,t,r):d(e,t),S}var u=/^(node|path):./,f=e(fe),b=e(le).emit,h=e(ce).emit,_=l(function(t,r){if(S[t])c(r,S[t]);else{var n=e(t),s=r[0];u.test(t)?a(n,s):n.on(s)}return S}),v=function(t,r,a){if("done"==t)f.un(r);else if("node"==t||"path"==t)e.un(t+":"+r,a);else{e(t).un(r)}return S},S;return e(ye).on(function(e){S.root=g(e)}),e("start").on(function(e,t){S.header=function(e){return e?t[e]:t}}),S={on:_,addListener:_,removeListener:v,emit:e.emit,node:K(p,"node"),path:K(p,"path"),done:K(a,f),start:K(r,"start"),fail:e("fail").on,abort:e(me).emit,header:y,root:y,source:t}}function z(e,t,r,a,n){var s=D();return t&&O(s,F(),e,t,r,a,n),M(s),C(s,L(s)),H(s,oe),q(s,t)}function V(e,t,r,a,n,s,o){return n=n?i.parse(i.stringify(n)):{},a?!J(a)&&(a=i.stringify(a),n["Content-Type"]=n["Content-Type"]||"application/json"):a=null,e(r||"GET",function(e,t){return!1===t&&(e+=-1==e.indexOf("?")?"?":"&",e+="_="+new Date().getTime()),e}(t,o),a,n,s||!1)}function G(e){var t=te("resume","pause","pipe"),r=K(_,t);return e?r(e)||J(e)?V(z,e):V(z,e.url,e.method,e.body,e.headers,e.withCredentials,e.cached):z()}var K=l(function(e,t){var r=t.length;return l(function(a){for(var n=0;na)throw new TypeError("Bad iterations");if("number"!=typeof n)throw new TypeError("Key length not a number");if(0>n||1073741823s?t=n(t):t.length=t.length){s++;break}var o=t.slice(2,n-1);if(("0002"!==a.toString("hex")&&!r||"0001"!==a.toString("hex")&&r)&&s++,8>o.length&&s++,s)throw new Error("decryption error");return t.slice(n)}function n(e,t){e=u.from(e),t=u.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var s=-1;++sc||0<=new i(t).cmp(d.modulus))throw new Error("decryption error");var f=n?l(new i(t),d):p(t,d);var y=u.alloc(c-f.length);if(f=u.concat([y,f],c),4===o)return r(d,f);if(1===o)return a(d,f,n);if(3===o)return f;throw new Error("unknown padding")}},{"./mgf":190,"./withPublic":193,"./xor":194,"bn.js":50,"browserify-rsa":73,"create-hash":89,"parse-asn1":181,"safe-buffer":218}],192:[function(e,t){function r(e,t){var r=e.modulus.byteLength(),a=t.length,n=i("sha1").update(f.alloc(0)).digest(),s=n.length,l=2*s;if(a>r-l-2)throw new Error("message too long");var u=f.alloc(r-a-l-2),y=r-s-1,b=o(s),g=p(f.concat([n,u,f.alloc(1,1),t],y),d(b,y)),h=p(b,d(g,s));return new c(f.concat([f.alloc(1),h,g],r))}function a(e,t,r){var a=t.length,s=e.modulus.byteLength();if(a>s-11)throw new Error("message too long");var o;return o=r?f.alloc(s-a-3,255):n(s-a-3),new c(f.concat([f.from([0,r?1:2]),o,f.alloc(1),t],s))}function n(e){for(var t=f.allocUnsafe(e),r=0,a=o(2*e),n=0,s;rp&&(c=p);for(var l=0;le)throw new TypeError("offset must be a uint32");if(e>l||e>t)throw new RangeError("offset out of range")}function o(e,t,r){if("number"!=typeof e||e!==e)throw new TypeError("size must be a number");if(4294967295e)throw new TypeError("size must be a uint32");if(e+t>r||e>l)throw new RangeError("buffer too small")}function i(e,r,a,n){if(t.browser){var s=e.buffer,o=new Uint8Array(s,r,a);return u.getRandomValues(o),n?void t.nextTick(function(){n(null,e)}):e}if(n)return void p(a,function(t,a){return t?n(t):void(a.copy(e,r),n(null,e))});var i=p(a);return i.copy(e,r),e}var d=e("safe-buffer"),p=e("randombytes"),c=d.Buffer,l=d.kMaxLength,u=a.crypto||a.msCrypto;u&&u.getRandomValues||!t.browser?(r.randomFill=function(e,t,r,n){if(!c.isBuffer(e)&&!(e instanceof a.Uint8Array))throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");if("function"==typeof t)n=t,t=0,r=e.length;else if("function"==typeof r)n=r,r=e.length-t;else if("function"!=typeof n)throw new TypeError("\"cb\" argument must be a function");return s(t,e.length),o(r,t,e.length),i(e,t,r,n)},r.randomFillSync=function(e,t,r){if("undefined"==typeof t&&(t=0),!c.isBuffer(e)&&!(e instanceof a.Uint8Array))throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");return s(t,e.length),void 0===r&&(r=e.length-t),o(r,t,e.length),i(e,t,r)}):(r.randomFill=n,r.randomFillSync=n)}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{_process:80,randombytes:199,"safe-buffer":218}],201:[function(e,t){t.exports=window.crypto},{}],202:[function(e,t){t.exports=e("crypto")},{crypto:201}],203:[function(e,t){t.exports=function(t,r){var a=e("./crypto.js"),n="function"==typeof r;if(65536>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function y(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=f(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function b(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,g(e)}}function g(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(H("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R.nextTick(h,e):h(e))}function h(e){H("emit readable"),e.emit("readable"),B(e)}function m(e,t){t.readingMore||(t.readingMore=!0,R.nextTick(_,e,t))}function _(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=k(e,t.buffer,t.decoder),r}function k(e,t,r){var a;return eo.length?o.length:e;if(s+=i===o.length?o:o.slice(0,e),e-=i,0===e){i===o.length?(++a,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(i));break}++a}return t.length-=a,s}function T(e,t){var r=L.allocUnsafe(e),a=t.head,s=1;for(a.data.copy(r),e-=a.data.length;a=a.next;){var o=a.data,i=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,i),e-=i,0===e){i===o.length?(++s,t.head=a.next?a.next:t.tail=null):(t.head=a,a.data=o.slice(i));break}++s}return t.length-=s,r}function I(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return H("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):g(this),null;if(e=y(e,t),0===e&&t.ended)return 0===t.length&&I(this),null;var a=t.needReadable;H("need readable",a),(0===t.length||t.length-e>>0),r=this.head,n=0;r;)a(r.data,t,n),n+=r.data.length,r=r.next;return t},e}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":218,util:52}],211:[function(e,t){"use strict";function r(e,t){e.emit("error",t)}var a=e("process-nextick-args");t.exports={destroy:function(e,t){var n=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(t?t(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&a.nextTick(r,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(r,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":188}],212:[function(e,t){t.exports=e("events").EventEmitter},{events:140}],213:[function(e,t){t.exports=e("./readable").PassThrough},{"./readable":214}],214:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js"),r.Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":205,"./lib/_stream_passthrough.js":206,"./lib/_stream_readable.js":207,"./lib/_stream_transform.js":208,"./lib/_stream_writable.js":209}],215:[function(e,t){t.exports=e("./readable").Transform},{"./readable":214}],216:[function(e,t){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":209}],217:[function(e,t){"use strict";function r(){l.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function n(e,t){return e<>>32-t}function a(t,r,a,o,i,e,d,p){return 0|n(0|t+(r^a^o)+e+d,p)+i}function s(t,r,a,o,i,e,d,p){return 0|n(0|t+(r&a|~r&o)+e+d,p)+i}function o(t,r,a,o,i,e,d,p){return 0|n(0|t+((r|~a)^o)+e+d,p)+i}function d(t,r,a,o,i,e,d,p){return 0|n(0|t+(r&o|a&~o)+e+d,p)+i}function p(t,r,a,o,i,e,d,p){return 0|n(0|t+(r^(a|~o))+e+d,p)+i}var i=e("buffer").Buffer,c=e("inherits"),l=e("hash-base"),u=Array(16),f=[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],y=[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],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],m=[1352829926,1548603684,1836072691,2053994217,0];c(r,l),r.prototype._update=function(){for(var e=u,r=0;16>r;++r)e[r]=this._block.readInt32LE(4*r);for(var c=0|this._a,l=0|this._b,_=0|this._c,v=0|this._d,S=0|this._e,w=0|this._a,A=0|this._b,B=0|this._c,x=0|this._d,k=0|this._e,E=0;80>E;E+=1){var T,I;16>E?(T=a(c,l,_,v,S,e[f[E]],h[0],b[E]),I=p(w,A,B,x,k,e[y[E]],m[0],g[E])):32>E?(T=s(c,l,_,v,S,e[f[E]],h[1],b[E]),I=d(w,A,B,x,k,e[y[E]],m[1],g[E])):48>E?(T=o(c,l,_,v,S,e[f[E]],h[2],b[E]),I=o(w,A,B,x,k,e[y[E]],m[2],g[E])):64>E?(T=d(c,l,_,v,S,e[f[E]],h[3],b[E]),I=s(w,A,B,x,k,e[y[E]],m[3],g[E])):(T=p(c,l,_,v,S,e[f[E]],h[4],b[E]),I=a(w,A,B,x,k,e[y[E]],m[4],g[E])),c=S,S=v,v=n(_,10),_=l,l=T,w=k,k=x,x=n(B,10),B=A,A=I}var M=0|this._b+_+x;this._b=0|this._c+v+k,this._c=0|this._d+S+w,this._d=0|this._e+c+A,this._e=0|this._a+l+B,this._a=M},r.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>32-t}function y(e){var t;for(t=0;16>t;t++)m[t]=(255&e[4*t+0])<<0,m[t]|=(255&e[4*t+1])<<8,m[t]|=(255&e[4*t+2])<<16,m[t]|=(255&e[4*t+3])<<24;for(n(m,0,_,0,16),t=8;0t;++t)m[t]=_[t]+m[t];for(t=0;16>t;t++){var r=4*t;e[r+0]=255&m[t]>>0,e[r+1]=255&m[t]>>8,e[r+2]=255&m[t]>>16,e[r+3]=255&m[t]>>24}}function b(e,t,r,a,n){for(var s=0;s 0 and a power of 2");if(o>2147483647/128/d)throw Error("Parameter N is too large");if(d>2147483647/128/r)throw Error("Parameter r is too large");var g=new a(256*d),h=new a(128*d*o),m=new Int32Array(16),_=new Int32Array(16),v=new a(64),S=s(e,t,1,128*r*d,"sha256"),w;if(c){var A=2*(r*o),B=0;w=function(){++B,0==B%1e3&&c({current:B,total:A,percent:100*(B/A)})}}for(var x=0;x=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(4294967295>=r)this._block.writeUInt32BE(r,this._blockSize-4);else{var a=(4294967295&r)>>>0;this._block.writeUInt32BE((r-a)/4294967296,this._blockSize-8),this._block.writeUInt32BE(a,this._blockSize-4)}this._update(this._block);var n=this._hash();return e?n.toString(e):n},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":218}],222:[function(e,t,r){var r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":223,"./sha1":224,"./sha224":225,"./sha256":226,"./sha384":227,"./sha512":228}],223:[function(e,t){function r(){this.init(),this._w=c,s.call(this,64,56)}function n(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function i(e,t,r,a){return 0===e?t&r|~t&a:2===e?t&r|t&a|r&a:t^r^a}var a=e("inherits"),s=e("./hash"),d=e("safe-buffer").Buffer,p=[1518500249,1859775393,-1894007588,-899497514],c=Array(80);a(r,s),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(r){for(var l=this._w,u=0|this._a,f=0|this._b,y=0|this._c,g=0|this._d,h=0|this._e,m=0;16>m;++m)l[m]=r.readInt32BE(4*m);for(;80>m;++m)l[m]=l[m-3]^l[m-8]^l[m-14]^l[m-16];for(var _=0;80>_;++_){var v=~~(_/20),s=0|n(u)+i(v,f,y,g)+h+l[_]+p[v];h=g,g=y,y=o(f),f=u,u=s}this._a=0|u+this._a,this._b=0|f+this._b,this._c=0|y+this._c,this._d=0|g+this._d,this._e=0|h+this._e},r.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],224:[function(e,t){function r(){this.init(),this._w=c,d.call(this,64,56)}function a(e){return e<<1|e>>>31}function n(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function i(e,t,r,a){return 0===e?t&r|~t&a:2===e?t&r|t&a|r&a:t^r^a}var s=e("inherits"),d=e("./hash"),p=e("safe-buffer").Buffer,l=[1518500249,1859775393,-1894007588,-899497514],c=Array(80);s(r,d),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(r){for(var p=this._w,u=0|this._a,f=0|this._b,y=0|this._c,g=0|this._d,h=0|this._e,m=0;16>m;++m)p[m]=r.readInt32BE(4*m);for(;80>m;++m)p[m]=a(p[m-3]^p[m-8]^p[m-14]^p[m-16]);for(var _=0;80>_;++_){var v=~~(_/20),s=0|n(u)+i(v,f,y,g)+h+p[_]+l[v];h=g,g=y,y=o(f),f=u,u=s}this._a=0|u+this._a,this._b=0|f+this._b,this._c=0|y+this._c,this._d=0|g+this._d,this._e=0|h+this._e},r.prototype._hash=function(){var e=p.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],225:[function(e,t){function r(){this.init(),this._w=i,s.call(this,64,56)}var a=e("inherits"),n=e("./sha256"),s=e("./hash"),o=e("safe-buffer").Buffer,i=Array(64);a(r,n),r.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},r.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=r},{"./hash":221,"./sha256":226,inherits:162,"safe-buffer":218}],226:[function(e,t){function r(){this.init(),this._w=f,c.call(this,64,56)}function n(e,t,r){return r^e&(t^r)}function s(e,t,r){return e&t|r&(e|t)}function o(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function i(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function a(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function d(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var p=e("inherits"),c=e("./hash"),l=e("safe-buffer").Buffer,u=[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],f=Array(64);p(r,c),r.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},r.prototype._update=function(t){for(var r=this._w,p=0|this._a,l=0|this._b,y=0|this._c,m=0|this._d,_=0|this._e,v=0|this._f,S=0|this._g,w=0|this._h,A=0;16>A;++A)r[A]=t.readInt32BE(4*A);for(;64>A;++A)r[A]=0|d(r[A-2])+r[A-7]+a(r[A-15])+r[A-16];for(var B=0;64>B;++B){var x=0|w+i(_)+n(_,v,S)+u[B]+r[B],k=0|o(p)+s(p,l,y);w=S,S=v,v=_,_=0|m+x,m=y,y=l,l=p,p=0|x+k}this._a=0|p+this._a,this._b=0|l+this._b,this._c=0|y+this._c,this._d=0|m+this._d,this._e=0|_+this._e,this._f=0|v+this._f,this._g=0|S+this._g,this._h=0|w+this._h},r.prototype._hash=function(){var e=l.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],227:[function(e,t){function r(){this.init(),this._w=i,s.call(this,128,112)}var a=e("inherits"),n=e("./sha512"),s=e("./hash"),o=e("safe-buffer").Buffer,i=Array(160);a(r,n),r.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},r.prototype._hash=function(){function e(e,r,a){t.writeInt32BE(e,a),t.writeInt32BE(r,a+4)}var t=o.allocUnsafe(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=r},{"./hash":221,"./sha512":228,inherits:162,"safe-buffer":218}],228:[function(e,t){function r(){this.init(),this._w=g,f.call(this,128,112)}function a(e,t,r){return r^e&(t^r)}function n(e,t,r){return e&t|r&(e|t)}function s(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function o(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function u(e,t){return e>>>0>>0?1:0}var i=e("inherits"),f=e("./hash"),y=e("safe-buffer").Buffer,b=[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],g=Array(160);i(r,f),r.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},r.prototype._update=function(e){for(var t=this._w,r=0|this._ah,f=0|this._bh,y=0|this._ch,g=0|this._dh,h=0|this._eh,m=0|this._fh,_=0|this._gh,v=0|this._hh,S=0|this._al,w=0|this._bl,A=0|this._cl,B=0|this._dl,x=0|this._el,k=0|this._fl,E=0|this._gl,T=0|this._hl,I=0;32>I;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;160>I;I+=2){var M=t[I-30],C=t[I-30+1],R=d(M,C),N=p(C,M);M=t[I-4],C=t[I-4+1];var P=c(M,C),F=l(C,M),O=t[I-14],L=t[I-14+1],U=t[I-32],D=t[I-32+1],W=0|N+L,H=0|R+O+u(W,N);W=0|W+F,H=0|H+P+u(W,F),W=0|W+D,H=0|H+U+u(W,D),t[I]=H,t[I+1]=W}for(var q=0;160>q;q+=2){H=t[q],W=t[q+1];var z=n(r,f,y),V=n(S,w,A),G=s(r,S),K=s(S,r),X=o(h,x),Y=o(x,h),Z=b[q],J=b[q+1],Q=a(h,m,_),$=a(x,k,E),ee=0|T+Y,te=0|v+X+u(ee,T);ee=0|ee+$,te=0|te+Q+u(ee,$),ee=0|ee+J,te=0|te+Z+u(ee,J),ee=0|ee+W,te=0|te+H+u(ee,W);var re=0|K+V,ae=0|G+z+u(re,K);v=_,T=E,_=m,E=k,m=h,k=x,x=0|B+ee,h=0|g+te+u(x,B),g=y,B=A,y=f,A=w,f=r,w=S,S=0|ee+re,r=0|te+ae+u(S,ee)}this._al=0|this._al+S,this._bl=0|this._bl+w,this._cl=0|this._cl+A,this._dl=0|this._dl+B,this._el=0|this._el+x,this._fl=0|this._fl+k,this._gl=0|this._gl+E,this._hl=0|this._hl+T,this._ah=0|this._ah+r+u(this._al,S),this._bh=0|this._bh+f+u(this._bl,w),this._ch=0|this._ch+y+u(this._cl,A),this._dh=0|this._dh+g+u(this._dl,B),this._eh=0|this._eh+h+u(this._el,x),this._fh=0|this._fh+m+u(this._fl,k),this._gh=0|this._gh+_+u(this._gl,E),this._hh=0|this._hh+v+u(this._hl,T)},r.prototype._hash=function(){function e(e,r,a){t.writeInt32BE(e,a),t.writeInt32BE(r,a+4)}var t=y.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],229:[function(e,t){function r(){a.call(this)}t.exports=r;var a=e("events").EventEmitter,n=e("inherits");n(r,a),r.Readable=e("readable-stream/readable.js"),r.Writable=e("readable-stream/writable.js"),r.Duplex=e("readable-stream/duplex.js"),r.Transform=e("readable-stream/transform.js"),r.PassThrough=e("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&p.pause&&p.pause()}function n(){p.readable&&p.resume&&p.resume()}function s(){c||(c=!0,e.end())}function o(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function i(e){if(d(),0===a.listenerCount(this,"error"))throw e}function d(){p.removeListener("data",r),e.removeListener("drain",n),p.removeListener("end",s),p.removeListener("close",o),p.removeListener("error",i),e.removeListener("error",i),p.removeListener("end",d),p.removeListener("close",d),e.removeListener("close",d)}var p=this;p.on("data",r),e.on("drain",n),e._isStdio||t&&!1===t.end||(p.on("end",s),p.on("close",o));var c=!1;return p.on("error",i),e.on("error",i),p.on("end",d),p.on("close",d),e.on("close",d),e.emit("pipe",p),e}},{events:140,inherits:162,"readable-stream/duplex.js":204,"readable-stream/passthrough.js":213,"readable-stream/readable.js":214,"readable-stream/transform.js":215,"readable-stream/writable.js":216}],230:[function(e,t,r){(function(t){var a=e("./lib/request"),n=e("./lib/response"),s=e("xtend"),o=e("builtin-status-codes"),i=e("url"),d=r;d.request=function(e,r){e="string"==typeof e?i.parse(e):s(e);var n=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||n,d=e.hostname||e.host,p=e.port,c=e.path||"/";d&&-1!==d.indexOf(":")&&(d="["+d+"]"),e.url=(d?o+"//"+d:"")+(p?":"+p:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new a(e);return r&&l.on("response",r),l},d.get=function(e,t){var r=d.request(e,t);return r.end(),r},d.ClientRequest=a,d.IncomingMessage=n.IncomingMessage,d.Agent=function(){},d.Agent.defaultMaxSockets=4,d.globalAgent=new d.Agent,d.STATUS_CODES=o,d.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./lib/request":232,"./lib/response":233,"builtin-status-codes":84,url:247,xtend:315}],231:[function(e,t,r){(function(e){function t(){if(i!==void 0)return i;if(e.XMLHttpRequest){i=new e.XMLHttpRequest;try{i.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(t){i=null}}else i=null;return i}function a(e){var r=t();if(!r)return!1;try{return r.responseType=e,r.responseType===e}catch(t){}return!1}function n(e){return"function"==typeof e}r.fetch=n(e.fetch)&&n(e.ReadableStream),r.writableStream=n(e.WritableStream),r.abortController=n(e.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(t){}var s="undefined"!=typeof e.ArrayBuffer,o=s&&n(e.ArrayBuffer.prototype.slice),i;r.arraybuffer=r.fetch||s&&a("arraybuffer"),r.msstream=!r.fetch&&o&&a("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&s&&a("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!t()&&n(t().overrideMimeType),r.vbArray=n(e.VBArray),i=null}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],232:[function(e,t){(function(r,a,n){function s(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":i.vbArray&&e?"text:vbarray":"text"}function o(e){try{var t=e.status;return null!==t&&0!==t}catch(t){return!1}}var i=e("./capability"),d=e("inherits"),p=e("./response"),c=e("readable-stream"),l=e("to-arraybuffer"),u=p.IncomingMessage,f=p.readyStates,y=t.exports=function(e){var t=this;c.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new n(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(r){t.setHeader(r,e.headers[r])});var r=!0,a;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)r=!1,a=!0;else if("prefer-streaming"===e.mode)a=!1;else if("allow-wrong-content-type"===e.mode)a=!i.overrideMimeType;else if(!e.mode||"default"===e.mode||"prefer-fast"===e.mode)a=!0;else throw new Error("Invalid value for opts.mode");t._mode=s(a,r),t._fetchTimer=null,t.on("finish",function(){t._onFinish()})};d(y,c.Writable),y.prototype.setHeader=function(e,t){var r=this,a=e.toLowerCase();-1!==b.indexOf(a)||(r._headers[a]={name:e,value:t})},y.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},y.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},y.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,s=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(i.arraybuffer?o=l(n.concat(e._body)):i.blobConstructor?o=new a.Blob(e._body.map(function(e){return l(e)}),{type:(s["content-type"]||{}).value||""}):o=n.concat(e._body).toString());var d=[];if(Object.keys(s).forEach(function(e){var t=s[e].name,r=s[e].value;Array.isArray(r)?r.forEach(function(e){d.push([t,e])}):d.push([t,r])}),"fetch"===e._mode){var p=null;if(i.abortController){var c=new AbortController;p=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=a.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}a.fetch(e._opts.url,{method:e._opts.method,headers:d,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:p}).then(function(t){e._fetchResponse=t,e._connect()},function(t){a.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var u=e._xhr=new a.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}"responseType"in u&&(u.responseType=e._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(u.timeout=t.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),d.forEach(function(e){u.setRequestHeader(e[0],e[1])}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case f.LOADING:case f.DONE:e._onXHRProgress();}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{u.send(o)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}}}},y.prototype._onXHRProgress=function(){var e=this;!o(e._xhr)||e._destroyed||(!e._response&&e._connect(),e._response._onXHRProgress())},y.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},y.prototype._write=function(e,t,r){var a=this;a._body.push(e),r()},y.prototype.abort=y.prototype.destroy=function(){var e=this;e._destroyed=!0,a.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},y.prototype.end=function(e,t,r){var a=this;"function"==typeof e&&(r=e,e=void 0),c.Writable.prototype.end.call(a,e,t,r)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var b=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("buffer").Buffer)},{"./capability":231,"./response":233,_process:80,buffer:83,inherits:162,"readable-stream":214,"to-arraybuffer":243}],233:[function(e,t,r){(function(t,a,n){var s=e("./capability"),o=e("inherits"),i=e("readable-stream"),d=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},p=r.IncomingMessage=function(e,r,o,d){var p=this;if(i.Readable.call(p),p._mode=o,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",function(){t.nextTick(function(){p.emit("close")})}),"fetch"===o){function e(){l.read().then(function(t){return p._destroyed?void 0:t.done?(a.clearTimeout(d),void p.push(null)):void(p.push(new n(t.value)),e())}).catch(function(e){a.clearTimeout(d),p._destroyed||p.emit("error",e)})}if(p._fetchResponse=r,p.url=r.url,p.statusCode=r.status,p.statusMessage=r.statusText,r.headers.forEach(function(e,t){p.headers[t.toLowerCase()]=e,p.rawHeaders.push(t,e)}),s.writableStream){var c=new WritableStream({write:function(e){return new Promise(function(t,r){p._destroyed?r():p.push(new n(e))?t():p._resumeFetch=t})},close:function(){a.clearTimeout(d),p._destroyed||p.push(null)},abort:function(e){p._destroyed||p.emit("error",e)}});try{return void r.body.pipeTo(c).catch(function(e){a.clearTimeout(d),p._destroyed||p.emit("error",e)})}catch(t){}}var l=r.body.getReader();e()}else{p._xhr=e,p._pos=0,p.url=e.responseURL,p.statusCode=e.status,p.statusMessage=e.statusText;var u=e.getAllResponseHeaders().split(/\r?\n/);if(u.forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===p.headers[r]&&(p.headers[r]=[]),p.headers[r].push(t[2])):void 0===p.headers[r]?p.headers[r]=t[2]:p.headers[r]+=", "+t[2],p.rawHeaders.push(t[1],t[2])}}),p._charset="x-user-defined",!s.overrideMimeType){var f=p.rawHeaders["mime-type"];if(f){var y=f.match(/;\s*charset=([^;])(;|$)/);y&&(p._charset=y[1].toLowerCase())}p._charset||(p._charset="utf-8")}}};o(p,i.Readable),p.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())},p.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==d.DONE)break;try{r=new a.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new n(r));break}case"text":try{r=e.responseText}catch(r){t._mode="text:vbarray";break}if(r.length>t._pos){var s=r.substr(t._pos);if("x-user-defined"===t._charset){for(var o=new n(s.length),p=0;pt._pos&&(t.push(new n(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(r);}t._xhr.readyState===d.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("buffer").Buffer)},{"./capability":231,_process:80,buffer:83,inherits:162,"readable-stream":214}],234:[function(e,t){"use strict";t.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},{}],235:[function(e,t,r){"use strict";function a(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0;}}function n(e){var t=a(e);if("string"!=typeof t&&(g.isEncoding===h||!h(e)))throw new Error("Unknown encoding: "+e);return t||e}function s(e){this.encoding=n(e);var t;switch(this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=p,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=y,void(this.end=b);}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function o(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function d(e,t,r){var a=t.length-1;if(a=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],a.slice(0,-1)}return a}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function y(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}var g=e("safe-buffer").Buffer,h=g.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1;}};r.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,a;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";a=this.lastNeed,this.lastNeed=0}else a=0;return a=r)return n(r,t);for(var s=4096;s*128arguments.length)&&i.call(arguments,1);return d[t]=!0,s(function(){d[t]&&(a?e.apply(null,a):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof a?a:function(e){delete d[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":242,timers:241}],242:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],243:[function(e,t){var r=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(r.isBuffer(e)){for(var t=new Uint8Array(e.length),a=e.length,n=0;narguments.length&&(n=r[o?o[d]:d],d+=e),t(r,a,n,o,d,i)}}function n(e){return function(t,r,a){r=B(r,a);for(var n=T(t),s=0a||null==r)return r;for(var n=1;na&&(a=s)}else t=B(t,r),A.each(e,function(e,r,s){o=t(e,r,s),(o>n||o===-Infinity&&a===-Infinity)&&(a=e,n=o)});return a},A.min=function(e,t,r){var a=1/0,n=1/0,s,o;if(null==t&&null!=e){e=I(e)?e:A.values(e);for(var d=0,p=e.length;da||void 0===r)return 1;if(r=t)throw new Error("bindAll must be passed function names");for(r=1;r=c||c>t?(a&&(clearTimeout(a),a=null),n=p,i=e.apply(s,o),!a&&(s=o=null)):!a&&!1!==r.trailing&&(a=setTimeout(d,c)),i}},A.debounce=function(e,t,r){var a=function(){var p=A.now()-i;p--e)return t.apply(this,arguments)}},A.before=function(e,t){var r;return function(){return 0<--e&&(r=t.apply(this,arguments)),1>=e&&(t=null),r}},A.once=A.partial(A.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),P=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];A.keys=function(e){if(!A.isObject(e))return[];if(m)return m(e);var t=[];for(var r in e)A.has(e,r)&&t.push(r);return N&&i(e,t),t},A.allKeys=function(e){if(!A.isObject(e))return[];var t=[];for(var r in e)t.push(r);return N&&i(e,t),t},A.values=function(e){for(var t=A.keys(e),r=t.length,a=Array(r),n=0;n":">",'"':""","'":"'","`":"`"},j=A.invert(O),L=function(e){var t=function(t){return e[t]},r="(?:"+A.keys(e).join("|")+")",a=RegExp(r),n=RegExp(r,"g");return function(e){return e=null==e?"":""+e,a.test(e)?e.replace(n,t):e}};A.escape=L(O),A.unescape=L(j),A.result=function(e,t,r){var a=null==e?void 0:e[t];return void 0===a&&(a=r),A.isFunction(a)?a.call(e):a};var U=0;A.uniqueId=function(e){var t=++U+"";return e?e+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,W={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,q=function(e){return"\\"+W[e]};A.template=function(e,t,r){!t&&r&&(t=r),t=A.defaults({},t,A.templateSettings);var a=RegExp([(t.escape||D).source,(t.interpolate||D).source,(t.evaluate||D).source].join("|")+"|$","g"),n=0,s="__p+='";e.replace(a,function(t,r,a,o,i){return s+=e.slice(n,i).replace(H,q),n=i+t.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":a?s+="'+\n((__t=("+a+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}var i=function(e){return o.call(this,e,A)},d=t.variable||"obj";return i.source="function("+d+"){\n"+s+"}",i},A.chain=function(e){var t=A(e);return t._chain=!0,t};var z=function(e,t){return e._chain?A(t).chain():t};A.mixin=function(e){A.each(A.functions(e),function(t){var r=A[t]=e[t];A.prototype[t]=function(){var e=[this._wrapped];return f.apply(e,arguments),z(this,r.apply(A,e))}})},A.mixin(A),A.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=c[e];A.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),("shift"===e||"splice"===e)&&0===r.length&&delete r[0],z(this,r)}}),A.each(["concat","join","slice"],function(e){var t=c[e];A.prototype[e]=function(){return z(this,t.apply(this._wrapped,arguments))}}),A.prototype.value=function(){return this._wrapped},A.prototype.valueOf=A.prototype.toJSON=A.prototype.value,A.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return A})}).call(this)},{}],246:[function(e,t){t.exports=function(e,t){if(t){t=t.trim().replace(/^(\?|#|&)/,""),t=t?"?"+t:t;var r=e.split(/[\?\#]/),a=r[0];t&&/\:\/\/[^\/]*$/.test(a)&&(a+="/");var n=e.match(/(\#.*)$/);e=a+t,n&&(e+=n[0])}return e}},{}],247:[function(e,t,r){"use strict";function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function n(e,t,r){if(e&&o.isObject(e)&&e instanceof a)return e;var n=new a;return n.parse(e,t,r),n}var s=e("punycode"),o=e("./util");r.parse=n,r.resolve=function(e,t){return n(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?n(e,!1,!0).resolveObject(t):t},r.format=function(e){return o.isString(e)&&(e=n(e)),e instanceof a?e.format():a.prototype.format.call(e)},r.Url=a;var d=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,p=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">","\"","`"," ","\r","\n","\t"]),u=["'"].concat(c),l=["%","/","?",";","#"].concat(u),f=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("querystring");a.prototype.parse=function(e,t,r){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),n=-1!==a&&ah.length&&h.unshift(""),r.pathname=h.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var S=r.pathname||"",p=r.search||"";r.path=S+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var s=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),A=w||s||r.host&&e.pathname,B=A,x=r.pathname&&r.pathname.split("/")||[],h=e.pathname&&e.pathname.split("/")||[],E=r.protocol&&!_[r.protocol];if(E&&(r.hostname="",r.port=null,r.host&&(""===x[0]?x[0]=r.host:x.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),A=A&&(""===h[0]||""===x[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,x=h;else if(h.length)x||(x=[]),x.pop(),x=x.concat(h),r.search=e.search,r.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(E){r.hostname=r.host=x.shift();var T=!!(r.host&&0=n&&r>>10),n=56320|1023&n),a+=b(n);return a}function o(e){if(55296<=e&&57343>=e)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function i(e,t){return b(128|63&e>>t)}function d(e){if(0==(4294967168&e))return b(e);var t="";return 0==(4294965248&e)?t=b(192|31&e>>6):0==(4294901760&e)?(o(e),t=b(224|15&e>>12),t+=i(e,6)):0==(4292870144&e)&&(t=b(240|7&e>>18),t+=i(e,12),t+=i(e,6)),t+=b(128|63&e),t}function p(){if(_>=m)throw Error("Invalid byte index");var e=255&h[_];if(_++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,t,r,a,n;if(_>m)throw Error("Invalid byte index");if(_==m)return!1;if(e=255&h[_],_++,0==(128&e))return e;if(192==(224&e)){var t=p();if(n=(31&e)<<6|t,128<=n)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if(t=p(),r=p(),n=(15&e)<<12|t<<6|r,2048<=n)return o(n),n;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=p(),r=p(),a=p(),n=(15&e)<<18|t<<12|r<<6|a,65536<=n&&1114111>=n))return n;throw Error("Invalid UTF-8 detected")}function l(e){h=n(e),m=h.length,_=0;for(var t=[],r;!1!==(r=c());)t.push(r);return s(t)}var u="object"==typeof r&&r,f="object"==typeof t&&t&&t.exports==u&&t,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(a=y);var b=String.fromCharCode,g={version:"2.0.0",encode:function(e){for(var t=n(e),r=t.length,a=-1,s="",o;++a=p&&(c.unsubscribe(),u=!0,s._fireError(new Error("Transaction was not mined within"+p+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):y-1>=d&&(c.unsubscribe(),u=!0,s._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))}))},A=function(e){r.isFunction(this.requestManager.provider.on)?S.subscribe("newBlockHeaders",w.bind(null,e,!1)):g=setInterval(w.bind(null,e,!0),1e3)}.bind(this);S.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(0a;a++)r+=7s.v?s.v:1-s.v%2),i="0x"+o.encode("hex",!1).slice(2),p=c(i),l=u("0x"+p.slice(-40));return l},encodeSignature:y,decodeSignature:b}}).call(this,e("buffer").Buffer)},{"./bytes":269,"./hash":270,"./nat":271,"./rlp":272,buffer:83,elliptic:105}],268:[function(e,t,r){arguments[4][123][0].apply(r,arguments)},{dup:123}],269:[function(e,t,r){arguments[4][124][0].apply(r,arguments)},{"./array.js":268,dup:124}],270:[function(e,t,r){arguments[4][125][0].apply(r,arguments)},{dup:125}],271:[function(e,t){var r=e("bn.js"),n=e("./bytes"),s=function(e){return"0x"+e.toString("hex")},o=function(e){return new r(e.slice(2),16)},a=function(e){var t="0x"+("0x"===e.slice(0,2)?new r(e.slice(2),16):new r(e,10)).toString("hex");return"0x0"==t?"0x":t},i=function(e){return"string"==typeof e?/^0x/.test(e)?e:"0x"+e:"0x"+new r(e).toString("hex")},d=function(e){return o(e).toNumber()},p=function(e){return function(t,r){return s(o(t)[e](o(r)))}},c=p("add"),l=p("mul"),u=p("div"),f=p("sub");t.exports={toString:function(e){return o(e).toString(10)},fromString:a,toNumber:d,fromNumber:i,toEther:function(e){return d(u(e,a("10000000000")))/1e8},fromEther:function(e){return l(i(Math.floor(1e8*e)),a("10000000000"))},toUint256:function(e){return n.pad(32,e)},add:c,mul:l,div:u,sub:f}},{"./bytes":269,"bn.js":50}],272:[function(e,t){t.exports={encode:function(e){var t=function(e){return 0==e.length%2?e:"0"+e},r=function(e){return t(e.toString(16))},a=function(e,t){return 56>e?r(t+e):r(t+r(e).length/2+55)+r(e)};return"0x"+function e(t){if("string"==typeof t){var r=t.slice(2),n=2!=r.length||"80"<=r?a(r.length/2,128):"";return n+r}var s=t.map(e).join(""),o=a(s.length/2,192);return o+s}(e)},decode:function(e){var t=2,r=function(){if(t>=e.length)throw"";var r=e.slice(t,t+2);return"80">r?(t+=2,"0x"+r):"c0">r?n():s()},a=function(){var r=parseInt(e.slice(t,t+=2),16)%64;return 56>r?r:parseInt(e.slice(t,t+=2*(r-55)),16)},n=function(){var r=a();return"0x"+e.slice(t,t+=2*r)},s=function(){for(var e=2*a()+t,n=[];te;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=255&t>>>((3&e)<<3);return n}}t.exports=r}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],274:[function(e,t){function r(e,t,r){var a=t&&r||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[a+n++]=p[e])});16>n;)t[a+n++]=0;return t}function a(e,t){var r=t||0,a=d;return a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]}function n(e,t,r){var s=t&&r||0,o=t||[];e=e||{};var d=void 0===e.clockseq?f:e.clockseq,p=void 0===e.msecs?new Date().getTime():e.msecs,c=void 0===e.nsecs?g+1:e.nsecs,l=p-y+(c-g)/1e4;if(0>l&&void 0===e.clockseq&&(d=16383&d+1),(0>l||p>y)&&void 0===e.nsecs&&(c=0),1e4<=c)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");y=p,g=c,f=d,p+=122192928e5;var b=(1e4*(268435455&p)+c)%4294967296;o[s++]=255&b>>>24,o[s++]=255&b>>>16,o[s++]=255&b>>>8,o[s++]=255&b;var h=268435455&1e4*(p/4294967296);o[s++]=255&h>>>8,o[s++]=255&h,o[s++]=16|15&h>>>24,o[s++]=255&h>>>16,o[s++]=128|d>>>8,o[s++]=255&d;for(var m=e.node||u,_=0;6>_;_++)o[s+_]=m[_];return t?t:a(o)}function s(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"==e?Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||o)();if(s[6]=64|15&s[6],s[8]=128|63&s[8],t)for(var i=0;16>i;i++)t[n+i]=s[i];return t||a(s)}for(var o=e("./rng"),d=[],p={},c=0;256>c;c++)d[c]=(c+256).toString(16).substr(1),p[d[c]]=c;var l=o(),u=[1|l[0],l[1],l[2],l[3],l[4],l[5]],f=16383&(l[6]<<8|l[7]),y=0,g=0,b=s;b.v1=n,b.v4=s,b.parse=r,b.unparse=a,t.exports=b},{"./rng":273}],275:[function(e,t){(function(r,a){"use strict";function n(e){this._accounts=e,this.length=0,this.defaultKeyName="web3js_wallet"}var s=e("underscore"),o=e("web3-core"),i=e("web3-core-method"),d=e("any-promise"),p=e("eth-lib/lib/account"),c=e("eth-lib/lib/hash"),l=e("eth-lib/lib/rlp"),u=e("eth-lib/lib/nat"),f=e("eth-lib/lib/bytes"),y="undefined"==typeof r?e("crypto-browserify"):e("crypto"),b=e("scrypt.js"),g=e("uuid"),h=e("web3-utils"),m=e("web3-core-helpers"),_=function(e){return s.isUndefined(e)||s.isNull(e)},v=function(e){for(;e&&e.startsWith("0x0");)e="0x"+e.slice(3);return e},S=function(e){return 1==e.length%2&&(e=e.replace("0x","0x0")),e},w=function(){var e=this;o.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var t=[new i({name:"getId",call:"net_version",params:0,outputFormatter:h.hexToNumber}),new i({name:"getGasPrice",call:"eth_gasPrice",params:0}),new i({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(e){if(h.isAddress(e))return e;throw new Error("Address "+e+" is not a valid address to get the \"transactionCount\".")},function(){return"latest"}]})];this._ethereumCall={},s.each(t,function(t){t.attachToObject(e._ethereumCall),t.setRequestManager(e._requestManager)}),this.wallet=new n(this)};w.prototype._addAccountFunctions=function(e){var t=this;return e.signTransaction=function(r,a){return t.signTransaction(r,e.privateKey,a)},e.sign=function(r){return t.sign(r,e.privateKey)},e.encrypt=function(r,a){return t.encrypt(e.privateKey,r,a)},e},w.prototype.create=function(e){return this._addAccountFunctions(p.create(e||h.randomHex(32)))},w.prototype.privateKeyToAccount=function(e){return this._addAccountFunctions(p.fromPrivate(e))},w.prototype.signTransaction=function(e,t,r){function a(e){if(e.gas||e.gasLimit||(o=new Error("\"gas\" is missing")),(0>e.nonce||0>e.gas||0>e.gasPrice||0>e.chainId)&&(o=new Error("Gas, gasPrice, nonce or chainId is lower than 0")),o)return r(o),d.reject(o);try{e=m.formatters.inputCallFormatter(e);var a=e;a.to=e.to||"0x",a.data=e.data||"0x",a.value=e.value||"0x",a.chainId=h.numberToHex(e.chainId);var n=l.encode([f.fromNat(a.nonce),f.fromNat(a.gasPrice),f.fromNat(a.gas),a.to.toLowerCase(),f.fromNat(a.value),a.data,f.fromNat(a.chainId||"0x1"),"0x","0x"]),s=c.keccak256(n),y=p.makeSigner(2*u.toNumber(a.chainId||"0x1")+35)(c.keccak256(n),t),b=l.decode(n).slice(0,6).concat(p.decodeSignature(y));b[6]=S(v(b[6])),b[7]=S(v(b[7])),b[8]=S(v(b[8]));var g=l.encode(b),_=l.decode(g);i={messageHash:s,v:v(_[6]),r:v(_[7]),s:v(_[8]),rawTransaction:g}}catch(t){return r(t),d.reject(t)}return r(null,i),i}var n=this,o=!1,i;return r=r||function(){},e?void 0!==e.nonce&&void 0!==e.chainId&&void 0!==e.gasPrice?d.resolve(a(e)):d.all([_(e.chainId)?n._ethereumCall.getId():e.chainId,_(e.gasPrice)?n._ethereumCall.getGasPrice():e.gasPrice,_(e.nonce)?n._ethereumCall.getTransactionCount(n.privateKeyToAccount(t).address):e.nonce]).then(function(t){if(_(t[0])||_(t[1])||_(t[2]))throw new Error("One of the values \"chainId\", \"gasPrice\", or \"nonce\" couldn't be fetched: "+JSON.stringify(t));return a(s.extend(e,{chainId:t[0],gasPrice:t[1],nonce:t[2]}))}):(o=new Error("No transaction object given!"),r(o),d.reject(o))},w.prototype.recoverTransaction=function(e){var t=l.decode(e),r=p.encodeSignature(t.slice(6,9)),a=f.toNumber(t[6]),n=35>a?[]:[f.fromNumber(a-35>>1),"0x","0x"],s=t.slice(0,6).concat(n),o=l.encode(s);return p.recover(c.keccak256(o),r)},w.prototype.hashMessage=function(e){var t=h.isHexStrict(e)?h.hexToBytes(e):e,r=a.from(t),n="\x19Ethereum Signed Message:\n"+t.length,s=a.from(n),o=a.concat([s,r]);return c.keccak256s(o)},w.prototype.sign=function(e,t){var r=this.hashMessage(e),a=p.sign(r,t),n=p.decodeSignature(a);return{message:e,messageHash:r,v:n[0],r:n[1],s:n[2],signature:a}},w.prototype.recover=function(e,t,r){var a=[].slice.apply(arguments);return s.isObject(e)?this.recover(e.messageHash,p.encodeSignature([e.v,e.r,e.s]),!0):(r||(e=this.hashMessage(e)),4<=a.length?(r=a.slice(-1)[0],r=!!s.isBoolean(r)&&!!r,this.recover(e,p.encodeSignature(a.slice(1,4)),r)):p.recover(e,t))},w.prototype.decrypt=function(e,t,r){if(!s.isString(t))throw new Error("No password given.");var n=s.isObject(e)?e:JSON.parse(r?e.toLowerCase():e);if(3!==n.version)throw new Error("Not a valid V3 wallet");var o,i;if("scrypt"===n.crypto.kdf)i=n.crypto.kdfparams,o=b(new a(t),new a(i.salt,"hex"),i.n,i.r,i.p,i.dklen);else if("pbkdf2"===n.crypto.kdf){if(i=n.crypto.kdfparams,"hmac-sha256"!==i.prf)throw new Error("Unsupported parameters to PBKDF2");o=y.pbkdf2Sync(new a(t),new a(i.salt,"hex"),i.c,i.dklen,"sha256")}else throw new Error("Unsupported key derivation scheme");var d=new a(n.crypto.ciphertext,"hex"),p=h.sha3(a.concat([o.slice(16,32),d])).replace("0x","");if(p!==n.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var c=y.createDecipheriv(n.crypto.cipher,o.slice(0,16),new a(n.crypto.cipherparams.iv,"hex")),l="0x"+a.concat([c.update(d),c.final()]).toString("hex");return this.privateKeyToAccount(l)},w.prototype.encrypt=function(e,t,r){var n=this.privateKeyToAccount(e);r=r||{};var s=r.salt||y.randomBytes(32),o=r.iv||y.randomBytes(16),i=r.kdf||"scrypt",d={dklen:r.dklen||32,salt:s.toString("hex")},p;if("pbkdf2"===i)d.c=r.c||262144,d.prf="hmac-sha256",p=y.pbkdf2Sync(new a(t),s,d.c,d.dklen,"sha256");else if("scrypt"===i)d.n=r.n||8192,d.r=r.r||8,d.p=r.p||1,p=b(new a(t),s,d.n,d.r,d.p,d.dklen);else throw new Error("Unsupported kdf");var c=y.createCipheriv(r.cipher||"aes-128-ctr",p.slice(0,16),o);if(!c)throw new Error("Unsupported cipher");var l=a.concat([c.update(new a(n.privateKey.replace("0x",""),"hex")),c.final()]),u=h.sha3(a.concat([p.slice(16,32),new a(l,"hex")])).replace("0x","");return{version:3,id:g.v4({random:r.uuid||y.randomBytes(16)}),address:n.address.toLowerCase().replace("0x",""),crypto:{ciphertext:l.toString("hex"),cipherparams:{iv:o.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:i,kdfparams:d,mac:u.toString("hex")}}},n.prototype._findSafeIndex=function(e){return e=e||0,s.has(this,e)?this._findSafeIndex(e+1):e},n.prototype._currentIndexes=function(){var e=Object.keys(this),t=e.map(function(e){return parseInt(e)}).filter(function(e){return 9e20>e});return t},n.prototype.create=function(e,t){for(var r=0;re.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),r.isFunction(t.callback)&&t.callback(null,t._isSyncing,t))},500)):(this._isSyncing=!0,this.emit("changed",t._isSyncing),r.isFunction(this.callback)&&this.callback(null,t._isSyncing,this),setTimeout(function(){t.emit("data",e),r.isFunction(t.callback)&&t.callback(null,e,t)},0))}}}})];x.forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager,e.accounts),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount})};a.addProviders(w),t.exports=w},{"./getNetworkType.js":287,underscore:245,"web3-core":265,"web3-core-helpers":255,"web3-core-method":256,"web3-core-subscriptions":262,"web3-eth-abi":266,"web3-eth-accounts":275,"web3-eth-contract":276,"web3-eth-ens":280,"web3-eth-iban":285,"web3-eth-personal":286,"web3-net":289,"web3-utils":295}],289:[function(e,t){"use strict";var r=e("web3-core"),a=e("web3-core-method"),n=e("web3-utils"),s=function(){var e=this;r.packageInit(this,arguments),[new a({name:"getId",call:"net_version",params:0,outputFormatter:n.hexToNumber}),new a({name:"isListening",call:"net_listening",params:0}),new a({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:n.hexToNumber})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};r.addProviders(s),t.exports=s},{"web3-core":265,"web3-core-method":256,"web3-utils":295}],290:[function(e,t){var r=e("web3-core-helpers").errors,a=e("xhr2-cookies").XMLHttpRequest,n=e("http"),s=e("https"),o=function(e,t){t=t||{};var r=!(!0!==t.keepAlive&&!1===t.keepAlive);this.host=e||"http://localhost:8545","https"===this.host.substring(0,5)?this.httpsAgent=new s.Agent({keepAlive:r}):this.httpAgent=new n.Agent({keepAlive:r}),this.timeout=t.timeout||0,this.headers=t.headers,this.connected=!1};o.prototype._prepareRequest=function(){var e=new a;return e.nodejsSet({httpsAgent:this.httpsAgent,httpAgent:this.httpAgent}),e.open("POST",this.host,!0),e.setRequestHeader("Content-Type","application/json"),e.timeout=this.timeout&&1!==this.timeout?this.timeout:0,e.withCredentials=!0,this.headers&&this.headers.forEach(function(t){e.setRequestHeader(t.name,t.value)}),e},o.prototype.send=function(e,t){var a=this,n=this._prepareRequest();n.onreadystatechange=function(){if(4===n.readyState&&1!==n.timeout){var e=n.responseText,s=null;try{e=JSON.parse(e)}catch(t){s=r.InvalidResponse(n.responseText)}a.connected=!0,t(s,e)}},n.ontimeout=function(){a.connected=!1,t(r.ConnectionTimeout(this.timeout))};try{n.send(JSON.stringify(e))}catch(e){this.connected=!1,t(r.InvalidConnection(this.host))}},o.prototype.disconnect=function(){},t.exports=o},{http:230,https:158,"web3-core-helpers":255,"xhr2-cookies":310}],291:[function(e,t){"use strict";var r=e("underscore"),a=e("web3-core-helpers").errors,n=e("oboe"),s=function(e,t){var a=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=e,this.connected=!1,this.connection=t.connect({path:this.path}),this.addDefaultEvents();var s=function(e){var t=null;r.isArray(e)?e.forEach(function(e){a.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,t||-1===e.method.indexOf("_subscription")?a.responseCallbacks[t]&&(a.responseCallbacks[t](null,e),delete a.responseCallbacks[t]):a.notificationCallbacks.forEach(function(t){r.isFunction(t)&&t(e)})};"Socket"===t.constructor.name?n(this.connection).done(s):this.connection.on("data",function(e){a._parseResponse(e.toString()).forEach(s)})};s.prototype.addDefaultEvents=function(){var e=this;this.connection.on("connect",function(){e.connected=!0}),this.connection.on("close",function(){e.connected=!1}),this.connection.on("error",function(){e._timeout()}),this.connection.on("end",function(){e._timeout()}),this.connection.on("timeout",function(){e._timeout()})},s.prototype._parseResponse=function(e){var t=this,r=[],n=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return n.forEach(function(n){t.lastChunk&&(n=t.lastChunk+n);var e=null;try{e=JSON.parse(n)}catch(r){return t.lastChunk=n,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){throw t._timeout(),a.InvalidResponse(n)},15000))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,e&&r.push(e)}),r},s.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,a=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=a},s.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](a.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},s.prototype.reconnect=function(){this.connection.connect({path:this.path})},s.prototype.send=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},s.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.notificationCallbacks.push(t);break;default:this.connection.on(e,t);}},s.prototype.once=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");this.connection.once(e,t)},s.prototype.removeListener=function(e,t){var r=this;switch(e){case"data":this.notificationCallbacks.forEach(function(e,a){e===t&&r.notificationCallbacks.splice(a,1)});break;default:this.connection.removeListener(e,t);}},s.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(e);}},s.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},t.exports=s},{oboe:175,underscore:245,"web3-core-helpers":255}],292:[function(e,t){(function(r){"use strict";var a=e("underscore"),n=e("web3-core-helpers").errors,s=null,o=null,i=null;if("undefined"!=typeof window&&"undefined"!=typeof window.WebSocket)s=function(e,t){return new window.WebSocket(e,t)},o=btoa,i=function(e){return new URL(e)};else{s=e("websocket").w3cwebsocket,o=function(e){return r(e).toString("base64")};var d=e("url");if(d.URL){var p=d.URL;i=function(e){return new p(e)}}else i=e("url").parse}var c=function(e,t){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],t=t||{},this._customTimeout=t.timeout;var n=i(e),d=t.headers||{},p=t.protocol||void 0;n.username&&n.password&&(d.authorization="Basic "+o(n.username+":"+n.password));var c=t.clientConfig||void 0;n.auth&&(d.authorization="Basic "+o(n.auth)),this.connection=new s(e,p,void 0,d,void 0,c),this.addDefaultEvents(),this.connection.onmessage=function(t){var e="string"==typeof t.data?t.data:"";r._parseResponse(e).forEach(function(e){var t=null;a.isArray(e)?e.forEach(function(e){r.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,!t&&e&&e.method&&-1!==e.method.indexOf("_subscription")?r.notificationCallbacks.forEach(function(t){a.isFunction(t)&&t(e)}):r.responseCallbacks[t]&&(r.responseCallbacks[t](null,e),delete r.responseCallbacks[t])})},Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0})};c.prototype.addDefaultEvents=function(){var e=this;this.connection.onerror=function(){e._timeout()},this.connection.onclose=function(){e._timeout(),e.reset()}},c.prototype._parseResponse=function(e){var t=this,r=[],a=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return a.forEach(function(a){t.lastChunk&&(a=t.lastChunk+a);var e=null;try{e=JSON.parse(a)}catch(r){return t.lastChunk=a,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){throw t._timeout(),n.InvalidResponse(a)},15000))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,e&&r.push(e)}),r},c.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,a=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=a;var s=this;this._customTimeout&&setTimeout(function(){s.responseCallbacks[r]&&(s.responseCallbacks[r](n.ConnectionTimeout(s._customTimeout)),delete s.responseCallbacks[r])},this._customTimeout)},c.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](n.InvalidConnection("on WS")),delete this.responseCallbacks[e])},c.prototype.send=function(e,t){var r=this;return this.connection.readyState===this.connection.CONNECTING?void setTimeout(function(){r.send(e,t)},10):this.connection.readyState===this.connection.OPEN?void(this.connection.send(JSON.stringify(e)),this._addResponseCallback(e,t)):(console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void t(new Error("connection not open")))},c.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");"data"===e?this.notificationCallbacks.push(t):"connect"===e?this.connection.onopen=t:"end"===e?this.connection.onclose=t:"error"===e?this.connection.onerror=t:void 0},c.prototype.removeListener=function(e,t){var r=this;"data"===e?this.notificationCallbacks.forEach(function(e,a){e===t&&r.notificationCallbacks.splice(a,1)}):void 0},c.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null;break;default:}},c.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},c.prototype.disconnect=function(){this.connection&&this.connection.close()},t.exports=c}).call(this,e("buffer").Buffer)},{buffer:83,underscore:245,url:247,"web3-core-helpers":255,websocket:300}],293:[function(e,t){"use strict";var r=e("web3-core"),a=e("web3-core-subscriptions").subscriptions,n=e("web3-core-method"),s=e("web3-net"),o=function(){var e=this;r.packageInit(this,arguments);var t=this.setProvider;this.setProvider=function(){t.apply(e,arguments),e.net.setProvider.apply(e,arguments)},this.net=new s(this.currentProvider),[new a({name:"subscribe",type:"shh",subscriptions:{messages:{params:1}}}),new n({name:"getVersion",call:"shh_version",params:0}),new n({name:"getInfo",call:"shh_info",params:0}),new n({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new n({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new n({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new n({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new n({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new n({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new n({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new n({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new n({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new n({name:"newSymKey",call:"shh_newSymKey",params:0}),new n({name:"addSymKey",call:"shh_addSymKey",params:1}),new n({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new n({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new n({name:"getSymKey",call:"shh_getSymKey",params:1}),new n({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new n({name:"newMessageFilter",call:"shh_newMessageFilter",params:1}),new n({name:"getFilterMessages",call:"shh_getFilterMessages",params:1}),new n({name:"deleteMessageFilter",call:"shh_deleteMessageFilter",params:1}),new n({name:"post",call:"shh_post",params:1,inputFormatter:[null]}),new n({name:"unsubscribe",call:"shh_unsubscribe",params:1})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};o.prototype.clearSubscriptions=function(){this._requestManager.clearSubscriptions()},r.addProviders(o),t.exports=o},{"web3-core":265,"web3-core-method":256,"web3-core-subscriptions":262,"web3-net":289}],294:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{dup:138}],295:[function(e,t){var r=e("underscore"),a=e("ethjs-unit"),n=e("./utils.js"),s=e("./soliditySha3.js"),o=e("randomhex"),i=function(e,t){var a=[];return t.forEach(function(t){if("object"==typeof t.components){if("tuple"!==t.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var n="",s=t.type.indexOf("[");0<=s&&(n=t.type.substring(s));var o=i(e,t.components);r.isArray(o)&&e?a.push("tuple("+o.join(",")+")"+n):e?a.push("("+o+")"):a.push("("+o.join(",")+")"+n)}else a.push(t.type)}),a},d=function(e){if(!n.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);rs.length?"0"+s:s}return"0x"+t},c=function(e){if(e=e?e.toLowerCase():"ether",!a.unitMap[e])throw new Error("This unit \""+e+"\" doesn't exist, please use the one of the following units"+JSON.stringify(a.unitMap,null,2));return e};t.exports={_fireError:function(e,t,a,n){return r.isObject(e)&&!(e instanceof Error)&&e.data&&((r.isObject(e.data)||r.isArray(e.data))&&(e.data=JSON.stringify(e.data,null,2)),e=e.message+"\n"+e.data),r.isString(e)&&(e=new Error(e)),r.isFunction(n)&&n(e),r.isFunction(a)&&((t&&r.isFunction(t.listeners)&&t.listeners("error").length||r.isFunction(n))&&t.catch(function(){}),setTimeout(function(){a(e)},1)),t&&r.isFunction(t.emit)&&setTimeout(function(){t.emit("error",e),t.removeAllListeners()},1),t},_jsonInterfaceMethodToString:function(e){return r.isObject(e)&&e.name&&-1!==e.name.indexOf("(")?e.name:e.name+"("+i(!1,e.inputs).join(",")+")"},_flattenTypes:i,randomHex:o,_:r,BN:n.BN,isBN:n.isBN,isBigNumber:n.isBigNumber,isHex:n.isHex,isHexStrict:n.isHexStrict,sha3:n.sha3,keccak256:n.sha3,soliditySha3:s,isAddress:n.isAddress,checkAddressChecksum:n.checkAddressChecksum,toChecksumAddress:function(e){if("undefined"==typeof e)return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error("Given address \""+e+"\" is not a valid Ethereum address.");e=e.toLowerCase().replace(/^0x/i,"");for(var t=n.sha3(e).replace(/^0x/i,""),r="0x",a=0;ai||32i||256i)throw new Error("Supplied uint exceeds width: "+i+" vs "+p.bitLength());if(p.lt(new a(0)))throw new Error("Supplied uint "+p.toString()+" is negative");return i?n.leftPad(p.toString("hex"),2*(i/8)):p}if(e.startsWith("int")){if(i%8||8>i||256i)throw new Error("Supplied int exceeds width: "+i+" vs "+p.bitLength());return p.lt(new a(0))?p.toTwos(i).toString("hex"):i?n.leftPad(p.toString("hex"),2*(i/8)):p}throw new Error("Unsupported or invalid type: "+e)},c=function(e){if(r.isArray(e))throw new Error("Autodetection of array types is not supported.");var t="",s,o,d;if(r.isObject(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(s=e.hasOwnProperty("t")?e.t:e.type,t=e.hasOwnProperty("v")?e.v:e.value):(s=n.toHex(e,!0),t=n.toHex(e),!s.startsWith("int")&&!s.startsWith("uint")&&(s="bytes")),(s.startsWith("int")||s.startsWith("uint"))&&"string"==typeof t&&!/^(-)?0x/i.test(t)&&(t=new a(t)),r.isArray(t))if(d=i(s),d&&t.length!==d)throw new Error(s+" is not matching the given array "+JSON.stringify(t));else d=t.length;return r.isArray(t)?(o=t.map(function(e){return p(s,e,d).toString("hex").replace("0x","")}),o.join("")):(o=p(s,t,d),o.toString("hex").replace("0x",""))};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=r.map(e,c);return n.sha3("0x"+t.join(""))}},{"./utils.js":297,"bn.js":294,underscore:245}],297:[function(e,t){var r=e("underscore"),a=e("bn.js"),n=e("number-to-bn"),s=e("utf8"),o=e("eth-lib/lib/hash"),i=function(e){return e instanceof a||e&&e.constructor&&"BN"===e.constructor.name},d=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},p=function(t){try{return n.apply(null,arguments)}catch(r){throw new Error(r+" Given value: \""+t+"\"")}},c=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!!(/^(0x|0X)?[0-9a-f]{40}$/.test(e)||/^(0x|0X)?[0-9A-F]{40}$/.test(e))||l(e))},l=function(e){e=e.replace(/^0x/i,"");for(var t=g(e.toLowerCase()).replace(/^0x/i,""),r=0;40>r;r++)if(7=parseInt(t[r],16)&&e[r].toLowerCase()!==e[r])return!1;return!0},u=function(e){e=s.encode(e);var t="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(var r=0;ro.length?"0"+o:o}return"0x"+t},f=function(e){if(r.isNull(e)||r.isUndefined(e))return e;if(!isFinite(e)&&!b(e))throw new Error("Given input \""+e+"\" is not a number.");var t=p(e),n=t.toString(16);return t.lt(new a(0))?"-0x"+n.substr(1):"0x"+n},y=function(e){if(e=e.toString(16),!b(e))throw new Error("Given value \""+e+"\" is not a valid hex string.");e=e.replace(/^0x/i,"");for(var t=[],r=0;re?"int256":"uint256":f(e)},hexToBytes:y,bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},isHex:function(e){return(r.isString(e)||r.isNumber(e))&&/^(-0x|0x)?[0-9a-f]*$/i.test(e)},isHexStrict:b,leftPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+Array(n).join(r?r:"0")+e},rightPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+e+Array(n).join(r?r:"0")},toTwosComplement:function(e){return"0x"+p(e).toTwos(256).toString(16,64)},sha3:g}},{"bn.js":294,"eth-lib/lib/hash":125,"number-to-bn":173,underscore:245,utf8:249}],298:[function(e,t){t.exports={_from:"web3@^1.0.0-beta.37",_id:"web3@1.0.0-beta.37",_inBundle:!1,_integrity:"sha512-8XLgUspdzicC/xHG82TLrcF/Fxzj2XYNJ1KTYnepOI77bj5rvpsxxwHYBWQ6/JOjk0HkZqoBfnXWgcIHCDhZhQ==",_location:"/web3",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"web3@^1.0.0-beta.37",name:"web3",escapedName:"web3",rawSpec:"^1.0.0-beta.37",saveSpec:null,fetchSpec:"^1.0.0-beta.37"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/web3/-/web3-1.0.0-beta.37.tgz",_shasum:"b42c30e67195f816cd19d048fda872f70eca7083",_spec:"web3@^1.0.0-beta.37",_where:"/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-base",author:{name:"ethereum.org"},authors:[{name:"Fabian Vogelsteller",email:"fabian@ethereum.org",homepage:"http://frozeman.de"},{name:"Marek Kotewicz",email:"marek@parity.io",url:"https://github.com/debris"},{name:"Marian Oancea",url:"https://github.com/cubedro"},{name:"Gav Wood",email:"g@parity.io",homepage:"http://gavwood.com"},{name:"Jeffery Wilcke",email:"jeffrey.wilcke@ethereum.org",url:"https://github.com/obscuren"}],bugs:{url:"https://github.com/ethereum/web3.js/issues"},bundleDependencies:!1,dependencies:{"web3-bzz":"1.0.0-beta.37","web3-core":"1.0.0-beta.37","web3-eth":"1.0.0-beta.37","web3-eth-personal":"1.0.0-beta.37","web3-net":"1.0.0-beta.37","web3-shh":"1.0.0-beta.37","web3-utils":"1.0.0-beta.37"},deprecated:!1,description:"Ethereum JavaScript API",keywords:["Ethereum","JavaScript","API"],license:"LGPL-3.0",main:"src/index.js",name:"web3",namespace:"ethereum",repository:{type:"git",url:"https://github.com/ethereum/web3.js/tree/master/packages/web3"},version:"1.0.0-beta.37"}},{}],299:[function(e,t){"use strict";var r=e("../package.json").version,a=e("web3-core"),n=e("web3-eth"),s=e("web3-net"),o=e("web3-eth-personal"),i=e("web3-shh"),d=e("web3-bzz"),p=e("web3-utils"),c=function(){var e=this;a.packageInit(this,arguments),this.version=r,this.utils=p,this.eth=new n(this),this.shh=new i(this),this.bzz=new d(this);var t=this.setProvider;this.setProvider=function(r,a){return t.apply(e,arguments),this.eth.setProvider(r,a),this.shh.setProvider(r,a),this.bzz.setProvider(r),!0}};c.version=r,c.utils=p,c.modules={Eth:n,Net:s,Personal:o,Shh:i,Bzz:d},a.addProviders(c),t.exports=c},{"../package.json":298,"web3-bzz":252,"web3-core":265,"web3-eth":288,"web3-eth-personal":286,"web3-net":289,"web3-shh":293,"web3-utils":295}],300:[function(e,t){function r(e,t){var r;return r=t?new n(e,t):new n(e),r}var a=function(){return this||{}}(),n=a.WebSocket||a.MozWebSocket,s=e("./version");n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(r,e,{get:function(){return n[e]}})}),t.exports={w3cwebsocket:n?r:null,version:s}},{"./version":301}],301:[function(e,t){t.exports=e("../package.json").version},{"../package.json":302}],302:[function(e,t){t.exports={_from:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",_id:"websocket@1.0.26",_inBundle:!1,_integrity:"",_location:"/websocket",_phantomChildren:{},_requested:{type:"git",raw:"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",name:"websocket",escapedName:"websocket",rawSpec:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",saveSpec:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",fetchSpec:"git://github.com/frozeman/WebSocket-Node.git",gitCommittish:"browserifyCompatible"},_requiredBy:["/web3-providers-ws"],_resolved:"git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",_spec:"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",_where:"/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-base/node_modules/web3-providers-ws",author:{name:"Brian McKelvey",email:"brian@worlize.com",url:"https://www.worlize.com/"},browser:"lib/browser.js",bugs:{url:"https://github.com/theturtle32/WebSocket-Node/issues"},bundleDependencies:!1,config:{verbose:!1},contributors:[{name:"I\xF1aki Baz Castillo",email:"ibc@aliax.net",url:"http://dev.sipdoc.net"}],dependencies:{debug:"^2.2.0",nan:"^2.3.3","typedarray-to-buffer":"^3.1.2",yaeti:"^0.0.6"},deprecated:!1,description:"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",devDependencies:{"buffer-equal":"^1.0.0",faucet:"^0.0.1",gulp:"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jshint":"^2.0.4",jshint:"^2.0.0","jshint-stylish":"^2.2.1",tape:"^4.0.1"},directories:{lib:"./lib"},engines:{node:">=0.10.0"},homepage:"https://github.com/theturtle32/WebSocket-Node",keywords:["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],license:"Apache-2.0",main:"index",name:"websocket",repository:{type:"git",url:"git+https://github.com/theturtle32/WebSocket-Node.git"},scripts:{gulp:"gulp",install:"(node-gyp rebuild 2> builderror.log) || (exit 0)",test:"faucet test/unit"},version:"1.0.26"}},{}],303:[function(e,t){var r=e("xhr-request");t.exports=function(e,t){return new Promise(function(a,n){r(e,t,function(e,t){e?n(e):a(t)})})}},{"xhr-request":304}],304:[function(e,t){var r=e("query-string"),a=e("url-set-query"),n=e("object-assign"),s=e("./lib/ensure-header.js"),o=e("./lib/request.js"),i=function(){};t.exports=function(e,t,d){if(!e||"string"!=typeof e)throw new TypeError("must specify a URL");if("function"==typeof t&&(d=t,t={}),d&&"function"!=typeof d)throw new TypeError("expected cb to be undefined or a function");d=d||i,t=t||{};var p=t.json?"json":"text";t=n({responseType:p},t);var c=t.headers||{},l=(t.method||"GET").toUpperCase(),u=t.query;return u&&("string"!=typeof u&&(u=r.stringify(u)),e=a(e,u)),"json"===t.responseType&&s(c,"Accept","application/json"),t.json&&"GET"!==l&&"HEAD"!==l&&(s(c,"Content-Type","application/json"),t.body=JSON.stringify(t.body)),t.method=l,t.url=e,t.headers=c,delete t.query,delete t.json,o(t,d)}},{"./lib/ensure-header.js":305,"./lib/request.js":307,"object-assign":174,"query-string":195,"url-set-query":246}],305:[function(e,t){t.exports=function(e,t,r){var a=t.toLowerCase();e[t]||e[a]||(e[t]=r)}},{}],306:[function(e,t){t.exports=function(e,t){return t?{statusCode:t.statusCode,headers:t.headers,method:e.method,url:e.url,rawRequest:t.rawRequest?t.rawRequest:t}:null}},{}],307:[function(e,t){var r=e("xhr"),a=e("./normalize-response"),n=function(){};t.exports=function(e,t){delete e.uri;var s=!1;"json"===e.responseType&&(e.responseType="text",s=!0);var o=r(e,function(r,o,i){if(s&&!r)try{var d=o.rawRequest.responseText;i=JSON.parse(d)}catch(t){r=t}o=a(e,o),r?t(r,null,o):t(r,i,o),t=n}),i=o.onabort;return o.onabort=function(){var e=i.apply(o,Array.prototype.slice.call(arguments));return t(new Error("XHR Aborted")),t=n,e},o}},{"./normalize-response":306,xhr:308}],308:[function(e,t){"use strict";function r(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e,t,r){var a=e;return d(t)?(r=t,"string"==typeof e&&(a={uri:e})):a=c(t,{uri:e}),a.callback=r,a}function n(e,t,r){return t=a(e,t,r),s(t)}function s(e){function t(){4===l.readyState&&setTimeout(i,0)}function a(){var e;if(e=l.response?l.response:l.responseText||o(l),h)try{e=JSON.parse(e)}catch(t){}return e}function s(e){return clearTimeout(S),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,c(e,m)}function i(){if(!v){var t;clearTimeout(S),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=m,n=null;return 0===t?n=new Error("Internal XMLHttpRequest Error"):(r={body:a(),statusCode:t,method:f,headers:{},url:u,rawRequest:l},l.getAllResponseHeaders&&(r.headers=p(l.getAllResponseHeaders()))),c(n,r,r.body)}}if("undefined"==typeof e.callback)throw new Error("callback argument missing");var d=!1,c=function(t,r,a){d||(d=!0,e.callback(t,r,a))},l=e.xhr||null;l||(e.cors||e.useXDR?l=new n.XDomainRequest:l=new n.XMLHttpRequest);var u=l.url=e.uri||e.url,f=l.method=e.method||"GET",y=e.body||e.data,b=l.headers=e.headers||{},g=!!e.sync,h=!1,m={body:void 0,headers:{},statusCode:0,method:f,url:u,rawRequest:l},_,v,S;if("json"in e&&!1!==e.json&&(h=!0,b.accept||b.Accept||(b.Accept="application/json"),"GET"!==f&&"HEAD"!==f&&(b["content-type"]||b["Content-Type"]||(b["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),l.onreadystatechange=t,l.onload=i,l.onerror=s,l.onprogress=function(){},l.onabort=function(){v=!0},l.ontimeout=s,l.open(f,u,!g,e.username,e.password),g||(l.withCredentials=!!e.withCredentials),!g&&0r||this.listeners[e].splice(r,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var r=0,a=this.listeners[t],n;rn.randomHex(5),r.hex2bytes=e=>(e=e.replace(/^0x/,""),e=e.length%2?"0x0"+e:"0x"+e,n.hexToBytes(e)),r.bytes2hex=e=>n.bytesToHex(e);r.default=({from:e,privateKey:a,data:p="",nonce:c=r.getNonce(),quota:i,validUntilBlock:d,value:l="",version:u="0",chainId:f="1",to:y=""},b)=>{const g=b||a;if(!g)return console.warn(`No private key found`),{data:p,from:e,nonce:c,quota:i,validUntilBlock:d,value:l,version:u,chainId:f,to:y};let h=y.toLowerCase().replace(/^0x/,""),m=f,_=+u?`V${u}`:"",v=`${c}`,S=+i;switch(_){case"V1":{h=new Uint8Array(r.hex2bytes(h)),m=r.hex2bytes(""+f);const e=new Uint8Array(32);e.set(m,32-m.length),m=e;break}default:}const w=new s.Transaction;if(!v)w.setNonce(r.getNonce());else if(128=S)throw new Error("Quota should be larger than 0");else w.setQuota(S);if(l="number"==typeof l?"0x"+l.toString(16):l||"0x0",l.length>o.length)throw new Error(`Value should not be larger than ${o}`);if(0>+l)throw new Error(`Value should not be negative`);if(l)try{l=l.replace(/^0x/,""),l.length%2&&(l="0"+l);const e=r.hex2bytes(l),t=new Uint8Array(32);t.set(e,32-e.length),w.setValue(t)}catch(e){throw e}if(y)if(n.isAddress(y))w[`setTo${_}`](h);else throw new Error(`Invalid to address`);if(void 0===d||isNaN(+d))throw new Error(`ValidUntilBlock should be set`);else w.setValidUntilBlock(+d);if(void 0===m)throw new Error(`Chain Id should be set`);else w[`setChainId${_}`](m);try{const e=r.hex2bytes(p);w.setData(new Uint8Array(e))}catch(e){throw e}w.setVersion(u);const A=w.serializeBinary(),B=r.sha3(A).slice(2);if(64!==g.replace(/^0x/,"").length||!n.isHex(g))throw new Error("Invalid Private Key");const x=r.ec.keyFromPrivate(g.replace(/^0x/,""),"hex"),k=x.sign(new t(B.toString(),"hex"),{canonical:!0});let E=k.r.toString(16).padStart(64,0),T=k.s.toString(16).padStart(64,0);const I=(E+T).padStart(128,0),M=new t(I,"hex"),C=new Uint8Array(65);C.set(M),C[64]=k.recoveryParam;const R=new s.UnverifiedTransaction;R.setTransaction(w),R.setCrypto(s.Crypto.SECP),R.setSignature(C);const N=R.serializeBinary(),P=n.bytesToHex(N);return P}}).call(this,e("buffer").Buffer)},{"../proto-js/blockchain_pb":369,"./unsigner":317,buffer:83,elliptic:320,"web3-utils":366}],317:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("elliptic/lib/elliptic/ec/signature"),n=e("../proto-js/blockchain_pb"),s=e("./index");r.default=e=>{const r=s.hex2bytes(e),o=n.UnverifiedTransaction.deserializeBinary(r),i=o.getTransaction(),d=o.getSignature(),p=i.getVersion(),c={version:p,data:s.bytes2hex(i.getData()),chainId:i.getChainId(),to:i.getTo(),nonce:i.getNonce(),value:+s.bytes2hex(i.getValue()),quota:i.getQuota(),validUntilBlock:+i.getValidUntilBlock()};switch(+p){case 1:{c.chainId="0x"+(+s.bytes2hex(i.getChainIdV1())).toString(16),c.to=s.bytes2hex(i.getToV1());break}default:}c.to&&!c.to.startsWith("0x")&&(c.to="0x"+c.to);const l=new a({r:s.bytes2hex(d.slice(0,32)).slice(2),s:s.bytes2hex(d.slice(32,64)).slice(2),recoveryParam:d[64]}),u=i.serializeBinary(),f=s.sha3(u).slice(2),y=new t(f.toString(),"hex"),b=s.ec.recoverPubKey(y,l,l.recoveryParam,"hex"),g=`0x${b.encode("hex").slice(2).toLowerCase()}`,h=new t(s.hex2bytes(g)),m=`0x${s.sha3(h).slice(-40).toLowerCase()}`,_=s.bytes2hex(d).slice(2);return{transaction:c,signature:_,sender:{publicKey:g,address:m}}}}).call(this,e("buffer").Buffer)},{"../proto-js/blockchain_pb":369,"./index":316,buffer:83,"elliptic/lib/elliptic/ec/signature":329}],318:[function(e,t,r){arguments[4][50][0].apply(r,arguments)},{buffer:52,dup:50}],319:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{crypto:52,dup:51}],320:[function(e,t,r){arguments[4][105][0].apply(r,arguments)},{"../package.json":335,"./elliptic/curve":323,"./elliptic/curves":326,"./elliptic/ec":327,"./elliptic/eddsa":330,"./elliptic/utils":334,brorand:319,dup:105}],321:[function(e,t,r){arguments[4][106][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:106}],322:[function(e,t,r){arguments[4][107][0].apply(r,arguments)},{"../../elliptic":320,"../curve":323,"bn.js":318,dup:107,inherits:353}],323:[function(e,t,r){arguments[4][108][0].apply(r,arguments)},{"./base":321,"./edwards":322,"./mont":324,"./short":325,dup:108}],324:[function(e,t,r){arguments[4][109][0].apply(r,arguments)},{"../../elliptic":320,"../curve":323,"bn.js":318,dup:109,inherits:353}],325:[function(e,t,r){arguments[4][110][0].apply(r,arguments)},{"../../elliptic":320,"../curve":323,"bn.js":318,dup:110,inherits:353}],326:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{"../elliptic":320,"./precomputed/secp256k1":333,dup:111,"hash.js":340}],327:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{"../../elliptic":320,"./key":328,"./signature":329,"bn.js":318,dup:112,"hmac-drbg":352}],328:[function(e,t,r){arguments[4][113][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:113}],329:[function(e,t,r){arguments[4][114][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:114}],330:[function(e,t,r){arguments[4][115][0].apply(r,arguments)},{"../../elliptic":320,"./key":331,"./signature":332,dup:115,"hash.js":340}],331:[function(e,t,r){arguments[4][116][0].apply(r,arguments)},{"../../elliptic":320,dup:116}],332:[function(e,t,r){arguments[4][117][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:117}],333:[function(e,t,r){arguments[4][118][0].apply(r,arguments)},{dup:118}],334:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{"bn.js":318,dup:119,"minimalistic-assert":355,"minimalistic-crypto-utils":356}],335:[function(e,t){t.exports={_args:[["elliptic@6.4.1","/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-signer"]],_from:"elliptic@6.4.1",_id:"elliptic@6.4.1",_inBundle:!1,_integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.4.1",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.1",saveSpec:null,fetchSpec:"6.4.1"},_requiredBy:["/","/browserify-sign","/create-ecdh","/eth-lib","/web3-eth-accounts/eth-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_spec:"6.4.1",_where:"/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-signer",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],336:[function(e,t,r){arguments[4][125][0].apply(r,arguments)},{dup:125}],337:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{"bn.js":338,dup:137,"number-to-bn":358}],338:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{dup:138}],339:[function(require,module,exports){var _Mathabs=Math.abs,_MathLN=Math.LN2,_Mathlog=Math.log,_Mathsqrt=Math.sqrt,_Mathpow3=Math.pow,_Mathfloor2=Math.floor,_Mathmax7=Math.max,_Mathmin5=Math.min,_StringfromCharCode4=String.fromCharCode,_Mathround4=Math.round;(function(global,Buffer){var _Stringprototype=String.prototype,_Mathexp=Math.exp,$jscomp={scope:{},getGlobal:function(e){return"undefined"!=typeof window&&window===e?e:"undefined"==typeof global?e:global}};$jscomp.global=$jscomp.getGlobal(this),$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol),$jscomp.initSymbol=function(){}},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(e){return"jscomp_symbol_"+e+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol(),$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),$jscomp.initSymbolIterator=function(){}},$jscomp.makeIterator=function(e){$jscomp.initSymbolIterator(),$jscomp.initSymbol(),$jscomp.initSymbolIterator();var t=e[Symbol.iterator];if(t)return t.call(e);var r=0;return{next:function(){return rt;)--r in this?this[--e]=this[r]:delete this[e];return this},$jscomp.array.copyWithin$install=function(){$jscomp.array.installHelper_("copyWithin",$jscomp.array.copyWithin)},$jscomp.array.fill=function(e,t,r){var a=this.length||0;for(0>t&&(t=_Mathmax7(0,a+t)),(null==r||r>a)&&(r=a),r=+r,0>r&&(r=_Mathmax7(0,a+r)),t=+(t||0);t>>0,0===e)return 32;var t=0;return 0==(4294901760&e)&&(e<<=16,t+=16),0==(4278190080&e)&&(e<<=8,t+=8),0==(4026531840&e)&&(e<<=4,t+=4),0==(3221225472&e)&&(e<<=2,t+=2),0==(2147483648&e)&&t++,t},$jscomp.math.imul=function(e,t){e=+e,t=+t;var r=65535&e,n=65535&t;return 0|r*n+((65535&e>>>16)*n+r*(65535&t>>>16)<<16>>>0)},$jscomp.math.sign=function(e){return e=+e,0===e||isNaN(e)?e:0t&&-.25t&&-.25e?-t:t},$jscomp.math.acosh=function(e){return e=+e,_Mathlog(e+_Mathsqrt(e*e-1))},$jscomp.math.asinh=function(e){if(e=+e,0===e)return e;var t=_Mathlog(_Mathabs(e)+_Mathsqrt(e*e+1));return 0>e?-t:t},$jscomp.math.atanh=function(e){return e=+e,($jscomp.math.log1p(e)-$jscomp.math.log1p(-e))/2},$jscomp.math.hypot=function(t,r){t=+t,r=+r;var n=_Mathmax7(_Mathabs(t),_Mathabs(r)),s,o,i;for(s=2;sn){for(t/=n,r/=n,i=t*t+r*r,s=2;se?-t:t},$jscomp.math.cbrt=function(e){if(0===e)return e;e=+e;var t=_Mathpow3(_Mathabs(e),1/3);return 0>e?-t:t},$jscomp.number=$jscomp.number||{},$jscomp.number.isFinite=function(e){return!("number"!=typeof e)&&!isNaN(e)&&1/0!==e&&-Infinity!==e},$jscomp.number.isInteger=function(e){return!!$jscomp.number.isFinite(e)&&e===_Mathfloor2(e)},$jscomp.number.isNaN=function(e){return"number"==typeof e&&isNaN(e)},$jscomp.number.isSafeInteger=function(e){return $jscomp.number.isInteger(e)&&_Mathabs(e)<=$jscomp.number.MAX_SAFE_INTEGER},$jscomp.number.EPSILON=function(){return 2.220446049250313e-16}(),$jscomp.number.MAX_SAFE_INTEGER=function(){return 9007199254740991}(),$jscomp.number.MIN_SAFE_INTEGER=function(){return-9007199254740991}(),$jscomp.object=$jscomp.object||{},$jscomp.object.assign=function(t){for(var r=1,a;rr||1114111=r?e+=_StringfromCharCode4(r):(r-=65536,e+=_StringfromCharCode4(55296|1023&r>>>10),e+=_StringfromCharCode4(56320|1023&r))}return e},$jscomp.string.repeat=function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279>>=1)&&(t+=t);return r},$jscomp.string.repeat$install=function(){_Stringprototype.repeat||(_Stringprototype.repeat=$jscomp.string.repeat)},$jscomp.string.codePointAt=function(e){var t=$jscomp.checkStringArgs(this,null,"codePointAt"),r=t.length;if(e=+e||0,0<=e&&en||56319e||57343=o},$jscomp.string.startsWith$install=function(){_Stringprototype.startsWith||(_Stringprototype.startsWith=$jscomp.string.startsWith)},$jscomp.string.endsWith=function(t,r){var n=$jscomp.checkStringArgs(this,t,"endsWith");t+="",void 0===r&&(r=n.length);for(var s=_Mathmax7(0,_Mathmin5(0|r,n.length)),o=t.length;0=o},$jscomp.string.endsWith$install=function(){_Stringprototype.endsWith||(_Stringprototype.endsWith=$jscomp.string.endsWith)};var COMPILED=!0,goog=goog||{};goog.global=this,goog.isDef=function(e){return void 0!==e},goog.exportPath_=function(e,t,r){e=e.split("."),r=r||goog.global,e[0]in r||!r.execScript||r.execScript("var "+e[0]);for(var n;e.length&&(n=e.shift());)!e.length&&goog.isDef(t)?r[n]=t:r=r[n]?r[n]:r[n]={}},goog.define=function(e,t){!0,goog.exportPath_(e,t)},goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(){},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return null!=goog.moduleLoaderState_},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(){},!0,goog.getObjectByName=function(t,r){for(var a=t.split("."),n=r||goog.global,s;s=a.shift();)if(goog.isDefAndNotNull(n[s]))n=n[s];else return null;return n},goog.globalize=function(e,t){var r=t||goog.global,a;for(a in e)r[a]=e[a]},goog.addDependency=function(t,r,n,s){if(goog.DEPENDENCIES_ENABLED){var o;t=t.replace(/\\/g,"/");for(var i=goog.dependencies_,p=0;o=r[p];p++)i.nameToPath[o]=t,i.pathIsModule[t]=!!s;for(s=0;r=n[s];s++)t in i.requires||(i.requires[t]={}),i.requires[t][r]=!0}},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(){},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!1,goog.DEPENDENCIES_ENABLED&&(goog.dependencies_={pathIsModule:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}},goog.inHtmlDocument_=function(){var e=goog.global.document;return null!=e&&"write"in e},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var e=goog.global.document.getElementsByTagName("SCRIPT"),t=e.length-1;0<=t;--t){var r=e[t].src,a=r.lastIndexOf("?"),a=-1==a?r.length:a;if("base.js"==r.substr(a-7,7)){goog.basePath=r.substr(0,a-7);break}}},goog.importScript_=function(e,t){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_)(e,t)&&(goog.dependencies_.written[e]=!0)},goog.IS_OLD_IE_=!goog.global.atob&&goog.global.document&&goog.global.document.all,goog.importModule_=function(e){goog.importScript_("","goog.retrieveAndExecModule_(\""+e+"\");")&&(goog.dependencies_.written[e]=!0)},goog.queuedModules_=[],goog.wrapModule_=function(e,t){return goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(t+"\n//# sourceURL="+e+"\n")+");":"goog.loadModule(function(exports) {\"use strict\";"+t+"\n;return exports});\n//# sourceURL="+e+"\n"},goog.loadQueuedModules_=function(){var e=goog.queuedModules_.length;if(0")},goog.appendScriptSrcNode_=function(e){var t=goog.global.document,r=t.createElement("script");r.type="text/javascript",r.src=e,r.defer=!1,r.async=!1,t.head.appendChild(r)},goog.writeScriptTag_=function(e,t){if(goog.inHtmlDocument_()){var r=goog.global.document;if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==r.readyState){if(/\bdeps.js$/.test(e))return!1;throw Error("Cannot write \""+e+"\" after document load")}var a=goog.IS_OLD_IE_;return void 0===t?a?(a=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ",r.write("")):goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?goog.appendScriptSrcNode_(e):goog.writeScriptSrcNode_(e):r.write(""),!0}return!1},goog.lastNonModuleScriptIndex_=0,goog.onScriptLoad_=function(e,t){return"complete"==e.readyState&&goog.lastNonModuleScriptIndex_==t&&goog.loadQueuedModules_(),!0},goog.writeScripts_=function(t){function r(e){if(!(e in o.written||e in o.visited)){if(o.visited[e]=!0,e in o.requires)for(var t in o.requires[e])if(!goog.isProvided_(t))if(t in o.nameToPath)r(o.nameToPath[t]);else throw Error("Undefined nameToPath for "+t);e in s||(s[e]=!0,n.push(e))}}var n=[],s={},o=goog.dependencies_;for(r(t),t=0;t>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if(e.clone)return e.clone();var t="array"==t?[]:{},r;for(r in e)t[r]=goog.cloneObject(e[r]);return t}return e},goog.bindNative_=function(e){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t){if(!e)throw Error();if(2=e||"\x80"<=e&&"\uFFFD">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.TRUSTED_SITE&&_Stringprototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=function(e,t){var r=(e+"").toLowerCase(),a=(t+"").toLowerCase();return r":"
")},goog.string.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.AMP_RE_,"&").replace(goog.string.LT_RE_,"<").replace(goog.string.GT_RE_,">").replace(goog.string.QUOT_RE_,""").replace(goog.string.SINGLE_QUOTE_RE_,"'").replace(goog.string.NULL_RE_,"�"),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e"));else{if(!goog.string.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.AMP_RE_,"&")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.LT_RE_,"<")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.GT_RE_,">")),-1!=e.indexOf("\"")&&(e=e.replace(goog.string.QUOT_RE_,""")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.SINGLE_QUOTE_RE_,"'")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.NULL_RE_,"�")),goog.string.DETECT_DOUBLE_ESCAPING&&-1!=e.indexOf("e")&&(e=e.replace(goog.string.E_RE_,"e"))}return e},goog.string.AMP_RE_=/&/g,goog.string.LT_RE_=//g,goog.string.QUOT_RE_=/"/g,goog.string.SINGLE_QUOTE_RE_=/'/g,goog.string.NULL_RE_=/\x00/g,goog.string.E_RE_=/e/g,goog.string.ALL_RE_=goog.string.DETECT_DOUBLE_ESCAPING?/[\x00&<>"'e]/:/[\x00&<>"']/,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var r={"&":"&","<":"<",">":">",""":"\""},n;return n=t?t.createElement("div"):goog.global.document.createElement("div"),e.replace(goog.string.HTML_ENTITY_PATTERN_,function(e,t){var a=r[e];if(a)return a;if("#"==t.charAt(0)){var s=+("0"+t.substr(1));isNaN(s)||(a=_StringfromCharCode4(s))}return a||(n.innerHTML=e+" ",a=n.firstChild.nodeValue.slice(0,-1)),r[e]=a})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return"\"";default:if("#"==t.charAt(0)){var r=+("0"+t.substr(1));if(!isNaN(r))return _StringfromCharCode4(r)}return e;}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(t,r){for(var a=r.length,n=0,s;nt&&(e=e.substring(0,t-3)+"..."),r&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(t,r,n,s){if(n&&(t=goog.string.unescapeEntities(t)),s&&t.length>r){s>r&&(s=r);var o=t.length-s;t=t.substring(0,r-s)+"..."+t.substring(o)}else t.length>r&&(s=_Mathfloor2(r/2),o=t.length-s,t=t.substring(0,s+r%2)+"..."+t.substring(o));return n&&(t=goog.string.htmlEscape(t)),t},goog.string.specialEscapeChars_={"":"\\0","":"\\b"," ":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\x0B",'"':"\\\"","\\":"\\\\","<":"<"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(t){t+="";for(var r=["\""],n=0;no?s:goog.string.escapeChar(s))}return r.push("\""),r.join("")},goog.string.escapeString=function(e){for(var t=[],r=0;rt?r=e:(256>t?(r="\\x",16>t||256t&&(r+="0")),r+=t.toString(16).toUpperCase()),goog.string.jsEscapeCache_[e]=r},goog.string.contains=function(e,t){return-1!=e.indexOf(t)},goog.string.caseInsensitiveContains=function(e,t){return goog.string.contains(e.toLowerCase(),t.toLowerCase())},goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,r){var a=e;return 0<=t&&tt?1:0},goog.string.hashCode=function(e){for(var t=0,r=0;r>>0;return t},goog.string.uniqueStringCounter_=0|2147483648*Math.random(),goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=+e;return 0==t&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return /^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return /^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return(e+"").replace(/\-([a-z])/g,function(e,t){return t.toUpperCase()})},goog.string.toSelectorCase=function(e){return(e+"").replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){var r=goog.isString(t)?goog.string.regExpEscape(t):"\\s";return e.replace(new RegExp("(^"+(r?"|["+r+"]+":"")+")([a-z])","g"),function(e,t,r){return t+r.toUpperCase()})},goog.string.capitalize=function(e){return(e.charAt(0)+"").toUpperCase()+(e.substr(1)+"").toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e+=""),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,r){e=e.split(t);for(var n=[];0r?_Mathmax7(0,e.length+r):r,goog.isString(e))return goog.isString(t)&&1==t.length?e.indexOf(t,r):-1;for(;rr&&(r=_Mathmax7(0,e.length+r)),goog.isString(e))return goog.isString(t)&&1==t.length?e.lastIndexOf(t,r):-1;for(;0<=r;r--)if(r in e&&e[r]===t)return r;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,r){goog.asserts.assert(null!=e.length),Array.prototype.forEach.call(e,t,r)}:function(t,r,a){for(var n=t.length,s=goog.isString(t)?t.split(""):t,e=0;et?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(t,r,a){for(var n=t.length,s=goog.isString(t)?t.split(""):t,e=0;et?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(t,r,a){for(var n=t.length,s=goog.isString(t)?t.split(""):t,n=n-1;0<=n;n--)if(n in s&&r.call(a,s[n],n,t))return n;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return 0==e.length},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,r){goog.array.splice(e,r,0,t)},goog.array.insertArrayAt=function(e,t,r){goog.partial(goog.array.splice,e,r,0).apply(null,t)},goog.array.insertBefore=function(e,t,r){var a;2==arguments.length||0>(a=goog.array.indexOf(e,r))?e.push(t):goog.array.insertAt(e,t,a)},goog.array.remove=function(e,t){var r=goog.array.indexOf(e,t),a;return(a=0<=r)&&goog.array.removeAt(e,r),a},goog.array.removeAt=function(e,t){return goog.asserts.assert(null!=e.length),1==Array.prototype.splice.call(e,t,1).length},goog.array.removeIf=function(e,t,r){return t=goog.array.findIndex(e,t,r),!!(0<=t)&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(t,r,a){var n=0;return goog.array.forEachRight(t,function(s,e){r.call(a,s,e,t)&&goog.array.removeAt(t,e)&&n++}),n},goog.array.concat=function(){return Array.prototype.concat.apply(Array.prototype,arguments)},goog.array.join=function(){return Array.prototype.concat.apply(Array.prototype,arguments)},goog.array.toArray=function(e){var t=e.length;if(0=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)},goog.array.removeDuplicates=function(t,r,a){r=r||t;var n=function(e){return goog.isObject(e)?"o"+goog.getUid(e):(typeof e).charAt(0)+e};a=a||n;for(var n={},s=0,o=0;o>1,p;p=a?r.call(s,t[d],d,t):r(n,t[d]),0t?1:er)&&(goog.array.insertAt(e,t,-(r+1)),!0)},goog.array.binaryRemove=function(e,t,r){return t=goog.array.binarySearch(e,t,r),!!(0<=t)&&goog.array.removeAt(e,t)},goog.array.bucket=function(t,r,a){for(var n={},s=0;sn*(i-o))return[];if(0i;t+=n)s.push(t);return s},goog.array.repeat=function(e,t){for(var r=[],a=0;at&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,r){goog.asserts.assert(0<=t&&t>=8;r[a++]=s}return r},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return _StringfromCharCode4.apply(null,e);for(var t="",r=0;rs?r[a++]=s:(2048>s?r[a++]=192|s>>6:(55296==(64512&s)&&n+1>18,r[a++]=128|63&s>>12):r[a++]=224|s>>12,r[a++]=128|63&s>>6),r[a++]=128|63&s);return r},goog.crypt.utf8ByteArrayToString=function(t){for(var r=[],a=0,n=0,s;as)r[n++]=_StringfromCharCode4(s);else if(191s){var o=t[a++];r[n++]=_StringfromCharCode4((31&s)<<6|63&o)}else if(239s){var o=t[a++],i=t[a++],p=t[a++],s=((7&s)<<18|(63&o)<<12|(63&i)<<6|63&p)-65536;r[n++]=_StringfromCharCode4(55296+(s>>10)),r[n++]=_StringfromCharCode4(56320+(1023&s))}else o=t[a++],i=t[a++],r[n++]=_StringfromCharCode4((15&s)<<12|(63&o)<<6|63&i);return r.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var r=[],a=0;aparseFloat(e))?t+"":e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv\:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.userAgent.isVersionOrHigherCache_[e]||(goog.userAgent.isVersionOrHigherCache_[e]=0<=goog.string.compareVersions(goog.userAgent.VERSION,e))},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return+goog.userAgent.DOCUMENT_MODE>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){var e=goog.global.document,t=goog.userAgent.getDocumentMode_();return e&&goog.userAgent.IE?t||("CSS1Compat"==e.compatMode?parseInt(goog.userAgent.VERSION,10):5):void 0}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.byteToCharMap_=null,goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.byteToCharMapWebSafe_=null,goog.crypt.base64.ENCODED_VALS_BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.ENCODED_VALS_BASE+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.ENCODED_VALS_BASE+"-_.",goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa,goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob,goog.crypt.base64.encodeByteArray=function(t,r){goog.asserts.assert(goog.isArrayLike(t),"encodeByteArray takes an array as a parameter"),goog.crypt.base64.init_();for(var a=r?goog.crypt.base64.byteToCharMapWebSafe_:goog.crypt.base64.byteToCharMap_,n=[],s=0;s>2,o=(3&o)<<4|d>>4,d=(15&d)<<2|u>>6,u=63&u;c||(u=64,i||(d=64)),n.push(a[y],a[o],a[d],a[u])}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var r="";return goog.crypt.base64.decodeStringInternal_(e,function(e){r+=_StringfromCharCode4(e)}),r},goog.crypt.base64.decodeStringToByteArray=function(e){var t=[];return goog.crypt.base64.decodeStringInternal_(e,function(e){t.push(e)}),t},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=new Uint8Array(Math.ceil(3*e.length/4)),r=0;return goog.crypt.base64.decodeStringInternal_(e,function(e){t[r++]=e}),t.subarray(0,r)},goog.crypt.base64.decodeStringInternal_=function(t,r){function a(r){for(;n>4),64!=o&&(r(240&e<<4|o>>2),64!=i&&r(192&o<<6|i))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.byteToCharMap_){goog.crypt.base64.byteToCharMap_={},goog.crypt.base64.charToByteMap_={},goog.crypt.base64.byteToCharMapWebSafe_={};for(var e=0;e=goog.crypt.base64.ENCODED_VALS_BASE.length&&(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(e)]=e)}},jspb.ExtensionFieldInfo=function(t,r,a,n,s){this.fieldIndex=t,this.fieldName=r,this.ctor=a,this.toObjectFn=n,this.isRepeated=s},jspb.ExtensionFieldBinaryInfo=function(t,r,a,n,s,e){this.fieldInfo=t,this.binaryReaderFn=r,this.binaryWriterFn=a,this.binaryMessageSerializeFn=n,this.binaryMessageDeserializeFn=s,this.isPacked=e},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_="function"==typeof Uint8Array,jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(t,r,a,n,s,e){if(t.wrappers_=null,r||(r=a?[a]:[]),t.messageId_=a?a+"":void 0,t.arrayIndexOffset_=0===a?-1:0,t.array=r,jspb.Message.initPivotAndExtensionObject_(t,n),t.convertedFloatingPointFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(t.repeatedFields=s),s)for(r=0;rn.length?a.length:n.length;for(t.getJsPbMessageId()&&(s[0]=t.getJsPbMessageId(),e=1);e>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((4294967295&this.lo+e.lo)>>>0>>>0,((4294967295&this.hi+e.hi)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((4294967295&this.lo-e.lo)>>>0>>>0,((4294967295&this.hi-e.hi)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(t,r){for(var a=65535&t,n=t>>>16,s=65535&r,e=r>>>16,o=a*s+65536*(65535&a*e)+65536*(65535&n*s),a=n*e+(a*e>>>16)+(n*s>>>16);4294967296<=o;)o-=4294967296,a+=1;return new jspb.arith.UInt64(o>>>0,a>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return e=jspb.arith.UInt64.mul32x32(this.hi,e),e.hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(0==e)return[];var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var n=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),n=n.leftShift();for(;!n.zero();)0>=e.cmp(r)&&(t=t.add(n),r=r.sub(e)),e=e.rightShift(),n=n.rightShift();return[t,r]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();)var t=t.div(10),r=t[0],e=t[1].lo+e,t=r;return""==e&&(e="0"),e},jspb.arith.UInt64.fromString=function(t){for(var r=new jspb.arith.UInt64(0,0),a=new jspb.arith.UInt64(0,0),n=0;nt[n]||"9">>0>>>0,((4294967295&this.hi+e.hi)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((4294967295&this.lo-e.lo)>>>0>>>0,((4294967295&this.hi-e.hi)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=0!=(2147483648&this.hi),t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0>>0;e=_Mathfloor2((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e;e=_Mathabs(e);var r=e>>>0;e=_Mathfloor2((e-r)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,r=(~r>>>0)+1,4294967295e;e=2*_Mathabs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;t&&(0==e?0==r?r=e=4294967295:(r--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=r},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;e=t?-e:e;var r;0===e?0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(e)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):e>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(2139095040|t<<31)>>>0):e>>0):(r=_Mathfloor2(_Mathlog(e)/_MathLN),e*=_Mathpow3(2,-r),e=8388607&_Mathround4(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|r+127<<23|e)>>>0)},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if(e=t?-e:e,0===e)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(2146435072|t<<31)>>>0,jspb.utils.split64Low=0;else if(e>>0,jspb.utils.split64Low=r>>>0}else{var n=_Mathfloor2(_Mathlog(e)/_MathLN);1024==n&&(n=1023),r=e*_Mathpow3(2,-n),e=1048575&r*jspb.BinaryConstants.TWO_TO_20,r=r*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|n+1023<<20|e)>>>0,jspb.utils.split64Low=r}},jspb.utils.splitHash64=function(t){var r=t.charCodeAt(0),n=t.charCodeAt(1),s=t.charCodeAt(2),o=t.charCodeAt(3),e=t.charCodeAt(4),i=t.charCodeAt(5),d=t.charCodeAt(6);t=t.charCodeAt(7),jspb.utils.split64Low=r+(n<<8)+(s<<16)+(o<<24)>>>0,jspb.utils.split64High=e+(i<<8)+(d<<16)+(t<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+e},jspb.utils.joinInt64=function(e,t){var r=2147483648&t;r&&(e=~e+1>>>0,t=~t>>>0,0==e&&(t=t+1>>>0));var n=jspb.utils.joinUint64(e,t);return r?-n:n},jspb.utils.joinZigzag64=function(e,t){var r=1&e;e=(e>>>1|t<<31)>>>0,t>>>=1,r&&(e=e+1>>>0,0==e&&(t=t+1>>>0));var n=jspb.utils.joinUint64(e,t);return r?-n:n},jspb.utils.joinFloat32=function(t){var r=2*(t>>31)+1,a=255&t>>>23,n=8388607&t;return 255==a?n?NaN:1/0*r:0==a?1.401298464324817e-45*r*n:r*_Mathpow3(2,a-150)*(n+8388608)},jspb.utils.joinFloat64=function(t,r){var a=2*(r>>31)+1,n=2047&r>>>20,s=jspb.BinaryConstants.TWO_TO_32*(1048575&r)+t;return 2047==n?s?NaN:1/0*a:0==n?5e-324*a*s:a*_Mathpow3(2,n-1075)*(s+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return _StringfromCharCode4(255&e>>>0,255&e>>>8,255&e>>>16,255&e>>>24,255&t>>>0,255&t>>>8,255&t>>>16,255&t>>>24)},jspb.utils.DIGITS=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],jspb.utils.joinUnsignedDecimalString=function(t,r){function a(e){for(var t=1E7,r=0;7>r;r++){var t=t/10,a=e/t%10>>>0;(0!=a||p)&&(p=!0,c+=i[a])}}if(2097151>=r)return""+(jspb.BinaryConstants.TWO_TO_32*r+t);var n=16777215&(t>>>24|r<<8)>>>0,s=65535&r>>16,o=(16777215&t)+6777216*n+6710656*s,n=n+8147497*s,s=2*s;1E7<=o&&(n+=_Mathfloor2(o/1E7),o%=1E7),1E7<=n&&(s+=_Mathfloor2(n/1E7),n%=1E7);var i=jspb.utils.DIGITS,p=!1,c="";return(s||p)&&a(s),(n||p)&&a(n),(o||p)&&a(o),c},jspb.utils.joinSignedDecimalString=function(e,t){var r=2147483648&t;r&&(e=~e+1>>>0,t=~t+(0==e?1:0)>>>0);var n=jspb.utils.joinUnsignedDecimalString(e,t);return r?"-"+n:n},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e);var r=jspb.utils.split64Low,a=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(r,a):jspb.utils.joinUnsignedDecimalString(r,a)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var r=Array(e.length),a=0;ar&&(1!==e||0>>8}function n(){for(var e=0;8>e;e++)o[e]=255&~o[e]}goog.asserts.assert(0r;r++)a=e.charCodeAt(7-r),t[2*r+2]=jspb.utils.DIGITS[a>>4],t[2*r+3]=jspb.utils.DIGITS[15&a];return t.join("")},jspb.utils.hexStringToHash64=function(t){t=t.toLowerCase(),goog.asserts.assert(18==t.length),goog.asserts.assert("0"==t[0]),goog.asserts.assert("x"==t[1]);for(var r="",n=0;8>n;n++)var s=jspb.utils.DIGITS.indexOf(t[2*n+2]),o=jspb.utils.DIGITS.indexOf(t[2*n+3]),r=_StringfromCharCode4(16*s+o)+r;return r},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e);var r=jspb.utils.split64Low,a=jspb.utils.split64High;return t?jspb.utils.joinInt64(r,a):jspb.utils.joinUint64(r,a)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(t,r,a){for(var n=0,s=r;s>7;return a-r-n},jspb.utils.countVarintFields=function(t,r,a,n){var s=0;if(n=8*n+jspb.BinaryConstants.WireType.VARINT,128>n)for(;r>=7}if(t[r++]!=o)break;for(s++;o=t[r++],0!=(128&o););}return s},jspb.utils.countFixedFields_=function(t,r,a,n,s){var e=0;if(128>n)for(;r>=7}if(t[r++]!=o)break;e++,r+=s}return e},jspb.utils.countFixed32Fields=function(e,t,r,a){return jspb.utils.countFixedFields_(e,t,r,8*a+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,r,a){return jspb.utils.countFixedFields_(e,t,r,8*a+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(t,r,a,n){var s=0;for(n=8*n+jspb.BinaryConstants.WireType.DELIMITED;r>=7}if(t[r++]!=o)break;s++;for(var i=0,p=1;o=t[r++],i+=(127&o)*p,p*=128,0!=(128&o););r+=i}return s},jspb.utils.debugBytesToTextFormat=function(e){var t="\"";if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var r=0;re[r]&&(t+="0"),t+=e[r].toString(16)}return t+"\""},jspb.utils.debugScalarToTextFormat=function(e){return goog.isString(e)?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),r=0,a;r>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(t==_Mathfloor2(t)),goog.asserts.assert(0<=e&&e>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&et;t++)this.buffer_.push(128|127&e),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&e=-jspb.BinaryConstants.TWO_TO_63&&e=-jspb.BinaryConstants.TWO_TO_31&&e>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&ee),this.buffer_.push(255&e>>>0)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(255&e>>>0),this.buffer_.push(255&e>>>8)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&e>>0),this.buffer_.push(255&e>>>8),this.buffer_.push(255&e>>>16),this.buffer_.push(255&e>>>24)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&ee),this.buffer_.push(255&e>>>0)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(255&e>>>0),this.buffer_.push(255&e>>>8)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e>>0),this.buffer_.push(255&e>>>8),this.buffer_.push(255&e>>>16),this.buffer_.push(255&e>>>24)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e=-jspb.BinaryConstants.TWO_TO_63&&+e=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(goog.isBoolean(e)||goog.isNumber(e)),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&en)this.buffer_.push(n);else if(2048>n)this.buffer_.push(192|n>>6),this.buffer_.push(128|63&n);else if(65536>n)if(55296<=n&&56319>=n&&a+1=s&&(n=1024*(n-55296)+s-56320+65536,this.buffer_.push(240|n>>18),this.buffer_.push(128|63&n>>12),this.buffer_.push(128|63&n>>6),this.buffer_.push(128|63&n),a++)}else this.buffer_.push(224|n>>12),this.buffer_.push(128|63&n>>6),this.buffer_.push(128|63&n);return this.buffer_.length-r},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop(),t=this.totalLength_+this.encoder_.length()-t;for(goog.asserts.assert(0<=t);127>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,r){this.appendUint8Array_(e.subarray(t,r))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,r){null!=e&&null!=t&&null!=r&&this.writeSerializedMessage(e,t,r)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(0==this.bookmarks_.length);for(var t=new Uint8Array(this.totalLength_+this.encoder_.length()),r=this.blocks_,a=r.length,n=0,s=0,o;s=-jspb.BinaryConstants.TWO_TO_31&&t=-jspb.BinaryConstants.TWO_TO_31&&r=-jspb.BinaryConstants.TWO_TO_63&&t=-jspb.BinaryConstants.TWO_TO_31&&t=-jspb.BinaryConstants.TWO_TO_63&&t=-jspb.BinaryConstants.TWO_TO_63&&+t=-jspb.BinaryConstants.TWO_TO_31&&t=-jspb.BinaryConstants.TWO_TO_63&&t=-jspb.BinaryConstants.TWO_TO_31&&tjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)},jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free(),this.elements_=this.nextMethod_=this.decoder_=null,this.cursor_=0,this.nextValue_=null,this.atEnd_=!0},jspb.BinaryIterator.prototype.get=function(){return this.nextValue_},jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_},jspb.BinaryIterator.prototype.next=function(){var e=this.nextValue_;return this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]),e},jspb.BinaryDecoder=function(e,t,r){this.bytes_=null,this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,r)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,r){if(jspb.BinaryDecoder.instanceCache_.length){var a=jspb.BinaryDecoder.instanceCache_.pop();return e&&a.setBlock(e,t,r),a}return new jspb.BinaryDecoder(e,t,r)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,r){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=goog.isDef(t)?t:0,this.end_=goog.isDef(r)?this.start_+r:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var e=0,t=0,r,n;4>t;t++)if(r=this.bytes_[this.cursor_++],e|=(127&r)<<7*t,128>r)return this.tempLow_=e>>>0,void(this.tempHigh_=0);if(r=this.bytes_[this.cursor_++],e|=(127&r)<<28,n=0|(127&r)>>4,128>r)this.tempLow_=e>>>0,this.tempHigh_=n>>>0;else{for(t=0;5>t;t++)if(r=this.bytes_[this.cursor_++],n|=(127&r)<<7*t+3,128>r)return this.tempLow_=e>>>0,void(this.tempHigh_=n>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0}},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t;t=e[this.cursor_+0];var r=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+1],r|=(127&t)<<7,128>t)?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+2],r|=(127&t)<<14,128>t)?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+3],r|=(127&t)<<21,128>t)?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+4],r|=(15&t)<<28,128>t)?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),r>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),r)},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64_(),jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64_(),jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64_(),jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64_(),jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64_(),jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],a=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|r<<16|a<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],a=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|r<<16|a<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(t){var r=this.bytes_,n=this.cursor_;t=n+t;for(var s=[],o="",i;ni)s.push(i);else if(192>i)continue;else if(224>i){var d=r[n++];s.push((31&i)<<6|63&d)}else if(240>i){var d=r[n++],p=r[n++];s.push((15&i)<<12|(63&d)<<6|63&p)}else if(248>i){var d=r[n++],p=r[n++],l=r[n++],i=(7&i)<<18|(63&d)<<12|(63&p)<<6|63&l,i=i-65536;s.push((1023&i>>10)+55296,(1023&i)+56320)}8192<=s.length&&(o+=_StringfromCharCode4.apply(null,s),s.length=0)}return o+=goog.crypt.byteArrayToString(s),this.cursor_=n,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64_(),jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var t=this.bytes_,r=this.cursor_,n=t[r+0],s=t[r+1],o=t[r+2],e=t[r+3],i=t[r+4],d=t[r+5],p=t[r+6],t=t[r+7];return this.cursor_+=8,_StringfromCharCode4(n,s,o,e,i,d,p,t)},jspb.BinaryReader=function(e,t,r){this.decoder_=jspb.BinaryDecoder.alloc(e,t,r),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,r){if(jspb.BinaryReader.instanceCache_.length){var a=jspb.BinaryReader.instanceCache_.pop();return e&&a.decoder_.setBlock(e,t,r),a}return new jspb.BinaryReader(e,t,r)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,r){this.decoder_.setBlock(e,t,r),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3,e=7&e;return e!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type"),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_==jspb.BinaryConstants.WireType.VARINT?this.decoder_.skipVarint():(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField())},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32?this.decoder_.advance(4):(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField())},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64?this.decoder_.advance(8):(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField())},jspb.BinaryReader.prototype.skipGroup=function(){var e=[this.nextField_];do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP)e.push(this.nextField_);else if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP&&this.nextField_!=e.pop()){goog.asserts.fail("Unmatched end-group tag"),this.error_=!0;break}}while(0r;r++)if(7=parseInt(t[r],16)&&e[r].toLowerCase()!==e[r])return!1;return!0},u=function(e){e=s.encode(e);var t="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(var r=0;ro.length?"0"+o:o}return"0x"+t},f=function(e){if(r.isNull(e)||r.isUndefined(e))return e;if(!isFinite(e)&&!b(e))throw new Error("Given input \""+e+"\" is not a number.");var t=p(e),n=t.toString(16);return t.lt(new a(0))?"-0x"+n.substr(1):"0x"+n},y=function(e){if(e=e.toString(16),!b(e))throw new Error("Given value \""+e+"\" is not a valid hex string.");e=e.replace(/^0x/i,"");for(var t=[],r=0;re?"int256":"uint256":f(e)},hexToBytes:y,bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},isHex:function(e){return(r.isString(e)||r.isNumber(e))&&/^(-0x|0x)?[0-9a-f]*$/i.test(e)},isHexStrict:b,leftPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+Array(n).join(r?r:"0")+e},rightPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+e+Array(n).join(r?r:"0")},toTwosComplement:function(e){return"0x"+p(e).toTwos(256).toString(16,64)},sha3:g}},{"bn.js":365,"eth-lib/lib/hash":336,"number-to-bn":358,underscore:363,utf8:364}],369:[function(e,t,r){var a=e("google-protobuf"),n=a,s=Function("return this")();n.exportSymbol("proto.AccountGasLimit",null,s),n.exportSymbol("proto.BlackList",null,s),n.exportSymbol("proto.Block",null,s),n.exportSymbol("proto.BlockBody",null,s),n.exportSymbol("proto.BlockHeader",null,s),n.exportSymbol("proto.BlockTxs",null,s),n.exportSymbol("proto.BlockWithProof",null,s),n.exportSymbol("proto.Crypto",null,s),n.exportSymbol("proto.Proof",null,s),n.exportSymbol("proto.ProofType",null,s),n.exportSymbol("proto.RichStatus",null,s),n.exportSymbol("proto.SignedTransaction",null,s),n.exportSymbol("proto.StateSignal",null,s),n.exportSymbol("proto.Status",null,s),n.exportSymbol("proto.Transaction",null,s),n.exportSymbol("proto.UnverifiedTransaction",null,s),proto.Proof=function(e){a.Message.initialize(this,e,0,-1,null,null)},n.inherits(proto.Proof,a.Message),n.DEBUG&&!COMPILED&&(proto.Proof.displayName="proto.Proof"),a.Message.GENERATE_TO_OBJECT&&(proto.Proof.prototype.toObject=function(e){return proto.Proof.toObject(e,this)},proto.Proof.toObject=function(e,t){var r={content:t.getContent_asB64(),type:a.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.Proof.deserializeBinary=function(e){var t=new a.BinaryReader(e),r=new proto.Proof;return proto.Proof.deserializeBinaryFromReader(r,t)},proto.Proof.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){var r=t.getFieldNumber();switch(r){case 1:var a=t.readBytes();e.setContent(a);break;case 2:var a=t.readEnum();e.setType(a);break;default:t.skipField();}}return e},proto.Proof.prototype.serializeBinary=function(){var e=new a.BinaryWriter;return proto.Proof.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.Proof.serializeBinaryToWriter=function(e,t){var r;r=e.getContent_asU8(),0{e.base=e.base||{},e.extend({property:"base",methods:[d.peerCount,d.getMetaData,d.getAbi,d.getCode,d.getBalance,d.getTransactionReceipt,d.getAccounts,d.getBlock,d.getBlockByHash,d.getBlockByNumber,d.getBlockNumber,d.getBlockTransactionCount,d.getTransaction,d.getTransactionCount,d.getTransactionProof,d.sendSignedTransaction,d.signTransaction,d.sendTransaction,d.sign,d.call,d.newMessageFilter,d.newBlockFilter,d.getFilterLogs,d.getFilterChanges,d.deleteMessageFilter,d.getLogs,p.getAccounts,p.newAccount,p.sign,p.ecRecover]}),e.base.accounts=e.eth.accounts,u.default.setProvider(e.currentProvider),u.default.accounts=e.base.accounts,e.base.Contract=u.default,e=c.default(e),e.base.signer=i.default,e.base.unsigner=i.unsigner,e.base.deploy=(t,r)=>n(this,void 0,void 0,function*(){const n=yield e.base.getBlockNumber().catch(e=>{console.error(e)});let o="",s=[],i=[],d="";"string"==typeof t?o=t:t.code&&(o=t.code,s=t.args||[],i=t.initTypes||[]),s.length&&(d=e.eth.abi.encodeParameters(i,s));const p=Object.assign({version:0,value:0,nonce:a(10*Math.random())},r,{data:o.replace(/^0x/,"")+d,validUntilBlock:+n+88}),c=l.default(e.eth.accounts.wallet)(p),u=yield e.base.sendTransaction(c).catch(e=>{throw new Error(e)});return u.hash?e.listeners.listenToTransactionReceipt(u.hash):new Error("No Transaction Hash Received")}),e.base._abiAddress=b.ReservedAddr.abiAddress.replace(/^0x/,""),Object.defineProperty(e.base,"abiAddress",{get:()=>e.base._abiAddress,set:t=>{if(e.utils.isAddress(t))e.base._abiAddress=t.replace(/^0x/,"");else throw new Error("Not valid address")}}),e.base.storeAbi=(t,r,o)=>n(this,void 0,void 0,function*(){if(!t)throw new Error("Store ABI needs contract address");if(!Array.isArray(r))throw new Error("ABI should be Array type");const n=Object.assign({version:0,value:0,nonce:a(10*Math.random())},o,{to:e.base.abiAddress}),s=l.default(e.eth.accounts.wallet)(n);try{const a=e.utils.utf8ToHex(JSON.stringify(r)).slice(2);s.data=t.replace(/^0x/i,"")+a}catch(e){throw new Error(e)}const i=yield e.base.sendTransaction(s),d=yield e.listeners.listenToTransactionReceipt(i.hash);return d});const t={sign:e.base.neuron_sign};return e.base.personal=t,Object.assign(e.utils,y.default),f.default(e)}},{"../contract":8,"../systems/config":24,"../utils/addPrivateKey":26,"../utils/validators":31,"./listener":2,"./neuron":3,"./proxy":4,"./rpc":6,"@cryptape/cita-signer":316}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=["getTransactionReceipt","getTransaction","getTransactionProof","getFilterChanges"];r.default=e=>{let t={};return a.forEach(r=>{t[`listenTo${r.slice(3)}`]=(t,a=10)=>new Promise((n,o)=>{let s=a,i=null;const d=()=>{clearInterval(i)};i=setInterval(()=>{s||(d(),o("No Result Received")),e.base[r](t).then(e=>{s--,("getFilterChanges"===r&&e.length||e)&&(clearInterval(i),n(e))})},1e3)})}),e.listeners=t,e}},{}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("web3-core-helpers").formatters,n=e("web3-utils");r.getAccounts={name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:n.toChecksumAddress},r.newAccount={name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:n.toChecksumAddress},r.unlockAccount={name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[a.inputAddressFormatter,null,null]},r.lockAccount={name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[a.inputAddressFormatter]},r.sign={name:"neuron_sign",call:"neuron_sign",params:3,inputFormatter:[a.inputSignFormatter,a.inputAddressFormatter,null],transformPayload:function(e){return e.params.reverse(),e}},r.ecRecover={name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[a.inputSignFormatter,null]}},{"web3-core-helpers":255,"web3-utils":295}],4:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=a(e("./proxyHandlers"));r.default=e=>(e.base.sendTransaction=new Proxy(e.base.sendTransaction,n.default.sendTransactionHandler),e.base.getLogs=new Proxy(e.base.getLogs,n.default.getLogsHandler),e)},{"./proxyHandlers":5}],5:[function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))(function(n,o){function s(e){try{d(a.next(e))}catch(t){o(t)}}function i(e){try{d(a["throw"](e))}catch(t){o(t)}}function d(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(s,i)}d((a=a.apply(e,t||[])).next())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const o=n(e("../../utils/addPrivateKey")),s=e("../../utils/parsers");r.sendTransactionHandler={apply:function(e,t,r){return a(this,void 0,void 0,function*(){const a=r[0],n=o.default(t.accounts.wallet)(a);return e(n)})}},r.getLogsHandler={apply:function(e,t,r){return a(this,void 0,void 0,function*(){const t=r[0],a=r[1];return e(t).then(t=>{if(!a)return t;try{const e=[...t].map(e=>s.LogParser(e,a));return e}catch(r){return console.warn(r.message),t}})})}},r.default={sendTransactionHandler:r.sendTransactionHandler,getLogsHandler:r.getLogsHandler}},{"../../utils/addPrivateKey":26,"../../utils/parsers":28}],6:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(r,"__esModule",{value:!0});const o=a(e("@cryptape/cita-signer")),s=e("underscore"),i=e("web3-core-helpers").formatters,d=e("web3-utils"),p=n(e("../utils/outputFormatters"));r.peerCount={name:"peerCount",call:"peerCount",params:0},r.getMetaData={name:"getMetaData",call:"getMetaData",params:1,inputFormatter:[i.inputDefaultBlockNumberFormatter]},r.getAbi={name:"getAbi",call:"getAbi",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:p.outputAbiFormatter},r.getTransactionReceipt={name:"getTransactionReceipt",call:"getTransactionReceipt",params:1,outputFormatter:i.outputTransactionReceiptFormatter},r.getCode={name:"getCode",call:"getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]},r.getAccounts={name:"getAccounts",call:"accounts",params:0,outputFormatter:d.toChecksumAddress},r.getBalance={name:"getBalance",call:"getBalance",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:d.hexToNumberString};r.getBlock={name:"getBlock",call:function(e){return s.isString(e[0])&&0===e[0].indexOf("0x")?"getBlockByHash":"getBlockByNumber"},params:2,inputFormatter:[i.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:i.outputBlockFormatter},r.getBlockByHash={name:"getBlockByHash",call:"getBlockByHash",params:2,inputFormatter:[i.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:i.outputBlockFormatter},r.getBlockByNumber={name:"getBlockByNumber",call:"getBlockByNumber",params:2,inputFormatter:[i.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:i.outputBlockFormatter},r.getBlockNumber={name:"getBlockNumber",call:"blockNumber",params:0,outputFormatter:d.hexToNumber};r.getBlockTransactionCount={name:"getBlockTransactionCount",call:function(e){return s.isString(e[0])&&0===e[0].indexOf("0x")?"getBlockTransactionCountByHash":"getBlockTransactionCountByNumber"},params:1,inputFormatter:[i.inputBlockNumberFormatter],outputFormatter:d.hexToNumber},r.getTransaction={name:"getTransaction",call:"getTransaction",params:1,inputFormatter:[null],outputFormatter:p.outputTransactionFormatter},r.getTransactionCount={name:"getTransactionCount",call:"getTransactionCount",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter],outputFormatter:d.hexToNumber},r.getTransactionProof={name:"getTransactionProof",call:"getTransactionProof",params:1},r.sendSignedTransaction={name:"sendSignedTransaction",call:"sendRawTransaction",params:1,inputFormatter:[null]},r.signTransaction={name:"signTransaction",call:"signTransaction",params:1,inputFormatter:[o.default]};r.sendTransaction={name:"sendTransaction",call:e=>e&&e.length&&e[0]&&e[0].privateKey?"sendRawTransaction":"sendTransaction",params:1,inputFormatter:[o.default]},r.newMessageFilter={name:"newMessageFilter",call:"newFilter",params:1},r.newBlockFilter={name:"newBlockFilter",call:"newBlockFilter",params:0},r.getFilterChanges={name:"getFilterChanges",call:"getFilterChanges",params:1},r.getFilterLogs={name:"getFilterLogs",call:"getFilterLogs",params:1},r.deleteMessageFilter={name:"deleteMessageFilter",call:"uninstallFilter",params:1},r.sign={name:"sign",call:"sign",params:2,inputFormatter:[i.inputSignFormatter,i.inputAddressFormatter],transformPayload:function(e){return e.params.reverse(),e}},r.call={name:"call",call:"call",params:2,inputFormatter:[i.inputCallFormatter,i.inputDefaultBlockNumberFormatter]},r.getLogs={name:"getLogs",call:"getLogs",params:1}},{"../utils/outputFormatters":27,"@cryptape/cita-signer":316,underscore:245,"web3-core-helpers":255,"web3-utils":295}],7:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=a(e("./index"));window&&(window.CITASDK=n.default)},{"./index":9}],8:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(r,"__esModule",{value:!0});const o=a(e("@cryptape/cita-signer")),s=a(e("../utils/addPrivateKey")),i=n(e("underscore")),d=e("web3-eth-contract"),p=e("web3-core-method"),c=e("web3-utils"),{formatters:l}=e("web3-core-helpers"),u=e("web3-core-promievent");var f;(function(e){e.NONE="",e.CALL="call",e.SEND="send",e.SEND_TRANSACTION="sendTransaction"})(f||(f={}));const y=e=>{const t=s.default(d.accounts.wallet)(e);return o.default(t)};d.prototype._executeMethod=function(){const e=this;let t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),void 0);var r=u("send"!==t.type);const a=e.constructor._ethAccounts||e._ethAccounts;if(t.generateRequest){const e={params:[l.inputCallFormatter.call(this._parent,t.options)],callback:t.callback,method:"",format:null};return t.type===f.CALL?(e.params.push(l.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),e.method=f.CALL,e.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):e.method=f.SEND_TRANSACTION,e}switch(t.type){case f.CALL:const n=new p({name:"call",call:f.CALL,params:2,inputFormatter:[l.inputCallFormatter,l.inputDefaultBlockNumberFormatter],outputFormatter:function(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:a,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return n(t.options,t.defaultBlock,t.callback);case f.SEND:if(!c.isAddress(t.options.from))return c._fireError(new Error("No \"from\" address specified in neither the given options, nor the default options."),r.eventEmitter,r.reject,t.callback);if(i.isBoolean(this._method.payable)&&!this._method.payable&&t.options.value&&0{if(i.isArray(t.logs)){const r=i.map(t.logs,function(t){return e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)});t.events={};let a=0;r.forEach(e=>{e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[a]=e,a++)}),delete t.logs}return t},contractDeployFormatter:t=>{const r=e._parent.clone();return r.options.address=t.contractAddress,r}}}).createFunction();return o(t.options,t.callback);}},d.prototype.getPastEvents=function(){const e=this._generateEventOptions.apply(this,arguments);let t=new p({name:"getPastLogs",call:"getLogs",params:1,inputFormatter:[l.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);const r=t.buildCall();return t=null,r(e.params,e.callback)},r.default=d},{"../utils/addPrivateKey":26,"@cryptape/cita-signer":316,underscore:245,"web3-core-helpers":255,"web3-core-method":256,"web3-core-promievent":257,"web3-eth-contract":276,"web3-utils":295}],9:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=e("web3"),o=a(e("./systems")),s=a(e("./base")),i=a(e("./utils/patchHexToBytes")),d=a(e("./utils/patchPrivateKeyToAccount"));r.default=(e,t=n)=>{const r=new t(e);i.default(r),d.default(r);const a=s.default(r),p=o.default(a);return p}},{"./base":1,"./systems":25,"./utils/patchHexToBytes":29,"./utils/patchPrivateKeyToAccount":30,web3:299}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_account",type:"address"}],name:"update",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"isAdmin",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"admin",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_account",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_old",type:"address"},{indexed:!0,name:"_sender",type:"address"}],name:"AdminUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"}]},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"cancelAuth",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"createContractAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"checkPermission",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_permission",type:"address"}],name:"queryAccounts",outputs:[{name:"_accounts",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"rootGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"groupCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"}],name:"clearAuthOfPermission",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"permissionCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"allGroupsAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sysConfigAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"adminAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"}],name:"queryPermissions",outputs:[{name:"_permissions",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"userManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"uint256"}],name:"builtInPermissions",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"clearAuth",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"permissionManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"authorizationAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sendTxAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"queryAllAccounts",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"address"},{name:"",type:"bytes4"}],name:"checkResource",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"roleAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"setAuth",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{name:"_superAdmin",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_permission",type:"address"}],name:"AuthSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_permission",type:"address"}],name:"AuthCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"}],name:"AuthCleared",type:"event"}]},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"",type:"bytes"}],name:"multiTxs",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getChainId",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"id",type:"uint32"}],name:"getAuthorities",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"getParentChainId",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint32"}],name:"enableSideChain",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"sideChainId",type:"uint32"},{name:"addrs",type:"address[]"}],name:"newSideChain",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"id",type:"uint32"}],name:"disableSideChain",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"",type:"uint32"}],name:"sideChains",outputs:[{name:"status",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_pid",type:"uint32"},{name:"_addrs",type:"address[]"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"}]},{}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"state",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_state",type:"bool"}],name:"setState",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"},{name:"_accounts",type:"address[]"}],name:"addAccounts",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"queryGroups",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"},{name:"_name",type:"bytes32"}],name:"updateGroupName",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"}],name:"deleteGroup",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_name",type:"bytes32"},{name:"_accounts",type:"address[]"}],name:"newGroup",outputs:[{name:"new_group",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"},{name:"_accounts",type:"address[]"}],name:"deleteAccounts",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_origin",type:"address"},{name:"_target",type:"address"}],name:"checkScope",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,name:"_group",type:"address"}],name:"GroupDeleted",type:"event"}]},{}],16:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=a(e("./admin")),o=a(e("./authorization")),s=a(e("./batchTx")),i=a(e("./chainManager")),d=a(e("./emergencyBrake")),p=a(e("./groupManagement")),c=a(e("./nodeManager")),l=a(e("./permissionManagement")),u=a(e("./priceManager")),f=a(e("./quotaManager")),y=a(e("./roleManagement")),b=a(e("./sysConfig")),g=a(e("./versionManager")),h={admin:n.default,authorization:o.default,batchTx:s.default,chainManager:i.default,emergencyBrake:d.default,groupManagement:p.default,nodeManager:c.default,permissionManagement:l.default,priceManager:u.default,quotaManager:f.default,roleManagement:y.default,sysConfig:b.default,versionManager:g.default};r.default=h},{"./admin":10,"./authorization":11,"./batchTx":12,"./chainManager":13,"./emergencyBrake":14,"./groupManagement":15,"./nodeManager":17,"./permissionManagement":18,"./priceManager":19,"./quotaManager":20,"./roleManagement":21,"./sysConfig":22,"./versionManager":23}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"deleteRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_node",type:"address"}],name:"stakePermillage",outputs:[{name:"",type:"uint64"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"createContractAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_node",type:"address"}],name:"deleteNode",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"rootGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_node",type:"address"}],name:"getStatus",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"groupCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newPermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"permissionCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deleteGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_node",type:"address"},{name:"stake",type:"uint64"}],name:"setStake",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"newRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"listNode",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"status",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"listStake",outputs:[{name:"_stakes",type:"uint64[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deletePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"adminAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"userManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"permissionManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"authorizationAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sendTxAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_node",type:"address"}],name:"approveNode",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"roleAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updatePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_nodes",type:"address[]"},{name:"_stakes",type:"uint64[]"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_node",type:"address"}],name:"ApproveNode",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_node",type:"address"}],name:"DeleteNode",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_node",type:"address"},{indexed:!1,name:"_stake",type:"uint256"}],name:"SetStake",type:"event"}]},{}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"setAuthorization",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permission",type:"address"}],name:"cancelAuthorization",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permissions",type:"address[]"}],name:"setAuthorizations",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"},{name:"_name",type:"bytes32"}],name:"updatePermissionName",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"},{name:"_conts",type:"address[]"},{name:"_funcs",type:"bytes4[]"}],name:"deleteResources",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"}],name:"deletePermission",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"clearAuthorization",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_permissions",type:"address[]"}],name:"cancelAuthorizations",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_permission",type:"address"},{name:"_conts",type:"address[]"},{name:"_funcs",type:"bytes4[]"}],name:"addResources",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_conts",type:"address[]"},{name:"_funcs",type:"bytes4[]"}],name:"newPermission",outputs:[{name:"id",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!1,name:"_permission",type:"address"}],name:"PermissionDeleted",type:"event"}]},{}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getQuotaPrice",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_quotaPrice",type:"uint256"}],name:"setQuotaPrice",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"deleteRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getBQL",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"createContractAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"rootGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"groupCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newPermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"permissionCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deleteGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_value",type:"uint256"}],name:"setAQL",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"newRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"cancelRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"newGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deletePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"adminAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getAccounts",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_value",type:"uint256"}],name:"setBQL",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"}],name:"getAQL",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"userManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updateGroupAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_value",type:"uint256"}],name:"setDefaultAQL",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"permissionManagementAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getDefaultAQL",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"authorizationAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"setRoleAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"sendTxAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getQuotas",outputs:[{name:"",type:"uint256[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleAuthAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"updatePermissionAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"roleCreatorAddr",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{name:"_admin",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"errorType",type:"uint8"},{indexed:!1,name:"msg",type:"string"}],name:"ErrorLog",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_value",type:"uint256"},{indexed:!0,name:"_sender",type:"address"}],name:"DefaultAqlSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_value",type:"uint256"},{indexed:!0,name:"_sender",type:"address"}],name:"BqlSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!1,name:"_value",type:"uint256"},{indexed:!0,name:"_sender",type:"address"}],name:"AqlSetted",type:"event"}]},{}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!1,inputs:[{name:"_roleid",type:"address"},{name:"_permissions",type:"address[]"}],name:"addPermissions",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_roleid",type:"address"},{name:"_permissions",type:"address[]"}],name:"deletePermissions",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_roleId",type:"address"}],name:"queryAccounts",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_roleid",type:"address"}],name:"deleteRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_name",type:"bytes32"},{name:"_permissions",type:"address[]"}],name:"newRole",outputs:[{name:"roleid",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_role",type:"address"}],name:"queryPermissions",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_role",type:"address"}],name:"setRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"},{name:"_role",type:"address"}],name:"cancelRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_account",type:"address"}],name:"clearRole",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_roleid",type:"address"},{name:"_name",type:"bytes32"}],name:"updateRoleName",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_account",type:"address"}],name:"queryRoles",outputs:[{name:"",type:"address[]"}],payable:!1,stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_role",type:"address"}],name:"RoleSetted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"},{indexed:!0,name:"_role",type:"address"}],name:"RoleCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_account",type:"address"}],name:"RoleCleared",type:"event"}]},{}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getChainId",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getEconomicalModel",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_operator",type:"string"}],name:"setOperator",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getDelayBlockNumber",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getFeeBackPlatformCheck",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getTokenInfo",outputs:[{name:"name",type:"string"},{name:"symbol",type:"string"},{name:"avatar",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getQuotaCheck",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_chainName",type:"string"}],name:"setChainName",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getBlockInterval",outputs:[{name:"",type:"uint64"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getChainName",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getPermissionCheck",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getWebsite",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getChainOwner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getOperator",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_website",type:"string"}],name:"setWebsite",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{name:"_delayBlockNumber",type:"uint256"},{name:"_checkPermission",type:"bool"},{name:"_checkQuota",type:"bool"},{name:"_checkFeeBackPlatform",type:"bool"},{name:"_chainOwner",type:"address"},{name:"_chainName",type:"string"},{name:"_chainId",type:"uint32"},{name:"_operator",type:"string"},{name:"_website",type:"string"},{name:"_blockInterval",type:"uint64"},{name:"_economicalModel",type:"uint8"},{name:"_name",type:"string"},{name:"_symbol",type:"string"},{name:"_avatar",type:"string"}],payable:!1,stateMutability:"nonpayable",type:"constructor"}]},{}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[{constant:!0,inputs:[],name:"getVersion",outputs:[{name:"",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_version",type:"uint32"}],name:"setVersion",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},{}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ReservedAddr={admin:"0xffffffffffffffffffffffffffffffffff02000c",authorization:"0xffffffffffffffffffffffffffffffffff020006",batchTx:"0xffffffffffffffffffffffffffffffffff02000e",chainManager:"0xffffffffffffffffffffffffffffffffff020002",emergencyBrake:"0xffffffffffffffffffffffffffffffffff02000f",group:"0xffffffffffffffffffffffffffffffffff020009",groupManagement:"0xffffffffffffffffffffffffffffffffff02000a",nodeManager:"0xffffffffffffffffffffffffffffffffff020001",permissionManagement:"0xffffffffffffffffffffffffffffffffff020004",priceManager:"0xffffffffffffffffffffffffffffffffff020010",quotaManager:"0xffffffffffffffffffffffffffffffffff020003",roleManagement:"0xffffffffffffffffffffffffffffffffff020007",sysConfig:"0xffffffffffffffffffffffffffffffffff020000",versionManager:"0xffffffffffffffffffffffffffffffffff020011",abiAddress:"0xffffffffffffffffffffffffffffffffff010001"}},{}],25:[function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const n=e("./config"),o=a(e("./abis")),s=["admin","authorization","batchTx","chainManager","emergencyBrake","groupManagement","nodeManager","permissionManagement","priceManager","quotaManager","roleManagement","sysConfig","versionManager"],i=(e,t)=>new e.base.Contract(o.default[t],n.ReservedAddr[t]);r.default=e=>{const t={};return s.forEach(r=>{t[r]=i(e,r)}),Object.assign(e,{system:t})}},{"./abis":16,"./config":24}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=e=>t=>!e.length||t.privateKey&&(66===t.privateKey.length||64===t.privateKey.length)?t:(t.privateKey||(t.privateKey=e[0].privateKey,t.from=e[0].from),t)},{}],27:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const{unsigner:a}=e("@cryptape/cita-signer"),n=e("web3-utils");r.outputTransactionFormatter=e=>Object.assign({},e,{unsignedTransaction:a(e.content)}),r.outputAbiFormatter=e=>{if("string"!=typeof e)throw new Error("Malformed ABI");const t=n.hexToUtf8(e);try{const e=JSON.parse(t);return e}catch(e){throw new Error("Malformed ABI")}}},{"@cryptape/cita-signer":316,"web3-utils":295}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("web3-eth-abi");r.LogParser=(e,t)=>{if("string"==typeof e)return e;if(!t)throw new Error("ABI Missed");const r=a.decodeLog(t,e.data||"",e.topics||[]);return Object.assign({},e,{decodedLogs:r})}},{"web3-eth-abi":266}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=e=>{e.utils.hexToBytes=new Proxy(e.utils.hexToBytes,{apply:(e,t,r)=>{let a=(""+r[0]||"").replace(/^0x/,"");return a.length%2&&(a="0"+a),e("0x"+a)}})}},{}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=e=>{e.eth.accounts.privateKeyToAccount=new Proxy(e.eth.accounts.privateKeyToAccount,{apply:(e,t,r)=>{let a=r[0];return a&&64===a.length&&(a="0x"+a),e.call(t,a)}})}},{}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("web3-utils");r.isPrivateKey=e=>{if(!e)return console.warn("No Private Key"),!1;if("string"!=typeof e)return console.warn("Invalid Type of Private Key"),!1;const t=e.replace(/^0x/,"");return 64===t.length?!!a.isHex(t)||(console.warn("Invalid Hex of Private Key"),!1):(console.warn("Invalid Length of Private Key"),!1)},r.default={isPrivateKey:r.isPrivateKey}},{"web3-utils":295}],32:[function(e,t){t.exports=e("./register")().Promise},{"./register":34}],33:[function(e,t){"use strict";var r=null;t.exports=function(e,t){return function(a,n){a=a||null,n=n||{};var o=!1!==n.global;if(null===r&&o&&(r=e["@@any-promise/REGISTRATION"]||null),null!==r&&null!==a&&r.implementation!==a)throw new Error("any-promise already defined as \""+r.implementation+"\". You can only register an implementation before the first call to require(\"any-promise\") and an implementation cannot be changed");return null===r&&(r=null!==a&&"undefined"!=typeof n.Promise?{Promise:n.Promise,implementation:a}:t(a),o&&(e["@@any-promise/REGISTRATION"]=r)),r}}},{}],34:[function(e,t){"use strict";t.exports=e("./loader")(window,function(){if("undefined"==typeof window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}})},{"./loader":33}],35:[function(e,t,r){var a=r;a.bignum=e("bn.js"),a.define=e("./asn1/api").define,a.base=e("./asn1/base"),a.constants=e("./asn1/constants"),a.decoders=e("./asn1/decoders"),a.encoders=e("./asn1/encoders")},{"./asn1/api":36,"./asn1/base":38,"./asn1/constants":42,"./asn1/decoders":44,"./asn1/encoders":47,"bn.js":50}],36:[function(e,t,r){function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}var n=e("../asn1"),o=e("inherits");r.define=function(e,t){return new a(e,t)};a.prototype._createNamed=function(t){var r;try{r=e("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){r=function(e){this._initNamed(e)}}return o(r,t),r.prototype._initNamed=function(e){t.call(this,e)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"../asn1":35,inherits:162,vm:251}],37:[function(e,t,r){function a(e,t){return s.call(this,t),i.isBuffer(e)?void(this.base=e,this.offset=0,this.length=e.length):void this.error("Input not Buffer")}function n(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof n||(e=new n(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&255>=e))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=i.byteLength(e);else if(i.isBuffer(e))this.value=e,this.length=e.length;else return t.error("Unsupported type: "+typeof e)}var o=e("inherits"),s=e("../base").Reporter,i=e("buffer").Buffer;o(a,s),r.DecoderBuffer=a,a.prototype.save=function(){return{offset:this.offset,reporter:s.prototype.save.call(this)}},a.prototype.restore=function(e){var t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,s.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},r.EncoderBuffer=n,n.prototype.join=function(e,t){return(e||(e=new i(this.length)),t||(t=0),0===this.length)?e:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},{"../base":38,buffer:83,inherits:162}],38:[function(e,t,r){var a=r;a.Reporter=e("./reporter").Reporter,a.DecoderBuffer=e("./buffer").DecoderBuffer,a.EncoderBuffer=e("./buffer").EncoderBuffer,a.Node=e("./node")},{"./buffer":37,"./node":39,"./reporter":40}],39:[function(e,t){function r(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r["default"]=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var a=e("../base").Reporter,n=e("../base").EncoderBuffer,o=e("../base").DecoderBuffer,s=e("minimalistic-assert"),i=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],d=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(i);t.exports=r;var p=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];r.prototype.clone=function(){var e=this._baseState,t={};p.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},r.prototype._wrap=function(){var e=this._baseState;d.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},r.prototype._init=function(e){var t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),s.equal(t.children.length,1,"Root node can have only one child")},r.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var a=e[r];t[a]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){r.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),i.forEach(function(e){r.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}}),r.prototype.use=function(e){s(e);var t=this._baseState;return s(null===t.use),t.use=e,this},r.prototype.optional=function(){var e=this._baseState;return e.optional=!0,this},r.prototype.def=function(e){var t=this._baseState;return s(null===t["default"]),t["default"]=e,t.optional=!0,this},r.prototype.explicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},r.prototype.implicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},r.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},r.prototype.key=function(e){var t=this._baseState;return s(null===t.key),t.key=e,this},r.prototype.any=function(){var e=this._baseState;return e.any=!0,this},r.prototype.choice=function(e){var t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},r.prototype.contains=function(e){var t=this._baseState;return s(null===t.use),t.contains=e,this},r.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var a=r["default"],n=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){var i=null;if(null===r.explicit?null===r.implicit?null!==r.tag&&(i=r.tag):i=r.implicit:i=r.explicit,null===i&&!r.any){var d=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),n=!0}catch(t){n=!1}e.restore(d)}else if(n=this._peekTag(e,i,r.any),e.isError(n))return n}var p;if(r.obj&&n&&(p=e.enterObject()),n){if(null!==r.explicit){var c=this._decodeTag(e,r.explicit);if(e.isError(c))return c;e=c}var l=e.offset;if(null===r.use&&null===r.choice){if(r.any)var d=e.save();var u=this._decodeTag(e,null===r.implicit?r.tag:r.implicit,r.any);if(e.isError(u))return u;r.any?a=e.raw(d):e=u}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),a=r.any?a:null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),e.isError(a))return a;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var f=new o(a);a=this._getUse(r.contains,e._reporterState.obj)._decode(f,t)}}return r.obj&&n&&(a=e.leaveObject(p)),null!==r.key&&(null!==a||!0===n)?e.leaveKey(s,r.key,a):null!==s&&e.exitKey(s),a},r.prototype._decodeGeneric=function(e,t,r){var a=this._baseState;if("seq"===e||"set"===e)return null;return"seqof"===e||"setof"===e?this._decodeList(t,e,a.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&a.args?this._decodeObjid(t,a.args[0],a.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,a.args&&a.args[0],r):null===a.use?t.error("unknown tag: "+e):this._getUse(a.use,t._reporterState.obj)._decode(t,r)},r.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},r.prototype._decodeChoice=function(t,e){var r=this._baseState,a=null,n=!1;return Object.keys(r.choice).some(function(o){var s=t.save(),i=r.choice[o];try{var d=i._decode(t,e);if(t.isError(d))return!1;a={type:o,value:d},n=!0}catch(r){return t.restore(s),!1}return!0},this),n?a:t.error("Choice not matched")},r.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},r.prototype._encode=function(e,t,r){var a=this._baseState;if(null===a["default"]||a["default"]!==e){var n=this._encodeValue(e,t,r);return void 0===n||this._skipDefault(n,t,r)?void 0:n}},r.prototype._encodeValue=function(e,t,r){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new a);var o=null;if(this.reporter=t,n.optional&&void 0===e)if(null!==n["default"])e=n["default"];else return;var s=null,i=!1;if(n.any)o=this._createEncoderBuffer(e);else if(n.choice)o=this._encodeChoice(e,t);else if(n.contains)s=this._getUse(n.contains,r)._encode(e,t),i=!0;else if(n.children)s=n.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var a=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(a),n},this).filter(function(e){return e}),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!(n.args&&1===n.args.length))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var d=this.clone();d._baseState.implicit=null,s=this._createEncoderBuffer(e.map(function(r){var a=this._baseState;return this._getUse(a.args[0],e)._encode(r,t)},d))}else null===n.use?(s=this._encodePrimitive(n.tag,e),i=!0):o=this._getUse(n.use,r)._encode(e,t);var o;if(!n.any&&null===n.choice){var p=null===n.implicit?n.tag:n.implicit,c=null===n.implicit?"universal":"context";null===p?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(p,i,c,s))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},r.prototype._encodeChoice=function(e,t){var r=this._baseState,a=r.choice[e.type];return a||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),a._encode(e.value,t)},r.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},r.prototype._isNumstr=function(e){return /^[0-9 ]*$/.test(e)},r.prototype._isPrintstr=function(e){return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},{"../base":38,"minimalistic-assert":170}],40:[function(e,t,r){function a(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function n(e,t){this.path=e,this.rethrow(t)}var o=e("inherits");r.Reporter=a,a.prototype.isError=function(e){return e instanceof n},a.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},a.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},a.prototype.enterKey=function(e){return this._reporterState.path.push(e)},a.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},a.prototype.leaveKey=function(e,t,r){var a=this._reporterState;this.exitKey(e),null!==a.obj&&(a.obj[t]=r)},a.prototype.path=function(){return this._reporterState.path.join("/")},a.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},a.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},a.prototype.error=function(e){var t=this._reporterState,r=e instanceof n,a;if(a=r?e:new n(t.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!t.options.partial)throw a;return r||t.errors.push(a),a},a.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};o(n,Error),n.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,n),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:162}],41:[function(e,t,r){var a=e("../constants");r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=a._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=a._reverse(r.tag)},{"../constants":42}],42:[function(e,t,r){var a=r;a._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);var a=e[r];t[a]=r}),t},a.der=e("./der")},{"./der":41}],43:[function(e,t){function r(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new a,this.tree._init(e.body)}function a(e){d.Node.call(this,"der",e)}function n(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var a=c.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;var s=c.tag[r];return{cls:a,primitive:n,tag:r,tagStr:s}}function o(e,t,r){var a=e.readUInt8(r);if(e.isError(a))return a;if(!t&&128===a)return null;if(0==(128&a))return a;var n=127&a;if(4a?2e3+a:1900+a}else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(a,n-1,o,s,i,d,0)},a.prototype._decodeNull=function(){return null},a.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},a.prototype._decodeInt=function(e,t){var r=e.raw(),a=new p(r);return t&&(a=t[a.toString(10)]||a),a},a.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},{"../../asn1":35,inherits:162}],44:[function(e,t,r){var a=r;a.der=e("./der"),a.pem=e("./pem")},{"./der":43,"./pem":45}],45:[function(e,t){function r(e){o.call(this,e),this.enc="pem"}var a=e("inherits"),n=e("buffer").Buffer,o=e("./der");a(r,o),t.exports=r,r.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),a=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,d=-1,p=-1,c=0,l;ce?"0"+e:e}function o(e,t,r,a){var n;if("seqof"===e?e="seq":"setof"==e&&(e="set"),c.tagByName.hasOwnProperty(e))n=c.tagByName[e];else if("number"==typeof e&&(0|e)===e)n=e;else return a.error("Unknown tag: "+e);return 31<=n?a.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=c.tagClassByName[r||"universal"]<<6,n)}var s=e("inherits"),d=e("buffer").Buffer,i=e("../../asn1"),p=i.base,c=i.constants.der;t.exports=r,r.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},s(a,p.Node),a.prototype._encodeComposite=function(e,t,r,a){var n=o(e,t,r,this.reporter);if(128>a.length){var s=new d(2);return s[0]=n,s[1]=a.length,this._createEncoderBuffer([s,a])}for(var p=1,c=a.length;256<=c;c>>=8)p++;var s=new d(2+p);s[0]=n,s[1]=128|p;for(var c=1+p,l=a.length;0>=8)s[c]=255&l;return this._createEncoderBuffer([s,a])},a.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new d(2*e.length),a=0;a>=7)n++;for(var s=new d(n),p=s.length-1,a=e.length-1,o;0<=a;a--)for(o=e[a],s[p--]=127&o;0<(o>>=7);)s[p--]=128|127&o;return this._createEncoderBuffer(s)},a.prototype._encodeTime=function(e,t){var r=new Date(e),a;return"gentime"===t?a=[n(r.getFullYear()),n(r.getUTCMonth()+1),n(r.getUTCDate()),n(r.getUTCHours()),n(r.getUTCMinutes()),n(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?a=[n(r.getFullYear()%100),n(r.getUTCMonth()+1),n(r.getUTCDate()),n(r.getUTCHours()),n(r.getUTCMinutes()),n(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(a,"octstr")},a.prototype._encodeNull=function(){return this._createEncoderBuffer("")},a.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!d.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new d(r)}if(d.isBuffer(e)){var a=e.length;0===e.length&&a++;var n=new d(a);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(128>e)return this._createEncoderBuffer(e);if(256>e)return this._createEncoderBuffer([0,e]);for(var a=1,o=e;256<=o;o>>=8)a++;for(var n=Array(a),o=n.length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new d(n))},a.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},a.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},a.prototype._skipDefault=function(e,t,r){var a=this._baseState,n;if(null===a["default"])return!1;var o=e.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a["default"],t,r).join()),o.length!==a.defaultBuffer.length)return!1;for(n=0;n>16,s[d++]=255&f>>8,s[d++]=255&f;return 2===o&&(f=l[e.charCodeAt(c)]<<2|l[e.charCodeAt(c+1)]>>4,s[d++]=255&f),1===o&&(f=l[e.charCodeAt(c)]<<10|l[e.charCodeAt(c+1)]<<4|l[e.charCodeAt(c+2)]>>2,s[d++]=255&f>>8,s[d++]=255&f),s}function s(e){return c[63&e>>18]+c[63&e>>12]+c[63&e>>6]+c[63&e]}function d(e,t,r){for(var a=[],n=t,o;ns?s:o+n));return 1===r?(p=e[t-1],a.push(c[p>>2]+c[63&p<<4]+"==")):2===r&&(p=(e[t-2]<<8)+e[t-1],a.push(c[p>>10]+c[63&p>>4]+c[63&p<<2]+"=")),a.join("")}r.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=o,r.fromByteArray=p;for(var c=[],l=[],u="undefined"==typeof Uint8Array?Array:Uint8Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=0,b=f.length;y=p?p-49+10:17<=p&&22>=p?p-17+10:15&p;return n}function y(e,t,a,n){for(var o=0,s=d(e.length,a),p=t,l;p>>n}return t}function g(e,t,n){n.negative=t.negative^e.negative;var s=0|e.length+t.length;n.length=s,s=0|s-1;var p=0|e.words[0],c=0|t.words[0],l=p*c,u=67108863&l,f=0|l/67108864;n.words[0]=u;for(var y=1;y>>26,h=67108863&f,m=d(y,t.length-1),_=o(0,y-e.length+1),v;_<=m;_++)v=0|y-_,p=0|e.words[v],c=0|t.words[_],l=p*c+h,g+=0|l/67108864,h=67108863&l;n.words[y]=0|h,f=0|g}return 0===f?n.length--:n.words[y]=0|f,n.strip()}function h(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var s=0,p=0,c=0,l;c>>26),p+=l>>>26,l&=67108863}n.words[c]=u,s=l,l=p}return 0===s?n.length--:n.words[c]=s,n.strip()}function m(e,t,r){var a=new _;return a.mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}function v(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=f._prime(e);this.m=t.p,this.prime=t}else l(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),0!=this.shift%26&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=f:i.BN=f,f.BN=f,f.wordSize=26;var E;try{E=e("buffer").Buffer}catch(t){}f.isBN=function(e){return!!(e instanceof f)||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return 0e.cmp(t)?e:t},f.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),l(t===(0|t)&&2<=t&&36>=t),e=e.toString().replace(/\s+/g,"");var a=0;"-"===e[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip();"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initNumber=function(e,t,r){0>e&&(this.negative=1,e=-e),67108864>e?(this.words=[67108863&e],this.length=1):4503599627370496>e?(this.words=[67108863&e,67108863&e/67108864],this.length=2):(l(9007199254740992>e),this.words=[67108863&e,67108863&e/67108864,1],this.length=3);"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initArray=function(e,t,r){if(l("number"==typeof e.length),0>=e.length)return this.words=[0],this.length=1,this;this.length=s(e.length/3),this.words=Array(this.length);for(var a=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);else if("le"===r)for(a=0,o=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=s((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=6)o=u(e,r,r+6),this.words[n]|=67108863&o<>>26-a,a+=24,26<=a&&(a-=26,n++);r+6!==t&&(o=u(e,t,r+6),this.words[n]|=67108863&o<>>26-a),this.strip()},f.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;67108863>=n;n*=t)a++;a--,n=0|n/t;for(var o=e.length-r,s=o%a,p=d(o,o-s)+r,c=0,l=r;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c);if(0!==s){var u=1;for(c=y(e,l,e.length,t),l=0;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c)}},f.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t"};var T=["","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"],M=[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],I=[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];f.prototype.toString=function(e,t){e=e||10,t=0|t||1;var a;if(16===e||"hex"===e){a="";for(var n=0,o=0,s=0;s>>24-n,a=0!==o||s!=this.length-1?T[6-p.length]+p+a:p+a,n+=2,26<=n&&(n-=26,s--)}for(0!==o&&(a=o.toString(16)+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&2<=e&&36>=e){var u=M[e],f=I[e];a="";var y=this.clone();for(y.negative=0;!y.isZero();){var b=y.modn(f).toString(e);y=y.idivn(f),a=y.isZero()?b+a:T[u-b.length]+b+a}for(this.isZero()&&(a="0"+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}l(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=a&&(n+=7,a>>>=7),8<=a&&(n+=4,a>>>=4),2<=a&&(n+=2,a>>>=2),n+a},f.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,n=0;return 0==(8191&a)&&(n+=13,a>>>=13),0==(127&a)&&(n+=7,a>>>=7),0==(15&a)&&(n+=4,a>>>=4),0==(3&a)&&(n+=2,a>>>=2),0==(1&a)&&n++,n},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0,a;te.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.prototype.iuand=function(e){var t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.prototype.inotn=function(e){l("number"==typeof e&&0<=e);var t=0|s(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.prototype.setn=function(e,t){l("number"==typeof e&&0<=e);var r=0|e/26,a=e%26;return this._expand(r+1),t?this.words[r]|=1<e.length?(n=this,o=e):(n=e,o=this);for(var s=0,d=0;d>>26;for(;0!==s&&d>>26;if(this.length=n.length,0!==s)this.words[this.length]=s,this.length++;else if(n!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},f.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;var s,d;0>26,this.words[c]=67108863&t;for(;0!==p&&c>26,this.words[c]=67108863&t;if(0===p&&c>>13,u=0|s[1],f=8191&u,y=u>>>13,b=0|s[2],g=8191&b,h=b>>>13,m=0|s[3],_=8191&m,v=m>>>13,S=0|s[4],w=8191&S,A=S>>>13,B=0|s[5],x=8191&B,k=B>>>13,E=0|s[6],T=8191&E,M=E>>>13,I=0|s[7],C=8191&I,R=I>>>13,N=0|s[8],P=8191&N,F=N>>>13,O=0|s[9],j=8191&O,L=O>>>13,U=0|a[0],D=8191&U,W=U>>>13,H=0|a[1],q=8191&H,z=H>>>13,V=0|a[2],G=8191&V,K=V>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,$=J>>>13,ee=0|a[5],te=8191&ee,re=ee>>>13,ae=0|a[6],ne=8191&ae,oe=ae>>>13,se=0|a[7],ie=8191&se,de=se>>>13,pe=0|a[8],ce=8191&pe,le=pe>>>13,ue=0|a[9],fe=8191&ue,ye=ue>>>13,be,ge,he;r.negative=e.negative^t.negative,r.length=19,be=n(p,D),ge=n(p,W),ge=0|ge+n(l,D),he=n(l,W);var me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(me>>>26),me&=67108863,be=n(f,D),ge=n(f,W),ge=0|ge+n(y,D),he=n(y,W),be=0|be+n(p,q),ge=0|ge+n(p,z),ge=0|ge+n(l,q),he=0|he+n(l,z);var _e=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(_e>>>26),_e&=67108863,be=n(g,D),ge=n(g,W),ge=0|ge+n(h,D),he=n(h,W),be=0|be+n(f,q),ge=0|ge+n(f,z),ge=0|ge+n(y,q),he=0|he+n(y,z),be=0|be+n(p,G),ge=0|ge+n(p,K),ge=0|ge+n(l,G),he=0|he+n(l,K);var ve=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ve>>>26),ve&=67108863,be=n(_,D),ge=n(_,W),ge=0|ge+n(v,D),he=n(v,W),be=0|be+n(g,q),ge=0|ge+n(g,z),ge=0|ge+n(h,q),he=0|he+n(h,z),be=0|be+n(f,G),ge=0|ge+n(f,K),ge=0|ge+n(y,G),he=0|he+n(y,K),be=0|be+n(p,Y),ge=0|ge+n(p,Z),ge=0|ge+n(l,Y),he=0|he+n(l,Z);var Se=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Se>>>26),Se&=67108863,be=n(w,D),ge=n(w,W),ge=0|ge+n(A,D),he=n(A,W),be=0|be+n(_,q),ge=0|ge+n(_,z),ge=0|ge+n(v,q),he=0|he+n(v,z),be=0|be+n(g,G),ge=0|ge+n(g,K),ge=0|ge+n(h,G),he=0|he+n(h,K),be=0|be+n(f,Y),ge=0|ge+n(f,Z),ge=0|ge+n(y,Y),he=0|he+n(y,Z),be=0|be+n(p,Q),ge=0|ge+n(p,$),ge=0|ge+n(l,Q),he=0|he+n(l,$);var we=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(we>>>26),we&=67108863,be=n(x,D),ge=n(x,W),ge=0|ge+n(k,D),he=n(k,W),be=0|be+n(w,q),ge=0|ge+n(w,z),ge=0|ge+n(A,q),he=0|he+n(A,z),be=0|be+n(_,G),ge=0|ge+n(_,K),ge=0|ge+n(v,G),he=0|he+n(v,K),be=0|be+n(g,Y),ge=0|ge+n(g,Z),ge=0|ge+n(h,Y),he=0|he+n(h,Z),be=0|be+n(f,Q),ge=0|ge+n(f,$),ge=0|ge+n(y,Q),he=0|he+n(y,$),be=0|be+n(p,te),ge=0|ge+n(p,re),ge=0|ge+n(l,te),he=0|he+n(l,re);var Ae=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ae>>>26),Ae&=67108863,be=n(T,D),ge=n(T,W),ge=0|ge+n(M,D),he=n(M,W),be=0|be+n(x,q),ge=0|ge+n(x,z),ge=0|ge+n(k,q),he=0|he+n(k,z),be=0|be+n(w,G),ge=0|ge+n(w,K),ge=0|ge+n(A,G),he=0|he+n(A,K),be=0|be+n(_,Y),ge=0|ge+n(_,Z),ge=0|ge+n(v,Y),he=0|he+n(v,Z),be=0|be+n(g,Q),ge=0|ge+n(g,$),ge=0|ge+n(h,Q),he=0|he+n(h,$),be=0|be+n(f,te),ge=0|ge+n(f,re),ge=0|ge+n(y,te),he=0|he+n(y,re),be=0|be+n(p,ne),ge=0|ge+n(p,oe),ge=0|ge+n(l,ne),he=0|he+n(l,oe);var Be=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Be>>>26),Be&=67108863,be=n(C,D),ge=n(C,W),ge=0|ge+n(R,D),he=n(R,W),be=0|be+n(T,q),ge=0|ge+n(T,z),ge=0|ge+n(M,q),he=0|he+n(M,z),be=0|be+n(x,G),ge=0|ge+n(x,K),ge=0|ge+n(k,G),he=0|he+n(k,K),be=0|be+n(w,Y),ge=0|ge+n(w,Z),ge=0|ge+n(A,Y),he=0|he+n(A,Z),be=0|be+n(_,Q),ge=0|ge+n(_,$),ge=0|ge+n(v,Q),he=0|he+n(v,$),be=0|be+n(g,te),ge=0|ge+n(g,re),ge=0|ge+n(h,te),he=0|he+n(h,re),be=0|be+n(f,ne),ge=0|ge+n(f,oe),ge=0|ge+n(y,ne),he=0|he+n(y,oe),be=0|be+n(p,ie),ge=0|ge+n(p,de),ge=0|ge+n(l,ie),he=0|he+n(l,de);var xe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(xe>>>26),xe&=67108863,be=n(P,D),ge=n(P,W),ge=0|ge+n(F,D),he=n(F,W),be=0|be+n(C,q),ge=0|ge+n(C,z),ge=0|ge+n(R,q),he=0|he+n(R,z),be=0|be+n(T,G),ge=0|ge+n(T,K),ge=0|ge+n(M,G),he=0|he+n(M,K),be=0|be+n(x,Y),ge=0|ge+n(x,Z),ge=0|ge+n(k,Y),he=0|he+n(k,Z),be=0|be+n(w,Q),ge=0|ge+n(w,$),ge=0|ge+n(A,Q),he=0|he+n(A,$),be=0|be+n(_,te),ge=0|ge+n(_,re),ge=0|ge+n(v,te),he=0|he+n(v,re),be=0|be+n(g,ne),ge=0|ge+n(g,oe),ge=0|ge+n(h,ne),he=0|he+n(h,oe),be=0|be+n(f,ie),ge=0|ge+n(f,de),ge=0|ge+n(y,ie),he=0|he+n(y,de),be=0|be+n(p,ce),ge=0|ge+n(p,le),ge=0|ge+n(l,ce),he=0|he+n(l,le);var ke=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ke>>>26),ke&=67108863,be=n(j,D),ge=n(j,W),ge=0|ge+n(L,D),he=n(L,W),be=0|be+n(P,q),ge=0|ge+n(P,z),ge=0|ge+n(F,q),he=0|he+n(F,z),be=0|be+n(C,G),ge=0|ge+n(C,K),ge=0|ge+n(R,G),he=0|he+n(R,K),be=0|be+n(T,Y),ge=0|ge+n(T,Z),ge=0|ge+n(M,Y),he=0|he+n(M,Z),be=0|be+n(x,Q),ge=0|ge+n(x,$),ge=0|ge+n(k,Q),he=0|he+n(k,$),be=0|be+n(w,te),ge=0|ge+n(w,re),ge=0|ge+n(A,te),he=0|he+n(A,re),be=0|be+n(_,ne),ge=0|ge+n(_,oe),ge=0|ge+n(v,ne),he=0|he+n(v,oe),be=0|be+n(g,ie),ge=0|ge+n(g,de),ge=0|ge+n(h,ie),he=0|he+n(h,de),be=0|be+n(f,ce),ge=0|ge+n(f,le),ge=0|ge+n(y,ce),he=0|he+n(y,le),be=0|be+n(p,fe),ge=0|ge+n(p,ye),ge=0|ge+n(l,fe),he=0|he+n(l,ye);var Ee=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ee>>>26),Ee&=67108863,be=n(j,q),ge=n(j,z),ge=0|ge+n(L,q),he=n(L,z),be=0|be+n(P,G),ge=0|ge+n(P,K),ge=0|ge+n(F,G),he=0|he+n(F,K),be=0|be+n(C,Y),ge=0|ge+n(C,Z),ge=0|ge+n(R,Y),he=0|he+n(R,Z),be=0|be+n(T,Q),ge=0|ge+n(T,$),ge=0|ge+n(M,Q),he=0|he+n(M,$),be=0|be+n(x,te),ge=0|ge+n(x,re),ge=0|ge+n(k,te),he=0|he+n(k,re),be=0|be+n(w,ne),ge=0|ge+n(w,oe),ge=0|ge+n(A,ne),he=0|he+n(A,oe),be=0|be+n(_,ie),ge=0|ge+n(_,de),ge=0|ge+n(v,ie),he=0|he+n(v,de),be=0|be+n(g,ce),ge=0|ge+n(g,le),ge=0|ge+n(h,ce),he=0|he+n(h,le),be=0|be+n(f,fe),ge=0|ge+n(f,ye),ge=0|ge+n(y,fe),he=0|he+n(y,ye);var Te=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Te>>>26),Te&=67108863,be=n(j,G),ge=n(j,K),ge=0|ge+n(L,G),he=n(L,K),be=0|be+n(P,Y),ge=0|ge+n(P,Z),ge=0|ge+n(F,Y),he=0|he+n(F,Z),be=0|be+n(C,Q),ge=0|ge+n(C,$),ge=0|ge+n(R,Q),he=0|he+n(R,$),be=0|be+n(T,te),ge=0|ge+n(T,re),ge=0|ge+n(M,te),he=0|he+n(M,re),be=0|be+n(x,ne),ge=0|ge+n(x,oe),ge=0|ge+n(k,ne),he=0|he+n(k,oe),be=0|be+n(w,ie),ge=0|ge+n(w,de),ge=0|ge+n(A,ie),he=0|he+n(A,de),be=0|be+n(_,ce),ge=0|ge+n(_,le),ge=0|ge+n(v,ce),he=0|he+n(v,le),be=0|be+n(g,fe),ge=0|ge+n(g,ye),ge=0|ge+n(h,fe),he=0|he+n(h,ye);var Me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Me>>>26),Me&=67108863,be=n(j,Y),ge=n(j,Z),ge=0|ge+n(L,Y),he=n(L,Z),be=0|be+n(P,Q),ge=0|ge+n(P,$),ge=0|ge+n(F,Q),he=0|he+n(F,$),be=0|be+n(C,te),ge=0|ge+n(C,re),ge=0|ge+n(R,te),he=0|he+n(R,re),be=0|be+n(T,ne),ge=0|ge+n(T,oe),ge=0|ge+n(M,ne),he=0|he+n(M,oe),be=0|be+n(x,ie),ge=0|ge+n(x,de),ge=0|ge+n(k,ie),he=0|he+n(k,de),be=0|be+n(w,ce),ge=0|ge+n(w,le),ge=0|ge+n(A,ce),he=0|he+n(A,le),be=0|be+n(_,fe),ge=0|ge+n(_,ye),ge=0|ge+n(v,fe),he=0|he+n(v,ye);var Ie=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ie>>>26),Ie&=67108863,be=n(j,Q),ge=n(j,$),ge=0|ge+n(L,Q),he=n(L,$),be=0|be+n(P,te),ge=0|ge+n(P,re),ge=0|ge+n(F,te),he=0|he+n(F,re),be=0|be+n(C,ne),ge=0|ge+n(C,oe),ge=0|ge+n(R,ne),he=0|he+n(R,oe),be=0|be+n(T,ie),ge=0|ge+n(T,de),ge=0|ge+n(M,ie),he=0|he+n(M,de),be=0|be+n(x,ce),ge=0|ge+n(x,le),ge=0|ge+n(k,ce),he=0|he+n(k,le),be=0|be+n(w,fe),ge=0|ge+n(w,ye),ge=0|ge+n(A,fe),he=0|he+n(A,ye);var Ce=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ce>>>26),Ce&=67108863,be=n(j,te),ge=n(j,re),ge=0|ge+n(L,te),he=n(L,re),be=0|be+n(P,ne),ge=0|ge+n(P,oe),ge=0|ge+n(F,ne),he=0|he+n(F,oe),be=0|be+n(C,ie),ge=0|ge+n(C,de),ge=0|ge+n(R,ie),he=0|he+n(R,de),be=0|be+n(T,ce),ge=0|ge+n(T,le),ge=0|ge+n(M,ce),he=0|he+n(M,le),be=0|be+n(x,fe),ge=0|ge+n(x,ye),ge=0|ge+n(k,fe),he=0|he+n(k,ye);var Re=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Re>>>26),Re&=67108863,be=n(j,ne),ge=n(j,oe),ge=0|ge+n(L,ne),he=n(L,oe),be=0|be+n(P,ie),ge=0|ge+n(P,de),ge=0|ge+n(F,ie),he=0|he+n(F,de),be=0|be+n(C,ce),ge=0|ge+n(C,le),ge=0|ge+n(R,ce),he=0|he+n(R,le),be=0|be+n(T,fe),ge=0|ge+n(T,ye),ge=0|ge+n(M,fe),he=0|he+n(M,ye);var Ne=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ne>>>26),Ne&=67108863,be=n(j,ie),ge=n(j,de),ge=0|ge+n(L,ie),he=n(L,de),be=0|be+n(P,ce),ge=0|ge+n(P,le),ge=0|ge+n(F,ce),he=0|he+n(F,le),be=0|be+n(C,fe),ge=0|ge+n(C,ye),ge=0|ge+n(R,fe),he=0|he+n(R,ye);var Pe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Pe>>>26),Pe&=67108863,be=n(j,ce),ge=n(j,le),ge=0|ge+n(L,ce),he=n(L,le),be=0|be+n(P,fe),ge=0|ge+n(P,ye),ge=0|ge+n(F,fe),he=0|he+n(F,ye);var Fe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Fe>>>26),Fe&=67108863,be=n(j,fe),ge=n(j,ye),ge=0|ge+n(L,fe),he=n(L,ye);var Oe=0|(0|o+be)+((8191&ge)<<13);return o=0|(0|he+(ge>>>13))+(Oe>>>26),Oe&=67108863,i[0]=me,i[1]=_e,i[2]=ve,i[3]=Se,i[4]=we,i[5]=Ae,i[6]=Be,i[7]=xe,i[8]=ke,i[9]=Ee,i[10]=Te,i[11]=Me,i[12]=Ie,i[13]=Ce,i[14]=Re,i[15]=Ne,i[16]=Pe,i[17]=Fe,i[18]=Oe,0!==o&&(i[19]=o,r.length++),r};n||(C=g),f.prototype.mulTo=function(e,t){var r=this.length+e.length,a;return a=10===this.length&&10===e.length?C(this,e,t):63>r?g(this,e,t):1024>r?h(this,e,t):m(this,e,t),a},_.prototype.makeRBT=function(e){for(var r=Array(e),t=f.prototype._countBits(e)-1,a=0;a>=1;return a},_.prototype.permute=function(e,t,r,a,n,o){for(var s=0;s>>=1)n++;return 1<=a))for(var n=0,o;n
n?0:0|n/67108864;return e},_.prototype.convert13b=function(e,t,r,a){for(var n=0,o=0;o>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;oe);for(var t=0,r=0;r>=26,t+=0|a/67108864,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(e){var t=b(e);if(0===t.length)return new f(1);for(var r=this,a=0;a>>26-t<<26-t,s=(0|this.words[a])-o<>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;ar)for(this.length-=r,c=0;c=n);c--){var f=0|this.words[c];this.words[c]=u<<26-p|f>>>p,u=f&(67108863^67108863>>>p<>>t<e),0>e?this.isubn(-e):0===this.negative?this._iaddn(e):1===this.length&&(0|this.words[0])e),0>e)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&0>this.words[0])this.words[0]=-this.words[0],this.negative=1;else for(var t=0;tthis.words[t];t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var a=e.length+r,n;this._expand(a);var o=0,s;for(n=0;n>26)-(0|d/67108864),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===o)return this.strip();for(l(-1===o),o=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),o=e,s=0|o.words[o.length-1],p=this._countBits(s);r=26-p,0!=r&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var c=n.length-o.length,l;if("mod"!==t){l=new f(null),l.length=c+1,l.words=Array(l.length);for(var u=0;uthis.length||0>this.cmp(e)?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t):(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n})},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0===t.div.negative?t.mod:t.mod.isub(e),a=e.ushrn(1),n=e.andln(1),o=r.cmp(a);return 0>o||1===n&&0===o?t.div:0===t.div.negative?t.div.iaddn(1):t.div.isubn(1)},f.prototype.modn=function(e){l(67108863>=e);for(var t=0,r=this.length-1;0<=r;r--)t=(67108864%e*t+(0|this.words[r]))%e;return t},f.prototype.idivn=function(e){l(67108863>=e);for(var t=0,r=this.length-1,a;0<=r;r--)a=(0|this.words[r])+67108864*t,this.words[r]=0|a/e,t=a%e;return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.prototype.egcd=function(e){l(0===e.negative),l(!e.isZero());var t=this,r=e.clone();t=0===t.negative?t.clone():t.umod(e);for(var a=new f(1),n=new f(0),o=new f(0),s=new f(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var p=r.clone(),c=t.clone();!t.isZero();){for(var u=0,y=1;0==(t.words[0]&y)&&26>u;++u,y<<=1);if(0b;++b,h<<=1);if(0d;++d,p<<=1);if(0c;++c,u<<=1);if(0y.cmpn(0)&&y.iadd(e),y},f.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var n=this.clone(),o=e.clone();n.negative=0,o.negative=0;for(var s=0;n.isEven()&&o.isEven();s++)n.iushrn(1),o.iushrn(1);do{for(;n.isEven();)n.iushrn(1);for(;o.isEven();)o.iushrn(1);var i=n.cmp(o);if(0>i){var r=n;n=o,o=r}else if(0===i||0===o.cmpn(1))break;n.isub(o)}while(!0);return o.iushln(s)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.prototype.bincn=function(e){l("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s;return 0!==n&&(this.words[o]=n,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(e){var t=0>e;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(1=e,"Number is too big");var a=0|this.words[0];r=a===e?0:ae.length)return 1;if(this.lengtha&&(t=1);break}}return t},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return 0<=this.cmpn(e)},f.prototype.gte=function(e){return 0<=this.cmp(e)},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return 0>=this.cmpn(e)},f.prototype.lte=function(e){return 0>=this.cmp(e)},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new x(e)},f.prototype.toRed=function(e){return l(!this.red,"Already a number in reduction context"),l(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},f.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return l(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return l(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var R={k256:null,p224:null,p192:null,p25519:null};v.prototype._tmp=function(){var e=new f(null);return e.words=Array(s(this.n/13)),e},v.prototype.ireduce=function(e){var t=e,a;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),a=t.bitLength();while(a>this.n);var n=a=e.length)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n>>22,o=s}o>>>=22,e.words[n-10]=o,e.length-=0===o&&10>>=26,e.words[r]=n,t=a}return 0!==t&&(e.words[e.length++]=t),e},f._prime=function e(t){if(R[t])return R[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new w;else if("p192"===t)e=new A;else if("p25519"===t)e=new B;else throw new Error("Unknown prime "+t);return R[t]=e,e},x.prototype._verify1=function(e){l(0===e.negative,"red works only with positives"),l(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){l(0==(e.negative|t.negative),"red works only with positives"),l(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(l(1==a%2),3===a){var n=this.m.add(new f(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),d=0;!o.isZero()&&0===o.andln(1);)d++,o.iushrn(1);l(!o.isZero());var p=new f(1).toRed(this),u=p.redNeg(),y=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new f(2*g*g).toRed(this);0!==this.pow(g,y).cmp(u);)g.redIAdd(u);for(var h=this.pow(g,o),_=this.pow(e,o.addn(1).iushrn(1)),v=this.pow(e,o),S=d;0!==v.cmp(p);){for(var w=v,A=0;0!==w.cmp(p);A++)w=w.redSqr();l(A>c,n!==r[0]&&(n=this.sqr(n)),0===l&&0===o){s=0;continue}o<<=1,o|=l,s++,4!==s&&(0!=a||0!=c)||(n=this.mul(n,r[o]),s=0,o=0)}d=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},f.mont=function(e){return new k(e)},c(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new f(0)._forceRed(this);var a=e.mul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})("undefined"==typeof t||t,this)},{buffer:52}],51:[function(e,t){function a(e){this.rand=e}var n;if(t.exports=function(e){return n||(n=new a(null)),n.generate(e)},t.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^s[255&c>>>16]^i[255&l>>>8]^d[255&u]^t[f++],g=o[c>>>24]^s[255&l>>>16]^i[255&u>>>8]^d[255&p]^t[f++],h=o[l>>>24]^s[255&u>>>16]^i[255&p>>>8]^d[255&c]^t[f++],m=o[u>>>24]^s[255&p>>>16]^i[255&c>>>8]^d[255&l]^t[f++],p=b,c=g,l=h,u=m;return b=(a[p>>>24]<<24|a[255&c>>>16]<<16|a[255&l>>>8]<<8|a[255&u])^t[f++],g=(a[c>>>24]<<24|a[255&l>>>16]<<16|a[255&u>>>8]<<8|a[255&p])^t[f++],h=(a[l>>>24]<<24|a[255&u>>>16]<<16|a[255&p>>>8]<<8|a[255&c])^t[f++],m=(a[u>>>24]<<24|a[255&p>>>16]<<16|a[255&c>>>8]<<8|a[255&l])^t[f++],b>>>=0,g>>>=0,h>>>=0,m>>>=0,[b,g,h,m]}function o(e){this._key=r(e),this._reset()}var s=e("safe-buffer").Buffer,i=[0,1,2,4,8,16,32,64,128,27,54],d=function(){for(var e=Array(256),r=0;256>r;r++)e[r]=128>r?r<<1:283^r<<1;for(var a=[],n=[],o=[[],[],[],[]],s=[[],[],[],[]],d=0,p=0,c=0,l;256>c;++c){l=p^p<<1^p<<2^p<<3^p<<4,l=99^(l>>>8^255&l),a[d]=l,n[l]=d;var u=e[d],f=e[u],y=e[f],b=257*e[l]^16843008*l;o[0][d]=b<<24|b>>>8,o[1][d]=b<<16|b>>>16,o[2][d]=b<<8|b>>>24,o[3][d]=b,b=16843009*y^65537*f^257*u^16843008*d,s[0][l]=b<<24|b>>>8,s[1][l]=b<<16|b>>>16,s[2][l]=b<<8|b>>>24,s[3][l]=b,0===d?d=p=1:(d=u^e[e[e[y^u]]],p^=e[e[p]])}return{SBOX:a,INV_SBOX:n,SUB_MIX:o,INV_SUB_MIX:s}}();o.blockSize=16,o.keySize=32,o.prototype.blockSize=o.blockSize,o.prototype.keySize=o.keySize,o.prototype._reset=function(){for(var e=this._key,r=e.length,a=r+6,n=4*(a+1),o=[],s=0;s>>24,p=d.SBOX[p>>>24]<<24|d.SBOX[255&p>>>16]<<16|d.SBOX[255&p>>>8]<<8|d.SBOX[255&p],p^=i[0|s/r]<<24):6>>24]<<24|d.SBOX[255&p>>>16]<<16|d.SBOX[255&p>>>8]<<8|d.SBOX[255&p]),o[s]=o[s-r]^p}for(var c=[],l=0;ll||4>=u?f:d.INV_SUB_MIX[0][d.SBOX[f>>>24]]^d.INV_SUB_MIX[1][d.SBOX[255&f>>>16]]^d.INV_SUB_MIX[2][d.SBOX[255&f>>>8]]^d.INV_SUB_MIX[3][d.SBOX[255&f]]}this._nRounds=a,this._keySchedule=o,this._invKeySchedule=c},o.prototype.encryptBlockRaw=function(e){return e=r(e),n(e,this._keySchedule,d.SUB_MIX,d.SBOX,this._nRounds)},o.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=s.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},o.prototype.decryptBlock=function(e){e=r(e);var t=e[1];e[1]=e[3],e[3]=t;var a=n(e,this._invKeySchedule,d.INV_SUB_MIX,d.INV_SBOX,this._nRounds),o=s.allocUnsafe(16);return o.writeUInt32BE(a[0],0),o.writeUInt32BE(a[3],4),o.writeUInt32BE(a[2],8),o.writeUInt32BE(a[1],12),o},o.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},t.exports.AES=o},{"safe-buffer":218}],54:[function(e,t){function r(e,t){var r=0;e.length!==t.length&&r++;for(var a=Math.min(e.length,t.length),n=0;nt&&(t=s.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&r(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},n.prototype.getAuthTag=function(){if(this._decrypt||!s.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},n.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},n.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=n},{"./aes":53,"./ghash":58,"./incr32":59,"buffer-xor":82,"cipher-base":85,inherits:162,"safe-buffer":218}],55:[function(e,t,r){var a=e("./encrypter"),n=e("./decrypter"),o=e("./modes/list.json");r.createCipher=r.Cipher=a.createCipher,r.createCipheriv=r.Cipheriv=a.createCipheriv,r.createDecipher=r.Decipher=n.createDecipher,r.createDecipheriv=r.Decipheriv=n.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(o)}},{"./decrypter":56,"./encrypter":57,"./modes/list.json":67}],56:[function(e,t,r){function a(e,t,r){l.call(this),this._cache=new n,this._last=void 0,this._cipher=new u.AES(t),this._prev=d.from(r),this._mode=e,this._autopadding=!0}function n(){this.cache=d.allocUnsafe(0)}function o(e){var t=e[15];if(1>t||16>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function n(e){this.h=e,this.state=o.alloc(16,0),this.cache=o.allocUnsafe(0)}var o=e("safe-buffer").Buffer,s=o.alloc(16,0);n.prototype.ghash=function(e){for(var t=-1;++t++n;){for(s=0!=(this.state[~~(n/8)]&1<<7-n%8),s&&(t[0]^=e[0],t[1]^=e[1],t[2]^=e[2],t[3]^=e[3]),d=0!=(1&e[3]),o=3;0>>1|(1&e[o-1])<<31;e[0]>>>=1,d&&(e[0]^=-520093696)}this.state=a(t)},n.prototype.update=function(e){this.cache=o.concat([this.cache,e]);for(var t;16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},n.prototype.final=function(e,t){return this.cache.length&&this.ghash(o.concat([this.cache,s],16)),this.ghash(a([0,e,0,t])),this.state},t.exports=n},{"safe-buffer":218}],59:[function(e,t){t.exports=function(e){for(var t=e.length,r;t--;)if(r=e.readUInt8(t),255===r)e.writeUInt8(0,t);else{r++,e.writeUInt8(r,t);break}}},{}],60:[function(e,t,r){var a=e("buffer-xor");r.encrypt=function(e,t){var r=a(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return a(n,r)}},{"buffer-xor":82}],61:[function(e,t,r){function a(e,t,r){var a=t.length,s=o(t,e._cache);return e._cache=e._cache.slice(a),e._prev=n.concat([e._prev,r?t:s]),s}var n=e("safe-buffer").Buffer,o=e("buffer-xor");r.encrypt=function(e,t,r){for(var o=n.allocUnsafe(0),s;t.length;)if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),e._cache.length<=t.length)s=e._cache.length,o=n.concat([o,a(e,t.slice(0,s),r)]),t=t.slice(s);else{o=n.concat([o,a(e,t,r)]);break}return o}},{"buffer-xor":82,"safe-buffer":218}],62:[function(e,t,r){function a(e,t,r){for(var a=-1,o=0,s,d,p;++a<8;)s=e._cipher.encryptBlock(e._prev),d=t&1<<7-a?128:0,p=s[0]^d,o+=(128&p)>>a%8,e._prev=n(e._prev,r?d:p);return o}function n(e,t){var r=e.length,a=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++a>7;return n}var o=e("safe-buffer").Buffer;r.encrypt=function(e,t,r){for(var n=t.length,s=o.allocUnsafe(n),d=-1;++d=e.cmpn(0))throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}var d=e("bn.js"),s=e("elliptic").ec,c=e("parse-asn1"),i=e("./curves.json");t.exports=function(e,t,o,s,p){var l=c(o);if("ec"===l.type){if("ecdsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong public key type");return a(e,t,l)}if("dsa"===l.type){if("dsa"!==s)throw new Error("wrong public key type");return n(e,t,l)}if("rsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong public key type");t=r.concat([p,t]);for(var u=l.modulus.byteLength(),f=[1],y=0;t.length+f.length+2y?1:0;for(u=Math.min(e.length,f.length),e.length!==f.length&&(h=1),b=-1;++b=n&&r>>10),e=56320|1023&e),t+=w(e),t}).join("")}function p(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:36}function c(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function l(e,t,r){var a=0;for(e=r?S(e/700):e>>1,e+=S(e/t);455y&&(y=0),b=0;b=a&&o("invalid-input"),v=p(e.charCodeAt(g++)),(36<=v||v>S((2147483647-s)/m))&&o("overflow"),s+=v*m,A=_<=u?1:_>=u+26?26:_-u,vS(2147483647/B)&&o("overflow"),m*=B}f=r.length+1,u=l(s-h,f,0==h),S(s/f)>2147483647-c&&o("overflow"),c+=S(s/f),s%=f,r.splice(s++,0,c)}return d(r)}function f(e){var r=[],a,s,d,p,u,f,y,b,g,h,_,v,A,B,x;for(e=i(e),v=e.length,a=128,s=0,u=72,f=0;f_&&r.push(w(_));for(d=p=r.length,p&&r.push("-");d=a&&_S((2147483647-s)/A)&&o("overflow"),s+=(y-a)*A,a=y,f=0;f=u+26?26:g-u,b= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=Math.floor,w=String.fromCharCode,A,B;if(A={version:"1.4.1",ucs2:{decode:i,encode:d},decode:u,encode:f,toASCII:function(e){return s(e,function(e){return m.test(e)?"xn--"+f(e):e})},toUnicode:function(e){return s(e,function(e){return h.test(e)?u(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return A});else if(!(y&&b))a.punycode=A;else if(t.exports==y)b.exports=A;else for(B in A)A.hasOwnProperty(B)&&(y[B]=A[B])})(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],82:[function(e,t){(function(e){t.exports=function(t,r){for(var a=Math.min(t.length,r.length),n=new e(a),o=0;oe)throw new RangeError("The value \""+e+"\" is invalid for option \"size\"")}function i(e,t,r){return s(e),0>=e?a(e):void 0===t?a(e):"string"==typeof r?a(e).fill(t,r):a(e).fill(t)}function d(e){return s(e),a(0>e?0:0|f(e))}function p(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!n.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),o=a(r),s=o.write(e,t);return s!==r&&(o=o.slice(0,s)),o}function c(e){for(var t=0>e.length?0:0|f(e.length),r=a(t),n=0;nt||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|e}function y(e,t){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof e);var r=e.length,a=2>>1;case"base64":return H(e).length;default:if(o)return a?-1:U(e).length;t=(""+t).toLowerCase(),o=!0;}}function b(e,t,r){var a=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0;}}function g(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function h(e,t,r,a,o){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):2147483647r&&(r=-2147483648),r=+r,V(r)&&(r=o?0:e.length-1),0>r&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(0>r)if(o)r=0;else return-1;if("string"==typeof t&&(t=n.from(t,a)),n.isBuffer(t))return 0===t.length?-1:m(e,t,r,a,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,a,o);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,a,n){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,d=e.length,p=t.length;if(void 0!==a&&(a=(a+"").toLowerCase(),"ucs2"===a||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(2>e.length||2>t.length)return-1;s=2,d/=2,p/=2,r/=2}var c;if(n){var l=-1;for(c=r;cd&&(r=d-p),c=r;0<=c;c--){for(var u=!0,f=0;fn&&(a=n)):a=n;var o=t.length;a>o/2&&(a=o/2);for(var s=0,d;so&&(s=o):2===d?(p=e[n+1],128==(192&p)&&(u=(31&o)<<6|63&p,127u||57343u&&(s=u))):void 0}null===s?(s=65533,d=1):65535>>10),s=56320|1023&s),a.push(s),n+=d}return E(a)}function E(e){var t=e.length;if(t<=4096)return X.apply(String,e);for(var r="",a=0;at)&&(t=0),(!r||0>r||r>a)&&(r=a);for(var n="",o=t;oe)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,a,o,s){if(!n.isBuffer(e))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(t>o||te.length)throw new RangeError("Index out of range")}function P(e,t,r,a){if(r+a>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function F(e,t,r,a,n){return t=+t,r>>>=0,n||P(e,t,r,4,34028234663852886e22,-34028234663852886e22),Z.write(e,t,r,a,23,4),r+4}function O(e,t,r,a,n){return t=+t,r>>>=0,n||P(e,t,r,8,17976931348623157e292,-17976931348623157e292),Z.write(e,t,r,a,52,8),r+8}function j(e){if(e=e.split("=")[0],e=e.trim().replace(J,""),2>e.length)return"";for(;0!=e.length%4;)e+="=";return e}function L(e){return 16>e?"0"+e.toString(16):e.toString(16)}function U(e,t){t=t||1/0;for(var r=e.length,a=null,n=[],o=0,s;os){if(!a){if(56319s){-1<(t-=3)&&n.push(239,191,189),a=s;continue}s=(a-55296<<10|s-56320)+65536}else a&&-1<(t-=3)&&n.push(239,191,189);if(a=null,128>s){if(0>(t-=1))break;n.push(s)}else if(2048>s){if(0>(t-=2))break;n.push(192|s>>6,128|63&s)}else if(65536>s){if(0>(t-=3))break;n.push(224|s>>12,128|63&s>>6,128|63&s)}else if(1114112>s){if(0>(t-=4))break;n.push(240|s>>18,128|63&s>>12,128|63&s>>6,128|63&s)}else throw new Error("Invalid code point")}return n}function D(e){for(var t=[],r=0;r(t-=2));++a)n=e.charCodeAt(a),o=n>>8,s=n%256,r.push(s),r.push(o);return r}function H(e){return Y.toByteArray(j(e))}function q(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!==e}var G=Math.pow,K=Math.min,X=String.fromCharCode,Y=e("base64-js"),Z=e("ieee754");r.Buffer=n,r.SlowBuffer=function(e){return+e!=e&&(e=0),n.alloc(+e)},r.INSPECT_MAX_BYTES=50;r.kMaxLength=2147483647,n.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),n.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){return n.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){return n.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.poolSize=8192,n.from=function(e,t,r){return o(e,t,r)},n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,n.alloc=function(e,t,r){return i(e,t,r)},n.allocUnsafe=function(e){return d(e)},n.allocUnsafeSlow=function(e){return d(e)},n.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==n.prototype},n.compare=function(e,t){if(z(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");if(e===t)return 0;for(var r=e.length,o=t.length,s=0,d=K(r,o);st&&(e+=" ... "),""},n.prototype.compare=function(e,t,r,a,o){if(z(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(e))throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type "+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===o&&(o=this.length),0>t||r>e.length||0>a||o>this.length)throw new RangeError("out of range index");if(a>=o&&t>=r)return 0;if(a>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,o>>>=0,this===e)return 0;for(var s=o-a,d=r-t,p=K(s,d),c=this.slice(a,o),l=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===a&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n=this.length-t;if((void 0===r||r>n)&&(r=n),0r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var o=!1;;)switch(a){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),o=!0;}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};n.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);for(var a=this[e],n=1,o=0;++o>>=0,t>>>=0,r||R(e,t,this.length);for(var a=this[e+--t],n=1;0>>=0,t||R(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var a=this[e],n=1,o=0;++o=n&&(a-=G(2,8*t)),a},n.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var a=t,n=1,o=this[e+--a];0=n&&(o-=G(2,8*t)),o},n.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),Z.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),Z.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),Z.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),Z.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var n=G(2,8*r)-1;N(this,e,t,r,n,0)}var o=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!a){var n=G(2,8*r)-1;N(this,e,t,r,n,0)}var o=r-1,s=1;for(this[t+o]=255&e;0<=--o&&(s*=256);)this[t+o]=255&e/s;return t+r},n.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=G(2,8*r-1);N(this,e,t,r,n-1,-n)}var o=0,s=1,d=0;for(this[t]=255&e;++oe&&0===d&&0!==this[t+o-1]&&(d=1),this[t+o]=255&(e/s>>0)-d;return t+r},n.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=G(2,8*r-1);N(this,e,t,r,n-1,-n)}var o=r-1,s=1,d=0;for(this[t+o]=255&e;0<=--o&&(s*=256);)0>e&&0===d&&0!==this[t+o+1]&&(d=1),this[t+o]=255&(e/s>>0)-d;return t+r},n.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},n.prototype.copy=function(e,t,r,a){if(!n.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),0t)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("Index out of range");if(0>a)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-to||"latin1"===a)&&(e=o)}}else"number"==typeof e&&(e&=255);if(0>t||this.length>>=0,r=r===void 0?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;sr){var a="rmd160"===e?new d:p(e);t=a.update(t).digest()}else t.length64?t=e(t):t.length<64&&(t=n.concat([t,s],64));for(var r=this._ipad=n.allocUnsafe(64),a=this._opad=n.allocUnsafe(64),d=0;d<64;d++)r[d]=54^t[d],a[d]=92^t[d];this._hash=[r]}var a=e("inherits"),n=e("safe-buffer").Buffer,o=e("cipher-base"),s=n.alloc(128);a(r,o),r.prototype._update=function(e){this._hash.push(e)},r.prototype._final=function(){var e=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,e]))},t.exports=r},{"cipher-base":85,inherits:162,"safe-buffer":218}],93:[function(e,t,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var a=e("browserify-sign/algos"),n=Object.keys(a),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);r.getHashes=function(){return o};var s=e("pbkdf2");r.pbkdf2=s.pbkdf2,r.pbkdf2Sync=s.pbkdf2Sync;var i=e("browserify-cipher");r.Cipher=i.Cipher,r.createCipher=i.createCipher,r.Cipheriv=i.Cipheriv,r.createCipheriv=i.createCipheriv,r.Decipher=i.Decipher,r.createDecipher=i.createDecipher,r.Decipheriv=i.Decipheriv,r.createDecipheriv=i.createDecipheriv,r.getCiphers=i.getCiphers,r.listCiphers=i.listCiphers;var d=e("diffie-hellman");r.DiffieHellmanGroup=d.DiffieHellmanGroup,r.createDiffieHellmanGroup=d.createDiffieHellmanGroup,r.getDiffieHellman=d.getDiffieHellman,r.createDiffieHellman=d.createDiffieHellman,r.DiffieHellman=d.DiffieHellman;var p=e("browserify-sign");r.createSign=p.createSign,r.Sign=p.Sign,r.createVerify=p.createVerify,r.Verify=p.Verify,r.createECDH=e("create-ecdh");var c=e("public-encrypt");r.publicEncrypt=c.publicEncrypt,r.privateEncrypt=c.privateEncrypt,r.publicDecrypt=c.publicDecrypt,r.privateDecrypt=c.privateDecrypt;var l=e("randomfill");r.randomFill=l.randomFill,r.randomFillSync=l.randomFillSync,r.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/crypto-browserify/crypto-browserify")},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":70,"browserify-sign":77,"browserify-sign/algos":74,"create-ecdh":88,"create-hash":89,"create-hmac":91,"diffie-hellman":101,pbkdf2:183,"public-encrypt":189,randombytes:199,randomfill:200}],94:[function(e,t){"use strict";function r(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var a=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],r(a),r(n))}function a(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(o),a=1;a>>1],r=d.r28shl(r,s),a=d.r28shl(a,s),d.pc2(r,a,e.keys,o)},a.prototype._update=function(e,t,a,n){var o=this._desState,s=d.readUInt32BE(e,t),i=d.readUInt32BE(e,t+4);d.ip(s,i,o.tmp,0),s=o.tmp[0],i=o.tmp[1],"encrypt"===this.type?this._encrypt(o,s,i,o.tmp,0):this._decrypt(o,s,i,o.tmp,0),s=o.tmp[0],i=o.tmp[1],d.writeUInt32BE(a,s,n),d.writeUInt32BE(a,i,n+4)},a.prototype._pad=function(e,t){for(var r=e.length-t,a=t;a>>0,c=f}d.rip(u,c,o,p)},a.prototype._decrypt=function(e,a,n,o,p){for(var c=n,u=a,y=e.keys.length-2;0<=y;y-=2){var b=e.keys[y],g=e.keys[y+1];d.expand(c,e.tmp,0),b^=e.tmp[0],g^=e.tmp[1];var h=d.substitute(b,g),s=d.permute(h),f=c;c=(u^s)>>>0,u=f}d.rip(c,u,o,p)}},{"../des":95,inherits:162,"minimalistic-assert":170}],99:[function(e,t){"use strict";function r(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),a=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[d.create({type:"encrypt",key:r}),d.create({type:"decrypt",key:a}),d.create({type:"encrypt",key:o})]:[d.create({type:"decrypt",key:o}),d.create({type:"encrypt",key:a}),d.create({type:"decrypt",key:r})]}function a(e){i.call(this,e);var t=new r(this.type,this.options.key);this._edeState=t}var n=e("minimalistic-assert"),o=e("inherits"),s=e("../des"),i=s.Cipher,d=s.DES;o(a,i),t.exports=a,a.create=function(e){return new a(e)},a.prototype._update=function(e,t,r,a){var n=this._edeState;n.ciphers[0]._update(e,t,r,a),n.ciphers[1]._update(r,a,r,a),n.ciphers[2]._update(r,a,r,a)},a.prototype._pad=d.prototype._pad,a.prototype._unpad=d.prototype._unpad},{"../des":95,inherits:162,"minimalistic-assert":170}],100:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=255&t>>>16,e[2+r]=255&t>>>8,e[3+r]=255&t},r.ip=function(e,t,r,a){for(var n=0,o=0,s=6;0<=s;s-=2){for(var d=0;24>=d;d+=8)n<<=1,n|=1&t>>>d+s;for(var d=0;24>=d;d+=8)n<<=1,n|=1&e>>>d+s}for(var s=6;0<=s;s-=2){for(var d=1;25>=d;d+=8)o<<=1,o|=1&t>>>d+s;for(var d=1;25>=d;d+=8)o<<=1,o|=1&e>>>d+s}r[a+0]=n>>>0,r[a+1]=o>>>0},r.rip=function(e,t,r,a){for(var n=0,o=0,s=0;4>s;s++)for(var d=24;0<=d;d-=8)n<<=1,n|=1&t>>>d+s,n<<=1,n|=1&e>>>d+s;for(var s=4;8>s;s++)for(var d=24;0<=d;d-=8)o<<=1,o|=1&t>>>d+s,o<<=1,o|=1&e>>>d+s;r[a+0]=n>>>0,r[a+1]=o>>>0},r.pc1=function(e,t,r,a){for(var n=0,o=0,s=7;5<=s;s--){for(var d=0;24>=d;d+=8)n<<=1,n|=1&t>>d+s;for(var d=0;24>=d;d+=8)n<<=1,n|=1&e>>d+s}for(var d=0;24>=d;d+=8)n<<=1,n|=1&t>>d+s;for(var s=1;3>=s;s++){for(var d=0;24>=d;d+=8)o<<=1,o|=1&t>>d+s;for(var d=0;24>=d;d+=8)o<<=1,o|=1&e>>d+s}for(var d=0;24>=d;d+=8)o<<=1,o|=1&e>>d+s;r[a+0]=n>>>0,r[a+1]=o>>>0},r.r28shl=function(e,t){return 268435455&e<>>28-t};var a=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,n){for(var o=0,s=0,d=a.length>>>1,p=0;p>>a[p];for(var p=d;p>>a[p];r[n+0]=o>>>0,r[n+1]=s>>>0},r.expand=function(e,t,r){var a=0,n=0;a=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)a<<=6,a|=63&e>>>o;for(var o=11;3<=o;o-=4)n|=63&e>>>o,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=a>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,a=0;4>a;a++){var o=63&e>>>18-6*a,s=n[64*a+o];r<<=4,r|=s}for(var a=0;4>a;a++){var o=63&t>>>18-6*a,s=n[256+64*a+o];r<<=4,r|=s}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>o[r];return t>>>0},r.padSplit=function(e,t,r){for(var a=e.toString(2);a.lengthr;r+=2){a=s(Math.sqrt(r));for(var n=0;ne)return 2===t||5===t?new d([140,123]):new d([140,39]);t=new d(t);for(var r,o;;){for(r=new d(i(s(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(f),!t.cmp(f))for(;r.mod(p).cmp(v);)r.iadd(S);else if(!t.cmp(y))for(;r.mod(h).cmp(m);)r.iadd(S);if(o=r.shrn(1),a(o)&&a(r)&&n(o)&&n(r)&&l.test(o)&&l.test(r))return r}}var s=Math.ceil,i=e("randombytes");t.exports=o,o.simpleSieve=a,o.fermatTest=n;var d=e("bn.js"),p=new d(24),c=e("miller-rabin"),l=new c,u=new d(1),f=new d(2),y=new d(5),b=new d(16),g=new d(8),h=new d(10),m=new d(3),_=new d(7),v=new d(11),S=new d(4),w=new d(12),A=null},{"bn.js":50,"miller-rabin":169,randombytes:199}],104:[function(e,t){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],105:[function(e,t,r){"use strict";var a=r;a.version=e("../package.json").version,a.utils=e("./elliptic/utils"),a.rand=e("brorand"),a.curve=e("./elliptic/curve"),a.curves=e("./elliptic/curves"),a.ec=e("./elliptic/ec"),a.eddsa=e("./elliptic/eddsa")},{"../package.json":120,"./elliptic/curve":108,"./elliptic/curves":111,"./elliptic/ec":112,"./elliptic/eddsa":115,"./elliptic/utils":119,brorand:51}],106:[function(e,t){"use strict";function r(e,t){this.type=e,this.p=new o(t.p,16),this.red=t.prime?o.red(t.prime):o.mont(this.p),this.zero=new o(0).toRed(this.red),this.one=new o(1).toRed(this.red),this.two=new o(2).toRed(this.red),this.n=t.n&&new o(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,];var r=this.n&&this.p.div(this.n);!r||0=p;t--)l=(l<<1)+n[t];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),y=o;0p)break;var l=o[p];c(0!==l),s="affine"===e.type?0>1]):s.mixedAdd(n[-l-1>>1].neg()):0>1]):s.add(n[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},r.prototype._wnafMulAdd=function(e,t,r,o,s){for(var c=this._wnafT1,l=this._wnafT2,u=this._wnafT3,f=0,y=0;yy)break;for(var S=0;S>1]:0>M&&(g=l[S][-M-1>>1].neg());B="affine"===g.type?B.mixedAdd(g):B.add(g)}}for(var y=0;y=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],a=this,n=0;n":""},a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},a.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),a=this.z.redSqr();a=a.redIAdd(a);var n=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),e=n.redAdd(r),s=e.redSub(a),i=n.redSub(r),d=o.redMul(s),p=e.redMul(i),l=o.redMul(i),u=s.redMul(e);return this.curve.point(d,p,u,l)},a.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),a=this.y.redSqr(),n,o,s;if(this.curve.twisted){var i=this.curve._mulA(r),d=i.redAdd(a);if(this.zOne)n=t.redSub(r).redSub(a).redMul(d.redSub(this.curve.two)),o=d.redMul(i.redSub(a)),s=d.redSqr().redSub(d).redSub(d);else{var p=this.z.redSqr(),c=d.redSub(p).redISub(p);n=t.redSub(r).redISub(a).redMul(c),o=d.redMul(i.redSub(a)),s=d.redMul(c)}}else{var i=r.redAdd(a),p=this.curve._mulC(this.z).redSqr(),c=i.redSub(p).redSub(p);n=this.curve._mulC(t.redISub(i)).redMul(c),o=this.curve._mulC(i).redMul(r.redISub(a)),s=i.redMul(c)}return this.curve.point(n,o,s)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),a=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),s=a.redSub(r),e=o.redSub(n),i=o.redAdd(n),d=a.redAdd(r),p=s.redMul(e),c=i.redMul(d),l=s.redMul(d),u=e.redMul(i);return this.curve.point(p,c,u,l)},a.prototype._projAdd=function(t){var r=this.z.redMul(t.z),a=r.redSqr(),n=this.x.redMul(t.x),o=this.y.redMul(t.y),s=this.curve.d.redMul(n).redMul(o),e=a.redSub(s),i=a.redAdd(s),d=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(n).redISub(o),p=r.redMul(e).redMul(d),c,l;return this.curve.twisted?(c=r.redMul(i).redMul(o.redSub(this.curve._mulA(n))),l=e.redMul(i)):(c=r.redMul(i).redMul(o.redSub(n)),l=this.curve._mulC(e).redMul(i)),this.curve.point(p,c,l)},a.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},a.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},a.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},a.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(r))return!0;for(var a=e.clone(),n=this.curve.redN.redMul(this.z);;){if(a.iadd(this.curve.n),0<=a.cmp(this.curve.p))return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add},{"../../elliptic":105,"../curve":108,"bn.js":50,inherits:162}],108:[function(e,t,r){"use strict";var a=r;a.base=e("./base"),a.short=e("./short"),a.mont=e("./mont"),a.edwards=e("./edwards")},{"./base":106,"./edwards":107,"./mont":109,"./short":110}],109:[function(e,t){"use strict";function r(e){i.call(this,"mont",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function a(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(t,16),this.z=new o(r,16),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),!this.z.red&&(this.z=this.z.toRed(this.curve.red)))}var n=e("../curve"),o=e("bn.js"),s=e("inherits"),i=n.base,d=e("../../elliptic"),p=d.utils;s(r,i),t.exports=r,r.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),a=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t),n=a.redSqrt();return 0===n.redSqr().cmp(a)},s(a,i.BasePoint),r.prototype.decodePoint=function(e,t){return this.point(p.toArray(e,t),1)},r.prototype.point=function(e,t){return new a(this,e,t)},r.prototype.pointFromJSON=function(e){return a.fromJSON(this,e)},a.prototype.precompute=function(){},a.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},a.fromJSON=function(e,t){return new a(e,t[0],t[1]||e.one)},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},a.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),a=r.redSqr(),n=t.redSub(a),o=t.redMul(a),s=n.redMul(a.redAdd(this.curve.a24.redMul(n)));return this.curve.point(o,s)},a.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),a=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z),s=o.redMul(r),i=n.redMul(a),d=t.z.redMul(s.redAdd(i).redSqr()),p=t.x.redMul(s.redISub(i).redSqr());return this.curve.point(d,p)},a.prototype.mul=function(e){for(var r=e.clone(),t=this,n=this.curve.point(null,null),o=this,s=[];0!==r.cmpn(0);r.iushrn(1))s.push(r.andln(1));for(var d=s.length-1;0<=d;d--)0===s[d]?(t=t.diffAdd(n,o),n=n.dbl()):(n=t.diffAdd(n,o),t=t.dbl());return n},a.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},a.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":105,"../curve":108,"bn.js":50,inherits:162}],110:[function(e,t){"use strict";function r(e){p.call(this,"short",e),this.a=new d(e.a,16).toRed(this.red),this.b=new d(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function a(e,t,r,a){p.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new d(t,16),this.y=new d(r,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),!this.y.red&&(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function n(e,t,r,a){p.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===a?(this.x=this.curve.one,this.y=this.curve.one,this.z=new d(0)):(this.x=new d(t,16),this.y=new d(r,16),this.z=new d(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var o=e("../curve"),s=e("../../elliptic"),d=e("bn.js"),i=e("inherits"),p=o.base,c=s.utils.assert;i(r,p),t.exports=r,r.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new d(e.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);t=0>a[0].cmp(a[1])?a[0]:a[1],t=t.toRed(this.red)}if(e.lambda)r=new d(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}var o;return o=e.basis?e.basis.map(function(e){return{a:new d(e.a,16),b:new d(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:o}}},r.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:d.mont(e),r=new d(2).toRed(t).redInvm(),a=r.redNeg(),n=new d(3).toRed(t).redNeg().redSqrt().redMul(r),o=a.redAdd(n).fromRed(),s=a.redSub(n).fromRed();return[o,s]},r.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,n=this.n.clone(),o=new d(1),s=new d(0),p=new d(0),c=new d(1),l=0,f,b,g,h,m,_,S,w,A,B;0!==a.cmpn(0);){B=n.div(a),w=n.sub(B.mul(a)),A=p.sub(B.mul(o));var k=c.sub(B.mul(s));if(!g&&0>w.cmp(t))f=S.neg(),b=o,g=w.neg(),h=A;else if(g&&2==++l)break;S=w,n=a,a=w,p=o,o=A,c=s,s=k}m=w.neg(),_=A;var y=g.sqr().add(h.sqr()),E=m.sqr().add(_.sqr());return 0<=E.cmp(y)&&(m=f,_=b),g.negative&&(g=g.neg(),h=h.neg()),m.negative&&(m=m.neg(),_=_.neg()),[{a:g,b:h},{a:m,b:_}]},r.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],a=t[1],n=a.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),i=o.mul(a.a),d=n.mul(r.b),p=o.mul(a.b),c=e.sub(s).sub(i),l=d.add(p).neg();return{k1:c,k2:l}},r.prototype.pointFromX=function(e,t){e=new d(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),a=r.redSqrt();if(0!==a.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=a.fromRed().isOdd();return(t&&!n||!t&&n)&&(a=a.redNeg()),this.point(e,a)},r.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,a=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(a).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},r.prototype._endoWnafMulAdd=function(e,t,r){for(var a=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),a=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,a)},a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),a=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(a),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(e){return e=new d(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n):this.curve._wnafMulAdd(1,a,n,2)},a.prototype.jmulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n,!0):this.curve._wnafMulAdd(1,a,n,2,!0)},a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,a=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(a)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(a)}}}return t},a.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},i(n,p.BasePoint),r.prototype.jpoint=function(e,t,r){return new n(this,e,t,r)},n.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),a=this.y.redMul(t).redMul(e);return this.curve.point(r,a)},n.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},n.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),a=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(a),s=this.y.redMul(t.redMul(e.z)),i=e.y.redMul(a.redMul(this.z)),d=n.redSub(o),p=s.redSub(i);if(0===d.cmpn(0))return 0===p.cmpn(0)?this.dbl():this.curve.jpoint(null,null,null);var r=d.redSqr(),c=r.redMul(d),l=n.redMul(r),u=p.redSqr().redIAdd(c).redISub(l).redISub(l),f=p.redMul(l.redISub(u)).redISub(s.redMul(c)),y=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(u,f,y)},n.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),a=this.x,n=e.x.redMul(t),o=this.y,s=e.y.redMul(t).redMul(this.z),i=a.redSub(n),d=o.redSub(s);if(0===i.cmpn(0))return 0===d.cmpn(0)?this.dbl():this.curve.jpoint(null,null,null);var r=i.redSqr(),p=r.redMul(i),c=a.redMul(r),l=d.redSqr().redIAdd(p).redISub(c).redISub(c),u=d.redMul(c.redISub(l)).redISub(o.redMul(p)),f=this.z.redMul(i);return this.curve.jpoint(l,u,f)},n.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,n=0;n":""},n.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":105,"../curve":108,"bn.js":50,inherits:162}],111:[function(e,t,r){"use strict";function a(e){this.curve="short"===e.type?new i.curve.short(e):"edwards"===e.type?new i.curve.edwards(e):new i.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function n(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:r}),r}})}var o=r,s=e("hash.js"),i=e("../elliptic"),d=i.utils.assert;o.PresetCurve=a,n("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),n("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),n("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),n("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),n("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),n("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),n("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var p;try{p=e("./precomputed/secp256k1")}catch(t){p=void 0}n("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",p]})},{"../elliptic":105,"./precomputed/secp256k1":118,"hash.js":145}],112:[function(e,t){"use strict";function r(e){return this instanceof r?void("string"==typeof e&&(i(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash):new r(e)}var a=e("bn.js"),n=e("hmac-drbg"),o=e("../../elliptic"),s=o.utils,i=s.assert,d=e("./key"),c=e("./signature");t.exports=r,r.prototype.keyPair=function(e){return new d(this,e)},r.prototype.keyFromPrivate=function(e,t){return d.fromPrivate(this,e,t)},r.prototype.keyFromPublic=function(e,t){return d.fromPublic(this,e,t)},r.prototype.genKeyPair=function(e){e||(e={});var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new a(2));do{var i=new a(t.generate(r));if(0=b.cmpn(1)||0<=b.cmp(f))){var g=this.g.mul(b);if(!g.isInfinity()){var h=g.getX(),m=h.umod(this.n);if(0!==m.cmpn(0)){var r=b.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(r=r.umod(this.n),0!==r.cmpn(0)){var _=(g.getY().isOdd()?1:0)|(0===h.cmp(m)?0:2);return i.canonical&&0i.cmpn(1)||0<=i.cmp(this.n))return!1;if(0>r.cmpn(1)||0<=r.cmp(this.n))return!1;var s=r.invm(this.n),d=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);if(!this.curve._maxwellTrick){var u=this.g.mulAdd(d,n.getPublic(),l);return!u.isInfinity()&&0===u.getX().umod(this.n).cmp(i)}var u=this.g.jmulAdd(d,n.getPublic(),l);return!u.isInfinity()&&u.eqXToP(i)},r.prototype.recoverPubKey=function(t,o,d,p){i((3&d)===d,"The recovery param is more than two bits"),o=new c(o,p);var l=this.n,n=new a(t),e=o.r,u=o.s,s=1&d,f=d>>1;if(0<=e.cmp(this.curve.p.umod(this.curve.n))&&f)throw new Error("Unable to find sencond key candinate");e=f?this.curve.pointFromX(e.add(this.curve.n),s):this.curve.pointFromX(e,s);var y=o.r.invm(l),b=l.sub(n).mul(y).umod(l),g=u.mul(y).umod(l);return this.g.mulAdd(b,e,g)},r.prototype.getKeyRecoveryParam=function(t,e,r,a){if(e=new c(e,a),null!==e.recoveryParam)return e.recoveryParam;for(var n=0;4>n;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":105,"./key":113,"./signature":114,"bn.js":50,"hmac-drbg":157}],113:[function(e,t){"use strict";function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var a=e("bn.js"),n=e("../../elliptic"),o=n.utils,s=o.assert;t.exports=r,r.fromPublic=function(e,t,a){return t instanceof r?t:new r(e,{pub:t,pubEnc:a})},r.fromPrivate=function(e,t,a){return t instanceof r?t:new r(e,{priv:t,privEnc:a})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(e,t){this.priv=new a(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,t){return e.x||e.y?("mont"===this.ec.curve.type?s(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&s(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y))):void(this.pub=this.ec.curve.decodePoint(e,t))},r.prototype.derive=function(e){return e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},r.prototype.inspect=function(){return""}},{"../../elliptic":105,"bn.js":50}],114:[function(e,t){"use strict";function r(e,t){return e instanceof r?e:void(this._importDER(e,t)||(p(e.r&&e.s,"Signature without r or s"),this.r=new d(e.r,16),this.s=new d(e.s,16),this.recoveryParam=void 0===e.recoveryParam?null:e.recoveryParam))}function a(){this.place=0}function n(e,t){var r=e[t.place++];if(!(128&r))return r;for(var a=0,n=0,o=t.place;n<(15&r);n++,o++)a<<=8,a|=e[o];return t.place=o,a}function o(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&tt)return void e.push(t);var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(255&t>>>(r<<3));e.push(t)}var d=e("bn.js"),s=e("../../elliptic"),c=s.utils,p=c.assert;t.exports=r,r.prototype._importDER=function(e,t){e=c.toArray(e,t);var o=new a;if(48!==e[o.place++])return!1;var i=n(e,o);if(i+o.place!==e.length)return!1;if(2!==e[o.place++])return!1;var p=n(e,o),l=e.slice(o.place,p+o.place);if(o.place+=p,2!==e[o.place++])return!1;var u=n(e,o);if(e.length!==u+o.place)return!1;var f=e.slice(o.place,u+o.place);return 0===l[0]&&128&l[1]&&(l=l.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new d(l),this.s=new d(f),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var t=this.r.toArray(),a=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&a[0]&&(a=[0].concat(a)),t=o(t),a=o(a);!a[0]&&!(128&a[1]);)a=a.slice(1);var n=[2];i(n,t.length),n=n.concat(t),n.push(2),i(n,a.length);var d=n.concat(a),p=[48];return i(p,d.length),p=p.concat(d),c.encode(p,e)}},{"../../elliptic":105,"bn.js":50}],115:[function(e,t){"use strict";function r(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof r))return new r(e);var e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=a.sha512}var a=e("hash.js"),n=e("../../elliptic"),o=n.utils,s=o.assert,i=o.parseBytes,d=e("./key"),p=e("./signature");t.exports=r,r.prototype.sign=function(e,t){e=i(e);var a=this.keyFromSecret(t),n=this.hashInt(a.messagePrefix(),e),r=this.g.mul(n),o=this.encodePoint(r),s=this.hashInt(o,a.pubBytes(),e).mul(a.priv()),d=n.add(s).umod(this.curve.n);return this.makeSignature({R:r,S:d,Rencoded:o})},r.prototype.verify=function(e,t,r){e=i(e),t=this.makeSignature(t);var a=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),a.pubBytes(),e),o=this.g.mul(t.S()),s=t.R().add(a.pub().mul(n));return s.eq(o)},r.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(a>>1)-1?(a>>1)-s:s,n.isubn(o)}else o=0;r.push(o);for(var d=0!==n.cmpn(0)&&0===n.andln(a-1)?t+1:1,p=1;po;o++)r+="00";if(name=a(e),name)for(var s=name.split("."),o=s.length-1,d;0<=o;o--)d=n(s[o]),r=n(new t(r+d,"hex"));return"0x"+r},r.normalize=a}).call(this,e("buffer").Buffer)},{buffer:83,"idna-uts46-hx":160,"js-sha3":122}],122:[function(e,t){(function(e,r){(function(){"use strict";function a(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var a=0;50>a;++a)this.s[a]=0}var n="object"==typeof window?window:{},o=!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node;o&&(n=r);for(var s=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,d=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],p=[31,7936,2031616,520093696],c=[1,256,65536,16777216],l=[6,1536,393216,100663296],u=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],g=[128,256],h=["hex","buffer","arrayBuffer","array"],m=function(e,t,r){return function(n){return new a(e,t,e).update(n)[r]()}},_=function(e,t,r){return function(n,o){return new a(e,t,o).update(n)[r]()}},v=function(e,t){var r=m(e,t,"hex");r.create=function(){return new a(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0,o;n>2]|=e[d]<c?a[s>>2]|=c<c?(a[s>>2]|=(192|c>>6)<>2]|=(128|63&c)<c||57344<=c?(a[s>>2]|=(224|c>>12)<>2]|=(128|63&c>>6)<>2]|=(128|63&c)<>2]|=(240|c>>18)<>2]|=(128|63&c>>12)<>2]|=(128|63&c>>6)<>2]|=(128|63&c)<=n){for(this.start=s-n,this.block=a[o],s=0;s>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4]+d[15&p]+d[15&p>>12]+d[15&p>>8]+d[15&p>>20]+d[15&p>>16]+d[15&p>>28]+d[15&p>>24];0==o%e&&(I(t),n=0)}return a&&(p=t[n],0>4]+d[15&p]),1>12]+d[15&p>>8]),2>20]+d[15&p>>16])),s},a.prototype.arrayBuffer=function(){this.finalize();var e=this.blockCount,t=this.s,r=this.outputBlocks,a=this.extraBytes,n=0,o=0,s=this.outputBits>>3,d;d=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var p=new Uint32Array(d);o>8,s[d+2]=255&p>>16,s[d+3]=255&p>>24;0==o%e&&I(t)}return a&&(d=o<<2,p=t[n],0>8),2>16)),s};var I=function(e){var t,r,a,o,s,i,d,p,c,u,f,b,g,m,_,v,S,w,A,B,x,k,E,T,M,I,C,R,N,P,F,O,j,L,U,D,W,H,q,z,V,G,K,X,Y,Z,J,Q,$,ee,te,re,ae,ne,oe,se,ie,de,pe,ce,le,ue,fe;for(a=0;48>a;a+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],d=e[3]^e[13]^e[23]^e[33]^e[43],p=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49],t=b^(i<<1|d>>>31),r=g^(d<<1|i>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(p<<1|c>>>31),r=s^(c<<1|p>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=i^(u<<1|f>>>31),r=d^(f<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=p^(b<<1|g>>>31),r=c^(g<<1|b>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(o<<1|s>>>31),r=f^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],_=e[1],Z=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,N=e[21]<<3|e[20]>>>29,ce=e[31]<<9|e[30]>>>23,le=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,S=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,F=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,ne=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,W=e[15]<<6|e[14]>>>26,w=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,ee=e[34]<<15|e[35]>>>17,te=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,j=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,M=e[7]<<28|e[6]>>>4,se=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,B=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,re=e[47]<<24|e[46]>>>8,ae=e[46]<<24|e[47]>>>8,X=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,I=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,pe=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=m^~v&w,e[1]=_^~S&A,e[10]=T^~I&R,e[11]=M^~C&N,e[20]=L^~D&H,e[21]=U^~W&q,e[30]=X^~Z&Q,e[31]=Y^~J&$,e[40]=ne^~se&de,e[41]=oe^~ie&pe,e[2]=v^~w&B,e[3]=S^~A&x,e[12]=I^~R&P,e[13]=C^~N&F,e[22]=D^~H&z,e[23]=W^~q&V,e[32]=Z^~Q&ee,e[33]=J^~$&te,e[42]=se^~de&ce,e[43]=ie^~pe&le,e[4]=w^~B&k,e[5]=A^~x&E,e[14]=R^~P&O,e[15]=N^~F&j,e[24]=H^~z&G,e[25]=q^~V&K,e[34]=Q^~ee&re,e[35]=$^~te&ae,e[44]=de^~ce&ue,e[45]=pe^~le&fe,e[6]=B^~k&m,e[7]=x^~E&_,e[16]=P^~O&T,e[17]=F^~j&M,e[26]=z^~G&L,e[27]=V^~K&U,e[36]=ee^~re&X,e[37]=te^~ae&Y,e[46]=ce^~ue&ne,e[47]=le^~fe&oe,e[8]=k^~m&v,e[9]=E^~_&S,e[18]=O^~T&I,e[19]=j^~M&C,e[28]=G^~L&D,e[29]=K^~U&W,e[38]=re^~X&Z,e[39]=ae^~Y&J,e[48]=ue^~ne&se,e[49]=fe^~oe&ie,e[0]^=y[a],e[1]^=y[a+1]};if(s)t.exports=A;else for(var x=0;xn?"0":"")+n.toString(16);return t};t.exports={random:function(t){var r;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues)r=window.crypto.getRandomValues(new Uint8Array(t));else if("undefined"!=typeof e)r=e("crypto").randomBytes(t);else throw"Safe random numbers not available.";for(var a="0x",n=0;nt.length?"0"+t:t},r="0x",a=0,n;a!=e.length;a++){if(n=e.charCodeAt(a),128>n){r+=t(n);continue}if(2048>n)r+=t(192|n>>6);else{if(55295n){if(++a==e.length)return null;var o=e.charCodeAt(a);if(56320>o||57343>18),r+=t(128|63&n>>12)}else r+=t(224|n>>12);r+=t(128|63&n>>6)}r+=t(128|63&n)}return r},toString:function(e){for(var t="",a=0,d=o(e);ap){if(a>=d)return null;p=(31&p)<<6|63&n(e,a)}else if(223p){if(a+1>=d)return null;p=(15&p)<<12|(63&n(e,a))<<6|63&n(e,++a)}else if(239p){if(a+2>=d)return null;p=(7&p)<<18|(63&n(e,a))<<12|(63&n(e,++a))<<6|63&n(e,++a)}else return null;++a}if(65535>=p)t+=r(p);else if(1114111>=p)p-=65536,t+=r(55296|p>>10),t+=r(56320|1023&p);else return null}return t},fromNumber:function(e){var t=e.toString(16);return 0==t.length%2?"0x"+t:"0x0"+t},toNumber:function(e){return parseInt(e.slice(2),16)},fromNat:function(e){return"0x0"===e?"0x":0==e.length%2?e:"0x0"+e.slice(2)},toNat:function(e){return"0"===e[2]?"0x"+e.slice(3):e},fromArray:i,toArray:s,fromUint8Array:function(e){return i([].slice.call(e,0))},toUint8Array:function(e){return new Uint8Array(s(e))}}},{"./array.js":123}],125:[function(e,t){var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],a=[1,256,65536,16777216],n=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],s=function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:function(e){return[].concat(e,e,e,e,e)}([0,0,0,0,0,0,0,0,0,0])}},d=function(e,t){for(var o=t.length,d=e.blocks,c=e.blockCount<<2,l=e.blockCount,u=e.outputBlocks,f=e.s,s=0,y,b;s>2]|=t[s]<b?d[y>>2]|=b<b?(d[y>>2]|=(192|b>>6)<>2]|=(128|63&b)<b||57344<=b?(d[y>>2]|=(224|b>>12)<>2]|=(128|63&b>>6)<>2]|=(128|63&b)<>2]|=(240|b>>18)<>2]|=(128|63&b>>12)<>2]|=(128|63&b>>6)<>2]|=(128|63&b)<=c){for(e.start=y-c,e.block=d[l],y=0;y>2]|=a[3&y],e.lastByteIndex===c)for(d[0]=d[l],y=1;y>4]+r[15&m]+r[15&m>>12]+r[15&m>>8]+r[15&m>>20]+r[15&m>>16]+r[15&m>>28]+r[15&m>>24];0==h%l&&(p(f),y=0)}return"0x"+g},p=function(e){var t,r,a,s,i,d,p,c,u,f,y,b,g,m,_,v,S,w,A,B,x,k,E,T,M,I,C,R,N,P,F,O,j,L,U,D,W,H,q,z,V,G,K,X,Y,Z,J,Q,$,ee,te,re,ae,ne,oe,se,ie,de,pe,ce,le,ue,fe;for(a=0;48>a;a+=2)s=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],d=e[2]^e[12]^e[22]^e[32]^e[42],p=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],y=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49],t=b^(d<<1|p>>>31),r=g^(p<<1|d>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=s^(c<<1|u>>>31),r=i^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=d^(f<<1|y>>>31),r=p^(y<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(b<<1|g>>>31),r=u^(g<<1|b>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(s<<1|i>>>31),r=y^(i<<1|s>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],_=e[1],Z=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,N=e[21]<<3|e[20]>>>29,ce=e[31]<<9|e[30]>>>23,le=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,S=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,F=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,ne=e[5]<<30|e[4]>>>2,oe=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,W=e[15]<<6|e[14]>>>26,w=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,ee=e[34]<<15|e[35]>>>17,te=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,j=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,M=e[7]<<28|e[6]>>>4,se=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,B=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,re=e[47]<<24|e[46]>>>8,ae=e[46]<<24|e[47]>>>8,X=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,I=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,pe=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=m^~v&w,e[1]=_^~S&A,e[10]=T^~I&R,e[11]=M^~C&N,e[20]=L^~D&H,e[21]=U^~W&q,e[30]=X^~Z&Q,e[31]=Y^~J&$,e[40]=ne^~se&de,e[41]=oe^~ie&pe,e[2]=v^~w&B,e[3]=S^~A&x,e[12]=I^~R&P,e[13]=C^~N&F,e[22]=D^~H&z,e[23]=W^~q&V,e[32]=Z^~Q&ee,e[33]=J^~$&te,e[42]=se^~de&ce,e[43]=ie^~pe&le,e[4]=w^~B&k,e[5]=A^~x&E,e[14]=R^~P&O,e[15]=N^~F&j,e[24]=H^~z&G,e[25]=q^~V&K,e[34]=Q^~ee&re,e[35]=$^~te&ae,e[44]=de^~ce&ue,e[45]=pe^~le&fe,e[6]=B^~k&m,e[7]=x^~E&_,e[16]=P^~O&T,e[17]=F^~j&M,e[26]=z^~G&L,e[27]=V^~K&U,e[36]=ee^~re&X,e[37]=te^~ae&Y,e[46]=ce^~ue&ne,e[47]=le^~fe&oe,e[8]=k^~m&v,e[9]=E^~_&S,e[18]=O^~T&I,e[19]=j^~M&C,e[28]=G^~L&D,e[29]=K^~U&W,e[38]=re^~X&Z,e[39]=ae^~Y&J,e[48]=ue^~ne&se,e[49]=fe^~oe&ie,e[0]^=o[a],e[1]^=o[a+1]},i=function(e){return function(t){var r;if("0x"===t.slice(0,2)){r=[];for(var a=2,n=t.length;a=parseInt(r[2])?t.toNumber():t};var T=/^([^)(]*)\((.*)\)([^)(]*)$/,M=/^[A-Za-z_][A-Za-z0-9_]*$/;r.parseParamType=function(e){return n(e,!0)},r.formatParamType=d,r.formatSignature=function(e){return e.name+"("+e.inputs.map(function(e){return d(e)}).join(",")+")"},r.parseSignature=function(e){if("string"==typeof e)return e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),"event "===e.substring(0,6)?o(e.substring(6).trim()):("function "===e.substring(0,9)&&(e=e.substring(9)),s(e.trim()));throw new Error("unknown signature")};var I=function(){return function(e,t,r,a,n){this.coerceFunc=e,this.name=t,this.type=r,this.localName=a,this.dynamic=n}}(),C=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return A.defineReadOnly(r,"coder",t),r}return h(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(I),R=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return h(t,e),t.prototype.encode=function(){return w.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(I),N=function(e){function t(t,r,a,n){var o=this,s=(a?"int":"uint")+8*r;return o=e.call(this,t,s,s,n,!1)||this,o.size=r,o.signed=a,o}return h(t,e),t.prototype.encode=function(e){try{var t=S.bigNumberify(e);return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),w.padZeros(w.arrayify(t),32)}catch(t){B.throwError("invalid number value",B.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.lengtha;a++)r[a]=t[a].charCodeAt(0);r=p.arrayify(c.keccak256(r));for(var n=0;40>n;n+=2)8<=r[n>>1]>>4&&(t[n]=t[n].toUpperCase()),8<=(15&r[n>>1])&&(t[n+1]=t[n+1].toUpperCase());return"0x"+t.join("")}function n(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach(function(e){t+=y[e]});t.length>=g;){var r=t.substring(0,g);t=parseInt(r,10)%97+t.substring(r.length)}for(var a=98-parseInt(t,10)%97+"";2>a.length;)a="0"+a;return a}function o(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=a(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==n(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new d.default.BN(e.substring(4),36).toString(16);40>t.length;)t="0"+t;t=a("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});for(var d=s(e("bn.js")),p=e("./bytes"),c=e("./keccak256"),l=e("./rlp"),u=e("./errors"),f=9007199254740991,y={},b=0;10>b;b++)y[b+""]=b+"";for(var b=0;26>b;b++)y[String.fromCharCode(65+b)]=10+b+"";var g=Math.floor(function(e){var t=Math.log10;return t?t(e):Math.log(e)/Math.LN10}(f));r.getAddress=o,r.getIcapAddress=function(e){for(var t=new d.default.BN(o(e).substring(2),16).toString(36).toUpperCase();30>t.length;)t="0"+t;return"XE"+n("XE00"+t)+t},r.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return o("0x"+c.keccak256(l.encode([o(e.from),p.stripZeros(p.hexlify(t))])).substring(26))}},{"./bytes":130,"./errors":131,"./keccak256":132,"./rlp":134,"bn.js":50}],129:[function(e,t,r){"use strict";function a(e){var t=e.toString(16);return"-"===t[0]?0==t.length%2?"-0x0"+t.substring(1):"-0x"+t.substring(1):1==t.length%2?"0x0"+t:"0x"+t}function n(e){return i(e)._bn}function s(e){return new g(a(e))}function i(e){return e instanceof g?e:new g(e)}var o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},p=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t};Object.defineProperty(r,"__esModule",{value:!0});var c=d(e("bn.js")),l=e("./bytes"),u=e("./properties"),f=e("./types"),y=p(e("./errors")),b=new c.default.BN(-1),g=function(e){function t(r){var o=e.call(this)||this;if(y.checkNew(o,t),"string"==typeof r)l.isHexString(r)?("0x"==r&&(r="0x0"),u.defineReadOnly(o,"_hex",r)):"-"===r[0]&&l.isHexString(r.substring(1))?u.defineReadOnly(o,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),u.defineReadOnly(o,"_hex",a(new c.default.BN(r)))):y.throwError("invalid BigNumber string value",y.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(r+"")!==r&&y.throwError("underflow",y.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(r+"")});try{u.defineReadOnly(o,"_hex",a(new c.default.BN(r)))}catch(e){y.throwError("overflow",y.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else r instanceof t?u.defineReadOnly(o,"_hex",r._hex):r.toHexString?u.defineReadOnly(o,"_hex",a(n(r.toHexString()))):l.isArrayish(r)?u.defineReadOnly(o,"_hex",a(new c.default.BN(l.hexlify(r).substring(2),16))):y.throwError("invalid BigNumber value",y.INVALID_ARGUMENT,{arg:"value",value:r});return o}return o(t,e),Object.defineProperty(t.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new c.default.BN(this._hex.substring(3),16).mul(b):new c.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),t.prototype.fromTwos=function(e){return s(this._bn.fromTwos(e))},t.prototype.toTwos=function(e){return s(this._bn.toTwos(e))},t.prototype.add=function(e){return s(this._bn.add(n(e)))},t.prototype.sub=function(e){return s(this._bn.sub(n(e)))},t.prototype.div=function(e){var t=i(e);return t.isZero()&&y.throwError("division by zero",y.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),s(this._bn.div(n(e)))},t.prototype.mul=function(e){return s(this._bn.mul(n(e)))},t.prototype.mod=function(e){return s(this._bn.mod(n(e)))},t.prototype.pow=function(e){return s(this._bn.pow(n(e)))},t.prototype.maskn=function(e){return s(this._bn.maskn(e))},t.prototype.eq=function(e){return this._bn.eq(n(e))},t.prototype.lt=function(e){return this._bn.lt(n(e))},t.prototype.lte=function(e){return this._bn.lte(n(e))},t.prototype.gt=function(e){return this._bn.gt(n(e))},t.prototype.gte=function(e){return this._bn.gte(n(e))},t.prototype.isZero=function(){return this._bn.isZero()},t.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(e){y.throwError("overflow",y.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},t.prototype.toString=function(){return this._bn.toString(10)},t.prototype.toHexString=function(){return this._hex},t}(f.BigNumber);r.bigNumberify=i,r.ConstantNegativeOne=i(-1),r.ConstantZero=i(0),r.ConstantOne=i(1),r.ConstantTwo=i(2),r.ConstantWeiPerEther=i("1000000000000000000")},{"./bytes":130,"./errors":131,"./properties":133,"./types":135,"bn.js":50}],130:[function(e,t,r){"use strict";function a(e){return!!e._bn}function n(e){return e.slice?e:(e.slice=function(){var t=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(e,t))},e)}function o(e){if(!e||parseInt(e.length+"")!=e.length||"string"==typeof e)return!1;for(var t=0,r;tr||256<=r||parseInt(r+"")!=r)return!1;return!0}function s(e){if(null==e&&f.throwError("cannot convert null value to array",f.INVALID_ARGUMENT,{arg:"value",value:e}),a(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||f.throwError("invalid hexidecimal string",f.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&f.throwError("hex string must have 0x prefix",f.INVALID_ARGUMENT,{arg:"value",value:e}),e=e.substring(2),e.length%2&&(e="0"+e);for(var r=[],s=0;se&&f.throwError("cannot hexlify negative value",f.INVALID_ARGUMENT,{arg:"value",value:e});for(var t="";e;)t="0123456789abcdef"[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||f.throwError("invalid hexidecimal string",f.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&f.throwError("hex string must have 0x prefix",f.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(o(e)){for(var n=[],s=0,d;s>4]+"0123456789abcdef"[15&d]);return"0x"+n.join("")}return f.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function c(e,t){for(d(e)||f.throwError("invalid hex string",f.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function l(e){return e&&null!=e.r&&null!=e.s}function u(e){var t=0,a="0x",n="0x";if(l(e)){null==e.v&&null==e.recoveryParam&&f.throwError("at least on of recoveryParam or v must be specified",f.INVALID_ARGUMENT,{argument:"signature",value:e}),a=c(e.r,32),n=c(e.s,32),t=e.v,"string"==typeof t&&(t=parseInt(t,16));var o=e.recoveryParam;null==o&&null!=e.v&&(o=1-t%2),t=27+o}else{var i=s(e);if(65!==i.length)throw new Error("invalid signature");a=p(i.slice(0,32)),n=p(i.slice(32,64)),t=i[64],27!==t&&28!==t&&(t=27+t%2)}return{r:a,s:n,recoveryParam:t-27,v:t}}Object.defineProperty(r,"__esModule",{value:!0});var f=e("./errors");r.AddressZero="0x0000000000000000000000000000000000000000",r.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",r.isArrayish=o,r.arrayify=s,r.concat=i,r.stripZeros=function(e){var t=s(e);if(0===t.length)return t;for(var r=0;0===t[r];)r++;return r&&(t=t.slice(r)),t},r.padZeros=function(e,t){if(e=s(e),tt&&a("too many arguments"+n,r.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})},r.setCensorship=n},{}],132:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e("js-sha3"),n=e("./bytes");r.keccak256=function(e){return"0x"+a.keccak_256(n.arrayify(e))}},{"./bytes":130,"js-sha3":126}],133:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defineReadOnly=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})},r.defineFrozen=function(e,t,r){var a=JSON.stringify(r);Object.defineProperty(e,t,{enumerable:!0,get:function(){return JSON.parse(a)}})},r.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach(function(a){var n=e[a];n instanceof Promise?r.push(n.then(function(e){return t[a]=e,null})):t[a]=n}),Promise.all(r).then(function(){return t})},r.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t},r.jsonCopy=function(e){return JSON.parse(JSON.stringify(e))}},{}],134:[function(e,t,r){"use strict";function a(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function n(e,t,r){for(var a=0,n=0;n=t.length)return t.unshift(192+t.length),t;var r=a(t.length);return r.unshift(247+r.length),r.concat(t)}var n=Array.prototype.slice.call(d.arrayify(e));if(1===n.length&&127>=n[0])return n;if(55>=n.length)return n.unshift(128+n.length),n;var r=a(n.length);return r.unshift(183+r.length),r.concat(n)}function s(e,t,r,a){for(var n=[],o;rt+1+a)throw new Error("invalid rlp");return{consumed:1+a,result:n}}function i(e,t){if(0===e.length)throw new Error("invalid rlp data");if(248<=e[t]){var r=e[t]-247;if(t+1+r>e.length)throw new Error("too short");var a=n(e,t+1,r);if(t+1+r+a>e.length)throw new Error("to short");return s(e,t,t+1+r,r+a)}if(192<=e[t]){var a=e[t]-192;if(t+1+a>e.length)throw new Error("invalid rlp data");return s(e,t,t+1,a)}if(184<=e[t]){var r=e[t]-183;if(t+1+r>e.length)throw new Error("invalid rlp data");var a=n(e,t+1,r);if(t+1+r+a>e.length)throw new Error("invalid rlp data");var o=d.hexlify(e.slice(t+1+r,t+1+r+a));return{consumed:1+r+a,result:o}}if(128<=e[t]){var a=e[t]-128;if(t+1+a>e.length)throw new Error("invlaid rlp data");var o=d.hexlify(e.slice(t+1,t+1+a));return{consumed:1+a,result:o}}return{consumed:1,result:d.hexlify(e[t])}}Object.defineProperty(r,"__esModule",{value:!0});var d=e("./bytes");r.encode=function(e){return d.hexlify(o(e))},r.decode=function(e){var t=d.arrayify(e),r=i(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":130}],135:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=function(){return function(){}}();r.BigNumber=a;var n=function(){return function(){}}();r.Indexed=n;var o=function(){return function(){}}();r.MinimalProvider=o;var s=function(){return function(){}}();r.Signer=s;var i=function(){return function(){}}();r.HDNode=i},{}],136:[function(e,t,r){"use strict";function a(e,t){void 0===t&&(t=s.current),t!=s.current&&(e=e.normalize(t));for(var r=[],a=0,n=0,d;nd?r[a++]=d:2048>d?(r[a++]=192|d>>6,r[a++]=128|63&d):55296==(64512&d)&&n+1>18,r[a++]=128|63&d>>12,r[a++]=128|63&d>>6,r[a++]=128|63&d):(r[a++]=224|d>>12,r[a++]=128|63&d>>6,r[a++]=128|63&d);return o.arrayify(r)}var n=String.fromCharCode;Object.defineProperty(r,"__esModule",{value:!0});var o=e("./bytes"),s;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(s=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={}));r.toUtf8Bytes=a;r.toUtf8String=function(e){e=o.arrayify(e);for(var t="",r=0;r>7){t+=n(a);continue}if(2!=a>>6){var s=null;if(6==a>>5)s=1;else if(14==a>>4)s=2;else if(30==a>>3)s=3;else if(62==a>>2)s=4;else if(126==a>>1)s=5;else continue;if(r+s>e.length){for(;r>6;r++);if(r!=e.length)continue;return t}var d=a&(1<<8-s-1)-1,p;for(p=0;p>6)break;d=d<<6|63&c}if(p!=s){r--;continue}if(65535>=d){t+=n(d);continue}d-=65536,t+=n((1023&d>>10)+55296,(1023&d)+56320)}}return t}},{"./bytes":130}],137:[function(e,t){"use strict";function r(e){var t=e?e.toLowerCase():"ether",r=d[t];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(d,null,2));return new n(r,10)}function a(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"==typeof e)return e+"";if("object"==typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?e.toPrecision()+"":e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}var n=e("bn.js"),o=e("number-to-bn"),s=new n(0),i=new n(-1),d={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};t.exports={unitMap:d,numberToString:a,getValueOfUnit:r,fromWei:function(e,t,a){var n=o(e),p=n.lt(s),c=r(t),l=d[t].length-1||1,u=a||{};p&&(n=n.mul(i));for(var f=n.mod(c).toString(10);f.lengthp)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;f.length=p?p-49+10:17<=p&&22>=p?p-17+10:15&p;return n}function y(e,t,a,n){for(var o=0,s=d(e.length,a),p=t,l;p>>n}return t}function g(e,t,n){n.negative=t.negative^e.negative;var s=0|e.length+t.length;n.length=s,s=0|s-1;var p=0|e.words[0],c=0|t.words[0],l=p*c,u=67108863&l,f=0|l/67108864;n.words[0]=u;for(var y=1;y>>26,h=67108863&f,m=d(y,t.length-1),_=o(0,y-e.length+1),v;_<=m;_++)v=0|y-_,p=0|e.words[v],c=0|t.words[_],l=p*c+h,g+=0|l/67108864,h=67108863&l;n.words[y]=0|h,f=0|g}return 0===f?n.length--:n.words[y]=0|f,n.strip()}function h(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var s=0,p=0,c=0,l;c>>26),p+=l>>>26,l&=67108863}n.words[c]=u,s=l,l=p}return 0===s?n.length--:n.words[c]=s,n.strip()}function m(e,t,r){var a=new _;return a.mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}function v(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=f._prime(e);this.m=t.p,this.prime=t}else l(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),0!=this.shift%26&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=f:i.BN=f,f.BN=f,f.wordSize=26;var E;try{E=e("buffer").Buffer}catch(t){}f.isBN=function(e){return!!(e instanceof f)||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return 0e.cmp(t)?e:t},f.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),l(t===(0|t)&&2<=t&&36>=t),e=e.toString().replace(/\s+/g,"");var a=0;"-"===e[0]&&a++,16===t?this._parseHex(e,a):this._parseBase(e,t,a),"-"===e[0]&&(this.negative=1),this.strip();"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initNumber=function(e,t,r){0>e&&(this.negative=1,e=-e),67108864>e?(this.words=[67108863&e],this.length=1):4503599627370496>e?(this.words=[67108863&e,67108863&e/67108864],this.length=2):(l(9007199254740992>e),this.words=[67108863&e,67108863&e/67108864,1],this.length=3);"le"!==r||this._initArray(this.toArray(),t,r)},f.prototype._initArray=function(e,t,r){if(l("number"==typeof e.length),0>=e.length)return this.words=[0],this.length=1,this;this.length=s(e.length/3),this.words=Array(this.length);for(var a=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);else if("le"===r)for(a=0,o=0;a>>26-n,n+=24,26<=n&&(n-=26,o++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=s((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=6)o=u(e,r,r+6),this.words[n]|=67108863&o<>>26-a,a+=24,26<=a&&(a-=26,n++);r+6!==t&&(o=u(e,t,r+6),this.words[n]|=67108863&o<>>26-a),this.strip()},f.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;67108863>=n;n*=t)a++;a--,n=0|n/t;for(var o=e.length-r,s=o%a,p=d(o,o-s)+r,c=0,l=r;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c);if(0!==s){var u=1;for(c=y(e,l,e.length,t),l=0;lthis.words[0]+c?this.words[0]+=c:this._iaddn(c)}},f.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t"};var T=["","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"],M=[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],I=[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];f.prototype.toString=function(e,t){e=e||10,t=0|t||1;var a;if(16===e||"hex"===e){a="";for(var n=0,o=0,s=0;s>>24-n,a=0!==o||s!=this.length-1?T[6-p.length]+p+a:p+a,n+=2,26<=n&&(n-=26,s--)}for(0!==o&&(a=o.toString(16)+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&2<=e&&36>=e){var u=M[e],f=I[e];a="";var y=this.clone();for(y.negative=0;!y.isZero();){var b=y.modn(f).toString(e);y=y.idivn(f),a=y.isZero()?b+a:T[u-b.length]+b+a}for(this.isZero()&&(a="0"+a);0!=a.length%t;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}l(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=a&&(n+=7,a>>>=7),8<=a&&(n+=4,a>>>=4),2<=a&&(n+=2,a>>>=2),n+a},f.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,n=0;return 0==(8191&a)&&(n+=13,a>>>=13),0==(127&a)&&(n+=7,a>>>=7),0==(15&a)&&(n+=4,a>>>=4),0==(3&a)&&(n+=2,a>>>=2),0==(1&a)&&n++,n},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0,a;te.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.prototype.iuand=function(e){var t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.prototype.inotn=function(e){l("number"==typeof e&&0<=e);var t=0|s(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.prototype.setn=function(e,t){l("number"==typeof e&&0<=e);var r=0|e/26,a=e%26;return this._expand(r+1),t?this.words[r]|=1<e.length?(n=this,o=e):(n=e,o=this);for(var s=0,d=0;d>>26;for(;0!==s&&d>>26;if(this.length=n.length,0!==s)this.words[this.length]=s,this.length++;else if(n!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},f.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;var s,d;0>26,this.words[c]=67108863&t;for(;0!==p&&c>26,this.words[c]=67108863&t;if(0===p&&c>>13,u=0|s[1],f=8191&u,y=u>>>13,b=0|s[2],g=8191&b,h=b>>>13,m=0|s[3],_=8191&m,v=m>>>13,S=0|s[4],w=8191&S,A=S>>>13,B=0|s[5],x=8191&B,k=B>>>13,E=0|s[6],T=8191&E,M=E>>>13,I=0|s[7],C=8191&I,R=I>>>13,N=0|s[8],P=8191&N,F=N>>>13,O=0|s[9],j=8191&O,L=O>>>13,U=0|a[0],D=8191&U,W=U>>>13,H=0|a[1],q=8191&H,z=H>>>13,V=0|a[2],G=8191&V,K=V>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,$=J>>>13,ee=0|a[5],te=8191&ee,re=ee>>>13,ae=0|a[6],ne=8191&ae,oe=ae>>>13,se=0|a[7],ie=8191&se,de=se>>>13,pe=0|a[8],ce=8191&pe,le=pe>>>13,ue=0|a[9],fe=8191&ue,ye=ue>>>13,be,ge,he;r.negative=e.negative^t.negative,r.length=19,be=n(p,D),ge=n(p,W),ge=0|ge+n(l,D),he=n(l,W);var me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(me>>>26),me&=67108863,be=n(f,D),ge=n(f,W),ge=0|ge+n(y,D),he=n(y,W),be=0|be+n(p,q),ge=0|ge+n(p,z),ge=0|ge+n(l,q),he=0|he+n(l,z);var _e=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(_e>>>26),_e&=67108863,be=n(g,D),ge=n(g,W),ge=0|ge+n(h,D),he=n(h,W),be=0|be+n(f,q),ge=0|ge+n(f,z),ge=0|ge+n(y,q),he=0|he+n(y,z),be=0|be+n(p,G),ge=0|ge+n(p,K),ge=0|ge+n(l,G),he=0|he+n(l,K);var ve=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ve>>>26),ve&=67108863,be=n(_,D),ge=n(_,W),ge=0|ge+n(v,D),he=n(v,W),be=0|be+n(g,q),ge=0|ge+n(g,z),ge=0|ge+n(h,q),he=0|he+n(h,z),be=0|be+n(f,G),ge=0|ge+n(f,K),ge=0|ge+n(y,G),he=0|he+n(y,K),be=0|be+n(p,Y),ge=0|ge+n(p,Z),ge=0|ge+n(l,Y),he=0|he+n(l,Z);var Se=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Se>>>26),Se&=67108863,be=n(w,D),ge=n(w,W),ge=0|ge+n(A,D),he=n(A,W),be=0|be+n(_,q),ge=0|ge+n(_,z),ge=0|ge+n(v,q),he=0|he+n(v,z),be=0|be+n(g,G),ge=0|ge+n(g,K),ge=0|ge+n(h,G),he=0|he+n(h,K),be=0|be+n(f,Y),ge=0|ge+n(f,Z),ge=0|ge+n(y,Y),he=0|he+n(y,Z),be=0|be+n(p,Q),ge=0|ge+n(p,$),ge=0|ge+n(l,Q),he=0|he+n(l,$);var we=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(we>>>26),we&=67108863,be=n(x,D),ge=n(x,W),ge=0|ge+n(k,D),he=n(k,W),be=0|be+n(w,q),ge=0|ge+n(w,z),ge=0|ge+n(A,q),he=0|he+n(A,z),be=0|be+n(_,G),ge=0|ge+n(_,K),ge=0|ge+n(v,G),he=0|he+n(v,K),be=0|be+n(g,Y),ge=0|ge+n(g,Z),ge=0|ge+n(h,Y),he=0|he+n(h,Z),be=0|be+n(f,Q),ge=0|ge+n(f,$),ge=0|ge+n(y,Q),he=0|he+n(y,$),be=0|be+n(p,te),ge=0|ge+n(p,re),ge=0|ge+n(l,te),he=0|he+n(l,re);var Ae=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ae>>>26),Ae&=67108863,be=n(T,D),ge=n(T,W),ge=0|ge+n(M,D),he=n(M,W),be=0|be+n(x,q),ge=0|ge+n(x,z),ge=0|ge+n(k,q),he=0|he+n(k,z),be=0|be+n(w,G),ge=0|ge+n(w,K),ge=0|ge+n(A,G),he=0|he+n(A,K),be=0|be+n(_,Y),ge=0|ge+n(_,Z),ge=0|ge+n(v,Y),he=0|he+n(v,Z),be=0|be+n(g,Q),ge=0|ge+n(g,$),ge=0|ge+n(h,Q),he=0|he+n(h,$),be=0|be+n(f,te),ge=0|ge+n(f,re),ge=0|ge+n(y,te),he=0|he+n(y,re),be=0|be+n(p,ne),ge=0|ge+n(p,oe),ge=0|ge+n(l,ne),he=0|he+n(l,oe);var Be=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Be>>>26),Be&=67108863,be=n(C,D),ge=n(C,W),ge=0|ge+n(R,D),he=n(R,W),be=0|be+n(T,q),ge=0|ge+n(T,z),ge=0|ge+n(M,q),he=0|he+n(M,z),be=0|be+n(x,G),ge=0|ge+n(x,K),ge=0|ge+n(k,G),he=0|he+n(k,K),be=0|be+n(w,Y),ge=0|ge+n(w,Z),ge=0|ge+n(A,Y),he=0|he+n(A,Z),be=0|be+n(_,Q),ge=0|ge+n(_,$),ge=0|ge+n(v,Q),he=0|he+n(v,$),be=0|be+n(g,te),ge=0|ge+n(g,re),ge=0|ge+n(h,te),he=0|he+n(h,re),be=0|be+n(f,ne),ge=0|ge+n(f,oe),ge=0|ge+n(y,ne),he=0|he+n(y,oe),be=0|be+n(p,ie),ge=0|ge+n(p,de),ge=0|ge+n(l,ie),he=0|he+n(l,de);var xe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(xe>>>26),xe&=67108863,be=n(P,D),ge=n(P,W),ge=0|ge+n(F,D),he=n(F,W),be=0|be+n(C,q),ge=0|ge+n(C,z),ge=0|ge+n(R,q),he=0|he+n(R,z),be=0|be+n(T,G),ge=0|ge+n(T,K),ge=0|ge+n(M,G),he=0|he+n(M,K),be=0|be+n(x,Y),ge=0|ge+n(x,Z),ge=0|ge+n(k,Y),he=0|he+n(k,Z),be=0|be+n(w,Q),ge=0|ge+n(w,$),ge=0|ge+n(A,Q),he=0|he+n(A,$),be=0|be+n(_,te),ge=0|ge+n(_,re),ge=0|ge+n(v,te),he=0|he+n(v,re),be=0|be+n(g,ne),ge=0|ge+n(g,oe),ge=0|ge+n(h,ne),he=0|he+n(h,oe),be=0|be+n(f,ie),ge=0|ge+n(f,de),ge=0|ge+n(y,ie),he=0|he+n(y,de),be=0|be+n(p,ce),ge=0|ge+n(p,le),ge=0|ge+n(l,ce),he=0|he+n(l,le);var ke=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(ke>>>26),ke&=67108863,be=n(j,D),ge=n(j,W),ge=0|ge+n(L,D),he=n(L,W),be=0|be+n(P,q),ge=0|ge+n(P,z),ge=0|ge+n(F,q),he=0|he+n(F,z),be=0|be+n(C,G),ge=0|ge+n(C,K),ge=0|ge+n(R,G),he=0|he+n(R,K),be=0|be+n(T,Y),ge=0|ge+n(T,Z),ge=0|ge+n(M,Y),he=0|he+n(M,Z),be=0|be+n(x,Q),ge=0|ge+n(x,$),ge=0|ge+n(k,Q),he=0|he+n(k,$),be=0|be+n(w,te),ge=0|ge+n(w,re),ge=0|ge+n(A,te),he=0|he+n(A,re),be=0|be+n(_,ne),ge=0|ge+n(_,oe),ge=0|ge+n(v,ne),he=0|he+n(v,oe),be=0|be+n(g,ie),ge=0|ge+n(g,de),ge=0|ge+n(h,ie),he=0|he+n(h,de),be=0|be+n(f,ce),ge=0|ge+n(f,le),ge=0|ge+n(y,ce),he=0|he+n(y,le),be=0|be+n(p,fe),ge=0|ge+n(p,ye),ge=0|ge+n(l,fe),he=0|he+n(l,ye);var Ee=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ee>>>26),Ee&=67108863,be=n(j,q),ge=n(j,z),ge=0|ge+n(L,q),he=n(L,z),be=0|be+n(P,G),ge=0|ge+n(P,K),ge=0|ge+n(F,G),he=0|he+n(F,K),be=0|be+n(C,Y),ge=0|ge+n(C,Z),ge=0|ge+n(R,Y),he=0|he+n(R,Z),be=0|be+n(T,Q),ge=0|ge+n(T,$),ge=0|ge+n(M,Q),he=0|he+n(M,$),be=0|be+n(x,te),ge=0|ge+n(x,re),ge=0|ge+n(k,te),he=0|he+n(k,re),be=0|be+n(w,ne),ge=0|ge+n(w,oe),ge=0|ge+n(A,ne),he=0|he+n(A,oe),be=0|be+n(_,ie),ge=0|ge+n(_,de),ge=0|ge+n(v,ie),he=0|he+n(v,de),be=0|be+n(g,ce),ge=0|ge+n(g,le),ge=0|ge+n(h,ce),he=0|he+n(h,le),be=0|be+n(f,fe),ge=0|ge+n(f,ye),ge=0|ge+n(y,fe),he=0|he+n(y,ye);var Te=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Te>>>26),Te&=67108863,be=n(j,G),ge=n(j,K),ge=0|ge+n(L,G),he=n(L,K),be=0|be+n(P,Y),ge=0|ge+n(P,Z),ge=0|ge+n(F,Y),he=0|he+n(F,Z),be=0|be+n(C,Q),ge=0|ge+n(C,$),ge=0|ge+n(R,Q),he=0|he+n(R,$),be=0|be+n(T,te),ge=0|ge+n(T,re),ge=0|ge+n(M,te),he=0|he+n(M,re),be=0|be+n(x,ne),ge=0|ge+n(x,oe),ge=0|ge+n(k,ne),he=0|he+n(k,oe),be=0|be+n(w,ie),ge=0|ge+n(w,de),ge=0|ge+n(A,ie),he=0|he+n(A,de),be=0|be+n(_,ce),ge=0|ge+n(_,le),ge=0|ge+n(v,ce),he=0|he+n(v,le),be=0|be+n(g,fe),ge=0|ge+n(g,ye),ge=0|ge+n(h,fe),he=0|he+n(h,ye);var Me=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Me>>>26),Me&=67108863,be=n(j,Y),ge=n(j,Z),ge=0|ge+n(L,Y),he=n(L,Z),be=0|be+n(P,Q),ge=0|ge+n(P,$),ge=0|ge+n(F,Q),he=0|he+n(F,$),be=0|be+n(C,te),ge=0|ge+n(C,re),ge=0|ge+n(R,te),he=0|he+n(R,re),be=0|be+n(T,ne),ge=0|ge+n(T,oe),ge=0|ge+n(M,ne),he=0|he+n(M,oe),be=0|be+n(x,ie),ge=0|ge+n(x,de),ge=0|ge+n(k,ie),he=0|he+n(k,de),be=0|be+n(w,ce),ge=0|ge+n(w,le),ge=0|ge+n(A,ce),he=0|he+n(A,le),be=0|be+n(_,fe),ge=0|ge+n(_,ye),ge=0|ge+n(v,fe),he=0|he+n(v,ye);var Ie=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ie>>>26),Ie&=67108863,be=n(j,Q),ge=n(j,$),ge=0|ge+n(L,Q),he=n(L,$),be=0|be+n(P,te),ge=0|ge+n(P,re),ge=0|ge+n(F,te),he=0|he+n(F,re),be=0|be+n(C,ne),ge=0|ge+n(C,oe),ge=0|ge+n(R,ne),he=0|he+n(R,oe),be=0|be+n(T,ie),ge=0|ge+n(T,de),ge=0|ge+n(M,ie),he=0|he+n(M,de),be=0|be+n(x,ce),ge=0|ge+n(x,le),ge=0|ge+n(k,ce),he=0|he+n(k,le),be=0|be+n(w,fe),ge=0|ge+n(w,ye),ge=0|ge+n(A,fe),he=0|he+n(A,ye);var Ce=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ce>>>26),Ce&=67108863,be=n(j,te),ge=n(j,re),ge=0|ge+n(L,te),he=n(L,re),be=0|be+n(P,ne),ge=0|ge+n(P,oe),ge=0|ge+n(F,ne),he=0|he+n(F,oe),be=0|be+n(C,ie),ge=0|ge+n(C,de),ge=0|ge+n(R,ie),he=0|he+n(R,de),be=0|be+n(T,ce),ge=0|ge+n(T,le),ge=0|ge+n(M,ce),he=0|he+n(M,le),be=0|be+n(x,fe),ge=0|ge+n(x,ye),ge=0|ge+n(k,fe),he=0|he+n(k,ye);var Re=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Re>>>26),Re&=67108863,be=n(j,ne),ge=n(j,oe),ge=0|ge+n(L,ne),he=n(L,oe),be=0|be+n(P,ie),ge=0|ge+n(P,de),ge=0|ge+n(F,ie),he=0|he+n(F,de),be=0|be+n(C,ce),ge=0|ge+n(C,le),ge=0|ge+n(R,ce),he=0|he+n(R,le),be=0|be+n(T,fe),ge=0|ge+n(T,ye),ge=0|ge+n(M,fe),he=0|he+n(M,ye);var Ne=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Ne>>>26),Ne&=67108863,be=n(j,ie),ge=n(j,de),ge=0|ge+n(L,ie),he=n(L,de),be=0|be+n(P,ce),ge=0|ge+n(P,le),ge=0|ge+n(F,ce),he=0|he+n(F,le),be=0|be+n(C,fe),ge=0|ge+n(C,ye),ge=0|ge+n(R,fe),he=0|he+n(R,ye);var Pe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Pe>>>26),Pe&=67108863,be=n(j,ce),ge=n(j,le),ge=0|ge+n(L,ce),he=n(L,le),be=0|be+n(P,fe),ge=0|ge+n(P,ye),ge=0|ge+n(F,fe),he=0|he+n(F,ye);var Fe=0|(0|o+be)+((8191&ge)<<13);o=0|(0|he+(ge>>>13))+(Fe>>>26),Fe&=67108863,be=n(j,fe),ge=n(j,ye),ge=0|ge+n(L,fe),he=n(L,ye);var Oe=0|(0|o+be)+((8191&ge)<<13);return o=0|(0|he+(ge>>>13))+(Oe>>>26),Oe&=67108863,i[0]=me,i[1]=_e,i[2]=ve,i[3]=Se,i[4]=we,i[5]=Ae,i[6]=Be,i[7]=xe,i[8]=ke,i[9]=Ee,i[10]=Te,i[11]=Me,i[12]=Ie,i[13]=Ce,i[14]=Re,i[15]=Ne,i[16]=Pe,i[17]=Fe,i[18]=Oe,0!==o&&(i[19]=o,r.length++),r};n||(C=g),f.prototype.mulTo=function(e,t){var r=this.length+e.length,a;return a=10===this.length&&10===e.length?C(this,e,t):63>r?g(this,e,t):1024>r?h(this,e,t):m(this,e,t),a},_.prototype.makeRBT=function(e){for(var r=Array(e),t=f.prototype._countBits(e)-1,a=0;a>=1;return a},_.prototype.permute=function(e,t,r,a,n,o){for(var s=0;s>>=1)n++;return 1<=a))for(var n=0,o;nn?0:0|n/67108864;return e},_.prototype.convert13b=function(e,t,r,a){for(var n=0,o=0;o>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;oe);for(var t=0,r=0;r>=26,t+=0|a/67108864,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(e){var t=b(e);if(0===t.length)return new f(1);for(var r=this,a=0;a>>26-t<<26-t,s=(0|this.words[a])-o<>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;ar)for(this.length-=r,c=0;c=n);c--){var f=0|this.words[c];this.words[c]=u<<26-p|f>>>p,u=f&(67108863^67108863>>>p<>>t<e),0>e?this.isubn(-e):0===this.negative?this._iaddn(e):1===this.length&&(0|this.words[0])e),0>e)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&0>this.words[0])this.words[0]=-this.words[0],this.negative=1;else for(var t=0;tthis.words[t];t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var a=e.length+r,n;this._expand(a);var o=0,s;for(n=0;n>26)-(0|d/67108864),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===o)return this.strip();for(l(-1===o),o=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),o=e,s=0|o.words[o.length-1],p=this._countBits(s);r=26-p,0!=r&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var c=n.length-o.length,l;if("mod"!==t){l=new f(null),l.length=c+1,l.words=Array(l.length);for(var u=0;uthis.length||0>this.cmp(e)?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t):(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n})},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0===t.div.negative?t.mod:t.mod.isub(e),a=e.ushrn(1),n=e.andln(1),o=r.cmp(a);return 0>o||1===n&&0===o?t.div:0===t.div.negative?t.div.iaddn(1):t.div.isubn(1)},f.prototype.modn=function(e){l(67108863>=e);for(var t=0,r=this.length-1;0<=r;r--)t=(67108864%e*t+(0|this.words[r]))%e;return t},f.prototype.idivn=function(e){l(67108863>=e);for(var t=0,r=this.length-1,a;0<=r;r--)a=(0|this.words[r])+67108864*t,this.words[r]=0|a/e,t=a%e;return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.prototype.egcd=function(e){l(0===e.negative),l(!e.isZero());var t=this,r=e.clone();t=0===t.negative?t.clone():t.umod(e);for(var a=new f(1),n=new f(0),o=new f(0),s=new f(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var p=r.clone(),c=t.clone();!t.isZero();){for(var u=0,y=1;0==(t.words[0]&y)&&26>u;++u,y<<=1);if(0b;++b,h<<=1);if(0d;++d,p<<=1);if(0c;++c,u<<=1);if(0y.cmpn(0)&&y.iadd(e),y},f.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var n=this.clone(),o=e.clone();n.negative=0,o.negative=0;for(var s=0;n.isEven()&&o.isEven();s++)n.iushrn(1),o.iushrn(1);do{for(;n.isEven();)n.iushrn(1);for(;o.isEven();)o.iushrn(1);var i=n.cmp(o);if(0>i){var r=n;n=o,o=r}else if(0===i||0===o.cmpn(1))break;n.isub(o)}while(!0);return o.iushln(s)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.prototype.bincn=function(e){l("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<>>26,s&=67108863,this.words[o]=s;return 0!==n&&(this.words[o]=n,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(e){var t=0>e;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(1=e,"Number is too big");var a=0|this.words[0];r=a===e?0:ae.length)return 1;if(this.lengtha&&(t=1);break}}return t},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return 0<=this.cmpn(e)},f.prototype.gte=function(e){return 0<=this.cmp(e)},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return 0>=this.cmpn(e)},f.prototype.lte=function(e){return 0>=this.cmp(e)},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new x(e)},f.prototype.toRed=function(e){return l(!this.red,"Already a number in reduction context"),l(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},f.prototype.fromRed=function(){return l(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return l(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return l(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return l(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return l(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return l(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return l(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return l(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return l(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return l(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return l(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return l(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return l(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return l(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var R={k256:null,p224:null,p192:null,p25519:null};v.prototype._tmp=function(){var e=new f(null);return e.words=Array(s(this.n/13)),e},v.prototype.ireduce=function(e){var t=e,a;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),a=t.bitLength();while(a>this.n);var n=a=e.length)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n>>22,o=s}o>>>=22,e.words[n-10]=o,e.length-=0===o&&10>>=26,e.words[r]=n,t=a}return 0!==t&&(e.words[e.length++]=t),e},f._prime=function e(t){if(R[t])return R[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new w;else if("p192"===t)e=new A;else if("p25519"===t)e=new B;else throw new Error("Unknown prime "+t);return R[t]=e,e},x.prototype._verify1=function(e){l(0===e.negative,"red works only with positives"),l(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){l(0==(e.negative|t.negative),"red works only with positives"),l(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(l(1==a%2),3===a){var n=this.m.add(new f(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),d=0;!o.isZero()&&0===o.andln(1);)d++,o.iushrn(1);l(!o.isZero());var p=new f(1).toRed(this),u=p.redNeg(),y=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new f(2*g*g).toRed(this);0!==this.pow(g,y).cmp(u);)g.redIAdd(u);for(var h=this.pow(g,o),_=this.pow(e,o.addn(1).iushrn(1)),v=this.pow(e,o),S=d;0!==v.cmp(p);){for(var w=v,A=0;0!==w.cmp(p);A++)w=w.redSqr();l(A>c,n!==r[0]&&(n=this.sqr(n)),0===l&&0===o){s=0;continue}o<<=1,o|=l,s++,4!==s&&(0!=a||0!=c)||(n=this.mul(n,r[o]),s=0,o=0)}d=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},f.mont=function(e){return new k(e)},c(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new f(0)._forceRed(this);var a=e.mul(r),t=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(t).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})("undefined"==typeof t||t,this)},{}],139:[function(e,t){"use strict";function r(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(){}var n="function"!=typeof Object.create&&"~";a.prototype._events=void 0,a.prototype.listeners=function(e,t){var r=n?n+e:e,a=this._events&&this._events[r];if(t)return!!a;if(!a)return[];if(a.fn)return[a.fn];for(var o=0,s=a.length,d=Array(s);oo)){i.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+i.length+" \""+(t+"\" listeners added. Use emitter.setMaxListeners() to increase limit."));d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=i.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",d.name,d.message)}return e}function l(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=Array(arguments.length),t=0;te||e!==e)throw new TypeError("\"defaultMaxListeners\" must be a positive number");S=e}}):r.defaultMaxListeners=S,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError("\"n\" argument must be a positive number");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(e){var t="error"===e,r,a,o,l,u,f;if(f=this._events,f)t=t&&null==f.error;else if(!t)return!1;if(t){if(1n)return this;0===n?r.shift():b(r,n),1===r.length&&(a[e]=r[0]),a.removeListener&&this.emit("removeListener",e,s||t)}return this},r.prototype.removeAllListeners=function(e){var t,r,a;if(r=this._events,!r)return this;if(!r.removeListener)return 0===arguments.length?(this._events=_(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=_(null):delete r[e]),this;if(0===arguments.length){var n=m(r),o;for(a=0;a=this._blockSize;){for(var s=this._blockOffset;sr;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=a},{inherits:162,"safe-buffer":218,stream:229}],145:[function(e,t,r){var a=r;a.utils=e("./hash/utils"),a.common=e("./hash/common"),a.sha=e("./hash/sha"),a.ripemd=e("./hash/ripemd"),a.hmac=e("./hash/hmac"),a.sha1=a.sha.sha1,a.sha256=a.sha.sha256,a.sha224=a.sha.sha224,a.sha384=a.sha.sha384,a.sha512=a.sha.sha512,a.ripemd160=a.ripemd.ripemd160},{"./hash/common":146,"./hash/hmac":147,"./hash/ripemd":148,"./hash/sha":149,"./hash/utils":156}],146:[function(e,t,r){"use strict";function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var n=e("./utils"),o=e("minimalistic-assert");r.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending=this.pending?this.pending.concat(e):e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var a=e.length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-a,this.endian);for(var r=0;r>>24,n[o++]=255&e>>>16,n[o++]=255&e>>>8,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=255&e>>>8,n[o++]=255&e>>>16,n[o++]=255&e>>>24,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,s=8;sthis.blockSize&&(e=new this.Hash().update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t=e?t^r^a:31>=e?t&r|~t&a:47>=e?(t|~r)^a:63>=e?t&a|r&~a:t^(r|~a)}function i(e){return 15>=e?0:31>=e?1518500249:47>=e?1859775393:63>=e?2400959708:2840853838}function d(e){return 15>=e?1352829926:31>=e?1548603684:47>=e?1836072691:63>=e?2053994217:0}var p=e("./utils"),c=e("./common"),l=p.rotl32,u=p.sum32,f=p.sum32_3,y=p.sum32_4,b=c.BlockHash;p.inherits(n,b),a.ripemd160=n,n.blockSize=512,n.outSize=160,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var a=this.h[0],n=this.h[1],p=this.h[2],c=this.h[3],b=this.h[4],m=a,_=n,v=p,S=c,w=b,x=0,k;80>x;x++)k=u(l(y(a,o(x,n,p,c),e[g[x]+t],i(x)),h[x]),b),a=b,b=c,c=l(p,10),p=n,n=k,k=u(l(y(m,o(79-x,_,v,S),e[r[x]+t],d(x)),s[x]),w),m=w,w=S,S=l(v,10),v=_,_=k;k=f(this.h[1],p,S),this.h[1]=f(this.h[2],c,w),this.h[2]=f(this.h[3],b,m),this.h[3]=f(this.h[4],a,_),this.h[4]=f(this.h[0],n,v),this.h[0]=k},n.prototype._digest=function(e){return"hex"===e?p.toHex32(this.h,"little"):p.split32(this.h,"little")};var g=[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],r=[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],h=[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],s=[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]},{"./common":146,"./utils":156}],149:[function(e,t,r){"use strict";r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":150,"./sha/224":151,"./sha/256":152,"./sha/384":153,"./sha/512":154}],150:[function(e,t){"use strict";function r(){return this instanceof r?void(s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)):new r}var a=e("../utils"),n=e("../common"),o=e("./common"),p=a.rotl32,l=a.sum32,u=a.sum32_5,f=o.ft_1,s=n.BlockHash,y=[1518500249,1859775393,2400959708,3395469782];a.inherits(r,s),t.exports=r,r.blockSize=512,r.outSize=160,r.hmacStrength=80,r.padLength=64,r.prototype._update=function(r,n){for(var o=this.W,g=0;16>g;g++)o[g]=r[n+g];for(;go;o++)n[o]=t[r+o];for(;os&&(s+=4294967296),s}function n(e,t,a,n,o,s){var i=t&n^~t&s;return 0>i&&(i+=4294967296),i}function o(e,t,a,n,o){var s=e&a^e&o^a&o;return 0>s&&(s+=4294967296),s}function s(e,t,a,n,o,s){var i=t&n^t&s^n&s;return 0>i&&(i+=4294967296),i}function d(e,t){var a=m(e,t,28),n=m(t,e,2),o=m(t,e,7),s=a^n^o;return 0>s&&(s+=4294967296),s}function p(e,t){var a=_(e,t,28),n=_(t,e,2),o=_(t,e,7),s=a^n^o;return 0>s&&(s+=4294967296),s}function c(e,t){var a=m(e,t,14),n=m(e,t,18),o=m(t,e,9),s=a^n^o;return 0>s&&(s+=4294967296),s}function l(e,t){var a=_(e,t,14),n=_(e,t,18),o=_(t,e,9),s=a^n^o;return 0>s&&(s+=4294967296),s}function u(e,t){var a=m(e,t,1),n=m(e,t,8),o=v(e,t,7),s=a^n^o;return 0>s&&(s+=4294967296),s}function f(e,t){var a=_(e,t,1),n=_(e,t,8),o=S(e,t,7),s=a^n^o;return 0>s&&(s+=4294967296),s}function y(e,t){var a=m(e,t,19),n=m(t,e,29),o=v(e,t,6),s=a^n^o;return 0>s&&(s+=4294967296),s}function b(e,t){var a=_(e,t,19),n=_(t,e,29),o=S(e,t,6),s=a^n^o;return 0>s&&(s+=4294967296),s}var i=e("../utils"),g=e("../common"),h=e("minimalistic-assert"),m=i.rotr64_hi,_=i.rotr64_lo,v=i.shr64_hi,S=i.shr64_lo,w=i.sum64,A=i.sum64_hi,B=i.sum64_lo,x=i.sum64_4_hi,k=i.sum64_4_lo,E=i.sum64_5_hi,T=i.sum64_5_lo,M=g.BlockHash,I=[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];i.inherits(r,M),t.exports=r,r.blockSize=1024,r.outSize=512,r.hmacStrength=192,r.padLength=128,r.prototype._prepareBlock=function(e,t){for(var r=this.W,a=0;32>a;a++)r[a]=e[t+a];for(;a>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":156}],156:[function(e,t,r){"use strict";function a(e){return(e>>>24|65280&e>>>8|16711680&e<<8|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var s=e("minimalistic-assert"),i=e("inherits");r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(!("string"==typeof e))for(a=0;a>8,s=255&n;o?r.push(o,s):r.push(s)}else if("hex"===t)for(e=e.replace(/[^a-z0-9]+/ig,""),0!=e.length%2&&(e="0"+e),a=0;a>>0}return o},r.split32=function(e,t){for(var r=Array(4*e.length),a=0,n=0,o;a>>24,r[n+1]=255&o>>>16,r[n+2]=255&o>>>8,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=255&o>>>16,r[n+1]=255&o>>>8,r[n]=255&o);return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,a){return e+t+r+a>>>0},r.sum32_5=function(t,r,a,n,o){return t+r+a+n+o>>>0},r.sum64=function(e,t,r,a){var n=e[t],o=e[t+1],s=a+o>>>0,i=(s>>0,e[t+1]=s},r.sum64_hi=function(e,t,r,a){var n=(t+a>>>0>>0},r.sum64_lo=function(e,t,r,a){return t+a>>>0},r.sum64_4_hi=function(e,t,r,a,n,o,s,i){var d=0,p=t;p=p+a>>>0,d+=p>>0,d+=p>>0,d+=p>>0},r.sum64_4_lo=function(e,t,r,a,n,o,s,i){return t+a+o+i>>>0},r.sum64_5_hi=function(e,t,r,a,n,o,s,i,d,p){var c=0,l=t;l=l+a>>>0,c+=l>>0,c+=l>>0,c+=l>>0,c+=l>>0},r.sum64_5_lo=function(e,t,r,a,n,o,s,i,d,p){return t+a+o+i+p>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:162,"minimalistic-assert":170}],157:[function(e,t){"use strict";function r(e){if(!(this instanceof r))return new r(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),a=n.toArray(e.nonce,e.nonceEnc||"hex"),s=n.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,a,s)}var a=e("hash.js"),n=e("minimalistic-crypto-utils"),o=e("minimalistic-assert");t.exports=r,r.prototype._init=function(e,t,r){var a=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},r.prototype.generate=function(e,t,r,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(a=r,r=t,t=null),r&&(r=n.toArray(r,a||"hex"),this._update(r));for(var o=[];o.length\\$%@\u0621\u0624\u0629\"'^|~\u2985\u2986\u30FB\u30A5\u30E3\xA2\xA3\xAC\xA6\xA5\u20A9\u2502\u2190\u2191\u2192\u2193\u25A0\u25CB\uD801\uDC28\uD801\uDC29\uD801\uDC2A\uD801\uDC2B\uD801\uDC2C\uD801\uDC2D\uD801\uDC2E\uD801\uDC2F\uD801\uDC30\uD801\uDC31\uD801\uDC32\uD801\uDC33\uD801\uDC34\uD801\uDC35\uD801\uDC36\uD801\uDC37\uD801\uDC38\uD801\uDC39\uD801\uDC3A\uD801\uDC3B\uD801\uDC3C\uD801\uDC3D\uD801\uDC3E\uD801\uDC3F\uD801\uDC40\uD801\uDC41\uD801\uDC42\uD801\uDC43\uD801\uDC44\uD801\uDC45\uD801\uDC46\uD801\uDC47\uD801\uDC48\uD801\uDC49\uD801\uDC4A\uD801\uDC4B\uD801\uDC4C\uD801\uDC4D\uD801\uDC4E\uD801\uDC4F\uD801\uDCD8\uD801\uDCD9\uD801\uDCDA\uD801\uDCDB\uD801\uDCDC\uD801\uDCDD\uD801\uDCDE\uD801\uDCDF\uD801\uDCE0\uD801\uDCE1\uD801\uDCE2\uD801\uDCE3\uD801\uDCE4\uD801\uDCE5\uD801\uDCE6\uD801\uDCE7\uD801\uDCE8\uD801\uDCE9\uD801\uDCEA\uD801\uDCEB\uD801\uDCEC\uD801\uDCED\uD801\uDCEE\uD801\uDCEF\uD801\uDCF0\uD801\uDCF1\uD801\uDCF2\uD801\uDCF3\uD801\uDCF4\uD801\uDCF5\uD801\uDCF6\uD801\uDCF7\uD801\uDCF8\uD801\uDCF9\uD801\uDCFA\uD801\uDCFB\uD803\uDCC0\uD803\uDCC1\uD803\uDCC2\uD803\uDCC3\uD803\uDCC4\uD803\uDCC5\uD803\uDCC6\uD803\uDCC7\uD803\uDCC8\uD803\uDCC9\uD803\uDCCA\uD803\uDCCB\uD803\uDCCC\uD803\uDCCD\uD803\uDCCE\uD803\uDCCF\uD803\uDCD0\uD803\uDCD1\uD803\uDCD2\uD803\uDCD3\uD803\uDCD4\uD803\uDCD5\uD803\uDCD6\uD803\uDCD7\uD803\uDCD8\uD803\uDCD9\uD803\uDCDA\uD803\uDCDB\uD803\uDCDC\uD803\uDCDD\uD803\uDCDE\uD803\uDCDF\uD803\uDCE0\uD803\uDCE1\uD803\uDCE2\uD803\uDCE3\uD803\uDCE4\uD803\uDCE5\uD803\uDCE6\uD803\uDCE7\uD803\uDCE8\uD803\uDCE9\uD803\uDCEA\uD803\uDCEB\uD803\uDCEC\uD803\uDCED\uD803\uDCEE\uD803\uDCEF\uD803\uDCF0\uD803\uDCF1\uD803\uDCF2\uD806\uDCC0\uD806\uDCC1\uD806\uDCC2\uD806\uDCC3\uD806\uDCC4\uD806\uDCC5\uD806\uDCC6\uD806\uDCC7\uD806\uDCC8\uD806\uDCC9\uD806\uDCCA\uD806\uDCCB\uD806\uDCCC\uD806\uDCCD\uD806\uDCCE\uD806\uDCCF\uD806\uDCD0\uD806\uDCD1\uD806\uDCD2\uD806\uDCD3\uD806\uDCD4\uD806\uDCD5\uD806\uDCD6\uD806\uDCD7\uD806\uDCD8\uD806\uDCD9\uD806\uDCDA\uD806\uDCDB\uD806\uDCDC\uD806\uDCDD\uD806\uDCDE\uD806\uDCDF\u0131\u0237\u2207\u2202\uD83A\uDD22\uD83A\uDD23\uD83A\uDD24\uD83A\uDD25\uD83A\uDD26\uD83A\uDD27\uD83A\uDD28\uD83A\uDD29\uD83A\uDD2A\uD83A\uDD2B\uD83A\uDD2C\uD83A\uDD2D\uD83A\uDD2E\uD83A\uDD2F\uD83A\uDD30\uD83A\uDD31\uD83A\uDD32\uD83A\uDD33\uD83A\uDD34\uD83A\uDD35\uD83A\uDD36\uD83A\uDD37\uD83A\uDD38\uD83A\uDD39\uD83A\uDD3A\uD83A\uDD3B\uD83A\uDD3C\uD83A\uDD3D\uD83A\uDD3E\uD83A\uDD3F\uD83A\uDD40\uD83A\uDD41\uD83A\uDD42\uD83A\uDD43\u066E\u06A1\u066F\u5B57\u53CC\u591A\u89E3\u4EA4\u6620\u7121\u524D\u5F8C\u518D\u65B0\u521D\u7D42\u8CA9\u58F0\u5439\u6F14\u6295\u6355\u904A\u6307\u7981\u7A7A\u5408\u6E80\u7533\u5272\u55B6\u914D\u5F97\u53EF\u4E3D\u4E38\u4E41\uD840\uDD22\u4F60\u4FBB\u5002\u507A\u5099\u50CF\u349E\uD841\uDE3A\u5154\u5164\u5177\uD841\uDD1C\u34B9\u5167\uD841\uDD4B\u5197\u51A4\u4ECC\u51AC\uD864\uDDDF\u5203\u34DF\u523B\u5246\u5277\u3515\u5305\u5306\u5349\u535A\u5373\u537D\u537F\uD842\uDE2C\u7070\u53CA\u53DF\uD842\uDF63\u53EB\u53F1\u5406\u549E\u5438\u5448\u5468\u54A2\u54F6\u5510\u5553\u5563\u5584\u55AB\u55B3\u55C2\u5716\u5717\u5651\u5674\u58EE\u57CE\u57F4\u580D\u578B\u5832\u5831\u58AC\uD845\uDCE4\u58F2\u58F7\u5906\u5922\u5962\uD845\uDEA8\uD845\uDEEA\u59EC\u5A1B\u5A27\u59D8\u5A66\u36EE\u5B08\u5B3E\uD846\uDDC8\u5BC3\u5BD8\u5BF3\uD846\uDF18\u5BFF\u5C06\u3781\u5C60\u5CC0\u5C8D\uD847\uDDE4\u5D43\uD847\uDDE6\u5D6E\u5D6B\u5D7C\u5DE1\u5DE2\u382F\u5DFD\u5E28\u5E3D\u5E69\u3862\uD848\uDD83\u387C\u5EB0\u5EB3\u5EB6\uD868\uDF92\uD848\uDF31\u8201\u5F22\u38C7\uD84C\uDEB8\uD858\uDDDA\u5F62\u5F6B\u38E3\u5F9A\u5FCD\u5FD7\u5FF9\u6081\u393A\u391C\uD849\uDED4\u60C7\u6148\u614C\u617A\u61B2\u61A4\u61AF\u61DE\u621B\u625D\u62B1\u62D4\u6350\uD84A\uDF0C\u633D\u62FC\u6368\u6383\u63E4\uD84A\uDFF1\u6422\u63C5\u63A9\u3A2E\u6469\u647E\u649D\u6477\u3A6C\u656C\uD84C\uDC0A\u65E3\u66F8\u6649\u3B19\u3B08\u3AE4\u5192\u5195\u6700\u669C\u80AD\u43D9\u6721\u675E\u6753\uD84C\uDFC3\u3B49\u67FA\u6785\u6852\uD84D\uDC6D\u688E\u681F\u6914\u6942\u69A3\u69EA\u6AA8\uD84D\uDEA3\u6ADB\u3C18\u6B21\uD84E\uDCA7\u6B54\u3C4E\u6B72\u6B9F\u6BBB\uD84E\uDE8D\uD847\uDD0B\uD84E\uDEFA\u6C4E\uD84F\uDCBC\u6CBF\u6CCD\u6C67\u6D16\u6D3E\u6D69\u6D78\u6D85\uD84F\uDD1E\u6D34\u6E2F\u6E6E\u3D33\u6EC7\uD84F\uDED1\u6DF9\u6F6E\uD84F\uDF5E\uD84F\uDF8E\u6FC6\u7039\u701B\u3D96\u704A\u707D\u7077\u70AD\uD841\uDD25\u7145\uD850\uDE63\u719C\u7228\u7250\uD851\uDE08\u7280\u7295\uD851\uDF35\uD852\uDC14\u737A\u738B\u3EAC\u73A5\u3EB8\u7447\u745C\u7485\u74CA\u3F1B\u7524\uD853\uDC36\u753E\uD853\uDC92\uD848\uDD9F\u7610\uD853\uDFA1\uD853\uDFB8\uD854\uDC44\u3FFC\u4008\uD854\uDCF3\uD854\uDCF2\uD854\uDD19\uD854\uDD33\u771E\u771F\u778B\u4046\u4096\uD855\uDC1D\u784E\u40E3\uD855\uDE26\uD855\uDE9A\uD855\uDEC5\u79EB\u412F\u7A4A\u7A4F\uD856\uDD7C\uD856\uDEA7\u4202\uD856\uDFAB\u7BC6\u7BC9\u4227\uD857\uDC80\u7CD2\u42A0\u7CE8\u7CE3\u7D00\uD857\uDF86\u7D63\u4301\u7DC7\u7E02\u7E45\u4334\uD858\uDE28\uD858\uDE47\u4359\uD858\uDED9\u7F7A\uD858\uDF3E\u7F95\u7FFA\uD859\uDCDA\uD859\uDD23\u8060\uD859\uDDA8\u8070\uD84C\uDF5F\u43D5\u80B2\u8103\u440B\u813E\u5AB5\uD859\uDFA7\uD859\uDFB5\uD84C\uDF93\uD84C\uDF9C\u8204\u8F9E\u446B\u8291\u828B\u829D\u52B3\u82B1\u82B3\u82BD\u82E6\uD85A\uDF3C\u831D\u8363\u83AD\u8323\u83BD\u83E7\u8353\u83CA\u83CC\u83DC\uD85B\uDC36\uD85B\uDD6B\uD85B\uDCD5\u452B\u84F1\u84F3\u8516\uD85C\uDFCA\u8564\uD85B\uDF2C\u455D\u4561\uD85B\uDFB1\uD85C\uDCD2\u456B\u8650\u8667\u8669\u86A9\u8688\u870E\u86E2\u8728\u876B\u8786\u87E1\u8801\u45F9\u8860\uD85D\uDE67\u88D7\u88DE\u4635\u88FA\u34BB\uD85E\uDCAE\uD85E\uDD66\u46BE\u46C7\u8AA0\uD85F\uDCA8\u8CAB\u8CC1\u8D1B\u8D77\uD85F\uDF2F\uD842\uDC04\u8DCB\u8DBC\u8DF0\uD842\uDCDE\u8ED4\uD861\uDDD2\uD861\uDDED\u9094\u90F1\u9111\uD861\uDF2E\u911B\u9238\u92D7\u92D8\u927C\u93F9\u9415\uD862\uDFFA\u958B\u4995\u95B7\uD863\uDD77\u49E6\u96C3\u5DB2\u9723\uD864\uDD45\uD864\uDE1A\u4A6E\u4A76\u97E0\uD865\uDC0A\u4AB2\uD865\uDC96\u9829\uD865\uDDB6\u98E2\u4B33\u9929\u99A7\u99C2\u99FE\u4BCE\uD866\uDF30\u9C40\u9CFD\u4CCE\u4CED\u9D67\uD868\uDCCE\u4CF8\uD868\uDD05\uD868\uDE0E\uD868\uDE91\u4D56\u9EFE\u9F05\u9F0F\u9F16\uD869\uDE00",mapChar:function(r){return 196608<=r?917760<=r&&917999>=r?18874368:0:e[t[r>>4]][15&r]}}})},{}],160:[function(e,t,r){(function(a,n){"function"==typeof define&&define.amd?define(["punycode","./idna-map"],function(e,t){return n(e,t)}):"object"==typeof r?t.exports=n(e("punycode"),e("./idna-map")):a.uts46=n(a.punycode,a.idna_map)})(this,function(e,t){function r(r,a,n){for(var o=[],s=e.ucs2.decode(r),d=0;d>21,f=t.mapStr.substr(65535&l>>5,31&l);if(0===u||a&&1&l>>23)throw new Error("Illegal char "+c);else 1===u?o.push(f):2===u?o.push(n?f:c):3===u&&o.push(c)}var y=o.join("").normalize("NFC");return y}function a(t,a,o){void 0===o&&(o=!1);var s=r(t,o,a),i=s.split(".");return i=i.map(function(t){return t.startsWith("xn--")?(t=e.decode(t.substring(4)),n(t,o,!1)):n(t,o,a),t}),i.join(".")}function n(e,a,n){if("-"===e[2]&&"-"===e[3])throw new Error("Failed to validate "+e);if(e.startsWith("-")||e.endsWith("-"))throw new Error("Failed to validate "+e);if(e.includes("."))throw new Error("Failed to validate "+e);if(r(e,a,n)!==e)throw new Error("Failed to validate "+e);var o=e.codePointAt(0);if(t.mapChar(o)&16777216)throw new Error("Label contains illegal character: "+o)}function o(t,r){r===void 0&&(r={});var n=!("transitional"in r)||r.transitional,o=!!("useStd3ASCII"in r)&&r.useStd3ASCII,s=!!("verifyDnsLength"in r)&&r.verifyDnsLength,d=a(t,n,o).split("."),p=d.map(e.toASCII),c=p.join("."),l;if(s){if(1>c.length||253u.length||63>1,f=-7,y=n?p-1:0,b=n?-1:1,d=t[r+y],g,h;for(y+=b,g=d&(1<<-f)-1,d>>=-f,f+=c;0>=-f,f+=o;0>1,b=23===p?5.960464477539063e-8-6.617444900424222e-24:0,g=o?0:l-1,h=o?1:-1,d=0>r||0===r&&0>1/r?1:0,s,_,v;for(r=Math.abs(r),isNaN(r)||r===1/0?(_=isNaN(r)?1:0,s=f):(s=Math.floor(Math.log(r)/Math.LN2),1>r*(v=a(2,-s))&&(s--,v*=2),r+=1<=s+y?b/v:b*a(2,1-y),2<=r*v&&(s++,v/=2),s+y>=f?(_=0,s=f):1<=s+y?(_=(r*v-1)*a(2,p),s+=y):(_=r*a(2,y-1)*a(2,p),s=0));8<=p;t[n+g]=255&_,g+=h,_/=256,p-=8);for(s=s<>>32-t}function o(e,t,r,a,o,i,d){return 0|n(0|e+(t&r|~t&a)+o+i,d)+t}function s(e,t,r,a,o,i,d){return 0|n(0|e+(t&a|r&~a)+o+i,d)+t}function p(e,t,r,a,o,i,d){return 0|n(0|e+(t^r^a)+o+i,d)+t}function l(e,t,r,a,o,i,d){return 0|n(0|e+(r^(t|~a))+o+i,d)+t}var a=e("inherits"),i=e("hash-base"),d=e("safe-buffer").Buffer,c=Array(16);a(r,i),r.prototype._update=function(){for(var e=c,t=0;16>t;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,u=this._c,f=this._d;r=o(r,n,u,f,e[0],3614090360,7),f=o(f,r,n,u,e[1],3905402710,12),u=o(u,f,r,n,e[2],606105819,17),n=o(n,u,f,r,e[3],3250441966,22),r=o(r,n,u,f,e[4],4118548399,7),f=o(f,r,n,u,e[5],1200080426,12),u=o(u,f,r,n,e[6],2821735955,17),n=o(n,u,f,r,e[7],4249261313,22),r=o(r,n,u,f,e[8],1770035416,7),f=o(f,r,n,u,e[9],2336552879,12),u=o(u,f,r,n,e[10],4294925233,17),n=o(n,u,f,r,e[11],2304563134,22),r=o(r,n,u,f,e[12],1804603682,7),f=o(f,r,n,u,e[13],4254626195,12),u=o(u,f,r,n,e[14],2792965006,17),n=o(n,u,f,r,e[15],1236535329,22),r=s(r,n,u,f,e[1],4129170786,5),f=s(f,r,n,u,e[6],3225465664,9),u=s(u,f,r,n,e[11],643717713,14),n=s(n,u,f,r,e[0],3921069994,20),r=s(r,n,u,f,e[5],3593408605,5),f=s(f,r,n,u,e[10],38016083,9),u=s(u,f,r,n,e[15],3634488961,14),n=s(n,u,f,r,e[4],3889429448,20),r=s(r,n,u,f,e[9],568446438,5),f=s(f,r,n,u,e[14],3275163606,9),u=s(u,f,r,n,e[3],4107603335,14),n=s(n,u,f,r,e[8],1163531501,20),r=s(r,n,u,f,e[13],2850285829,5),f=s(f,r,n,u,e[2],4243563512,9),u=s(u,f,r,n,e[7],1735328473,14),n=s(n,u,f,r,e[12],2368359562,20),r=p(r,n,u,f,e[5],4294588738,4),f=p(f,r,n,u,e[8],2272392833,11),u=p(u,f,r,n,e[11],1839030562,16),n=p(n,u,f,r,e[14],4259657740,23),r=p(r,n,u,f,e[1],2763975236,4),f=p(f,r,n,u,e[4],1272893353,11),u=p(u,f,r,n,e[7],4139469664,16),n=p(n,u,f,r,e[10],3200236656,23),r=p(r,n,u,f,e[13],681279174,4),f=p(f,r,n,u,e[0],3936430074,11),u=p(u,f,r,n,e[3],3572445317,16),n=p(n,u,f,r,e[6],76029189,23),r=p(r,n,u,f,e[9],3654602809,4),f=p(f,r,n,u,e[12],3873151461,11),u=p(u,f,r,n,e[15],530742520,16),n=p(n,u,f,r,e[2],3299628645,23),r=l(r,n,u,f,e[0],4096336452,6),f=l(f,r,n,u,e[7],1126891415,10),u=l(u,f,r,n,e[14],2878612391,15),n=l(n,u,f,r,e[5],4237533241,21),r=l(r,n,u,f,e[12],1700485571,6),f=l(f,r,n,u,e[3],2399980690,10),u=l(u,f,r,n,e[10],4293915773,15),n=l(n,u,f,r,e[1],2240044497,21),r=l(r,n,u,f,e[8],1873313359,6),f=l(f,r,n,u,e[15],4264355552,10),u=l(u,f,r,n,e[6],2734768916,15),n=l(n,u,f,r,e[13],1309151649,21),r=l(r,n,u,f,e[4],4149444226,6),f=l(f,r,n,u,e[11],3174756917,10),u=l(u,f,r,n,e[2],718787259,15),n=l(n,u,f,r,e[9],3951481745,21),this._a=0|this._a+r,this._b=0|this._b+n,this._c=0|this._c+u,this._d=0|this._d+f},r.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,s=255&n;o?r.push(o,s):r.push(s)}return r},o.zero2=a,o.toHex=n,o.encode=function(e,t){return"hex"===t?n(e):e}},{}],172:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{dup:138}],173:[function(e,t){var r=e("bn.js"),a=e("strip-hex-prefix");t.exports=function(e){if("string"==typeof e||"number"==typeof e){var t=new r(1),n=(e+"").toLowerCase().trim(),o="0x"===n.substr(0,2)||"-0x"===n.substr(0,3),s=a(n);if("-"===s.substr(0,1)&&(s=a(s.slice(1)),t=new r(-1,10)),s=""===s?"0":s,!s.match(/^-?[0-9]+$/)&&s.match(/^[0-9A-Fa-f]+$/)||s.match(/^[a-fA-F]+$/)||!0===o&&s.match(/^[0-9A-Fa-f]+$/))return new r(s,16).mul(t);if((s.match(/^-?[0-9]+$/)||""===s)&&!1===o)return new r(s,10).mul(t)}else if("object"==typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new r(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},{"bn.js":172,"strip-hex-prefix":236}],174:[function(e,t){"use strict";function r(e){if(null===e||e===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;10>r;r++)t["_"+String.fromCharCode(r)]=r;var a=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==a.join(""))return!1;var n={};return["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"].forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e){for(var t=r(e),d=1,p,c;d65536&&(r("Max buffer length exceeded: textNode"),e=a(e,$.length)),L.length>65536&&(r("Max buffer length exceeded: numberNode"),e=a(e,L.length)),j=65536-e+K}function r(e){$!==void 0&&(l($),u(),$=void 0),Z=s(e+"\nLn: "+Y+"\nCol: "+X+"\nChr: "+J),f(W(void 0,void 0,Z))}function n(){return H==g?(l({}),u(),void(D=!0)):void((H!==h||0!==G)&&r("Unexpected end"),$!==void 0&&(l($),u(),$=void 0),D=!0)}function o(e){return"\r"==e||"\n"==e||" "==e||"\t"==e}function i(e){if(!Z){if(D)return r("Cannot write after close");var a=0;for(J=e[0];J&&(Q=J,J=e[a++],!!J);)switch(K++,"\n"==J?(Y++,X=0):X++,H){case g:if("{"===J)H=m;else if("["===J)H=v;else if(!o(J))return r("Non-whitespace before {[.");continue;case A:case m:if(o(J))continue;if(H===A)q.push(B);else if("}"===J){l({}),u(),H=q.pop()||h;continue}else q.push(_);if("\""===J)H=w;else return r("Malformed object key should start with \" ");continue;case B:case _:if(o(J))continue;if(":"===J)H===_?(q.push(_),void 0!==$&&(l({}),d($),$=void 0),G++):void 0!==$&&(d($),$=void 0),H=h;else if("}"===J)void 0!==$&&(l($),u(),$=void 0),u(),G--,H=q.pop()||h;else if(","===J)H===_&&q.push(_),void 0!==$&&(l($),u(),$=void 0),H=A;else return r("Bad object");continue;case v:case h:if(o(J))continue;if(H===v)if(l([]),G++,H=h,"]"===J){u(),G--,H=q.pop()||h;continue}else q.push(S);if("\""===J)H=w;else if("{"===J)H=m;else if("["===J)H=v;else if("t"===J)H=x;else if("f"===J)H=T;else if("n"===J)H=R;else if("-"===J)L+=J;else if("0"===J)L+=J,H=O;else if(-1!=="123456789".indexOf(J))L+=J,H=O;else return r("Bad value");continue;case S:if(","===J)q.push(S),void 0!==$&&(l($),u(),$=void 0),H=h;else if("]"===J)void 0!==$&&(l($),u(),$=void 0),u(),G--,H=q.pop()||h;else if(o(J))continue;else return r("Bad array");continue;case w:void 0===$&&($="");var n=a-1;STRING_BIGLOOP:for(;;){for(;0=j&&t()}}var d=e(_e).emit,l=e(ve).emit,u=e(Se).emit,f=e(ue).emit,y=/[\\"\n]/g,b=0,g=b++,h=b++,m=b++,_=b++,v=b++,S=b++,w=b++,A=b++,B=b++,x=b++,k=b++,E=b++,T=b++,M=b++,I=b++,C=b++,R=b++,N=b++,P=b++,F=b++,O=b,j=65536,L="",U=!1,D=!1,H=g,q=[],z=null,V=0,G=0,K=0,X=0,Y=1,Z,J,Q,$;e(ge).on(i),e(he).on(n)}function C(e,t){"use strict";function r(e){return function(t){n=e(n,t)}}var a={},n;for(var o in t)e(o).on(r(t[o]),a);e(ce).on(function(e){var t=$(n),r=ae(t),a=ee(n),o;a&&(o=ne($(a)),o[r]=e)}),e(le).on(function(){var e=$(n),t=ae(e),r=ee(n),a;r&&(a=ne($(r)),delete a[t])}),e(me).on(function(){for(var r in t)e(r).un(a)})}function R(e){var t={};return e&&e.split("\r\n").forEach(function(e){var r=e.indexOf(": ");t[e.substring(0,r)]=e.substring(r+2)}),t}function N(e,t){function r(e){return{"http:":80,"https:":443}[e]}function a(t){return t.port||r(t.protocol||e.protocol)}return!!(t.protocol&&t.protocol!=e.protocol||t.host&&t.host!=e.host||t.host&&a(t)!=a(e))}function P(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,r=t.exec(e)||[];return{protocol:r[1]||"",host:r[2]||"",port:r[3]||""}}function F(){return new XMLHttpRequest}function O(e,t,r,a,o,s,i){"use strict";function d(){var e=t.responseText,r=e.substr(l);r&&p(r),l=Z(e)}var p=e(ge).emit,c=e(ue).emit,l=0,u=!0;e(me).on(function(){t.onreadystatechange=null,t.abort()}),"onprogress"in t&&(t.onprogress=d),t.onreadystatechange=function(){function r(){try{u&&e(be).emit(t.status,R(t.getAllResponseHeaders())),u=!1}catch(t){}}switch(t.readyState){case 2:case 3:return r();case 4:r();var a=2==(t.status+"")[0];a?(d(),e(he).emit()):c(W(t.status,t.responseText));}};try{for(var f in t.open(r,a,!0),s)t.setRequestHeader(f,s[f]);N(n.location,P(a))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=i,t.send(o)}catch(t){n.setTimeout(K(c,W(void 0,void 0,t)),0)}}function j(e,t){return{key:e,node:t}}function L(e){function t(e,t){var r=ne($(e));return h(o,r)?a(e,Z(r),t):e}function r(e,t,r){ne($(e))[t]=r}function a(e,t,a){e&&r(e,t,a);var o=v(j(t,a),e);return n(o),o}var n=e(de).emit,s=e(pe).emit,i=e(ye).emit,d=e(fe).emit,p={};return p[ve]=function(e,n){if(!e)return i(n),a(e,oe,n);var o=t(e,n),s=ee(o),d=ae($(o));return r(s,d,n),v(j(d,n),s)},p[Se]=function(e){return s(e),ee(e)||d(ne($(e)))},p[_e]=a,p}function U(e,t,r){function a(e){return function(t){return t.id==e}}var n,o;return{on:function(r,a){var s={listener:r,id:a||r};return t&&t.emit(e,r,s.id),n=v(s,n),o=v(r,o),this},emit:function(){E(o,arguments)},un:function(t){var s;n=x(n,a(t),function(e){s=e}),s&&(o=x(o,function(e){return e==s.listener}),r&&r.emit(e,s.listener,s.id))},listeners:function(){return o},hasListener:function(e){var t=e?a(e):b;return m(M(t,n))}}}function D(){function e(e){return r[e]=U(e,a,n)}function t(t){return r[t]||e(t)}var r={},a=e("newListener"),n=e("removeListener");return["emit","on","un"].forEach(function(e){t[e]=l(function(r,a){c(a,t(r)[e])})}),t}function W(e,t,r){try{var a=i.parse(t)}catch(t){}return{statusCode:e,body:t,jsonBody:a,thrown:r}}function H(e,t){function r(e,t,r){var a=T(r);e(t,w(ee(A(ae,a))),w(A(ne,a)))}function a(t,a,n){var o=e(t).emit;a.on(function(e){var t=n(e);!1!==t&&r(o,ne(t),e)},t),e("removeListener").on(function(r){r!=t||e(r).listeners()||a.un(t)})}var n={node:e(pe),path:e(de)};e("newListener").on(function(e){var r=/(node|path):(.*)/.exec(e);if(r){var o=n[r[1]];o.hasListener(e)||a(e,o,t(r[2]))}})}function q(e,t){function r(t,r){return e(t).on(n(r),r),S}function a(e,t,r){r=r||t;var a=n(t);return e.on(function(){var t=!1;S.forget=function(){t=!0},c(arguments,a),delete S.forget,t&&e.un(r)},r),S}function n(e){return function(){try{return e.apply(S,arguments)}catch(t){setTimeout(function(){throw t})}}}function o(t,r){return e(t+":"+r)}function s(e){return function(){var t=e.apply(this,arguments);m(t)&&(t==G.drop?b():h(t))}}function i(e,t,r){var n;n="node"==e?s(r):r,a(o(e,t),n,r)}function d(e,t){for(var r in t)i(e,r,t[r])}function p(e,t,r){return J(t)?i(e,t,r):d(e,t),S}var u=/^(node|path):./,f=e(fe),b=e(le).emit,h=e(ce).emit,_=l(function(t,r){if(S[t])c(r,S[t]);else{var n=e(t),o=r[0];u.test(t)?a(n,o):n.on(o)}return S}),v=function(t,r,a){if("done"==t)f.un(r);else if("node"==t||"path"==t)e.un(t+":"+r,a);else{e(t).un(r)}return S},S;return e(ye).on(function(e){S.root=g(e)}),e("start").on(function(e,t){S.header=function(e){return e?t[e]:t}}),S={on:_,addListener:_,removeListener:v,emit:e.emit,node:K(p,"node"),path:K(p,"path"),done:K(a,f),start:K(r,"start"),fail:e("fail").on,abort:e(me).emit,header:y,root:y,source:t}}function z(e,t,r,a,n){var o=D();return t&&O(o,F(),e,t,r,a,n),I(o),C(o,L(o)),H(o,se),q(o,t)}function V(e,t,r,a,n,o,s){return n=n?i.parse(i.stringify(n)):{},a?!J(a)&&(a=i.stringify(a),n["Content-Type"]=n["Content-Type"]||"application/json"):a=null,e(r||"GET",function(e,t){return!1===t&&(e+=-1==e.indexOf("?")?"?":"&",e+="_="+new Date().getTime()),e}(t,s),a,n,o||!1)}function G(e){var t=te("resume","pause","pipe"),r=K(_,t);return e?r(e)||J(e)?V(z,e):V(z,e.url,e.method,e.body,e.headers,e.withCredentials,e.cached):z()}var K=l(function(e,t){var r=t.length;return l(function(a){for(var n=0;na)throw new TypeError("Bad iterations");if("number"!=typeof n)throw new TypeError("Key length not a number");if(0>n||1073741823o?t=n(t):t.length=t.length){o++;break}var s=t.slice(2,n-1);if(("0002"!==a.toString("hex")&&!r||"0001"!==a.toString("hex")&&r)&&o++,8>s.length&&o++,o)throw new Error("decryption error");return t.slice(n)}function n(e,t){e=u.from(e),t=u.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var o=-1;++oc||0<=new i(t).cmp(d.modulus))throw new Error("decryption error");var f=n?l(new i(t),d):p(t,d);var y=u.alloc(c-f.length);if(f=u.concat([y,f],c),4===s)return r(d,f);if(1===s)return a(d,f,n);if(3===s)return f;throw new Error("unknown padding")}},{"./mgf":190,"./withPublic":193,"./xor":194,"bn.js":50,"browserify-rsa":73,"create-hash":89,"parse-asn1":181,"safe-buffer":218}],192:[function(e,t){function r(e,t){var r=e.modulus.byteLength(),a=t.length,n=i("sha1").update(f.alloc(0)).digest(),o=n.length,l=2*o;if(a>r-l-2)throw new Error("message too long");var u=f.alloc(r-a-l-2),y=r-o-1,b=s(o),g=p(f.concat([n,u,f.alloc(1,1),t],y),d(b,y)),h=p(b,d(g,o));return new c(f.concat([f.alloc(1),h,g],r))}function a(e,t,r){var a=t.length,o=e.modulus.byteLength();if(a>o-11)throw new Error("message too long");var s;return s=r?f.alloc(o-a-3,255):n(o-a-3),new c(f.concat([f.from([0,r?1:2]),s,f.alloc(1),t],o))}function n(e){for(var t=f.allocUnsafe(e),r=0,a=s(2*e),n=0,o;rp&&(c=p);for(var l=0;le)throw new TypeError("offset must be a uint32");if(e>l||e>t)throw new RangeError("offset out of range")}function s(e,t,r){if("number"!=typeof e||e!==e)throw new TypeError("size must be a number");if(4294967295e)throw new TypeError("size must be a uint32");if(e+t>r||e>l)throw new RangeError("buffer too small")}function i(e,r,a,n){if(t.browser){var o=e.buffer,s=new Uint8Array(o,r,a);return u.getRandomValues(s),n?void t.nextTick(function(){n(null,e)}):e}if(n)return void p(a,function(t,a){return t?n(t):void(a.copy(e,r),n(null,e))});var i=p(a);return i.copy(e,r),e}var d=e("safe-buffer"),p=e("randombytes"),c=d.Buffer,l=d.kMaxLength,u=a.crypto||a.msCrypto;u&&u.getRandomValues||!t.browser?(r.randomFill=function(e,t,r,n){if(!c.isBuffer(e)&&!(e instanceof a.Uint8Array))throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");if("function"==typeof t)n=t,t=0,r=e.length;else if("function"==typeof r)n=r,r=e.length-t;else if("function"!=typeof n)throw new TypeError("\"cb\" argument must be a function");return o(t,e.length),s(r,t,e.length),i(e,t,r,n)},r.randomFillSync=function(e,t,r){if("undefined"==typeof t&&(t=0),!c.isBuffer(e)&&!(e instanceof a.Uint8Array))throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");return o(t,e.length),void 0===r&&(r=e.length-t),s(r,t,e.length),i(e,t,r)}):(r.randomFill=n,r.randomFillSync=n)}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{_process:80,randombytes:199,"safe-buffer":218}],201:[function(e,t){t.exports=window.crypto},{}],202:[function(e,t){t.exports=e("crypto")},{crypto:201}],203:[function(e,t){t.exports=function(t,r){var a=e("./crypto.js"),n="function"==typeof r;if(65536>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function y(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=f(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function b(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,g(e)}}function g(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(H("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R.nextTick(h,e):h(e))}function h(e){H("emit readable"),e.emit("readable"),B(e)}function m(e,t){t.readingMore||(t.readingMore=!0,R.nextTick(_,e,t))}function _(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=k(e,t.buffer,t.decoder),r}function k(e,t,r){var a;return es.length?s.length:e;if(o+=i===s.length?s:s.slice(0,e),e-=i,0===e){i===s.length?(++a,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=s.slice(i));break}++a}return t.length-=a,o}function T(e,t){var r=L.allocUnsafe(e),a=t.head,o=1;for(a.data.copy(r),e-=a.data.length;a=a.next;){var s=a.data,i=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,i),e-=i,0===e){i===s.length?(++o,t.head=a.next?a.next:t.tail=null):(t.head=a,a.data=s.slice(i));break}++o}return t.length-=o,r}function M(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return H("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):g(this),null;if(e=y(e,t),0===e&&t.ended)return 0===t.length&&M(this),null;var a=t.needReadable;H("need readable",a),(0===t.length||t.length-e>>0),r=this.head,n=0;r;)a(r.data,t,n),n+=r.data.length,r=r.next;return t},e}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":218,util:52}],211:[function(e,t){"use strict";function r(e,t){e.emit("error",t)}var a=e("process-nextick-args");t.exports={destroy:function(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(!this._writableState||!this._writableState.errorEmitted)&&a.nextTick(r,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(r,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":188}],212:[function(e,t){t.exports=e("events").EventEmitter},{events:140}],213:[function(e,t){t.exports=e("./readable").PassThrough},{"./readable":214}],214:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js"),r.Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":205,"./lib/_stream_passthrough.js":206,"./lib/_stream_readable.js":207,"./lib/_stream_transform.js":208,"./lib/_stream_writable.js":209}],215:[function(e,t){t.exports=e("./readable").Transform},{"./readable":214}],216:[function(e,t){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":209}],217:[function(e,t){"use strict";function r(){l.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function n(e,t){return e<>>32-t}function a(t,r,a,o,i,e,d,p){return 0|n(0|t+(r^a^o)+e+d,p)+i}function o(t,r,a,o,i,e,d,p){return 0|n(0|t+(r&a|~r&o)+e+d,p)+i}function s(t,r,a,o,i,e,d,p){return 0|n(0|t+((r|~a)^o)+e+d,p)+i}function d(t,r,a,o,i,e,d,p){return 0|n(0|t+(r&o|a&~o)+e+d,p)+i}function p(t,r,a,o,i,e,d,p){return 0|n(0|t+(r^(a|~o))+e+d,p)+i}var i=e("buffer").Buffer,c=e("inherits"),l=e("hash-base"),u=Array(16),f=[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],y=[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],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],m=[1352829926,1548603684,1836072691,2053994217,0];c(r,l),r.prototype._update=function(){for(var e=u,r=0;16>r;++r)e[r]=this._block.readInt32LE(4*r);for(var c=0|this._a,l=0|this._b,_=0|this._c,v=0|this._d,S=0|this._e,w=0|this._a,A=0|this._b,B=0|this._c,x=0|this._d,k=0|this._e,E=0;80>E;E+=1){var T,M;16>E?(T=a(c,l,_,v,S,e[f[E]],h[0],b[E]),M=p(w,A,B,x,k,e[y[E]],m[0],g[E])):32>E?(T=o(c,l,_,v,S,e[f[E]],h[1],b[E]),M=d(w,A,B,x,k,e[y[E]],m[1],g[E])):48>E?(T=s(c,l,_,v,S,e[f[E]],h[2],b[E]),M=s(w,A,B,x,k,e[y[E]],m[2],g[E])):64>E?(T=d(c,l,_,v,S,e[f[E]],h[3],b[E]),M=o(w,A,B,x,k,e[y[E]],m[3],g[E])):(T=p(c,l,_,v,S,e[f[E]],h[4],b[E]),M=a(w,A,B,x,k,e[y[E]],m[4],g[E])),c=S,S=v,v=n(_,10),_=l,l=T,w=k,k=x,x=n(B,10),B=A,A=M}var I=0|this._b+_+x;this._b=0|this._c+v+k,this._c=0|this._d+S+w,this._d=0|this._e+c+A,this._e=0|this._a+l+B,this._a=I},r.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>32-t}function y(e){var t;for(t=0;16>t;t++)m[t]=(255&e[4*t+0])<<0,m[t]|=(255&e[4*t+1])<<8,m[t]|=(255&e[4*t+2])<<16,m[t]|=(255&e[4*t+3])<<24;for(n(m,0,_,0,16),t=8;0t;++t)m[t]=_[t]+m[t];for(t=0;16>t;t++){var r=4*t;e[r+0]=255&m[t]>>0,e[r+1]=255&m[t]>>8,e[r+2]=255&m[t]>>16,e[r+3]=255&m[t]>>24}}function b(e,t,r,a,n){for(var o=0;o 0 and a power of 2");if(s>2147483647/128/d)throw Error("Parameter N is too large");if(d>2147483647/128/r)throw Error("Parameter r is too large");var g=new a(256*d),h=new a(128*d*s),m=new Int32Array(16),_=new Int32Array(16),v=new a(64),S=o(e,t,1,128*r*d,"sha256"),w;if(c){var A=2*(r*s),B=0;w=function(){++B,0==B%1e3&&c({current:B,total:A,percent:100*(B/A)})}}for(var x=0;x=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(4294967295>=r)this._block.writeUInt32BE(r,this._blockSize-4);else{var a=(4294967295&r)>>>0;this._block.writeUInt32BE((r-a)/4294967296,this._blockSize-8),this._block.writeUInt32BE(a,this._blockSize-4)}this._update(this._block);var n=this._hash();return e?n.toString(e):n},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":218}],222:[function(e,t,r){var r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":223,"./sha1":224,"./sha224":225,"./sha256":226,"./sha384":227,"./sha512":228}],223:[function(e,t){function r(){this.init(),this._w=c,s.call(this,64,56)}function n(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function i(e,t,r,a){return 0===e?t&r|~t&a:2===e?t&r|t&a|r&a:t^r^a}var a=e("inherits"),s=e("./hash"),d=e("safe-buffer").Buffer,p=[1518500249,1859775393,-1894007588,-899497514],c=Array(80);a(r,s),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(r){for(var l=this._w,u=0|this._a,f=0|this._b,y=0|this._c,g=0|this._d,h=0|this._e,m=0;16>m;++m)l[m]=r.readInt32BE(4*m);for(;80>m;++m)l[m]=l[m-3]^l[m-8]^l[m-14]^l[m-16];for(var _=0;80>_;++_){var v=~~(_/20),s=0|n(u)+i(v,f,y,g)+h+l[_]+p[v];h=g,g=y,y=o(f),f=u,u=s}this._a=0|u+this._a,this._b=0|f+this._b,this._c=0|y+this._c,this._d=0|g+this._d,this._e=0|h+this._e},r.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],224:[function(e,t){function r(){this.init(),this._w=c,d.call(this,64,56)}function a(e){return e<<1|e>>>31}function n(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function i(e,t,r,a){return 0===e?t&r|~t&a:2===e?t&r|t&a|r&a:t^r^a}var s=e("inherits"),d=e("./hash"),p=e("safe-buffer").Buffer,l=[1518500249,1859775393,-1894007588,-899497514],c=Array(80);s(r,d),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(r){for(var p=this._w,u=0|this._a,f=0|this._b,y=0|this._c,g=0|this._d,h=0|this._e,m=0;16>m;++m)p[m]=r.readInt32BE(4*m);for(;80>m;++m)p[m]=a(p[m-3]^p[m-8]^p[m-14]^p[m-16]);for(var _=0;80>_;++_){var v=~~(_/20),s=0|n(u)+i(v,f,y,g)+h+p[_]+l[v];h=g,g=y,y=o(f),f=u,u=s}this._a=0|u+this._a,this._b=0|f+this._b,this._c=0|y+this._c,this._d=0|g+this._d,this._e=0|h+this._e},r.prototype._hash=function(){var e=p.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],225:[function(e,t){function r(){this.init(),this._w=i,o.call(this,64,56)}var a=e("inherits"),n=e("./sha256"),o=e("./hash"),s=e("safe-buffer").Buffer,i=Array(64);a(r,n),r.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},r.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=r},{"./hash":221,"./sha256":226,inherits:162,"safe-buffer":218}],226:[function(e,t){function r(){this.init(),this._w=f,c.call(this,64,56)}function n(e,t,r){return r^e&(t^r)}function o(e,t,r){return e&t|r&(e|t)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function i(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function a(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function d(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var p=e("inherits"),c=e("./hash"),l=e("safe-buffer").Buffer,u=[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],f=Array(64);p(r,c),r.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},r.prototype._update=function(t){for(var r=this._w,p=0|this._a,l=0|this._b,y=0|this._c,m=0|this._d,_=0|this._e,v=0|this._f,S=0|this._g,w=0|this._h,A=0;16>A;++A)r[A]=t.readInt32BE(4*A);for(;64>A;++A)r[A]=0|d(r[A-2])+r[A-7]+a(r[A-15])+r[A-16];for(var B=0;64>B;++B){var x=0|w+i(_)+n(_,v,S)+u[B]+r[B],k=0|s(p)+o(p,l,y);w=S,S=v,v=_,_=0|m+x,m=y,y=l,l=p,p=0|x+k}this._a=0|p+this._a,this._b=0|l+this._b,this._c=0|y+this._c,this._d=0|m+this._d,this._e=0|_+this._e,this._f=0|v+this._f,this._g=0|S+this._g,this._h=0|w+this._h},r.prototype._hash=function(){var e=l.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],227:[function(e,t){function r(){this.init(),this._w=i,o.call(this,128,112)}var a=e("inherits"),n=e("./sha512"),o=e("./hash"),s=e("safe-buffer").Buffer,i=Array(160);a(r,n),r.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},r.prototype._hash=function(){function e(e,r,a){t.writeInt32BE(e,a),t.writeInt32BE(r,a+4)}var t=s.allocUnsafe(48);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=r},{"./hash":221,"./sha512":228,inherits:162,"safe-buffer":218}],228:[function(e,t){function r(){this.init(),this._w=g,f.call(this,128,112)}function a(e,t,r){return r^e&(t^r)}function n(e,t,r){return e&t|r&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function u(e,t){return e>>>0>>0?1:0}var i=e("inherits"),f=e("./hash"),y=e("safe-buffer").Buffer,b=[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],g=Array(160);i(r,f),r.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},r.prototype._update=function(e){for(var t=this._w,r=0|this._ah,f=0|this._bh,y=0|this._ch,g=0|this._dh,h=0|this._eh,m=0|this._fh,_=0|this._gh,v=0|this._hh,S=0|this._al,w=0|this._bl,A=0|this._cl,B=0|this._dl,x=0|this._el,k=0|this._fl,E=0|this._gl,T=0|this._hl,M=0;32>M;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;160>M;M+=2){var I=t[M-30],C=t[M-30+1],R=d(I,C),N=p(C,I);I=t[M-4],C=t[M-4+1];var P=c(I,C),F=l(C,I),O=t[M-14],L=t[M-14+1],U=t[M-32],D=t[M-32+1],W=0|N+L,H=0|R+O+u(W,N);W=0|W+F,H=0|H+P+u(W,F),W=0|W+D,H=0|H+U+u(W,D),t[M]=H,t[M+1]=W}for(var q=0;160>q;q+=2){H=t[q],W=t[q+1];var z=n(r,f,y),V=n(S,w,A),G=o(r,S),K=o(S,r),X=s(h,x),Y=s(x,h),Z=b[q],J=b[q+1],Q=a(h,m,_),$=a(x,k,E),ee=0|T+Y,te=0|v+X+u(ee,T);ee=0|ee+$,te=0|te+Q+u(ee,$),ee=0|ee+J,te=0|te+Z+u(ee,J),ee=0|ee+W,te=0|te+H+u(ee,W);var re=0|K+V,ae=0|G+z+u(re,K);v=_,T=E,_=m,E=k,m=h,k=x,x=0|B+ee,h=0|g+te+u(x,B),g=y,B=A,y=f,A=w,f=r,w=S,S=0|ee+re,r=0|te+ae+u(S,ee)}this._al=0|this._al+S,this._bl=0|this._bl+w,this._cl=0|this._cl+A,this._dl=0|this._dl+B,this._el=0|this._el+x,this._fl=0|this._fl+k,this._gl=0|this._gl+E,this._hl=0|this._hl+T,this._ah=0|this._ah+r+u(this._al,S),this._bh=0|this._bh+f+u(this._bl,w),this._ch=0|this._ch+y+u(this._cl,A),this._dh=0|this._dh+g+u(this._dl,B),this._eh=0|this._eh+h+u(this._el,x),this._fh=0|this._fh+m+u(this._fl,k),this._gh=0|this._gh+_+u(this._gl,E),this._hh=0|this._hh+v+u(this._hl,T)},r.prototype._hash=function(){function e(e,r,a){t.writeInt32BE(e,a),t.writeInt32BE(r,a+4)}var t=y.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=r},{"./hash":221,inherits:162,"safe-buffer":218}],229:[function(e,t){function r(){a.call(this)}t.exports=r;var a=e("events").EventEmitter,n=e("inherits");n(r,a),r.Readable=e("readable-stream/readable.js"),r.Writable=e("readable-stream/writable.js"),r.Duplex=e("readable-stream/duplex.js"),r.Transform=e("readable-stream/transform.js"),r.PassThrough=e("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&p.pause&&p.pause()}function n(){p.readable&&p.resume&&p.resume()}function o(){c||(c=!0,e.end())}function s(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function i(e){if(d(),0===a.listenerCount(this,"error"))throw e}function d(){p.removeListener("data",r),e.removeListener("drain",n),p.removeListener("end",o),p.removeListener("close",s),p.removeListener("error",i),e.removeListener("error",i),p.removeListener("end",d),p.removeListener("close",d),e.removeListener("close",d)}var p=this;p.on("data",r),e.on("drain",n),e._isStdio||t&&!1===t.end||(p.on("end",o),p.on("close",s));var c=!1;return p.on("error",i),e.on("error",i),p.on("end",d),p.on("close",d),e.on("close",d),e.emit("pipe",p),e}},{events:140,inherits:162,"readable-stream/duplex.js":204,"readable-stream/passthrough.js":213,"readable-stream/readable.js":214,"readable-stream/transform.js":215,"readable-stream/writable.js":216}],230:[function(e,t,r){(function(t){var a=e("./lib/request"),n=e("./lib/response"),o=e("xtend"),s=e("builtin-status-codes"),i=e("url"),d=r;d.request=function(e,r){e="string"==typeof e?i.parse(e):o(e);var n=-1===t.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||n,d=e.hostname||e.host,p=e.port,c=e.path||"/";d&&-1!==d.indexOf(":")&&(d="["+d+"]"),e.url=(d?s+"//"+d:"")+(p?":"+p:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new a(e);return r&&l.on("response",r),l},d.get=function(e,t){var r=d.request(e,t);return r.end(),r},d.ClientRequest=a,d.IncomingMessage=n.IncomingMessage,d.Agent=function(){},d.Agent.defaultMaxSockets=4,d.globalAgent=new d.Agent,d.STATUS_CODES=s,d.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./lib/request":232,"./lib/response":233,"builtin-status-codes":84,url:247,xtend:315}],231:[function(e,t,r){(function(e){function t(){if(i!==void 0)return i;if(e.XMLHttpRequest){i=new e.XMLHttpRequest;try{i.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(t){i=null}}else i=null;return i}function a(e){var r=t();if(!r)return!1;try{return r.responseType=e,r.responseType===e}catch(t){}return!1}function n(e){return"function"==typeof e}r.fetch=n(e.fetch)&&n(e.ReadableStream),r.writableStream=n(e.WritableStream),r.abortController=n(e.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(t){}var o="undefined"!=typeof e.ArrayBuffer,s=o&&n(e.ArrayBuffer.prototype.slice),i;r.arraybuffer=r.fetch||o&&a("arraybuffer"),r.msstream=!r.fetch&&s&&a("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&o&&a("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!t()&&n(t().overrideMimeType),r.vbArray=n(e.VBArray),i=null}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],232:[function(e,t){(function(r,a,n){function o(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":i.vbArray&&e?"text:vbarray":"text"}function s(e){try{var t=e.status;return null!==t&&0!==t}catch(t){return!1}}var i=e("./capability"),d=e("inherits"),p=e("./response"),c=e("readable-stream"),l=e("to-arraybuffer"),u=p.IncomingMessage,f=p.readyStates,y=t.exports=function(e){var t=this;c.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new n(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(r){t.setHeader(r,e.headers[r])});var r=!0,a;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)r=!1,a=!0;else if("prefer-streaming"===e.mode)a=!1;else if("allow-wrong-content-type"===e.mode)a=!i.overrideMimeType;else if(!e.mode||"default"===e.mode||"prefer-fast"===e.mode)a=!0;else throw new Error("Invalid value for opts.mode");t._mode=o(a,r),t._fetchTimer=null,t.on("finish",function(){t._onFinish()})};d(y,c.Writable),y.prototype.setHeader=function(e,t){var r=this,a=e.toLowerCase();-1!==b.indexOf(a)||(r._headers[a]={name:e,value:t})},y.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},y.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},y.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,o=e._headers,s=null;"GET"!==t.method&&"HEAD"!==t.method&&(i.arraybuffer?s=l(n.concat(e._body)):i.blobConstructor?s=new a.Blob(e._body.map(function(e){return l(e)}),{type:(o["content-type"]||{}).value||""}):s=n.concat(e._body).toString());var d=[];if(Object.keys(o).forEach(function(e){var t=o[e].name,r=o[e].value;Array.isArray(r)?r.forEach(function(e){d.push([t,e])}):d.push([t,r])}),"fetch"===e._mode){var p=null;if(i.abortController){var c=new AbortController;p=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=a.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}a.fetch(e._opts.url,{method:e._opts.method,headers:d,body:s||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:p}).then(function(t){e._fetchResponse=t,e._connect()},function(t){a.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var u=e._xhr=new a.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}"responseType"in u&&(u.responseType=e._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(u.timeout=t.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),d.forEach(function(e){u.setRequestHeader(e[0],e[1])}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case f.LOADING:case f.DONE:e._onXHRProgress();}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{u.send(s)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}}}},y.prototype._onXHRProgress=function(){var e=this;!s(e._xhr)||e._destroyed||(!e._response&&e._connect(),e._response._onXHRProgress())},y.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},y.prototype._write=function(e,t,r){var a=this;a._body.push(e),r()},y.prototype.abort=y.prototype.destroy=function(){var e=this;e._destroyed=!0,a.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},y.prototype.end=function(e,t,r){var a=this;"function"==typeof e&&(r=e,e=void 0),c.Writable.prototype.end.call(a,e,t,r)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var b=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("buffer").Buffer)},{"./capability":231,"./response":233,_process:80,buffer:83,inherits:162,"readable-stream":214,"to-arraybuffer":243}],233:[function(e,t,r){(function(t,a,n){var o=e("./capability"),s=e("inherits"),i=e("readable-stream"),d=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},p=r.IncomingMessage=function(e,r,s,d){var p=this;if(i.Readable.call(p),p._mode=s,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",function(){t.nextTick(function(){p.emit("close")})}),"fetch"===s){function e(){l.read().then(function(t){return p._destroyed?void 0:t.done?(a.clearTimeout(d),void p.push(null)):void(p.push(new n(t.value)),e())}).catch(function(e){a.clearTimeout(d),p._destroyed||p.emit("error",e)})}if(p._fetchResponse=r,p.url=r.url,p.statusCode=r.status,p.statusMessage=r.statusText,r.headers.forEach(function(e,t){p.headers[t.toLowerCase()]=e,p.rawHeaders.push(t,e)}),o.writableStream){var c=new WritableStream({write:function(e){return new Promise(function(t,r){p._destroyed?r():p.push(new n(e))?t():p._resumeFetch=t})},close:function(){a.clearTimeout(d),p._destroyed||p.push(null)},abort:function(e){p._destroyed||p.emit("error",e)}});try{return void r.body.pipeTo(c).catch(function(e){a.clearTimeout(d),p._destroyed||p.emit("error",e)})}catch(t){}}var l=r.body.getReader();e()}else{p._xhr=e,p._pos=0,p.url=e.responseURL,p.statusCode=e.status,p.statusMessage=e.statusText;var u=e.getAllResponseHeaders().split(/\r?\n/);if(u.forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===p.headers[r]&&(p.headers[r]=[]),p.headers[r].push(t[2])):void 0===p.headers[r]?p.headers[r]=t[2]:p.headers[r]+=", "+t[2],p.rawHeaders.push(t[1],t[2])}}),p._charset="x-user-defined",!o.overrideMimeType){var f=p.rawHeaders["mime-type"];if(f){var y=f.match(/;\s*charset=([^;])(;|$)/);y&&(p._charset=y[1].toLowerCase())}p._charset||(p._charset="utf-8")}}};s(p,i.Readable),p.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())},p.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==d.DONE)break;try{r=new a.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new n(r));break}case"text":try{r=e.responseText}catch(r){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var s=new n(o.length),p=0;pt._pos&&(t.push(new n(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(r);}t._xhr.readyState===d.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,e("_process"),"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,e("buffer").Buffer)},{"./capability":231,_process:80,buffer:83,inherits:162,"readable-stream":214}],234:[function(e,t){"use strict";t.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},{}],235:[function(e,t,r){"use strict";function a(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0;}}function n(e){var t=a(e);if("string"!=typeof t&&(g.isEncoding===h||!h(e)))throw new Error("Unknown encoding: "+e);return t||e}function o(e){this.encoding=n(e);var t;switch(this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=p,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=y,void(this.end=b);}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function s(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function d(e,t,r){var a=t.length-1;if(a=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],a.slice(0,-1)}return a}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function y(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}var g=e("safe-buffer").Buffer,h=g.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1;}};r.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,a;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";a=this.lastNeed,this.lastNeed=0}else a=0;return a=r)return n(r,t);for(var o=4096;o*128arguments.length)&&i.call(arguments,1);return d[t]=!0,o(function(){d[t]&&(a?e.apply(null,a):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof a?a:function(e){delete d[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":242,timers:241}],242:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],243:[function(e,t){var r=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(r.isBuffer(e)){for(var t=new Uint8Array(e.length),a=e.length,n=0;narguments.length&&(n=r[s?s[d]:d],d+=e),t(r,a,n,s,d,i)}}function n(e){return function(t,r,a){r=B(r,a);for(var n=T(t),o=0a||null==r)return r;for(var n=1;na&&(a=o)}else t=B(t,r),A.each(e,function(e,r,o){s=t(e,r,o),(s>n||s===-Infinity&&a===-Infinity)&&(a=e,n=s)});return a},A.min=function(e,t,r){var a=1/0,n=1/0,o,s;if(null==t&&null!=e){e=M(e)?e:A.values(e);for(var d=0,p=e.length;da||void 0===r)return 1;if(r=t)throw new Error("bindAll must be passed function names");for(r=1;r=c||c>t?(a&&(clearTimeout(a),a=null),n=p,i=e.apply(o,s),!a&&(o=s=null)):!a&&!1!==r.trailing&&(a=setTimeout(d,c)),i}},A.debounce=function(e,t,r){var a=function(){var p=A.now()-i;p--e)return t.apply(this,arguments)}},A.before=function(e,t){var r;return function(){return 0<--e&&(r=t.apply(this,arguments)),1>=e&&(t=null),r}},A.once=A.partial(A.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),P=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];A.keys=function(e){if(!A.isObject(e))return[];if(m)return m(e);var t=[];for(var r in e)A.has(e,r)&&t.push(r);return N&&i(e,t),t},A.allKeys=function(e){if(!A.isObject(e))return[];var t=[];for(var r in e)t.push(r);return N&&i(e,t),t},A.values=function(e){for(var t=A.keys(e),r=t.length,a=Array(r),n=0;n":">",'"':""","'":"'","`":"`"},j=A.invert(O),L=function(e){var t=function(t){return e[t]},r="(?:"+A.keys(e).join("|")+")",a=RegExp(r),n=RegExp(r,"g");return function(e){return e=null==e?"":""+e,a.test(e)?e.replace(n,t):e}};A.escape=L(O),A.unescape=L(j),A.result=function(e,t,r){var a=null==e?void 0:e[t];return void 0===a&&(a=r),A.isFunction(a)?a.call(e):a};var U=0;A.uniqueId=function(e){var t=++U+"";return e?e+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,W={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,q=function(e){return"\\"+W[e]};A.template=function(e,t,r){!t&&r&&(t=r),t=A.defaults({},t,A.templateSettings);var a=RegExp([(t.escape||D).source,(t.interpolate||D).source,(t.evaluate||D).source].join("|")+"|$","g"),n=0,o="__p+='";e.replace(a,function(t,r,a,s,i){return o+=e.slice(n,i).replace(H,q),n=i+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":a?o+="'+\n((__t=("+a+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(t.variable||"obj","_",o)}catch(t){throw t.source=o,t}var i=function(e){return s.call(this,e,A)},d=t.variable||"obj";return i.source="function("+d+"){\n"+o+"}",i},A.chain=function(e){var t=A(e);return t._chain=!0,t};var z=function(e,t){return e._chain?A(t).chain():t};A.mixin=function(e){A.each(A.functions(e),function(t){var r=A[t]=e[t];A.prototype[t]=function(){var e=[this._wrapped];return f.apply(e,arguments),z(this,r.apply(A,e))}})},A.mixin(A),A.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=c[e];A.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),("shift"===e||"splice"===e)&&0===r.length&&delete r[0],z(this,r)}}),A.each(["concat","join","slice"],function(e){var t=c[e];A.prototype[e]=function(){return z(this,t.apply(this._wrapped,arguments))}}),A.prototype.value=function(){return this._wrapped},A.prototype.valueOf=A.prototype.toJSON=A.prototype.value,A.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return A})}).call(this)},{}],246:[function(e,t){t.exports=function(e,t){if(t){t=t.trim().replace(/^(\?|#|&)/,""),t=t?"?"+t:t;var r=e.split(/[\?\#]/),a=r[0];t&&/\:\/\/[^\/]*$/.test(a)&&(a+="/");var n=e.match(/(\#.*)$/);e=a+t,n&&(e+=n[0])}return e}},{}],247:[function(e,t,r){"use strict";function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function n(e,t,r){if(e&&d.isObject(e)&&e instanceof a)return e;var n=new a;return n.parse(e,t,r),n}var o=e("punycode"),d=e("./util");r.parse=n,r.resolve=function(e,t){return n(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?n(e,!1,!0).resolveObject(t):t},r.format=function(e){return d.isString(e)&&(e=n(e)),e instanceof a?e.format():a.prototype.format.call(e)},r.Url=a;var c=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["{","}","|","\\","^","`"].concat(["<",">","\"","`"," ","\r","\n","\t"]),u=["'"].concat(p),l=["%","/","?",";","#"].concat(u),f=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("querystring");a.prototype.parse=function(e,t,r){if(!d.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),n=-1!==a&&ah.length&&h.unshift(""),r.pathname=h.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var S=r.pathname||"",p=r.search||"";r.path=S+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var s=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),A=w||s||r.host&&e.pathname,B=A,x=r.pathname&&r.pathname.split("/")||[],h=e.pathname&&e.pathname.split("/")||[],E=r.protocol&&!_[r.protocol];if(E&&(r.hostname="",r.port=null,r.host&&(""===x[0]?x[0]=r.host:x.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),A=A&&(""===h[0]||""===x[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,x=h;else if(h.length)x||(x=[]),x.pop(),x=x.concat(h),r.search=e.search,r.query=e.query;else if(!d.isNullOrUndefined(e.search)){if(E){r.hostname=r.host=x.shift();var T=!!(r.host&&0=n&&r>>10),n=56320|1023&n),a+=b(n);return a}function s(e){if(55296<=e&&57343>=e)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function i(e,t){return b(128|63&e>>t)}function d(e){if(0==(4294967168&e))return b(e);var t="";return 0==(4294965248&e)?t=b(192|31&e>>6):0==(4294901760&e)?(s(e),t=b(224|15&e>>12),t+=i(e,6)):0==(4292870144&e)&&(t=b(240|7&e>>18),t+=i(e,12),t+=i(e,6)),t+=b(128|63&e),t}function p(){if(_>=m)throw Error("Invalid byte index");var e=255&h[_];if(_++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,t,r,a,n;if(_>m)throw Error("Invalid byte index");if(_==m)return!1;if(e=255&h[_],_++,0==(128&e))return e;if(192==(224&e)){var t=p();if(n=(31&e)<<6|t,128<=n)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if(t=p(),r=p(),n=(15&e)<<12|t<<6|r,2048<=n)return s(n),n;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=p(),r=p(),a=p(),n=(15&e)<<18|t<<12|r<<6|a,65536<=n&&1114111>=n))return n;throw Error("Invalid UTF-8 detected")}function l(e){h=n(e),m=h.length,_=0;for(var t=[],r;!1!==(r=c());)t.push(r);return o(t)}var u="object"==typeof r&&r,f="object"==typeof t&&t&&t.exports==u&&t,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(a=y);var b=String.fromCharCode,g={version:"2.0.0",encode:function(e){for(var t=n(e),r=t.length,a=-1,o="",s;++a=p&&(c.unsubscribe(),u=!0,o._fireError(new Error("Transaction was not mined within"+p+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):y-1>=d&&(c.unsubscribe(),u=!0,o._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))}))},A=function(e){r.isFunction(this.requestManager.provider.on)?S.subscribe("newBlockHeaders",w.bind(null,e,!1)):g=setInterval(w.bind(null,e,!0),1e3)}.bind(this);S.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(0a;a++)r+=7o.v?o.v:1-o.v%2),i="0x"+s.encode("hex",!1).slice(2),p=c(i),l=u("0x"+p.slice(-40));return l},encodeSignature:y,decodeSignature:b}}).call(this,e("buffer").Buffer)},{"./bytes":269,"./hash":270,"./nat":271,"./rlp":272,buffer:83,elliptic:105}],268:[function(e,t,r){arguments[4][123][0].apply(r,arguments)},{dup:123}],269:[function(e,t,r){arguments[4][124][0].apply(r,arguments)},{"./array.js":268,dup:124}],270:[function(e,t,r){arguments[4][125][0].apply(r,arguments)},{dup:125}],271:[function(e,t){var r=e("bn.js"),n=e("./bytes"),o=function(e){return"0x"+e.toString("hex")},s=function(e){return new r(e.slice(2),16)},a=function(e){var t="0x"+("0x"===e.slice(0,2)?new r(e.slice(2),16):new r(e,10)).toString("hex");return"0x0"==t?"0x":t},i=function(e){return"string"==typeof e?/^0x/.test(e)?e:"0x"+e:"0x"+new r(e).toString("hex")},d=function(e){return s(e).toNumber()},p=function(e){return function(t,r){return o(s(t)[e](s(r)))}},c=p("add"),l=p("mul"),u=p("div"),f=p("sub");t.exports={toString:function(e){return s(e).toString(10)},fromString:a,toNumber:d,fromNumber:i,toEther:function(e){return d(u(e,a("10000000000")))/1e8},fromEther:function(e){return l(i(Math.floor(1e8*e)),a("10000000000"))},toUint256:function(e){return n.pad(32,e)},add:c,mul:l,div:u,sub:f}},{"./bytes":269,"bn.js":50}],272:[function(e,t){t.exports={encode:function(e){var t=function(e){return 0==e.length%2?e:"0"+e},r=function(e){return t(e.toString(16))},a=function(e,t){return 56>e?r(t+e):r(t+r(e).length/2+55)+r(e)};return"0x"+function e(t){if("string"==typeof t){var r=t.slice(2),n=2!=r.length||"80"<=r?a(r.length/2,128):"";return n+r}var o=t.map(e).join(""),s=a(o.length/2,192);return s+o}(e)},decode:function(e){var t=2,r=function(){if(t>=e.length)throw"";var r=e.slice(t,t+2);return"80">r?(t+=2,"0x"+r):"c0">r?n():o()},a=function(){var r=parseInt(e.slice(t,t+=2),16)%64;return 56>r?r:parseInt(e.slice(t,t+=2*(r-55)),16)},n=function(){var r=a();return"0x"+e.slice(t,t+=2*r)},o=function(){for(var e=2*a()+t,n=[];te;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=255&t>>>((3&e)<<3);return n}}t.exports=r}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],274:[function(e,t){function r(e,t,r){var a=t&&r||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[a+n++]=p[e])});16>n;)t[a+n++]=0;return t}function a(e,t){var r=t||0,a=d;return a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+"-"+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]+a[e[r++]]}function n(e,t,r){var o=t&&r||0,s=t||[];e=e||{};var d=void 0===e.clockseq?f:e.clockseq,p=void 0===e.msecs?new Date().getTime():e.msecs,c=void 0===e.nsecs?g+1:e.nsecs,l=p-y+(c-g)/1e4;if(0>l&&void 0===e.clockseq&&(d=16383&d+1),(0>l||p>y)&&void 0===e.nsecs&&(c=0),1e4<=c)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");y=p,g=c,f=d,p+=122192928e5;var b=(1e4*(268435455&p)+c)%4294967296;s[o++]=255&b>>>24,s[o++]=255&b>>>16,s[o++]=255&b>>>8,s[o++]=255&b;var h=268435455&1e4*(p/4294967296);s[o++]=255&h>>>8,s[o++]=255&h,s[o++]=16|15&h>>>24,s[o++]=255&h>>>16,s[o++]=128|d>>>8,s[o++]=255&d;for(var m=e.node||u,_=0;6>_;_++)s[o+_]=m[_];return t?t:a(s)}function o(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"==e?Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||s)();if(o[6]=64|15&o[6],o[8]=128|63&o[8],t)for(var i=0;16>i;i++)t[n+i]=o[i];return t||a(o)}for(var s=e("./rng"),d=[],p={},c=0;256>c;c++)d[c]=(c+256).toString(16).substr(1),p[d[c]]=c;var l=s(),u=[1|l[0],l[1],l[2],l[3],l[4],l[5]],f=16383&(l[6]<<8|l[7]),y=0,g=0,b=o;b.v1=n,b.v4=o,b.parse=r,b.unparse=a,t.exports=b},{"./rng":273}],275:[function(e,t){(function(r,a){"use strict";function n(e){this._accounts=e,this.length=0,this.defaultKeyName="web3js_wallet"}var o=e("underscore"),s=e("web3-core"),i=e("web3-core-method"),d=e("any-promise"),p=e("eth-lib/lib/account"),c=e("eth-lib/lib/hash"),l=e("eth-lib/lib/rlp"),u=e("eth-lib/lib/nat"),f=e("eth-lib/lib/bytes"),y="undefined"==typeof r?e("crypto-browserify"):e("crypto"),b=e("scrypt.js"),g=e("uuid"),h=e("web3-utils"),m=e("web3-core-helpers"),_=function(e){return o.isUndefined(e)||o.isNull(e)},v=function(e){for(;e&&e.startsWith("0x0");)e="0x"+e.slice(3);return e},S=function(e){return 1==e.length%2&&(e=e.replace("0x","0x0")),e},w=function(){var e=this;s.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var t=[new i({name:"getId",call:"net_version",params:0,outputFormatter:h.hexToNumber}),new i({name:"getGasPrice",call:"eth_gasPrice",params:0}),new i({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(e){if(h.isAddress(e))return e;throw new Error("Address "+e+" is not a valid address to get the \"transactionCount\".")},function(){return"latest"}]})];this._ethereumCall={},o.each(t,function(t){t.attachToObject(e._ethereumCall),t.setRequestManager(e._requestManager)}),this.wallet=new n(this)};w.prototype._addAccountFunctions=function(e){var t=this;return e.signTransaction=function(r,a){return t.signTransaction(r,e.privateKey,a)},e.sign=function(r){return t.sign(r,e.privateKey)},e.encrypt=function(r,a){return t.encrypt(e.privateKey,r,a)},e},w.prototype.create=function(e){return this._addAccountFunctions(p.create(e||h.randomHex(32)))},w.prototype.privateKeyToAccount=function(e){return this._addAccountFunctions(p.fromPrivate(e))},w.prototype.signTransaction=function(e,t,r){function a(e){if(e.gas||e.gasLimit||(s=new Error("\"gas\" is missing")),(0>e.nonce||0>e.gas||0>e.gasPrice||0>e.chainId)&&(s=new Error("Gas, gasPrice, nonce or chainId is lower than 0")),s)return r(s),d.reject(s);try{e=m.formatters.inputCallFormatter(e);var a=e;a.to=e.to||"0x",a.data=e.data||"0x",a.value=e.value||"0x",a.chainId=h.numberToHex(e.chainId);var n=l.encode([f.fromNat(a.nonce),f.fromNat(a.gasPrice),f.fromNat(a.gas),a.to.toLowerCase(),f.fromNat(a.value),a.data,f.fromNat(a.chainId||"0x1"),"0x","0x"]),o=c.keccak256(n),y=p.makeSigner(2*u.toNumber(a.chainId||"0x1")+35)(c.keccak256(n),t),b=l.decode(n).slice(0,6).concat(p.decodeSignature(y));b[6]=S(v(b[6])),b[7]=S(v(b[7])),b[8]=S(v(b[8]));var g=l.encode(b),_=l.decode(g);i={messageHash:o,v:v(_[6]),r:v(_[7]),s:v(_[8]),rawTransaction:g}}catch(t){return r(t),d.reject(t)}return r(null,i),i}var n=this,s=!1,i;return r=r||function(){},e?void 0!==e.nonce&&void 0!==e.chainId&&void 0!==e.gasPrice?d.resolve(a(e)):d.all([_(e.chainId)?n._ethereumCall.getId():e.chainId,_(e.gasPrice)?n._ethereumCall.getGasPrice():e.gasPrice,_(e.nonce)?n._ethereumCall.getTransactionCount(n.privateKeyToAccount(t).address):e.nonce]).then(function(t){if(_(t[0])||_(t[1])||_(t[2]))throw new Error("One of the values \"chainId\", \"gasPrice\", or \"nonce\" couldn't be fetched: "+JSON.stringify(t));return a(o.extend(e,{chainId:t[0],gasPrice:t[1],nonce:t[2]}))}):(s=new Error("No transaction object given!"),r(s),d.reject(s))},w.prototype.recoverTransaction=function(e){var t=l.decode(e),r=p.encodeSignature(t.slice(6,9)),a=f.toNumber(t[6]),n=35>a?[]:[f.fromNumber(a-35>>1),"0x","0x"],o=t.slice(0,6).concat(n),s=l.encode(o);return p.recover(c.keccak256(s),r)},w.prototype.hashMessage=function(e){var t=h.isHexStrict(e)?h.hexToBytes(e):e,r=a.from(t),n="\x19Ethereum Signed Message:\n"+t.length,o=a.from(n),s=a.concat([o,r]);return c.keccak256s(s)},w.prototype.sign=function(e,t){var r=this.hashMessage(e),a=p.sign(r,t),n=p.decodeSignature(a);return{message:e,messageHash:r,v:n[0],r:n[1],s:n[2],signature:a}},w.prototype.recover=function(e,t,r){var a=[].slice.apply(arguments);return o.isObject(e)?this.recover(e.messageHash,p.encodeSignature([e.v,e.r,e.s]),!0):(r||(e=this.hashMessage(e)),4<=a.length?(r=a.slice(-1)[0],r=!!o.isBoolean(r)&&!!r,this.recover(e,p.encodeSignature(a.slice(1,4)),r)):p.recover(e,t))},w.prototype.decrypt=function(e,t,r){if(!o.isString(t))throw new Error("No password given.");var n=o.isObject(e)?e:JSON.parse(r?e.toLowerCase():e);if(3!==n.version)throw new Error("Not a valid V3 wallet");var s,i;if("scrypt"===n.crypto.kdf)i=n.crypto.kdfparams,s=b(new a(t),new a(i.salt,"hex"),i.n,i.r,i.p,i.dklen);else if("pbkdf2"===n.crypto.kdf){if(i=n.crypto.kdfparams,"hmac-sha256"!==i.prf)throw new Error("Unsupported parameters to PBKDF2");s=y.pbkdf2Sync(new a(t),new a(i.salt,"hex"),i.c,i.dklen,"sha256")}else throw new Error("Unsupported key derivation scheme");var d=new a(n.crypto.ciphertext,"hex"),p=h.sha3(a.concat([s.slice(16,32),d])).replace("0x","");if(p!==n.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var c=y.createDecipheriv(n.crypto.cipher,s.slice(0,16),new a(n.crypto.cipherparams.iv,"hex")),l="0x"+a.concat([c.update(d),c.final()]).toString("hex");return this.privateKeyToAccount(l)},w.prototype.encrypt=function(e,t,r){var n=this.privateKeyToAccount(e);r=r||{};var o=r.salt||y.randomBytes(32),s=r.iv||y.randomBytes(16),i=r.kdf||"scrypt",d={dklen:r.dklen||32,salt:o.toString("hex")},p;if("pbkdf2"===i)d.c=r.c||262144,d.prf="hmac-sha256",p=y.pbkdf2Sync(new a(t),o,d.c,d.dklen,"sha256");else if("scrypt"===i)d.n=r.n||8192,d.r=r.r||8,d.p=r.p||1,p=b(new a(t),o,d.n,d.r,d.p,d.dklen);else throw new Error("Unsupported kdf");var c=y.createCipheriv(r.cipher||"aes-128-ctr",p.slice(0,16),s);if(!c)throw new Error("Unsupported cipher");var l=a.concat([c.update(new a(n.privateKey.replace("0x",""),"hex")),c.final()]),u=h.sha3(a.concat([p.slice(16,32),new a(l,"hex")])).replace("0x","");return{version:3,id:g.v4({random:r.uuid||y.randomBytes(16)}),address:n.address.toLowerCase().replace("0x",""),crypto:{ciphertext:l.toString("hex"),cipherparams:{iv:s.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:i,kdfparams:d,mac:u.toString("hex")}}},n.prototype._findSafeIndex=function(e){return e=e||0,o.has(this,e)?this._findSafeIndex(e+1):e},n.prototype._currentIndexes=function(){var e=Object.keys(this),t=e.map(function(e){return parseInt(e)}).filter(function(e){return 9e20>e});return t},n.prototype.create=function(e,t){for(var r=0;re.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),r.isFunction(t.callback)&&t.callback(null,t._isSyncing,t))},500)):(this._isSyncing=!0,this.emit("changed",t._isSyncing),r.isFunction(this.callback)&&this.callback(null,t._isSyncing,this),setTimeout(function(){t.emit("data",e),r.isFunction(t.callback)&&t.callback(null,e,t)},0))}}}})];x.forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager,e.accounts),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount})};a.addProviders(w),t.exports=w},{"./getNetworkType.js":287,underscore:245,"web3-core":265,"web3-core-helpers":255,"web3-core-method":256,"web3-core-subscriptions":262,"web3-eth-abi":266,"web3-eth-accounts":275,"web3-eth-contract":276,"web3-eth-ens":280,"web3-eth-iban":285,"web3-eth-personal":286,"web3-net":289,"web3-utils":295}],289:[function(e,t){"use strict";var r=e("web3-core"),a=e("web3-core-method"),n=e("web3-utils"),o=function(){var e=this;r.packageInit(this,arguments),[new a({name:"getId",call:"net_version",params:0,outputFormatter:n.hexToNumber}),new a({name:"isListening",call:"net_listening",params:0}),new a({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:n.hexToNumber})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};r.addProviders(o),t.exports=o},{"web3-core":265,"web3-core-method":256,"web3-utils":295}],290:[function(e,t){var r=e("web3-core-helpers").errors,a=e("xhr2-cookies").XMLHttpRequest,n=e("http"),o=e("https"),s=function(e,t){t=t||{};var r=!(!0!==t.keepAlive&&!1===t.keepAlive);this.host=e||"http://localhost:8545","https"===this.host.substring(0,5)?this.httpsAgent=new o.Agent({keepAlive:r}):this.httpAgent=new n.Agent({keepAlive:r}),this.timeout=t.timeout||0,this.headers=t.headers,this.connected=!1};s.prototype._prepareRequest=function(){var e=new a;return e.nodejsSet({httpsAgent:this.httpsAgent,httpAgent:this.httpAgent}),e.open("POST",this.host,!0),e.setRequestHeader("Content-Type","application/json"),e.timeout=this.timeout&&1!==this.timeout?this.timeout:0,e.withCredentials=!0,this.headers&&this.headers.forEach(function(t){e.setRequestHeader(t.name,t.value)}),e},s.prototype.send=function(e,t){var a=this,n=this._prepareRequest();n.onreadystatechange=function(){if(4===n.readyState&&1!==n.timeout){var e=n.responseText,o=null;try{e=JSON.parse(e)}catch(t){o=r.InvalidResponse(n.responseText)}a.connected=!0,t(o,e)}},n.ontimeout=function(){a.connected=!1,t(r.ConnectionTimeout(this.timeout))};try{n.send(JSON.stringify(e))}catch(e){this.connected=!1,t(r.InvalidConnection(this.host))}},s.prototype.disconnect=function(){},t.exports=s},{http:230,https:158,"web3-core-helpers":255,"xhr2-cookies":310}],291:[function(e,t){"use strict";var r=e("underscore"),a=e("web3-core-helpers").errors,n=e("oboe"),o=function(e,t){var a=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=e,this.connected=!1,this.connection=t.connect({path:this.path}),this.addDefaultEvents();var o=function(e){var t=null;r.isArray(e)?e.forEach(function(e){a.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,t||-1===e.method.indexOf("_subscription")?a.responseCallbacks[t]&&(a.responseCallbacks[t](null,e),delete a.responseCallbacks[t]):a.notificationCallbacks.forEach(function(t){r.isFunction(t)&&t(e)})};"Socket"===t.constructor.name?n(this.connection).done(o):this.connection.on("data",function(e){a._parseResponse(e.toString()).forEach(o)})};o.prototype.addDefaultEvents=function(){var e=this;this.connection.on("connect",function(){e.connected=!0}),this.connection.on("close",function(){e.connected=!1}),this.connection.on("error",function(){e._timeout()}),this.connection.on("end",function(){e._timeout()}),this.connection.on("timeout",function(){e._timeout()})},o.prototype._parseResponse=function(e){var t=this,r=[],n=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return n.forEach(function(n){t.lastChunk&&(n=t.lastChunk+n);var e=null;try{e=JSON.parse(n)}catch(r){return t.lastChunk=n,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){throw t._timeout(),a.InvalidResponse(n)},15000))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,e&&r.push(e)}),r},o.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,a=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=a},o.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](a.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},o.prototype.reconnect=function(){this.connection.connect({path:this.path})},o.prototype.send=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},o.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.notificationCallbacks.push(t);break;default:this.connection.on(e,t);}},o.prototype.once=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");this.connection.once(e,t)},o.prototype.removeListener=function(e,t){var r=this;switch(e){case"data":this.notificationCallbacks.forEach(function(e,a){e===t&&r.notificationCallbacks.splice(a,1)});break;default:this.connection.removeListener(e,t);}},o.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(e);}},o.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},t.exports=o},{oboe:175,underscore:245,"web3-core-helpers":255}],292:[function(e,t){(function(r){"use strict";var a=e("underscore"),n=e("web3-core-helpers").errors,o=null,s=null,i=null;if("undefined"!=typeof window&&"undefined"!=typeof window.WebSocket)o=function(e,t){return new window.WebSocket(e,t)},s=btoa,i=function(e){return new URL(e)};else{o=e("websocket").w3cwebsocket,s=function(e){return r(e).toString("base64")};var d=e("url");if(d.URL){var p=d.URL;i=function(e){return new p(e)}}else i=e("url").parse}var c=function(e,t){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],t=t||{},this._customTimeout=t.timeout;var n=i(e),d=t.headers||{},p=t.protocol||void 0;n.username&&n.password&&(d.authorization="Basic "+s(n.username+":"+n.password));var c=t.clientConfig||void 0;n.auth&&(d.authorization="Basic "+s(n.auth)),this.connection=new o(e,p,void 0,d,void 0,c),this.addDefaultEvents(),this.connection.onmessage=function(t){var e="string"==typeof t.data?t.data:"";r._parseResponse(e).forEach(function(e){var t=null;a.isArray(e)?e.forEach(function(e){r.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,!t&&e&&e.method&&-1!==e.method.indexOf("_subscription")?r.notificationCallbacks.forEach(function(t){a.isFunction(t)&&t(e)}):r.responseCallbacks[t]&&(r.responseCallbacks[t](null,e),delete r.responseCallbacks[t])})},Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0})};c.prototype.addDefaultEvents=function(){var e=this;this.connection.onerror=function(){e._timeout()},this.connection.onclose=function(){e._timeout(),e.reset()}},c.prototype._parseResponse=function(e){var t=this,r=[],a=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return a.forEach(function(a){t.lastChunk&&(a=t.lastChunk+a);var e=null;try{e=JSON.parse(a)}catch(r){return t.lastChunk=a,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){throw t._timeout(),n.InvalidResponse(a)},15000))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,e&&r.push(e)}),r},c.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,a=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=a;var o=this;this._customTimeout&&setTimeout(function(){o.responseCallbacks[r]&&(o.responseCallbacks[r](n.ConnectionTimeout(o._customTimeout)),delete o.responseCallbacks[r])},this._customTimeout)},c.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](n.InvalidConnection("on WS")),delete this.responseCallbacks[e])},c.prototype.send=function(e,t){var r=this;return this.connection.readyState===this.connection.CONNECTING?void setTimeout(function(){r.send(e,t)},10):this.connection.readyState===this.connection.OPEN?void(this.connection.send(JSON.stringify(e)),this._addResponseCallback(e,t)):(console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void t(new Error("connection not open")))},c.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");"data"===e?this.notificationCallbacks.push(t):"connect"===e?this.connection.onopen=t:"end"===e?this.connection.onclose=t:"error"===e?this.connection.onerror=t:void 0},c.prototype.removeListener=function(e,t){var r=this;"data"===e?this.notificationCallbacks.forEach(function(e,a){e===t&&r.notificationCallbacks.splice(a,1)}):void 0},c.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null;break;default:}},c.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},c.prototype.disconnect=function(){this.connection&&this.connection.close()},t.exports=c}).call(this,e("buffer").Buffer)},{buffer:83,underscore:245,url:247,"web3-core-helpers":255,websocket:300}],293:[function(e,t){"use strict";var r=e("web3-core"),a=e("web3-core-subscriptions").subscriptions,n=e("web3-core-method"),o=e("web3-net"),s=function(){var e=this;r.packageInit(this,arguments);var t=this.setProvider;this.setProvider=function(){t.apply(e,arguments),e.net.setProvider.apply(e,arguments)},this.net=new o(this.currentProvider),[new a({name:"subscribe",type:"shh",subscriptions:{messages:{params:1}}}),new n({name:"getVersion",call:"shh_version",params:0}),new n({name:"getInfo",call:"shh_info",params:0}),new n({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new n({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new n({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new n({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new n({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new n({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new n({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new n({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new n({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new n({name:"newSymKey",call:"shh_newSymKey",params:0}),new n({name:"addSymKey",call:"shh_addSymKey",params:1}),new n({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new n({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new n({name:"getSymKey",call:"shh_getSymKey",params:1}),new n({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new n({name:"newMessageFilter",call:"shh_newMessageFilter",params:1}),new n({name:"getFilterMessages",call:"shh_getFilterMessages",params:1}),new n({name:"deleteMessageFilter",call:"shh_deleteMessageFilter",params:1}),new n({name:"post",call:"shh_post",params:1,inputFormatter:[null]}),new n({name:"unsubscribe",call:"shh_unsubscribe",params:1})].forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};s.prototype.clearSubscriptions=function(){this._requestManager.clearSubscriptions()},r.addProviders(s),t.exports=s},{"web3-core":265,"web3-core-method":256,"web3-core-subscriptions":262,"web3-net":289}],294:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{dup:138}],295:[function(e,t){var r=e("underscore"),a=e("ethjs-unit"),n=e("./utils.js"),o=e("./soliditySha3.js"),s=e("randomhex"),i=function(e,t){var a=[];return t.forEach(function(t){if("object"==typeof t.components){if("tuple"!==t.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var n="",o=t.type.indexOf("[");0<=o&&(n=t.type.substring(o));var s=i(e,t.components);r.isArray(s)&&e?a.push("tuple("+s.join(",")+")"+n):e?a.push("("+s+")"):a.push("("+s.join(",")+")"+n)}else a.push(t.type)}),a},d=function(e){if(!n.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);ro.length?"0"+o:o}return"0x"+t},c=function(e){if(e=e?e.toLowerCase():"ether",!a.unitMap[e])throw new Error("This unit \""+e+"\" doesn't exist, please use the one of the following units"+JSON.stringify(a.unitMap,null,2));return e};t.exports={_fireError:function(e,t,a,n){return r.isObject(e)&&!(e instanceof Error)&&e.data&&((r.isObject(e.data)||r.isArray(e.data))&&(e.data=JSON.stringify(e.data,null,2)),e=e.message+"\n"+e.data),r.isString(e)&&(e=new Error(e)),r.isFunction(n)&&n(e),r.isFunction(a)&&((t&&r.isFunction(t.listeners)&&t.listeners("error").length||r.isFunction(n))&&t.catch(function(){}),setTimeout(function(){a(e)},1)),t&&r.isFunction(t.emit)&&setTimeout(function(){t.emit("error",e),t.removeAllListeners()},1),t},_jsonInterfaceMethodToString:function(e){return r.isObject(e)&&e.name&&-1!==e.name.indexOf("(")?e.name:e.name+"("+i(!1,e.inputs).join(",")+")"},_flattenTypes:i,randomHex:s,_:r,BN:n.BN,isBN:n.isBN,isBigNumber:n.isBigNumber,isHex:n.isHex,isHexStrict:n.isHexStrict,sha3:n.sha3,keccak256:n.sha3,soliditySha3:o,isAddress:n.isAddress,checkAddressChecksum:n.checkAddressChecksum,toChecksumAddress:function(e){if("undefined"==typeof e)return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error("Given address \""+e+"\" is not a valid Ethereum address.");e=e.toLowerCase().replace(/^0x/i,"");for(var t=n.sha3(e).replace(/^0x/i,""),r="0x",a=0;ai||32i||256i)throw new Error("Supplied uint exceeds width: "+i+" vs "+p.bitLength());if(p.lt(new a(0)))throw new Error("Supplied uint "+p.toString()+" is negative");return i?n.leftPad(p.toString("hex"),2*(i/8)):p}if(e.startsWith("int")){if(i%8||8>i||256i)throw new Error("Supplied int exceeds width: "+i+" vs "+p.bitLength());return p.lt(new a(0))?p.toTwos(i).toString("hex"):i?n.leftPad(p.toString("hex"),2*(i/8)):p}throw new Error("Unsupported or invalid type: "+e)},c=function(e){if(r.isArray(e))throw new Error("Autodetection of array types is not supported.");var t="",o,s,d;if(r.isObject(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(o=e.hasOwnProperty("t")?e.t:e.type,t=e.hasOwnProperty("v")?e.v:e.value):(o=n.toHex(e,!0),t=n.toHex(e),!o.startsWith("int")&&!o.startsWith("uint")&&(o="bytes")),(o.startsWith("int")||o.startsWith("uint"))&&"string"==typeof t&&!/^(-)?0x/i.test(t)&&(t=new a(t)),r.isArray(t))if(d=i(o),d&&t.length!==d)throw new Error(o+" is not matching the given array "+JSON.stringify(t));else d=t.length;return r.isArray(t)?(s=t.map(function(e){return p(o,e,d).toString("hex").replace("0x","")}),s.join("")):(s=p(o,t,d),s.toString("hex").replace("0x",""))};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=r.map(e,c);return n.sha3("0x"+t.join(""))}},{"./utils.js":297,"bn.js":294,underscore:245}],297:[function(e,t){var r=e("underscore"),a=e("bn.js"),n=e("number-to-bn"),o=e("utf8"),s=e("eth-lib/lib/hash"),i=function(e){return e instanceof a||e&&e.constructor&&"BN"===e.constructor.name},d=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},p=function(t){try{return n.apply(null,arguments)}catch(r){throw new Error(r+" Given value: \""+t+"\"")}},c=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!!(/^(0x|0X)?[0-9a-f]{40}$/.test(e)||/^(0x|0X)?[0-9A-F]{40}$/.test(e))||l(e))},l=function(e){e=e.replace(/^0x/i,"");for(var t=g(e.toLowerCase()).replace(/^0x/i,""),r=0;40>r;r++)if(7=parseInt(t[r],16)&&e[r].toLowerCase()!==e[r])return!1;return!0},u=function(e){e=o.encode(e);var t="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(var r=0;rs.length?"0"+s:s}return"0x"+t},f=function(e){if(r.isNull(e)||r.isUndefined(e))return e;if(!isFinite(e)&&!b(e))throw new Error("Given input \""+e+"\" is not a number.");var t=p(e),n=t.toString(16);return t.lt(new a(0))?"-0x"+n.substr(1):"0x"+n},y=function(e){if(e=e.toString(16),!b(e))throw new Error("Given value \""+e+"\" is not a valid hex string.");e=e.replace(/^0x/i,"");for(var t=[],r=0;re?"int256":"uint256":f(e)},hexToBytes:y,bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},isHex:function(e){return(r.isString(e)||r.isNumber(e))&&/^(-0x|0x)?[0-9a-f]*$/i.test(e)},isHexStrict:b,leftPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+Array(n).join(r?r:"0")+e},rightPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+e+Array(n).join(r?r:"0")},toTwosComplement:function(e){return"0x"+p(e).toTwos(256).toString(16,64)},sha3:g}},{"bn.js":294,"eth-lib/lib/hash":125,"number-to-bn":173,underscore:245,utf8:249}],298:[function(e,t){t.exports={_from:"web3@^1.0.0-beta.37",_id:"web3@1.0.0-beta.37",_inBundle:!1,_integrity:"sha512-8XLgUspdzicC/xHG82TLrcF/Fxzj2XYNJ1KTYnepOI77bj5rvpsxxwHYBWQ6/JOjk0HkZqoBfnXWgcIHCDhZhQ==",_location:"/web3",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"web3@^1.0.0-beta.37",name:"web3",escapedName:"web3",rawSpec:"^1.0.0-beta.37",saveSpec:null,fetchSpec:"^1.0.0-beta.37"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/web3/-/web3-1.0.0-beta.37.tgz",_shasum:"b42c30e67195f816cd19d048fda872f70eca7083",_spec:"web3@^1.0.0-beta.37",_where:"/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-base",author:{name:"ethereum.org"},authors:[{name:"Fabian Vogelsteller",email:"fabian@ethereum.org",homepage:"http://frozeman.de"},{name:"Marek Kotewicz",email:"marek@parity.io",url:"https://github.com/debris"},{name:"Marian Oancea",url:"https://github.com/cubedro"},{name:"Gav Wood",email:"g@parity.io",homepage:"http://gavwood.com"},{name:"Jeffery Wilcke",email:"jeffrey.wilcke@ethereum.org",url:"https://github.com/obscuren"}],bugs:{url:"https://github.com/ethereum/web3.js/issues"},bundleDependencies:!1,dependencies:{"web3-bzz":"1.0.0-beta.37","web3-core":"1.0.0-beta.37","web3-eth":"1.0.0-beta.37","web3-eth-personal":"1.0.0-beta.37","web3-net":"1.0.0-beta.37","web3-shh":"1.0.0-beta.37","web3-utils":"1.0.0-beta.37"},deprecated:!1,description:"Ethereum JavaScript API",keywords:["Ethereum","JavaScript","API"],license:"LGPL-3.0",main:"src/index.js",name:"web3",namespace:"ethereum",repository:{type:"git",url:"https://github.com/ethereum/web3.js/tree/master/packages/web3"},version:"1.0.0-beta.37"}},{}],299:[function(e,t){"use strict";var r=e("../package.json").version,a=e("web3-core"),n=e("web3-eth"),o=e("web3-net"),s=e("web3-eth-personal"),i=e("web3-shh"),d=e("web3-bzz"),p=e("web3-utils"),c=function(){var e=this;a.packageInit(this,arguments),this.version=r,this.utils=p,this.eth=new n(this),this.shh=new i(this),this.bzz=new d(this);var t=this.setProvider;this.setProvider=function(r,a){return t.apply(e,arguments),this.eth.setProvider(r,a),this.shh.setProvider(r,a),this.bzz.setProvider(r),!0}};c.version=r,c.utils=p,c.modules={Eth:n,Net:o,Personal:s,Shh:i,Bzz:d},a.addProviders(c),t.exports=c},{"../package.json":298,"web3-bzz":252,"web3-core":265,"web3-eth":288,"web3-eth-personal":286,"web3-net":289,"web3-shh":293,"web3-utils":295}],300:[function(e,t){function r(e,t){var r;return r=t?new n(e,t):new n(e),r}var a=function(){return this||{}}(),n=a.WebSocket||a.MozWebSocket,o=e("./version");n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(r,e,{get:function(){return n[e]}})}),t.exports={w3cwebsocket:n?r:null,version:o}},{"./version":301}],301:[function(e,t){t.exports=e("../package.json").version},{"../package.json":302}],302:[function(e,t){t.exports={_from:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",_id:"websocket@1.0.26",_inBundle:!1,_integrity:"",_location:"/websocket",_phantomChildren:{},_requested:{type:"git",raw:"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",name:"websocket",escapedName:"websocket",rawSpec:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",saveSpec:"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",fetchSpec:"git://github.com/frozeman/WebSocket-Node.git",gitCommittish:"browserifyCompatible"},_requiredBy:["/web3-providers-ws"],_resolved:"git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",_spec:"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",_where:"/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-base/node_modules/web3-providers-ws",author:{name:"Brian McKelvey",email:"brian@worlize.com",url:"https://www.worlize.com/"},browser:"lib/browser.js",bugs:{url:"https://github.com/theturtle32/WebSocket-Node/issues"},bundleDependencies:!1,config:{verbose:!1},contributors:[{name:"I\xF1aki Baz Castillo",email:"ibc@aliax.net",url:"http://dev.sipdoc.net"}],dependencies:{debug:"^2.2.0",nan:"^2.3.3","typedarray-to-buffer":"^3.1.2",yaeti:"^0.0.6"},deprecated:!1,description:"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",devDependencies:{"buffer-equal":"^1.0.0",faucet:"^0.0.1",gulp:"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jshint":"^2.0.4",jshint:"^2.0.0","jshint-stylish":"^2.2.1",tape:"^4.0.1"},directories:{lib:"./lib"},engines:{node:">=0.10.0"},homepage:"https://github.com/theturtle32/WebSocket-Node",keywords:["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],license:"Apache-2.0",main:"index",name:"websocket",repository:{type:"git",url:"git+https://github.com/theturtle32/WebSocket-Node.git"},scripts:{gulp:"gulp",install:"(node-gyp rebuild 2> builderror.log) || (exit 0)",test:"faucet test/unit"},version:"1.0.26"}},{}],303:[function(e,t){var r=e("xhr-request");t.exports=function(e,t){return new Promise(function(a,n){r(e,t,function(e,t){e?n(e):a(t)})})}},{"xhr-request":304}],304:[function(e,t){var r=e("query-string"),a=e("url-set-query"),n=e("object-assign"),o=e("./lib/ensure-header.js"),s=e("./lib/request.js"),i=function(){};t.exports=function(e,t,d){if(!e||"string"!=typeof e)throw new TypeError("must specify a URL");if("function"==typeof t&&(d=t,t={}),d&&"function"!=typeof d)throw new TypeError("expected cb to be undefined or a function");d=d||i,t=t||{};var p=t.json?"json":"text";t=n({responseType:p},t);var c=t.headers||{},l=(t.method||"GET").toUpperCase(),u=t.query;return u&&("string"!=typeof u&&(u=r.stringify(u)),e=a(e,u)),"json"===t.responseType&&o(c,"Accept","application/json"),t.json&&"GET"!==l&&"HEAD"!==l&&(o(c,"Content-Type","application/json"),t.body=JSON.stringify(t.body)),t.method=l,t.url=e,t.headers=c,delete t.query,delete t.json,s(t,d)}},{"./lib/ensure-header.js":305,"./lib/request.js":307,"object-assign":174,"query-string":195,"url-set-query":246}],305:[function(e,t){t.exports=function(e,t,r){var a=t.toLowerCase();e[t]||e[a]||(e[t]=r)}},{}],306:[function(e,t){t.exports=function(e,t){return t?{statusCode:t.statusCode,headers:t.headers,method:e.method,url:e.url,rawRequest:t.rawRequest?t.rawRequest:t}:null}},{}],307:[function(e,t){var r=e("xhr"),a=e("./normalize-response"),n=function(){};t.exports=function(e,t){delete e.uri;var o=!1;"json"===e.responseType&&(e.responseType="text",o=!0);var s=r(e,function(r,s,i){if(o&&!r)try{var d=s.rawRequest.responseText;i=JSON.parse(d)}catch(t){r=t}s=a(e,s),r?t(r,null,s):t(r,i,s),t=n}),i=s.onabort;return s.onabort=function(){var e=i.apply(s,Array.prototype.slice.call(arguments));return t(new Error("XHR Aborted")),t=n,e},s}},{"./normalize-response":306,xhr:308}],308:[function(e,t){"use strict";function r(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e,t,r){var a=e;return d(t)?(r=t,"string"==typeof e&&(a={uri:e})):a=c(t,{uri:e}),a.callback=r,a}function n(e,t,r){return t=a(e,t,r),o(t)}function o(e){function t(){4===l.readyState&&setTimeout(i,0)}function a(){var e;if(e=l.response?l.response:l.responseText||s(l),h)try{e=JSON.parse(e)}catch(t){}return e}function o(e){return clearTimeout(S),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,c(e,m)}function i(){if(!v){var t;clearTimeout(S),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=m,n=null;return 0===t?n=new Error("Internal XMLHttpRequest Error"):(r={body:a(),statusCode:t,method:f,headers:{},url:u,rawRequest:l},l.getAllResponseHeaders&&(r.headers=p(l.getAllResponseHeaders()))),c(n,r,r.body)}}if("undefined"==typeof e.callback)throw new Error("callback argument missing");var d=!1,c=function(t,r,a){d||(d=!0,e.callback(t,r,a))},l=e.xhr||null;l||(e.cors||e.useXDR?l=new n.XDomainRequest:l=new n.XMLHttpRequest);var u=l.url=e.uri||e.url,f=l.method=e.method||"GET",y=e.body||e.data,b=l.headers=e.headers||{},g=!!e.sync,h=!1,m={body:void 0,headers:{},statusCode:0,method:f,url:u,rawRequest:l},_,v,S;if("json"in e&&!1!==e.json&&(h=!0,b.accept||b.Accept||(b.Accept="application/json"),"GET"!==f&&"HEAD"!==f&&(b["content-type"]||b["Content-Type"]||(b["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),l.onreadystatechange=t,l.onload=i,l.onerror=o,l.onprogress=function(){},l.onabort=function(){v=!0},l.ontimeout=o,l.open(f,u,!g,e.username,e.password),g||(l.withCredentials=!!e.withCredentials),!g&&0r||this.listeners[e].splice(r,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var r=0,a=this.listeners[t],n;rn.randomHex(5),r.hex2bytes=e=>(e=e.replace(/^0x/,""),e=e.length%2?"0x0"+e:"0x"+e,n.hexToBytes(e)),r.bytes2hex=e=>n.bytesToHex(e);r.default=({from:e,privateKey:a,data:p="",nonce:c=r.getNonce(),quota:i,validUntilBlock:d,value:l="",version:u="0",chainId:f="1",to:y=""},b)=>{const g=b||a;if(!g)return console.warn(`No private key found`),{data:p,from:e,nonce:c,quota:i,validUntilBlock:d,value:l,version:u,chainId:f,to:y};let h=y.toLowerCase().replace(/^0x/,""),m=f,_=+u?`V${u}`:"",v=`${c}`,S=+i;switch(_){case"V1":{h=new Uint8Array(r.hex2bytes(h)),m=r.hex2bytes(""+f);const e=new Uint8Array(32);e.set(m,32-m.length),m=e;break}default:}const w=new o.Transaction;if(!v)w.setNonce(r.getNonce());else if(128=S)throw new Error("Quota should be larger than 0");else w.setQuota(S);if(l="number"==typeof l?"0x"+l.toString(16):l||"0x0",l.length>s.length)throw new Error(`Value should not be larger than ${s}`);if(0>+l)throw new Error(`Value should not be negative`);if(l)try{l=l.replace(/^0x/,""),l.length%2&&(l="0"+l);const e=r.hex2bytes(l),t=new Uint8Array(32);t.set(e,32-e.length),w.setValue(t)}catch(e){throw e}if(y)if(n.isAddress(y))w[`setTo${_}`](h);else throw new Error(`Invalid to address`);if(void 0===d||isNaN(+d))throw new Error(`ValidUntilBlock should be set`);else w.setValidUntilBlock(+d);if(void 0===m)throw new Error(`Chain Id should be set`);else w[`setChainId${_}`](m);try{const e=r.hex2bytes(p);w.setData(new Uint8Array(e))}catch(e){throw e}w.setVersion(u);const A=w.serializeBinary(),B=r.sha3(A).slice(2);if(64!==g.replace(/^0x/,"").length||!n.isHex(g))throw new Error("Invalid Private Key");const x=r.ec.keyFromPrivate(g.replace(/^0x/,""),"hex"),k=x.sign(new t(B.toString(),"hex"),{canonical:!0});let E=k.r.toString(16).padStart(64,0),T=k.s.toString(16).padStart(64,0);const M=(E+T).padStart(128,0),I=new t(M,"hex"),C=new Uint8Array(65);C.set(I),C[64]=k.recoveryParam;const R=new o.UnverifiedTransaction;R.setTransaction(w),R.setCrypto(o.Crypto.DEFAULT),R.setSignature(C);const N=R.serializeBinary(),P=n.bytesToHex(N);return P}}).call(this,e("buffer").Buffer)},{"../proto-js/blockchain_pb":369,"./unsigner":317,buffer:83,elliptic:320,"web3-utils":366}],317:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=e("elliptic/lib/elliptic/ec/signature"),n=e("../proto-js/blockchain_pb"),o=e("./index");r.default=e=>{const r=o.hex2bytes(e),s=n.UnverifiedTransaction.deserializeBinary(r),i=s.getTransaction(),d=s.getSignature(),p=i.getVersion(),c={version:p,data:o.bytes2hex(i.getData()),chainId:i.getChainId(),to:i.getTo(),nonce:i.getNonce(),value:+o.bytes2hex(i.getValue()),quota:i.getQuota(),validUntilBlock:+i.getValidUntilBlock()};switch(+p){case 1:{c.chainId="0x"+(+o.bytes2hex(i.getChainIdV1())).toString(16),c.to=o.bytes2hex(i.getToV1());break}default:}c.to&&!c.to.startsWith("0x")&&(c.to="0x"+c.to);const l=new a({r:o.bytes2hex(d.slice(0,32)).slice(2),s:o.bytes2hex(d.slice(32,64)).slice(2),recoveryParam:d[64]}),u=i.serializeBinary(),f=o.sha3(u).slice(2),y=new t(f.toString(),"hex"),b=o.ec.recoverPubKey(y,l,l.recoveryParam,"hex"),g=`0x${b.encode("hex").slice(2).toLowerCase()}`,h=new t(o.hex2bytes(g)),m=`0x${o.sha3(h).slice(-40).toLowerCase()}`,_=o.bytes2hex(d).slice(2);return{transaction:c,signature:_,sender:{publicKey:g,address:m}}}}).call(this,e("buffer").Buffer)},{"../proto-js/blockchain_pb":369,"./index":316,buffer:83,"elliptic/lib/elliptic/ec/signature":329}],318:[function(e,t,r){arguments[4][50][0].apply(r,arguments)},{buffer:52,dup:50}],319:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{crypto:52,dup:51}],320:[function(e,t,r){arguments[4][105][0].apply(r,arguments)},{"../package.json":335,"./elliptic/curve":323,"./elliptic/curves":326,"./elliptic/ec":327,"./elliptic/eddsa":330,"./elliptic/utils":334,brorand:319,dup:105}],321:[function(e,t,r){arguments[4][106][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:106}],322:[function(e,t,r){arguments[4][107][0].apply(r,arguments)},{"../../elliptic":320,"../curve":323,"bn.js":318,dup:107,inherits:353}],323:[function(e,t,r){arguments[4][108][0].apply(r,arguments)},{"./base":321,"./edwards":322,"./mont":324,"./short":325,dup:108}],324:[function(e,t,r){arguments[4][109][0].apply(r,arguments)},{"../../elliptic":320,"../curve":323,"bn.js":318,dup:109,inherits:353}],325:[function(e,t,r){arguments[4][110][0].apply(r,arguments)},{"../../elliptic":320,"../curve":323,"bn.js":318,dup:110,inherits:353}],326:[function(e,t,r){arguments[4][111][0].apply(r,arguments)},{"../elliptic":320,"./precomputed/secp256k1":333,dup:111,"hash.js":340}],327:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{"../../elliptic":320,"./key":328,"./signature":329,"bn.js":318,dup:112,"hmac-drbg":352}],328:[function(e,t,r){arguments[4][113][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:113}],329:[function(e,t,r){arguments[4][114][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:114}],330:[function(e,t,r){arguments[4][115][0].apply(r,arguments)},{"../../elliptic":320,"./key":331,"./signature":332,dup:115,"hash.js":340}],331:[function(e,t,r){arguments[4][116][0].apply(r,arguments)},{"../../elliptic":320,dup:116}],332:[function(e,t,r){arguments[4][117][0].apply(r,arguments)},{"../../elliptic":320,"bn.js":318,dup:117}],333:[function(e,t,r){arguments[4][118][0].apply(r,arguments)},{dup:118}],334:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{"bn.js":318,dup:119,"minimalistic-assert":355,"minimalistic-crypto-utils":356}],335:[function(e,t){t.exports={_args:[["elliptic@6.4.1","/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-signer"]],_from:"elliptic@6.4.1",_id:"elliptic@6.4.1",_inBundle:!1,_integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.4.1",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.1",saveSpec:null,fetchSpec:"6.4.1"},_requiredBy:["/","/browserify-sign","/create-ecdh","/eth-lib","/web3-eth-accounts/eth-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_spec:"6.4.1",_where:"/Users/ChenYu/Documents/cryptape/projects/nervos/packages/appchain-signer",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],336:[function(e,t,r){arguments[4][125][0].apply(r,arguments)},{dup:125}],337:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{"bn.js":338,dup:137,"number-to-bn":358}],338:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{dup:138}],339:[function(require,module,exports){var _Mathabs=Math.abs,_MathLN=Math.LN2,_Mathlog=Math.log,_Mathsqrt=Math.sqrt,_Mathpow3=Math.pow,_Mathfloor2=Math.floor,_Mathmax7=Math.max,_Mathmin5=Math.min,_StringfromCharCode4=String.fromCharCode,_Mathround4=Math.round;(function(global,Buffer){var _Stringprototype=String.prototype,_Mathexp=Math.exp,$jscomp={scope:{},getGlobal:function(e){return"undefined"!=typeof window&&window===e?e:"undefined"==typeof global?e:global}};$jscomp.global=$jscomp.getGlobal(this),$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol),$jscomp.initSymbol=function(){}},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(e){return"jscomp_symbol_"+e+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol(),$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),$jscomp.initSymbolIterator=function(){}},$jscomp.makeIterator=function(e){$jscomp.initSymbolIterator(),$jscomp.initSymbol(),$jscomp.initSymbolIterator();var t=e[Symbol.iterator];if(t)return t.call(e);var r=0;return{next:function(){return rt;)--r in this?this[--e]=this[r]:delete this[e];return this},$jscomp.array.copyWithin$install=function(){$jscomp.array.installHelper_("copyWithin",$jscomp.array.copyWithin)},$jscomp.array.fill=function(e,t,r){var a=this.length||0;for(0>t&&(t=_Mathmax7(0,a+t)),(null==r||r>a)&&(r=a),r=+r,0>r&&(r=_Mathmax7(0,a+r)),t=+(t||0);t>>0,0===e)return 32;var t=0;return 0==(4294901760&e)&&(e<<=16,t+=16),0==(4278190080&e)&&(e<<=8,t+=8),0==(4026531840&e)&&(e<<=4,t+=4),0==(3221225472&e)&&(e<<=2,t+=2),0==(2147483648&e)&&t++,t},$jscomp.math.imul=function(e,t){e=+e,t=+t;var r=65535&e,n=65535&t;return 0|r*n+((65535&e>>>16)*n+r*(65535&t>>>16)<<16>>>0)},$jscomp.math.sign=function(e){return e=+e,0===e||isNaN(e)?e:0t&&-.25t&&-.25e?-t:t},$jscomp.math.acosh=function(e){return e=+e,_Mathlog(e+_Mathsqrt(e*e-1))},$jscomp.math.asinh=function(e){if(e=+e,0===e)return e;var t=_Mathlog(_Mathabs(e)+_Mathsqrt(e*e+1));return 0>e?-t:t},$jscomp.math.atanh=function(e){return e=+e,($jscomp.math.log1p(e)-$jscomp.math.log1p(-e))/2},$jscomp.math.hypot=function(t,r){t=+t,r=+r;var n=_Mathmax7(_Mathabs(t),_Mathabs(r)),o,s,i;for(o=2;on){for(t/=n,r/=n,i=t*t+r*r,o=2;oe?-t:t},$jscomp.math.cbrt=function(e){if(0===e)return e;e=+e;var t=_Mathpow3(_Mathabs(e),1/3);return 0>e?-t:t},$jscomp.number=$jscomp.number||{},$jscomp.number.isFinite=function(e){return!("number"!=typeof e)&&!isNaN(e)&&1/0!==e&&-Infinity!==e},$jscomp.number.isInteger=function(e){return!!$jscomp.number.isFinite(e)&&e===_Mathfloor2(e)},$jscomp.number.isNaN=function(e){return"number"==typeof e&&isNaN(e)},$jscomp.number.isSafeInteger=function(e){return $jscomp.number.isInteger(e)&&_Mathabs(e)<=$jscomp.number.MAX_SAFE_INTEGER},$jscomp.number.EPSILON=function(){return 2.220446049250313e-16}(),$jscomp.number.MAX_SAFE_INTEGER=function(){return 9007199254740991}(),$jscomp.number.MIN_SAFE_INTEGER=function(){return-9007199254740991}(),$jscomp.object=$jscomp.object||{},$jscomp.object.assign=function(t){for(var r=1,a;rr||1114111=r?e+=_StringfromCharCode4(r):(r-=65536,e+=_StringfromCharCode4(55296|1023&r>>>10),e+=_StringfromCharCode4(56320|1023&r))}return e},$jscomp.string.repeat=function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279>>=1)&&(t+=t);return r},$jscomp.string.repeat$install=function(){_Stringprototype.repeat||(_Stringprototype.repeat=$jscomp.string.repeat)},$jscomp.string.codePointAt=function(e){var t=$jscomp.checkStringArgs(this,null,"codePointAt"),r=t.length;if(e=+e||0,0<=e&&en||56319e||57343=s},$jscomp.string.startsWith$install=function(){_Stringprototype.startsWith||(_Stringprototype.startsWith=$jscomp.string.startsWith)},$jscomp.string.endsWith=function(t,r){var n=$jscomp.checkStringArgs(this,t,"endsWith");t+="",void 0===r&&(r=n.length);for(var o=_Mathmax7(0,_Mathmin5(0|r,n.length)),s=t.length;0=s},$jscomp.string.endsWith$install=function(){_Stringprototype.endsWith||(_Stringprototype.endsWith=$jscomp.string.endsWith)};var COMPILED=!0,goog=goog||{};goog.global=this,goog.isDef=function(e){return void 0!==e},goog.exportPath_=function(e,t,r){e=e.split("."),r=r||goog.global,e[0]in r||!r.execScript||r.execScript("var "+e[0]);for(var n;e.length&&(n=e.shift());)!e.length&&goog.isDef(t)?r[n]=t:r=r[n]?r[n]:r[n]={}},goog.define=function(e,t){!0,goog.exportPath_(e,t)},goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(){},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return null!=goog.moduleLoaderState_},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(){},!0,goog.getObjectByName=function(t,r){for(var a=t.split("."),n=r||goog.global,o;o=a.shift();)if(goog.isDefAndNotNull(n[o]))n=n[o];else return null;return n},goog.globalize=function(e,t){var r=t||goog.global,a;for(a in e)r[a]=e[a]},goog.addDependency=function(t,r,n,o){if(goog.DEPENDENCIES_ENABLED){var s;t=t.replace(/\\/g,"/");for(var i=goog.dependencies_,p=0;s=r[p];p++)i.nameToPath[s]=t,i.pathIsModule[t]=!!o;for(o=0;r=n[o];o++)t in i.requires||(i.requires[t]={}),i.requires[t][r]=!0}},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(){},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!1,goog.DEPENDENCIES_ENABLED&&(goog.dependencies_={pathIsModule:{},nameToPath:{},requires:{},visited:{},written:{},deferred:{}},goog.inHtmlDocument_=function(){var e=goog.global.document;return null!=e&&"write"in e},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var e=goog.global.document.getElementsByTagName("SCRIPT"),t=e.length-1;0<=t;--t){var r=e[t].src,a=r.lastIndexOf("?"),a=-1==a?r.length:a;if("base.js"==r.substr(a-7,7)){goog.basePath=r.substr(0,a-7);break}}},goog.importScript_=function(e,t){(goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_)(e,t)&&(goog.dependencies_.written[e]=!0)},goog.IS_OLD_IE_=!goog.global.atob&&goog.global.document&&goog.global.document.all,goog.importModule_=function(e){goog.importScript_("","goog.retrieveAndExecModule_(\""+e+"\");")&&(goog.dependencies_.written[e]=!0)},goog.queuedModules_=[],goog.wrapModule_=function(e,t){return goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(t+"\n//# sourceURL="+e+"\n")+");":"goog.loadModule(function(exports) {\"use strict\";"+t+"\n;return exports});\n//# sourceURL="+e+"\n"},goog.loadQueuedModules_=function(){var e=goog.queuedModules_.length;if(0")},goog.appendScriptSrcNode_=function(e){var t=goog.global.document,r=t.createElement("script");r.type="text/javascript",r.src=e,r.defer=!1,r.async=!1,t.head.appendChild(r)},goog.writeScriptTag_=function(e,t){if(goog.inHtmlDocument_()){var r=goog.global.document;if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&"complete"==r.readyState){if(/\bdeps.js$/.test(e))return!1;throw Error("Cannot write \""+e+"\" after document load")}var a=goog.IS_OLD_IE_;return void 0===t?a?(a=" onreadystatechange='goog.onScriptLoad_(this, "+ ++goog.lastNonModuleScriptIndex_+")' ",r.write("")):goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING?goog.appendScriptSrcNode_(e):goog.writeScriptSrcNode_(e):r.write(""),!0}return!1},goog.lastNonModuleScriptIndex_=0,goog.onScriptLoad_=function(e,t){return"complete"==e.readyState&&goog.lastNonModuleScriptIndex_==t&&goog.loadQueuedModules_(),!0},goog.writeScripts_=function(t){function r(e){if(!(e in s.written||e in s.visited)){if(s.visited[e]=!0,e in s.requires)for(var t in s.requires[e])if(!goog.isProvided_(t))if(t in s.nameToPath)r(s.nameToPath[t]);else throw Error("Undefined nameToPath for "+t);e in o||(o[e]=!0,n.push(e))}}var n=[],o={},s=goog.dependencies_;for(r(t),t=0;t>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if(e.clone)return e.clone();var t="array"==t?[]:{},r;for(r in e)t[r]=goog.cloneObject(e[r]);return t}return e},goog.bindNative_=function(e){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t){if(!e)throw Error();if(2=e||"\x80"<=e&&"\uFFFD">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.TRUSTED_SITE&&_Stringprototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=function(e,t){var r=(e+"").toLowerCase(),a=(t+"").toLowerCase();return r":"
")},goog.string.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.AMP_RE_,"&").replace(goog.string.LT_RE_,"<").replace(goog.string.GT_RE_,">").replace(goog.string.QUOT_RE_,""").replace(goog.string.SINGLE_QUOTE_RE_,"'").replace(goog.string.NULL_RE_,"�"),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e"));else{if(!goog.string.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.AMP_RE_,"&")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.LT_RE_,"<")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.GT_RE_,">")),-1!=e.indexOf("\"")&&(e=e.replace(goog.string.QUOT_RE_,""")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.SINGLE_QUOTE_RE_,"'")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.NULL_RE_,"�")),goog.string.DETECT_DOUBLE_ESCAPING&&-1!=e.indexOf("e")&&(e=e.replace(goog.string.E_RE_,"e"))}return e},goog.string.AMP_RE_=/&/g,goog.string.LT_RE_=//g,goog.string.QUOT_RE_=/"/g,goog.string.SINGLE_QUOTE_RE_=/'/g,goog.string.NULL_RE_=/\x00/g,goog.string.E_RE_=/e/g,goog.string.ALL_RE_=goog.string.DETECT_DOUBLE_ESCAPING?/[\x00&<>"'e]/:/[\x00&<>"']/,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var r={"&":"&","<":"<",">":">",""":"\""},n;return n=t?t.createElement("div"):goog.global.document.createElement("div"),e.replace(goog.string.HTML_ENTITY_PATTERN_,function(e,t){var a=r[e];if(a)return a;if("#"==t.charAt(0)){var o=+("0"+t.substr(1));isNaN(o)||(a=_StringfromCharCode4(o))}return a||(n.innerHTML=e+" ",a=n.firstChild.nodeValue.slice(0,-1)),r[e]=a})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return"\"";default:if("#"==t.charAt(0)){var r=+("0"+t.substr(1));if(!isNaN(r))return _StringfromCharCode4(r)}return e;}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(t,r){for(var a=r.length,n=0,o;nt&&(e=e.substring(0,t-3)+"..."),r&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(t,r,n,o){if(n&&(t=goog.string.unescapeEntities(t)),o&&t.length>r){o>r&&(o=r);var s=t.length-o;t=t.substring(0,r-o)+"..."+t.substring(s)}else t.length>r&&(o=_Mathfloor2(r/2),s=t.length-o,t=t.substring(0,o+r%2)+"..."+t.substring(s));return n&&(t=goog.string.htmlEscape(t)),t},goog.string.specialEscapeChars_={"":"\\0","":"\\b"," ":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\x0B",'"':"\\\"","\\":"\\\\","<":"<"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(t){t+="";for(var r=["\""],n=0;ns?o:goog.string.escapeChar(o))}return r.push("\""),r.join("")},goog.string.escapeString=function(e){for(var t=[],r=0;rt?r=e:(256>t?(r="\\x",16>t||256t&&(r+="0")),r+=t.toString(16).toUpperCase()),goog.string.jsEscapeCache_[e]=r},goog.string.contains=function(e,t){return-1!=e.indexOf(t)},goog.string.caseInsensitiveContains=function(e,t){return goog.string.contains(e.toLowerCase(),t.toLowerCase())},goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,r){var a=e;return 0<=t&&tt?1:0},goog.string.hashCode=function(e){for(var t=0,r=0;r>>0;return t},goog.string.uniqueStringCounter_=0|2147483648*Math.random(),goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=+e;return 0==t&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return /^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return /^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return(e+"").replace(/\-([a-z])/g,function(e,t){return t.toUpperCase()})},goog.string.toSelectorCase=function(e){return(e+"").replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){var r=goog.isString(t)?goog.string.regExpEscape(t):"\\s";return e.replace(new RegExp("(^"+(r?"|["+r+"]+":"")+")([a-z])","g"),function(e,t,r){return t+r.toUpperCase()})},goog.string.capitalize=function(e){return(e.charAt(0)+"").toUpperCase()+(e.substr(1)+"").toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e+=""),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,r){e=e.split(t);for(var n=[];0r?_Mathmax7(0,e.length+r):r,goog.isString(e))return goog.isString(t)&&1==t.length?e.indexOf(t,r):-1;for(;rr&&(r=_Mathmax7(0,e.length+r)),goog.isString(e))return goog.isString(t)&&1==t.length?e.lastIndexOf(t,r):-1;for(;0<=r;r--)if(r in e&&e[r]===t)return r;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,r){goog.asserts.assert(null!=e.length),Array.prototype.forEach.call(e,t,r)}:function(t,r,a){for(var n=t.length,o=goog.isString(t)?t.split(""):t,e=0;et?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(t,r,a){for(var n=t.length,o=goog.isString(t)?t.split(""):t,e=0;et?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(t,r,a){for(var n=t.length,o=goog.isString(t)?t.split(""):t,n=n-1;0<=n;n--)if(n in o&&r.call(a,o[n],n,t))return n;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return 0==e.length},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,r){goog.array.splice(e,r,0,t)},goog.array.insertArrayAt=function(e,t,r){goog.partial(goog.array.splice,e,r,0).apply(null,t)},goog.array.insertBefore=function(e,t,r){var a;2==arguments.length||0>(a=goog.array.indexOf(e,r))?e.push(t):goog.array.insertAt(e,t,a)},goog.array.remove=function(e,t){var r=goog.array.indexOf(e,t),a;return(a=0<=r)&&goog.array.removeAt(e,r),a},goog.array.removeAt=function(e,t){return goog.asserts.assert(null!=e.length),1==Array.prototype.splice.call(e,t,1).length},goog.array.removeIf=function(e,t,r){return t=goog.array.findIndex(e,t,r),!!(0<=t)&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(t,r,a){var n=0;return goog.array.forEachRight(t,function(o,e){r.call(a,o,e,t)&&goog.array.removeAt(t,e)&&n++}),n},goog.array.concat=function(){return Array.prototype.concat.apply(Array.prototype,arguments)},goog.array.join=function(){return Array.prototype.concat.apply(Array.prototype,arguments)},goog.array.toArray=function(e){var t=e.length;if(0=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)},goog.array.removeDuplicates=function(t,r,a){r=r||t;var n=function(e){return goog.isObject(e)?"o"+goog.getUid(e):(typeof e).charAt(0)+e};a=a||n;for(var n={},o=0,s=0;s>1,p;p=a?r.call(o,t[d],d,t):r(n,t[d]),0t?1:er)&&(goog.array.insertAt(e,t,-(r+1)),!0)},goog.array.binaryRemove=function(e,t,r){return t=goog.array.binarySearch(e,t,r),!!(0<=t)&&goog.array.removeAt(e,t)},goog.array.bucket=function(t,r,a){for(var n={},o=0;on*(i-s))return[];if(0i;t+=n)o.push(t);return o},goog.array.repeat=function(e,t){for(var r=[],a=0;at&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,r){goog.asserts.assert(0<=t&&t>=8;r[a++]=o}return r},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return _StringfromCharCode4.apply(null,e);for(var t="",r=0;ro?r[a++]=o:(2048>o?r[a++]=192|o>>6:(55296==(64512&o)&&n+1>18,r[a++]=128|63&o>>12):r[a++]=224|o>>12,r[a++]=128|63&o>>6),r[a++]=128|63&o);return r},goog.crypt.utf8ByteArrayToString=function(t){for(var r=[],a=0,n=0,o;ao)r[n++]=_StringfromCharCode4(o);else if(191o){var s=t[a++];r[n++]=_StringfromCharCode4((31&o)<<6|63&s)}else if(239o){var s=t[a++],i=t[a++],p=t[a++],o=((7&o)<<18|(63&s)<<12|(63&i)<<6|63&p)-65536;r[n++]=_StringfromCharCode4(55296+(o>>10)),r[n++]=_StringfromCharCode4(56320+(1023&o))}else s=t[a++],i=t[a++],r[n++]=_StringfromCharCode4((15&o)<<12|(63&s)<<6|63&i);return r.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var r=[],a=0;aparseFloat(e))?t+"":e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv\:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.userAgent.isVersionOrHigherCache_[e]||(goog.userAgent.isVersionOrHigherCache_[e]=0<=goog.string.compareVersions(goog.userAgent.VERSION,e))},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return+goog.userAgent.DOCUMENT_MODE>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){var e=goog.global.document,t=goog.userAgent.getDocumentMode_();return e&&goog.userAgent.IE?t||("CSS1Compat"==e.compatMode?parseInt(goog.userAgent.VERSION,10):5):void 0}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.byteToCharMap_=null,goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.byteToCharMapWebSafe_=null,goog.crypt.base64.ENCODED_VALS_BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.ENCODED_VALS_BASE+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.ENCODED_VALS_BASE+"-_.",goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa,goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob,goog.crypt.base64.encodeByteArray=function(t,r){goog.asserts.assert(goog.isArrayLike(t),"encodeByteArray takes an array as a parameter"),goog.crypt.base64.init_();for(var a=r?goog.crypt.base64.byteToCharMapWebSafe_:goog.crypt.base64.byteToCharMap_,n=[],o=0;o>2,s=(3&s)<<4|d>>4,d=(15&d)<<2|u>>6,u=63&u;c||(u=64,i||(d=64)),n.push(a[y],a[s],a[d],a[u])}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var r="";return goog.crypt.base64.decodeStringInternal_(e,function(e){r+=_StringfromCharCode4(e)}),r},goog.crypt.base64.decodeStringToByteArray=function(e){var t=[];return goog.crypt.base64.decodeStringInternal_(e,function(e){t.push(e)}),t},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=new Uint8Array(Math.ceil(3*e.length/4)),r=0;return goog.crypt.base64.decodeStringInternal_(e,function(e){t[r++]=e}),t.subarray(0,r)},goog.crypt.base64.decodeStringInternal_=function(t,r){function a(r){for(;n>4),64!=s&&(r(240&e<<4|s>>2),64!=i&&r(192&s<<6|i))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.byteToCharMap_){goog.crypt.base64.byteToCharMap_={},goog.crypt.base64.charToByteMap_={},goog.crypt.base64.byteToCharMapWebSafe_={};for(var e=0;e=goog.crypt.base64.ENCODED_VALS_BASE.length&&(goog.crypt.base64.charToByteMap_[goog.crypt.base64.ENCODED_VALS_WEBSAFE.charAt(e)]=e)}},jspb.ExtensionFieldInfo=function(t,r,a,n,o){this.fieldIndex=t,this.fieldName=r,this.ctor=a,this.toObjectFn=n,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(t,r,a,n,o,e){this.fieldInfo=t,this.binaryReaderFn=r,this.binaryWriterFn=a,this.binaryMessageSerializeFn=n,this.binaryMessageDeserializeFn=o,this.isPacked=e},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_="function"==typeof Uint8Array,jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(t,r,a,n,o,e){if(t.wrappers_=null,r||(r=a?[a]:[]),t.messageId_=a?a+"":void 0,t.arrayIndexOffset_=0===a?-1:0,t.array=r,jspb.Message.initPivotAndExtensionObject_(t,n),t.convertedFloatingPointFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(t.repeatedFields=o),o)for(r=0;rn.length?a.length:n.length;for(t.getJsPbMessageId()&&(o[0]=t.getJsPbMessageId(),e=1);e>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((4294967295&this.lo+e.lo)>>>0>>>0,((4294967295&this.hi+e.hi)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((4294967295&this.lo-e.lo)>>>0>>>0,((4294967295&this.hi-e.hi)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(t,r){for(var a=65535&t,n=t>>>16,o=65535&r,e=r>>>16,s=a*o+65536*(65535&a*e)+65536*(65535&n*o),a=n*e+(a*e>>>16)+(n*o>>>16);4294967296<=s;)s-=4294967296,a+=1;return new jspb.arith.UInt64(s>>>0,a>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return e=jspb.arith.UInt64.mul32x32(this.hi,e),e.hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(0==e)return[];var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var n=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),n=n.leftShift();for(;!n.zero();)0>=e.cmp(r)&&(t=t.add(n),r=r.sub(e)),e=e.rightShift(),n=n.rightShift();return[t,r]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();)var t=t.div(10),r=t[0],e=t[1].lo+e,t=r;return""==e&&(e="0"),e},jspb.arith.UInt64.fromString=function(t){for(var r=new jspb.arith.UInt64(0,0),a=new jspb.arith.UInt64(0,0),n=0;nt[n]||"9">>0>>>0,((4294967295&this.hi+e.hi)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((4294967295&this.lo-e.lo)>>>0>>>0,((4294967295&this.hi-e.hi)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=0!=(2147483648&this.hi),t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0>>0;e=_Mathfloor2((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e;e=_Mathabs(e);var r=e>>>0;e=_Mathfloor2((e-r)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,r=(~r>>>0)+1,4294967295e;e=2*_Mathabs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;t&&(0==e?0==r?r=e=4294967295:(r--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=r},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;e=t?-e:e;var r;0===e?0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648):isNaN(e)?(jspb.utils.split64High=0,jspb.utils.split64Low=2147483647):e>jspb.BinaryConstants.FLOAT32_MAX?(jspb.utils.split64High=0,jspb.utils.split64Low=(2139095040|t<<31)>>>0):e>>0):(r=_Mathfloor2(_Mathlog(e)/_MathLN),e*=_Mathpow3(2,-r),e=8388607&_Mathround4(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|r+127<<23|e)>>>0)},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if(e=t?-e:e,0===e)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(2146435072|t<<31)>>>0,jspb.utils.split64Low=0;else if(e>>0,jspb.utils.split64Low=r>>>0}else{var n=_Mathfloor2(_Mathlog(e)/_MathLN);1024==n&&(n=1023),r=e*_Mathpow3(2,-n),e=1048575&r*jspb.BinaryConstants.TWO_TO_20,r=r*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|n+1023<<20|e)>>>0,jspb.utils.split64Low=r}},jspb.utils.splitHash64=function(t){var r=t.charCodeAt(0),n=t.charCodeAt(1),o=t.charCodeAt(2),s=t.charCodeAt(3),e=t.charCodeAt(4),i=t.charCodeAt(5),d=t.charCodeAt(6);t=t.charCodeAt(7),jspb.utils.split64Low=r+(n<<8)+(o<<16)+(s<<24)>>>0,jspb.utils.split64High=e+(i<<8)+(d<<16)+(t<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+e},jspb.utils.joinInt64=function(e,t){var r=2147483648&t;r&&(e=~e+1>>>0,t=~t>>>0,0==e&&(t=t+1>>>0));var n=jspb.utils.joinUint64(e,t);return r?-n:n},jspb.utils.joinZigzag64=function(e,t){var r=1&e;e=(e>>>1|t<<31)>>>0,t>>>=1,r&&(e=e+1>>>0,0==e&&(t=t+1>>>0));var n=jspb.utils.joinUint64(e,t);return r?-n:n},jspb.utils.joinFloat32=function(t){var r=2*(t>>31)+1,a=255&t>>>23,n=8388607&t;return 255==a?n?NaN:1/0*r:0==a?1.401298464324817e-45*r*n:r*_Mathpow3(2,a-150)*(n+8388608)},jspb.utils.joinFloat64=function(t,r){var a=2*(r>>31)+1,n=2047&r>>>20,o=jspb.BinaryConstants.TWO_TO_32*(1048575&r)+t;return 2047==n?o?NaN:1/0*a:0==n?5e-324*a*o:a*_Mathpow3(2,n-1075)*(o+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return _StringfromCharCode4(255&e>>>0,255&e>>>8,255&e>>>16,255&e>>>24,255&t>>>0,255&t>>>8,255&t>>>16,255&t>>>24)},jspb.utils.DIGITS=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],jspb.utils.joinUnsignedDecimalString=function(t,r){function a(e){for(var t=1E7,r=0;7>r;r++){var t=t/10,a=e/t%10>>>0;(0!=a||p)&&(p=!0,c+=i[a])}}if(2097151>=r)return""+(jspb.BinaryConstants.TWO_TO_32*r+t);var n=16777215&(t>>>24|r<<8)>>>0,o=65535&r>>16,s=(16777215&t)+6777216*n+6710656*o,n=n+8147497*o,o=2*o;1E7<=s&&(n+=_Mathfloor2(s/1E7),s%=1E7),1E7<=n&&(o+=_Mathfloor2(n/1E7),n%=1E7);var i=jspb.utils.DIGITS,p=!1,c="";return(o||p)&&a(o),(n||p)&&a(n),(s||p)&&a(s),c},jspb.utils.joinSignedDecimalString=function(e,t){var r=2147483648&t;r&&(e=~e+1>>>0,t=~t+(0==e?1:0)>>>0);var n=jspb.utils.joinUnsignedDecimalString(e,t);return r?"-"+n:n},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e);var r=jspb.utils.split64Low,a=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(r,a):jspb.utils.joinUnsignedDecimalString(r,a)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var r=Array(e.length),a=0;ar&&(1!==e||0>>8}function n(){for(var e=0;8>e;e++)s[e]=255&~s[e]}goog.asserts.assert(0r;r++)a=e.charCodeAt(7-r),t[2*r+2]=jspb.utils.DIGITS[a>>4],t[2*r+3]=jspb.utils.DIGITS[15&a];return t.join("")},jspb.utils.hexStringToHash64=function(t){t=t.toLowerCase(),goog.asserts.assert(18==t.length),goog.asserts.assert("0"==t[0]),goog.asserts.assert("x"==t[1]);for(var r="",n=0;8>n;n++)var o=jspb.utils.DIGITS.indexOf(t[2*n+2]),s=jspb.utils.DIGITS.indexOf(t[2*n+3]),r=_StringfromCharCode4(16*o+s)+r;return r},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e);var r=jspb.utils.split64Low,a=jspb.utils.split64High;return t?jspb.utils.joinInt64(r,a):jspb.utils.joinUint64(r,a)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(t,r,a){for(var n=0,o=r;o>7;return a-r-n},jspb.utils.countVarintFields=function(t,r,a,n){var o=0;if(n=8*n+jspb.BinaryConstants.WireType.VARINT,128>n)for(;r>=7}if(t[r++]!=s)break;for(o++;s=t[r++],0!=(128&s););}return o},jspb.utils.countFixedFields_=function(t,r,a,n,o){var e=0;if(128>n)for(;r>=7}if(t[r++]!=s)break;e++,r+=o}return e},jspb.utils.countFixed32Fields=function(e,t,r,a){return jspb.utils.countFixedFields_(e,t,r,8*a+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,r,a){return jspb.utils.countFixedFields_(e,t,r,8*a+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(t,r,a,n){var o=0;for(n=8*n+jspb.BinaryConstants.WireType.DELIMITED;r>=7}if(t[r++]!=s)break;o++;for(var i=0,p=1;s=t[r++],i+=(127&s)*p,p*=128,0!=(128&s););r+=i}return o},jspb.utils.debugBytesToTextFormat=function(e){var t="\"";if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var r=0;re[r]&&(t+="0"),t+=e[r].toString(16)}return t+"\""},jspb.utils.debugScalarToTextFormat=function(e){return goog.isString(e)?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),r=0,a;r>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(t==_Mathfloor2(t)),goog.asserts.assert(0<=e&&e>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&et;t++)this.buffer_.push(128|127&e),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&e=-jspb.BinaryConstants.TWO_TO_63&&e=-jspb.BinaryConstants.TWO_TO_31&&e>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&ee),this.buffer_.push(255&e>>>0)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(255&e>>>0),this.buffer_.push(255&e>>>8)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&e>>0),this.buffer_.push(255&e>>>8),this.buffer_.push(255&e>>>16),this.buffer_.push(255&e>>>24)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(0<=e&&ee),this.buffer_.push(255&e>>>0)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(255&e>>>0),this.buffer_.push(255&e>>>8)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e>>0),this.buffer_.push(255&e>>>8),this.buffer_.push(255&e>>>16),this.buffer_.push(255&e>>>24)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e=-jspb.BinaryConstants.TWO_TO_63&&+e=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(goog.isBoolean(e)||goog.isNumber(e)),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==_Mathfloor2(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&en)this.buffer_.push(n);else if(2048>n)this.buffer_.push(192|n>>6),this.buffer_.push(128|63&n);else if(65536>n)if(55296<=n&&56319>=n&&a+1=o&&(n=1024*(n-55296)+o-56320+65536,this.buffer_.push(240|n>>18),this.buffer_.push(128|63&n>>12),this.buffer_.push(128|63&n>>6),this.buffer_.push(128|63&n),a++)}else this.buffer_.push(224|n>>12),this.buffer_.push(128|63&n>>6),this.buffer_.push(128|63&n);return this.buffer_.length-r},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop(),t=this.totalLength_+this.encoder_.length()-t;for(goog.asserts.assert(0<=t);127>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,r){this.appendUint8Array_(e.subarray(t,r))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,r){null!=e&&null!=t&&null!=r&&this.writeSerializedMessage(e,t,r)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(0==this.bookmarks_.length);for(var t=new Uint8Array(this.totalLength_+this.encoder_.length()),r=this.blocks_,a=r.length,n=0,o=0,s;o=-jspb.BinaryConstants.TWO_TO_31&&t=-jspb.BinaryConstants.TWO_TO_31&&r=-jspb.BinaryConstants.TWO_TO_63&&t=-jspb.BinaryConstants.TWO_TO_31&&t=-jspb.BinaryConstants.TWO_TO_63&&t=-jspb.BinaryConstants.TWO_TO_63&&+t=-jspb.BinaryConstants.TWO_TO_31&&t=-jspb.BinaryConstants.TWO_TO_63&&t=-jspb.BinaryConstants.TWO_TO_31&&tjspb.BinaryIterator.instanceCache_.length&&jspb.BinaryIterator.instanceCache_.push(this)},jspb.BinaryIterator.prototype.clear=function(){this.decoder_&&this.decoder_.free(),this.elements_=this.nextMethod_=this.decoder_=null,this.cursor_=0,this.nextValue_=null,this.atEnd_=!0},jspb.BinaryIterator.prototype.get=function(){return this.nextValue_},jspb.BinaryIterator.prototype.atEnd=function(){return this.atEnd_},jspb.BinaryIterator.prototype.next=function(){var e=this.nextValue_;return this.decoder_?this.decoder_.atEnd()?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.nextMethod_.call(this.decoder_):this.elements_&&(this.cursor_==this.elements_.length?(this.nextValue_=null,this.atEnd_=!0):this.nextValue_=this.elements_[this.cursor_++]),e},jspb.BinaryDecoder=function(e,t,r){this.bytes_=null,this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,r)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,r){if(jspb.BinaryDecoder.instanceCache_.length){var a=jspb.BinaryDecoder.instanceCache_.pop();return e&&a.setBlock(e,t,r),a}return new jspb.BinaryDecoder(e,t,r)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,r){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=goog.isDef(t)?t:0,this.end_=goog.isDef(r)?this.start_+r:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64_=function(){for(var e=0,t=0,r,n;4>t;t++)if(r=this.bytes_[this.cursor_++],e|=(127&r)<<7*t,128>r)return this.tempLow_=e>>>0,void(this.tempHigh_=0);if(r=this.bytes_[this.cursor_++],e|=(127&r)<<28,n=0|(127&r)>>4,128>r)this.tempLow_=e>>>0,this.tempHigh_=n>>>0;else{for(t=0;5>t;t++)if(r=this.bytes_[this.cursor_++],n|=(127&r)<<7*t+3,128>r)return this.tempLow_=e>>>0,void(this.tempHigh_=n>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0}},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t;t=e[this.cursor_+0];var r=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+1],r|=(127&t)<<7,128>t)?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+2],r|=(127&t)<<14,128>t)?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+3],r|=(127&t)<<21,128>t)?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),r):(t=e[this.cursor_+4],r|=(15&t)<<28,128>t)?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),r>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),r)},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64_(),jspb.utils.joinUint64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64_(),jspb.utils.joinUnsignedDecimalString(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64_(),jspb.utils.joinInt64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64_(),jspb.utils.joinSignedDecimalString(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64_(),jspb.utils.joinZigzag64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],a=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|r<<16|a<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],a=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|r<<16|a<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(t){var r=this.bytes_,n=this.cursor_;t=n+t;for(var o=[],s="",i;ni)o.push(i);else if(192>i)continue;else if(224>i){var d=r[n++];o.push((31&i)<<6|63&d)}else if(240>i){var d=r[n++],p=r[n++];o.push((15&i)<<12|(63&d)<<6|63&p)}else if(248>i){var d=r[n++],p=r[n++],l=r[n++],i=(7&i)<<18|(63&d)<<12|(63&p)<<6|63&l,i=i-65536;o.push((1023&i>>10)+55296,(1023&i)+56320)}8192<=o.length&&(s+=_StringfromCharCode4.apply(null,o),o.length=0)}return s+=goog.crypt.byteArrayToString(o),this.cursor_=n,s},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64_(),jspb.utils.joinHash64(this.tempLow_,this.tempHigh_)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var t=this.bytes_,r=this.cursor_,n=t[r+0],o=t[r+1],s=t[r+2],e=t[r+3],i=t[r+4],d=t[r+5],p=t[r+6],t=t[r+7];return this.cursor_+=8,_StringfromCharCode4(n,o,s,e,i,d,p,t)},jspb.BinaryReader=function(e,t,r){this.decoder_=jspb.BinaryDecoder.alloc(e,t,r),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,r){if(jspb.BinaryReader.instanceCache_.length){var a=jspb.BinaryReader.instanceCache_.pop();return e&&a.decoder_.setBlock(e,t,r),a}return new jspb.BinaryReader(e,t,r)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,r){this.decoder_.setBlock(e,t,r),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3,e=7&e;return e!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type"),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_==jspb.BinaryConstants.WireType.VARINT?this.decoder_.skipVarint():(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField())},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32?this.decoder_.advance(4):(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField())},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64?this.decoder_.advance(8):(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField())},jspb.BinaryReader.prototype.skipGroup=function(){var e=[this.nextField_];do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP)e.push(this.nextField_);else if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP&&this.nextField_!=e.pop()){goog.asserts.fail("Unmatched end-group tag"),this.error_=!0;break}}while(0r;r++)if(7=parseInt(t[r],16)&&e[r].toLowerCase()!==e[r])return!1;return!0},u=function(e){e=o.encode(e);var t="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(var r=0;rs.length?"0"+s:s}return"0x"+t},f=function(e){if(r.isNull(e)||r.isUndefined(e))return e;if(!isFinite(e)&&!b(e))throw new Error("Given input \""+e+"\" is not a number.");var t=p(e),n=t.toString(16);return t.lt(new a(0))?"-0x"+n.substr(1):"0x"+n},y=function(e){if(e=e.toString(16),!b(e))throw new Error("Given value \""+e+"\" is not a valid hex string.");e=e.replace(/^0x/i,"");for(var t=[],r=0;re?"int256":"uint256":f(e)},hexToBytes:y,bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},isHex:function(e){return(r.isString(e)||r.isNumber(e))&&/^(-0x|0x)?[0-9a-f]*$/i.test(e)},isHexStrict:b,leftPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+Array(n).join(r?r:"0")+e},rightPad:function(e,t,r){var a=/^0x/i.test(e)||"number"==typeof e;e=e.toString(16).replace(/^0x/i,"");var n=0<=t-e.length+1?t-e.length+1:0;return(a?"0x":"")+e+Array(n).join(r?r:"0")},toTwosComplement:function(e){return"0x"+p(e).toTwos(256).toString(16,64)},sha3:g}},{"bn.js":365,"eth-lib/lib/hash":336,"number-to-bn":358,underscore:363,utf8:364}],369:[function(e,t,r){var a=e("google-protobuf"),n=a,o=Function("return this")();n.exportSymbol("proto.AccountGasLimit",null,o),n.exportSymbol("proto.BlackList",null,o),n.exportSymbol("proto.Block",null,o),n.exportSymbol("proto.BlockBody",null,o),n.exportSymbol("proto.BlockHeader",null,o),n.exportSymbol("proto.BlockTxs",null,o),n.exportSymbol("proto.BlockWithProof",null,o),n.exportSymbol("proto.CompactBlock",null,o),n.exportSymbol("proto.CompactBlockBody",null,o),n.exportSymbol("proto.Crypto",null,o),n.exportSymbol("proto.Proof",null,o),n.exportSymbol("proto.ProofType",null,o),n.exportSymbol("proto.RichStatus",null,o),n.exportSymbol("proto.SignedTransaction",null,o),n.exportSymbol("proto.StateSignal",null,o),n.exportSymbol("proto.Status",null,o),n.exportSymbol("proto.Transaction",null,o),n.exportSymbol("proto.UnverifiedTransaction",null,o),proto.Proof=function(e){a.Message.initialize(this,e,0,-1,null,null)},n.inherits(proto.Proof,a.Message),n.DEBUG&&!COMPILED&&(proto.Proof.displayName="proto.Proof"),a.Message.GENERATE_TO_OBJECT&&(proto.Proof.prototype.toObject=function(e){return proto.Proof.toObject(e,this)},proto.Proof.toObject=function(e,t){var r={content:t.getContent_asB64(),type:a.Message.getFieldWithDefault(t,2,0)};return e&&(r.$jspbMessageInstance=t),r}),proto.Proof.deserializeBinary=function(e){var t=new a.BinaryReader(e),r=new proto.Proof;return proto.Proof.deserializeBinaryFromReader(r,t)},proto.Proof.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();){var r=t.getFieldNumber();switch(r){case 1:var a=t.readBytes();e.setContent(a);break;case 2:var a=t.readEnum();e.setType(a);break;default:t.skipField();}}return e},proto.Proof.prototype.serializeBinary=function(){var e=new a.BinaryWriter;return proto.Proof.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.Proof.serializeBinaryToWriter=function(e,t){var r;r=e.getContent_asU8(),0; + getTxHashesList_asU8(): Array; + getTxHashesList_asB64(): Array; + setTxHashesList(value: Array): void; + addTxHashes(value: Uint8Array | string, index?: number): Uint8Array | string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CompactBlockBody.AsObject; + static toObject(includeInstance: boolean, msg: CompactBlockBody): CompactBlockBody.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CompactBlockBody, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CompactBlockBody; + static deserializeBinaryFromReader(message: CompactBlockBody, reader: jspb.BinaryReader): CompactBlockBody; +} + +export namespace CompactBlockBody { + export type AsObject = { + txHashesList: Array, + } +} + export class Block extends jspb.Message { getVersion(): number; setVersion(value: number): void; @@ -380,6 +404,38 @@ export namespace Block { } } +export class CompactBlock extends jspb.Message { + getVersion(): number; + setVersion(value: number): void; + + hasHeader(): boolean; + clearHeader(): void; + getHeader(): BlockHeader | undefined; + setHeader(value?: BlockHeader): void; + + hasBody(): boolean; + clearBody(): void; + getBody(): CompactBlockBody | undefined; + setBody(value?: CompactBlockBody): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CompactBlock.AsObject; + static toObject(includeInstance: boolean, msg: CompactBlock): CompactBlock.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CompactBlock, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CompactBlock; + static deserializeBinaryFromReader(message: CompactBlock, reader: jspb.BinaryReader): CompactBlock; +} + +export namespace CompactBlock { + export type AsObject = { + version: number, + header?: BlockHeader.AsObject, + body?: CompactBlockBody.AsObject, + } +} + export class BlockWithProof extends jspb.Message { hasBlk(): boolean; clearBlk(): void; @@ -493,7 +549,7 @@ export enum ProofType { } export enum Crypto { - SECP = 0, - SM2 = 1, + DEFAULT = 0, + RESERVED = 1, } diff --git a/packages/cita-signer/proto-js/blockchain_pb.js b/packages/cita-signer/proto-js/blockchain_pb.js index 81681ce..f3055ea 100644 --- a/packages/cita-signer/proto-js/blockchain_pb.js +++ b/packages/cita-signer/proto-js/blockchain_pb.js @@ -18,6 +18,8 @@ goog.exportSymbol('proto.BlockBody', null, global); goog.exportSymbol('proto.BlockHeader', null, global); goog.exportSymbol('proto.BlockTxs', null, global); goog.exportSymbol('proto.BlockWithProof', null, global); +goog.exportSymbol('proto.CompactBlock', null, global); +goog.exportSymbol('proto.CompactBlockBody', null, global); goog.exportSymbol('proto.Crypto', null, global); goog.exportSymbol('proto.Proof', null, global); goog.exportSymbol('proto.ProofType', null, global); @@ -2638,6 +2640,193 @@ proto.BlockBody.prototype.clearTransactionsList = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.CompactBlockBody = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.CompactBlockBody.repeatedFields_, null); +}; +goog.inherits(proto.CompactBlockBody, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.CompactBlockBody.displayName = 'proto.CompactBlockBody'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.CompactBlockBody.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.CompactBlockBody.prototype.toObject = function(opt_includeInstance) { + return proto.CompactBlockBody.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.CompactBlockBody} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.CompactBlockBody.toObject = function(includeInstance, msg) { + var f, obj = { + txHashesList: msg.getTxHashesList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.CompactBlockBody} + */ +proto.CompactBlockBody.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.CompactBlockBody; + return proto.CompactBlockBody.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.CompactBlockBody} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.CompactBlockBody} + */ +proto.CompactBlockBody.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addTxHashes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.CompactBlockBody.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.CompactBlockBody.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.CompactBlockBody} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.CompactBlockBody.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTxHashesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes tx_hashes = 1; + * @return {!(Array|Array)} + */ +proto.CompactBlockBody.prototype.getTxHashesList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes tx_hashes = 1; + * This is a type-conversion wrapper around `getTxHashesList()` + * @return {!Array.} + */ +proto.CompactBlockBody.prototype.getTxHashesList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getTxHashesList())); +}; + + +/** + * repeated bytes tx_hashes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTxHashesList()` + * @return {!Array.} + */ +proto.CompactBlockBody.prototype.getTxHashesList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getTxHashesList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.CompactBlockBody.prototype.setTxHashesList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.CompactBlockBody.prototype.addTxHashes = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +proto.CompactBlockBody.prototype.clearTxHashesList = function() { + this.setTxHashesList([]); +}; + + + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -2868,6 +3057,236 @@ proto.Block.prototype.hasBody = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.CompactBlock = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.CompactBlock, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.CompactBlock.displayName = 'proto.CompactBlock'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.CompactBlock.prototype.toObject = function(opt_includeInstance) { + return proto.CompactBlock.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.CompactBlock} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.CompactBlock.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, 0), + header: (f = msg.getHeader()) && proto.BlockHeader.toObject(includeInstance, f), + body: (f = msg.getBody()) && proto.CompactBlockBody.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.CompactBlock} + */ +proto.CompactBlock.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.CompactBlock; + return proto.CompactBlock.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.CompactBlock} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.CompactBlock} + */ +proto.CompactBlock.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setVersion(value); + break; + case 2: + var value = new proto.BlockHeader; + reader.readMessage(value,proto.BlockHeader.deserializeBinaryFromReader); + msg.setHeader(value); + break; + case 3: + var value = new proto.CompactBlockBody; + reader.readMessage(value,proto.CompactBlockBody.deserializeBinaryFromReader); + msg.setBody(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.CompactBlock.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.CompactBlock.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.CompactBlock} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.CompactBlock.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getHeader(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.BlockHeader.serializeBinaryToWriter + ); + } + f = message.getBody(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.CompactBlockBody.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint32 version = 1; + * @return {number} + */ +proto.CompactBlock.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.CompactBlock.prototype.setVersion = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional BlockHeader header = 2; + * @return {?proto.BlockHeader} + */ +proto.CompactBlock.prototype.getHeader = function() { + return /** @type{?proto.BlockHeader} */ ( + jspb.Message.getWrapperField(this, proto.BlockHeader, 2)); +}; + + +/** @param {?proto.BlockHeader|undefined} value */ +proto.CompactBlock.prototype.setHeader = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.CompactBlock.prototype.clearHeader = function() { + this.setHeader(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.CompactBlock.prototype.hasHeader = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional CompactBlockBody body = 3; + * @return {?proto.CompactBlockBody} + */ +proto.CompactBlock.prototype.getBody = function() { + return /** @type{?proto.CompactBlockBody} */ ( + jspb.Message.getWrapperField(this, proto.CompactBlockBody, 3)); +}; + + +/** @param {?proto.CompactBlockBody|undefined} value */ +proto.CompactBlock.prototype.setBody = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.CompactBlock.prototype.clearBody = function() { + this.setBody(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.CompactBlock.prototype.hasBody = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -3663,8 +4082,8 @@ proto.ProofType = { * @enum {number} */ proto.Crypto = { - SECP: 0, - SM2: 1 + DEFAULT: 0, + RESERVED: 1 }; goog.object.extend(exports, proto); diff --git a/packages/cita-signer/src/index.ts b/packages/cita-signer/src/index.ts index 57053d8..04375e4 100644 --- a/packages/cita-signer/src/index.ts +++ b/packages/cita-signer/src/index.ts @@ -187,7 +187,7 @@ const signer = ( const unverifiedTx = new blockchainPb.UnverifiedTransaction() unverifiedTx.setTransaction(tx) - unverifiedTx.setCrypto(blockchainPb.Crypto.SECP) + unverifiedTx.setCrypto(blockchainPb.Crypto.DEFAULT) unverifiedTx.setSignature(sigBytes) const serializedUnverifiedTx = unverifiedTx.serializeBinary()