text: /*! For license information please see 25.27515676.chunk.js.LICENSE.txt */
  (this.webpackJsonpweb3gl=this.webpackJsonpweb3gl||[]).push([[25],{1146:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(792));e.Authereum=i.default;var o=n(r(916));e.AuthereumProvider=o.default;var s=n(r(1267));e.AuthereumSigner=s.default;var a=n(r(915));e.version=a.default,e.default=i.default},1147:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(r(1148)),i=s(r(1151)),o=r(730);function s(t){return t&&t.__esModule?t:{default:t}}var a={ERR_CONNECTION_DESTROYED:o.ERR_CONNECTION_DESTROYED,ERR_CONNECTION_TIMEOUT:o.ERR_CONNECTION_TIMEOUT,ERR_NOT_IN_IFRAME:o.ERR_NOT_IN_IFRAME,ERR_NO_IFRAME_SRC:o.ERR_NO_IFRAME_SRC,connectToChild:n.default,connectToParent:i.default};e.default=a,t.exports=e.default},1148:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(729),i=r(730),o=c(r(910)),s=c(r(1149)),a=c(r(911)),u=c(r(912)),h=c(r(914));function c(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){var e=t.iframe,r=t.methods,c=void 0===r?{}:r,f=t.childOrigin,l=t.timeout,d=t.debug,p=(0,a.default)(d),m=window,v=(0,o.default)(),g=v.destroy,y=v.onDestroy;if(!f){if(!e.src&&!e.srcdoc){var w=new Error("Iframe must have src or srcdoc property defined.");throw w.code=i.ERR_NO_IFRAME_SRC,w}f=(0,s.default)(e.src)}var b="null"===f?"*":f;return{promise:new Promise((function(t,r){var o;void 0!==l&&(o=setTimeout((function(){var t=new Error("Connection to child timed out after ".concat(l,"ms"));t.code=i.ERR_CONNECTION_TIMEOUT,r(t),g()}),l));var s,a,d={},v=function(r){var i=e.contentWindow;if(r.source===i&&r.data.penpal===n.HANDSHAKE)if(r.origin===f){p("Parent: Received handshake, sending reply"),r.source.postMessage({penpal:n.HANDSHAKE_REPLY,methodNames:Object.keys(c)},b);var l={localName:"Parent",local:m,remote:i,originForSending:b,originForReceiving:f};a&&a(),a=(0,u.default)(l,c,p),y(a),s&&s.forEach((function(t){delete d[t]})),s=r.data.methodNames;var v=(0,h.default)(d,l,s,g,p);y(v),clearTimeout(o),t(d)}else p("Parent received handshake from origin ".concat(r.origin," which did not match expected origin ").concat(f))};m.addEventListener(n.MESSAGE,v),p("Parent: Awaiting handshake");var w=setInterval((function(){document.contains(e)||(clearInterval(w),g())}),6e4);y((function(){m.removeEventListener(n.MESSAGE,v),clearInterval(w);var t=new Error("Connection destroyed");t.code=i.ERR_CONNECTION_DESTROYED,r(t)}))})),destroy:g}},t.exports=e.default},1149:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={"http:":"80","https:":"443"},i=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,o=["file:","data:"];e.default=function(t){if(t&&o.find((function(e){return t.startsWith(e)})))return"null";var e,r,s,a=document.location,u=i.exec(t);u?(e=u[1]?u[1]:a.protocol,r=u[2],s=u[4]):(e=a.protocol,r=a.hostname,s=a.port);var h=s&&s!==n[e]?":".concat(s):"";return"".concat(e,"//").concat(r).concat(h)},t.exports=e.default},1150:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=0;e.default=function(){return++n},t.exports=e.default},1151:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(729),i=r(730),o=h(r(910)),s=h(r(912)),a=h(r(914)),u=h(r(911));function h(t){return t&&t.__esModule?t:{default:t}}e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.parentOrigin,r=void 0===e?"*":e,h=t.methods,c=void 0===h?{}:h,f=t.timeout,l=t.debug,d=(0,u.default)(l);if(window===window.top){var p=new Error("connectToParent() must be called within an iframe");throw p.code=i.ERR_NOT_IN_IFRAME,p}var m=(0,o.default)(),v=m.destroy,g=m.onDestroy,y=window,w=y.parent,b=new Promise((function(t,e){var o;void 0!==f&&(o=setTimeout((function(){var t=new Error("Connection to parent timed out after ".concat(f,"ms"));t.code=i.ERR_CONNECTION_TIMEOUT,e(t),v()}),f));var u=function e(i){try{clearTimeout()}catch(p){return}if(i.source===w&&i.data.penpal===n.HANDSHAKE_REPLY)if("*"===r||r===i.origin){d("Child: Received handshake reply"),y.removeEventListener(n.MESSAGE,e);var u={localName:"Child",local:y,remote:w,originForSending:"null"===i.origin?"*":i.origin,originForReceiving:i.origin},h={},f=(0,s.default)(u,c,d);g(f);var l=(0,a.default)(h,u,i.data.methodNames,v,d);g(l),clearTimeout(o),t(h)}else d("Child received handshake reply from origin ".concat(i.origin," which did not match expected origin ").concat(r))};y.addEventListener(n.MESSAGE,u),g((function(){y.removeEventListener(n.MESSAGE,u);var t=new Error("Connection destroyed");t.code=i.ERR_CONNECTION_DESTROYED,e(t)})),d("Child: Sending handshake"),w.postMessage({penpal:n.HANDSHAKE,methodNames:Object.keys(c)},r)}));return{promise:b,destroy:v}},t.exports=e.default},1152:function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,n,o){if("function"!==typeof r)throw new TypeError("The listener must be a function");var a=new s(r,n||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0===--t._eventsCount?t._events=new o:delete t._events[e]}function h(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),h.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)n.call(t,e)&&r.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},h.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n<o;n++)s[n]=r[n].fn;return s},h.prototype.listenerCount=function(t){var e=i?i+t:t,r=this._events[e];return r?r.fn?1:r.length:0},h.prototype.emit=function(t,e,r,n,o,s){var a=i?i+t:t;if(!this._events[a])return!1;var u,h,c=this._events[a],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,n),!0;case 5:return c.fn.call(c.context,e,r,n,o),!0;case 6:return c.fn.call(c.context,e,r,n,o,s),!0}for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];c.fn.apply(c.context,u)}else{var l,d=c.length;for(h=0;h<d;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),f){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,r);break;case 4:c[h].fn.call(c[h].context,e,r,n);break;default:if(!u)for(l=1,u=new Array(f-1);l<f;l++)u[l-1]=arguments[l];c[h].fn.apply(c[h].context,u)}}return!0},h.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},h.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},h.prototype.removeListener=function(t,e,r,n){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return u(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||n&&!s.once||r&&s.context!==r||u(this,o);else{for(var a=0,h=[],c=s.length;a<c;a++)(s[a].fn!==e||n&&!s[a].once||r&&s[a].context!==r)&&h.push(s[a]);h.length?this._events[o]=1===h.length?h[0]:h:u(this,o)}return this},h.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&u(this,e)):(this._events=new o,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=i,h.EventEmitter=h,t.exports=h},1153:function(t,e){t.exports=function(t){return null!=t&&null!=t.constructor&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},1154:function(t,e,r){"use strict";var n=r(244);Object.defineProperty(e,"__esModule",{value:!0});var i=u(r(1155)),o=u(r(1156)),s=u(r(917)),a=u(r(1160));function u(t){return t&&t.__esModule?t:{default:t}}e.default=(0,a.default)((function(t,e){if(e=(0,i.default)(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function a(e){(0,s.default)(t[r++]).apply(void 0,n(e).concat([(0,o.default)(u)]))}function u(n){if(!1!==n){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(n||r===t.length)return e.apply(void 0,[n].concat(o));a(o)}}a([])})),t.exports=e.default},1155:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){function e(){if(null!==t){var e=t;t=null;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}return Object.assign(e,t),e},t.exports=e.default},1156:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}},t.exports=e.default},1157:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,o.isAsync)(t))return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r.pop(),o=t.apply(this,r);return a(o,i)};return(0,n.default)((function(e,r){var n;try{n=t.apply(this,e)}catch(i){return r(i)}if(n&&"function"===typeof n.then)return a(n,r);r(null,n)}))};var n=s(r(1158)),i=s(r(1159)),o=r(917);function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return t.then((function(t){u(e,null,t)}),(function(t){u(e,t&&t.message?t:new Error(t))}))}function u(t,e,r){try{t(e,r)}catch(n){(0,i.default)((function(t){throw t}),n)}}t.exports=e.default},1158:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r.pop();return t.call(this,r,i)}},t.exports=e.default},1159:function(t,e,r){"use strict";(function(t,r){Object.defineProperty(e,"__esModule",{value:!0}),e.fallback=s,e.wrap=a;var n,i=e.hasSetImmediate="function"===typeof t&&t,o=e.hasNextTick="object"===typeof r&&"function"===typeof r.nextTick;function s(t){setTimeout(t,0)}function a(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return t((function(){return e.apply(void 0,n)}))}}n=i?t:o?r.nextTick:s,e.default=a(n)}).call(this,r(141).setImmediate,r(21))},1160:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;if(!e)throw new Error("arity is undefined");function r(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return"function"===typeof i[e-1]?t.apply(this,i):new Promise((function(n,o){i[e-1]=function(t){if(t)return o(t);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];n(r.length>1?r:r[0])},t.apply(r,i)}))}return r},t.exports=e.default},1164:function(t,e,r){var n=r(43).EventEmitter,i=r(136).inherits,o=r(620),s=r(731),a=r(1168),u=r(1195),h=r(1198),c=(r(1199),r(736));function f(t){var e=this;n.call(e),e.setMaxListeners(30),t=t||{};var r={sendAsync:e._handleAsync.bind(e)},i=t.blockTrackerProvider||r;e._blockTracker=t.blockTracker||new s({provider:i,pollingInterval:t.pollingInterval||4e3,setSkipCacheFlag:!0}),e._ready=new h,e.currentBlock=null,e._providers=[]}function l(t){return{number:o.toBuffer(t.number),hash:o.toBuffer(t.hash),parentHash:o.toBuffer(t.parentHash),nonce:o.toBuffer(t.nonce),mixHash:o.toBuffer(t.mixHash),sha3Uncles:o.toBuffer(t.sha3Uncles),logsBloom:o.toBuffer(t.logsBloom),transactionsRoot:o.toBuffer(t.transactionsRoot),stateRoot:o.toBuffer(t.stateRoot),receiptsRoot:o.toBuffer(t.receiptRoot||t.receiptsRoot),miner:o.toBuffer(t.miner),difficulty:o.toBuffer(t.difficulty),totalDifficulty:o.toBuffer(t.totalDifficulty),size:o.toBuffer(t.size),extraData:o.toBuffer(t.extraData),gasLimit:o.toBuffer(t.gasLimit),gasUsed:o.toBuffer(t.gasUsed),timestamp:o.toBuffer(t.timestamp),transactions:t.transactions}}t.exports=f,i(f,n),f.prototype.start=function(){var t=this,e=this;e._ready.go(),e._blockTracker.on("latest",(function(r){e._getBlockByNumber(r,(function(r,n){if(r)t.emit("error",r);else if(n){var i=l(n);e._setCurrentBlock(i),e.emit("rawBlock",n),e.emit("latest",n)}else t.emit("error",new Error("Could not find block"))}))})),e._blockTracker.on("sync",e.emit.bind(e,"sync")),e._blockTracker.on("error",e.emit.bind(e,"error")),e._running=!0,e.emit("start")},f.prototype.stop=function(){var t=this;t._blockTracker.removeAllListeners(),t._running=!1,t.emit("stop")},f.prototype.isRunning=function(){return this._running},f.prototype.addProvider=function(t,e){"number"===typeof e?this._providers.splice(e,0,t):this._providers.push(t),t.setEngine(this)},f.prototype.removeProvider=function(t){var e=this._providers.indexOf(t);if(e<0)throw new Error("Provider not found.");this._providers.splice(e,1)},f.prototype.send=function(t){throw new Error("Web3ProviderEngine does not support synchronous requests.")},f.prototype.sendAsync=function(t,e){var r=this;r._ready.await((function(){Array.isArray(t)?a(t,r._handleAsync.bind(r),e):r._handleAsync(t,e)}))},f.prototype._getBlockByNumber=function(t,e){var r=c({method:"eth_getBlockByNumber",params:[t,!1],skipCache:!0});this._handleAsync(r,(function(t,r){return t?e(t):e(null,r.result)}))},f.prototype._handleAsync=function(t,e){var r=this,n=-1,i=null,o=null,s=[];function a(r,n){o=r,i=n,u(s,(function(t,e){t?t(o,i,e):e()}),(function(){var r={id:t.id,jsonrpc:t.jsonrpc,result:i};null!=o?(r.error={message:o.stack||o.message||o,code:-32e3},e(o,r)):e(null,r)}))}!function e(i){if(n+=1,s.unshift(i),n>=r._providers.length)a(new Error('Request for method "'+t.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(t,e,a)}catch(o){a(o)}}()},f.prototype._setCurrentBlock=function(t){this.currentBlock=t,this.emit("block",t)}},1168:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(r(1169)),i=o(r(1194));function o(t){return t&&t.__esModule?t:{default:t}}e.default=(0,n.default)(i.default),t.exports=e.default},1169:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(e,r,o){return t(n.default,e,(0,i.default)(r),o)}};var n=o(r(920)),i=o(r(643));function o(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1173:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,o){(0,n.default)(e)(t,(0,i.default)(r),o)};var n=o(r(926)),i=o(r(643));function o(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1174:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,n.default)(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e=(0,i.default)(t);return e?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(e):function(t){var e=(0,o.default)(t),r=-1,n=e.length;return function(){var i=e[++r];return r<n?{value:t[i],key:i}:null}}(t)};var n=s(r(621)),i=s(r(1175)),o=s(r(795));function s(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1175:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return n&&t[n]&&t[n]()};var n="function"===typeof Symbol&&Symbol.iterator;t.exports=e.default},1191:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)((function(e,r){var i;try{i=t.apply(this,e)}catch(o){return r(o)}(0,n.default)(i)&&"function"===typeof i.then?i.then((function(t){a(r,null,t)}),(function(t){a(r,t.message?t:new Error(t))})):r(null,i)}))};var n=s(r(732)),i=s(r(1192)),o=s(r(1193));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,r){try{t(e,r)}catch(n){(0,o.default)(u,n)}}function u(t){throw t}t.exports=e.default},1192:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){var e=(0,o.default)(arguments),r=e.pop();t.call(this,e,r)}};var n,i=r(734),o=(n=i)&&n.__esModule?n:{default:n};t.exports=e.default},1193:function(t,e,r){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.hasNextTick=e.hasSetImmediate=void 0,e.fallback=c,e.wrap=f;var i,o=r(734),s=(i=o)&&i.__esModule?i:{default:i};var a,u=e.hasSetImmediate="function"===typeof t&&t,h=e.hasNextTick="object"===typeof n&&"function"===typeof n.nextTick;function c(t){setTimeout(t,0)}function f(t){return function(e){var r=(0,s.default)(arguments,1);t((function(){e.apply(null,r)}))}}a=u?t:h?n.nextTick:c,e.default=f(a)}).call(this,r(141).setImmediate,r(21))},1194:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,o){o=o||n.default,e=e||[];var s=[],a=0,u=(0,i.default)(r);t(e,(function(t,e,r){var n=a++;u(t,(function(t,e){s[n]=e,r(t)}))}),(function(t){o(t,s)}))};var n=o(r(603)),i=o(r(643));function o(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1195:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(r(1196)),i=o(r(927));function o(t){return t&&t.__esModule?t:{default:t}}e.default=(0,i.default)(n.default,1),t.exports=e.default},1196:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,s){(0,n.default)(e)(t,(0,i.default)((0,o.default)(r)),s)};var n=s(r(926)),i=s(r(1197)),o=s(r(643));function s(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1197:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(e,r,n){return t(e,n)}},t.exports=e.default},1198:function(t,e,r){var n=r(43).EventEmitter,i=r(136).inherits;function o(){n.call(this),this.isLocked=!0}t.exports=o,i(o,n),o.prototype.go=function(){this.isLocked=!1,this.emit("unlock")},o.prototype.stop=function(){this.isLocked=!0,this.emit("lock")},o.prototype.await=function(t){this.isLocked?this.once("unlock",t):setTimeout(t)}},1199:function(t,e,r){var n=r(735);function i(t){return"never"!==a(t)}function o(t){var e=s(t);return e>=t.params.length?t.params:"eth_getBlockByNumber"===t.method?t.params.slice(1):t.params.slice(0,e)}function s(t){switch(t.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function a(t){switch(t.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}t.exports={cacheIdentifierForPayload:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))return null;var r=e.includeBlockRef,s=r?t.params:o(t);return t.method+":"+n(s)},canCache:i,blockTagForPayload:function(t){var e=s(t);if(e>=t.params.length)return null;return t.params[e]},paramsWithoutBlockTag:o,blockTagParamIndex:s,cacheTypeForPayload:a}},1203:function(t,e){t.exports=function(){var t=(new Date).getTime()*Math.pow(10,3),e=Math.floor(Math.random()*Math.pow(10,3));return t+e}},1204:function(t,e,r){var n=r(1205),i=r(1206),o=r(136).inherits,s=r(620),a=r(798),u=r(138),h=r(801),c=r(802),f=r(1216),l=/^[0-9A-Fa-f]+$/g;function d(t){var e=this;e.nonceLock=h(1),t.getAccounts&&(e.getAccounts=t.getAccounts),t.processTransaction&&(e.processTransaction=t.processTransaction),t.processSignTransaction&&(e.processSignTransaction=t.processSignTransaction),t.processMessage&&(e.processMessage=t.processMessage),t.processPersonalMessage&&(e.processPersonalMessage=t.processPersonalMessage),t.processTypedMessage&&(e.processTypedMessage=t.processTypedMessage),e.approveTransaction=t.approveTransaction||e.autoApprove,e.approveMessage=t.approveMessage||e.autoApprove,e.approvePersonalMessage=t.approvePersonalMessage||e.autoApprove,e.approveTypedMessage=t.approveTypedMessage||e.autoApprove,e.signTransaction=t.signTransaction||v("signTransaction"),e.signMessage=t.signMessage||v("signMessage"),e.signPersonalMessage=t.signPersonalMessage||v("signPersonalMessage"),e.signTypedMessage=t.signTypedMessage||v("signTypedMessage"),t.recoverPersonalSignature&&(e.recoverPersonalSignature=t.recoverPersonalSignature),t.publishTransaction&&(e.publishTransaction=t.publishTransaction),e.estimateGas=t.estimateGas||e.estimateGas,e.getGasPrice=t.getGasPrice||e.getGasPrice}function p(t){return t.toLowerCase()}function m(t){return"string"===typeof t&&("0x"===t.slice(0,2)&&t.slice(2).match(l))}function v(t){return function(e,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+t+'" fn in constructor options'))}}t.exports=d,o(d,c),d.prototype.handleRequest=function(t,e,r){var i,o,a,h,c,f=this;switch(f._parityRequests={},f._parityRequestCount=0,t.method){case"eth_coinbase":return void f.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));case"eth_accounts":return void f.getAccounts((function(t,e){if(t)return r(t);r(null,e)}));case"eth_sendTransaction":return i=t.params[0],void n([function(t){return f.validateTransaction(i,t)},function(t){return f.processTransaction(i,t)}],r);case"eth_signTransaction":return i=t.params[0],void n([function(t){return f.validateTransaction(i,t)},function(t){return f.processSignTransaction(i,t)}],r);case"eth_sign":return c=t.params[0],h=t.params[1],a=t.params[2]||{},o=u(a,{from:c,data:h}),void n([function(t){return f.validateMessage(o,t)},function(t){return f.processMessage(o,t)}],r);case"personal_sign":return function(){var e=t.params[0];if(function(t){var e=s.addHexPrefix(t);return!s.isValidAddress(e)&&m(t)}(t.params[1])&&function(t){var e=s.addHexPrefix(t);return s.isValidAddress(e)}(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),c=t.params[0],h=t.params[1]}else h=t.params[0],c=t.params[1];a=t.params[2]||{},o=u(a,{from:c,data:h}),n([function(t){return f.validatePersonalMessage(o,t)},function(t){return f.processPersonalMessage(o,t)}],r)}();case"personal_ecRecover":return function(){h=t.params[0];var e=t.params[1];a=t.params[2]||{},o=u(a,{sig:e,data:h}),f.recoverPersonalSignature(o,r)}();case"eth_signTypedData":return h=t.params[0],c=t.params[1],a=t.params[2]||{},o=u(a,{from:c,data:h}),void n([function(t){return f.validateTypedMessage(o,t)},function(t){return f.processTypedMessage(o,t)}],r);case"parity_postTransaction":return i=t.params[0],void f.parityPostTransaction(i,r);case"parity_postSign":return c=t.params[0],h=t.params[1],void f.parityPostSign(c,h,r);case"parity_checkRequest":return function(){var e=t.params[0];f.parityCheckRequest(e,r)}();case"parity_defaultAccount":return void f.getAccounts((function(t,e){if(t)return r(t);var n=e[0]||null;r(null,n)}));default:return void e()}},d.prototype.getAccounts=function(t){t(null,[])},d.prototype.processTransaction=function(t,e){var r=this;n([function(e){return r.approveTransaction(t,e)},function(t,e){return r.checkApproval("transaction",t,e)},function(e){return r.finalizeAndSubmitTx(t,e)}],e)},d.prototype.processSignTransaction=function(t,e){var r=this;n([function(e){return r.approveTransaction(t,e)},function(t,e){return r.checkApproval("transaction",t,e)},function(e){return r.finalizeTx(t,e)}],e)},d.prototype.processMessage=function(t,e){var r=this;n([function(e){return r.approveMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signMessage(t,e)}],e)},d.prototype.processPersonalMessage=function(t,e){var r=this;n([function(e){return r.approvePersonalMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signPersonalMessage(t,e)}],e)},d.prototype.processTypedMessage=function(t,e){var r=this;n([function(e){return r.approveTypedMessage(t,e)},function(t,e){return r.checkApproval("message",t,e)},function(e){return r.signTypedMessage(t,e)}],e)},d.prototype.autoApprove=function(t,e){e(null,!0)},d.prototype.checkApproval=function(t,e,r){r(e?null:new Error("User denied "+t+" signature."))},d.prototype.parityPostTransaction=function(t,e){var r=this,n=r._parityRequestCount,i="0x".concat(n.toString(16));r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[t]},(function(t,e){if(t)r._parityRequests[i]={error:t};else{var n=e.result;r._parityRequests[i]=n}})),e(null,i)},d.prototype.parityPostSign=function(t,e,r){var n=this,i=n._parityRequestCount,o="0x".concat(i.toString(16));n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[t,e]},(function(t,e){if(t)n._parityRequests[o]={error:t};else{var r=e.result;n._parityRequests[o]=r}})),r(null,o)},d.prototype.parityCheckRequest=function(t,e){var r=this._parityRequests[t]||null;return r?r.error?e(r.error):void e(null,r):e(null,null)},d.prototype.recoverPersonalSignature=function(t,e){var r;try{r=a.recoverPersonalSignature(t)}catch(n){return e(n)}e(null,r)},d.prototype.validateTransaction=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign transaction."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign transaction for this address: "'.concat(t.from,'"')))}))},d.prototype.validateMessage=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign message."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))}))},d.prototype.validatePersonalMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign personal message.")):void 0===t.data?e(new Error("Undefined message - message required to sign personal message.")):m(t.data)?void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))})):e(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},d.prototype.validateTypedMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign typed data.")):void 0===t.data?e(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error('Unknown address - unable to sign message for this address: "'.concat(t.from,'"')))}))},d.prototype.validateSender=function(t,e){if(!t)return e(null,!1);this.getAccounts((function(r,n){if(r)return e(r);var i=-1!==n.map(p).indexOf(t.toLowerCase());e(null,i)}))},d.prototype.finalizeAndSubmitTx=function(t,e){var r=this;r.nonceLock.take((function(){n([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(t,n){if(r.nonceLock.leave(),t)return e(t);e(null,n)}))}))},d.prototype.finalizeTx=function(t,e){var r=this;r.nonceLock.take((function(){n([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r)],(function(n,i){if(r.nonceLock.leave(),n)return e(n);e(null,{raw:i,tx:t})}))}))},d.prototype.publishTransaction=function(t,e){this.emitPayload({method:"eth_sendRawTransaction",params:[t]},(function(t,r){if(t)return e(t);e(null,r.result)}))},d.prototype.estimateGas=function(t,e){f(this.engine,t,e)},d.prototype.getGasPrice=function(t){this.emitPayload({method:"eth_gasPrice",params:[]},(function(e,r){if(e)return t(e);t(null,r.result)}))},d.prototype.fillInTxExtras=function(t,e){var r=this,n=t.from,o={};void 0===t.gasPrice&&(o.gasPrice=r.getGasPrice.bind(r)),void 0===t.nonce&&(o.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===t.gas&&(o.gas=r.estimateGas.bind(r,function(t){return{from:t.from,to:t.to,value:t.value,data:t.data,gas:t.gas,gasPrice:t.gasPrice,nonce:t.nonce}}(t))),i(o,(function(r,n){if(r)return e(r);var i={};n.gasPrice&&(i.gasPrice=n.gasPrice),n.nonce&&(i.nonce=n.nonce.result),n.gas&&(i.gas=n.gas),e(null,u(t,i))}))}},1205:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(e=(0,o.default)(e||i.default),!(0,n.default)(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function h(e){var n=(0,u.default)(t[r++]);e.push((0,a.default)(c)),n.apply(null,e)}function c(n){if(n||r===t.length)return e.apply(null,arguments);h((0,s.default)(arguments,1))}h([])};var n=h(r(733)),i=h(r(603)),o=h(r(794)),s=h(r(734)),a=h(r(797)),u=h(r(643));function h(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1206:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){(0,i.default)(n.default,t,e)};var n=o(r(920)),i=o(r(1207));function o(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1207:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){r=r||n.default;var a=(0,i.default)(e)?[]:{};t(e,(function(t,e,r){(0,s.default)(t)((function(t,n){arguments.length>2&&(n=(0,o.default)(arguments,1)),a[e]=n,r(t)}))}),(function(t){r(t,a)}))};var n=a(r(603)),i=a(r(621)),o=a(r(734)),s=a(r(643));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1216:function(t,e,r){var n=r(736);t.exports=function(t,e,r){t.sendAsync(n({method:"eth_estimateGas",params:[e]}),(function(t,e){if(t)return"no contract code at given address"===t.message?r(null,"0xcf08"):r(t);r(null,e.result)}))}},1217:function(t,e,r){(function(e){var n=e.browser?r(252):r(1218),i=r(136).inherits,o=r(736),s=r(802),a=r(1219).errors;function u(t){this.rpcUrl=t.rpcUrl}t.exports=u,i(u,s),u.prototype.handleRequest=function(t,e,r){var i=this.rpcUrl,s=o(t);n({uri:i,method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s),rejectUnauthorized:!1,timeout:2e4},(function(t,e,n){if(t)return r(a.internal(t));switch(e.statusCode){case 405:return r(a.methodNotFound());case 504:return r(a.internal("Gateway timeout. The request took too long to process. This can happen when querying logs over too wide a block range."));case 429:return function(){var t=new Error("Too Many Requests");return r(a.internal(t))}();default:if(200!=e.statusCode)return r(a.internal(e.body))}var i;try{i=JSON.parse(n)}catch(t){return console.error(t.stack),r(a.internal(t))}if(i.error)return r(i.error);r(null,i.result)}))}}).call(this,r(21))},1218:function(t,e){},1219:function(t,e,r){var n=r(803),i=n.JsonRpcError,o=n.EthJsonRpcError,s=r(928),a=s.serializeError,u=s.getMessageFromCode,h=r(1221),c=r(804);t.exports={errors:h,JsonRpcError:i,EthJsonRpcError:o,serializeError:a,getMessageFromCode:u,ERROR_CODES:c}},1220:function(t){t.exports=JSON.parse('{"4001":{"standard":"EIP 1193","message":"User rejected the request."},"4100":{"standard":"EIP 1193","message":"The requested account and/or method has not been authorized by the user."},"4200":{"standard":"EIP 1193","message":"The requested method is not supported by this Ethereum provider."},"-32700":{"standard":"JSON RPC 2.0","message":"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{"standard":"JSON RPC 2.0","message":"The JSON sent is not a valid Request object."},"-32601":{"standard":"JSON RPC 2.0","message":"The method does not exist / is not available."},"-32602":{"standard":"JSON RPC 2.0","message":"Invalid method parameter(s)."},"-32603":{"standard":"JSON RPC 2.0","message":"Internal JSON-RPC error."}}')},1221:function(t,e,r){var n=r(803),i=n.JsonRpcError,o=n.EthJsonRpcError,s=r(928).getMessageFromCode,a=r(804);function u(t,e,r){return new i(t,e||s(t),r)}function h(t,e,r){return new o(t,e||s(t),r)}t.exports={parse:function(t,e){return u(a.jsonRpc.parse,t,e)},invalidRequest:function(t,e){return u(a.jsonRpc.invalidRequest,t,e)},invalidParams:function(t,e){return u(a.jsonRpc.invalidParams,t,e)},methodNotFound:function(t,e){return u(a.jsonRpc.methodNotFound,t,e)},internal:function(t,e){return u(a.jsonRpc.internal,t,e)},server:function(t,e,r){if(!Number.isInteger(t)||t>-32e3||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32000');return u(t,e,r)},eth:{userRejectedRequest:function(t,e){return h(a.eth.userRejectedRequest,t,e)},unauthorized:function(t,e){return h(a.eth.unauthorized,t,e)},unsupportedMethod:function(t,e){return h(a.eth.unsupportedMethod,t,e)},custom:function(t,e,r){if(!e||"string"!==typeof e)throw new Error('"message" must be a nonempty string');return new o(t,e,r)}}}},1222:function(t,e,r){var n=r(41),i=r(94),o=r(95),s=r(929),a=r(739),u=function(t){"use strict";i(r,t);var e=o(r);function r(){return n(this,r),e.call(this,(function(t){var e=t.blockTracker,r=t.provider,n=t.engine,i=a({blockTracker:e,provider:r}),o=i.events,s=i.middleware;return o.on("notification",(function(t){return n.emit("data",null,t)})),s}))}return r}(s);t.exports=u},1235:function(t,e,r){var n=r(41),i=r(94),o=r(95),s=r(929),a=r(741),u=function(t){"use strict";i(r,t);var e=o(r);function r(){return n(this,r),e.call(this,(function(t){var e=t.blockTracker,r=t.provider;t.engine;return a({blockTracker:e,provider:r})}))}return r}(s);t.exports=u},1236:function(t,e,r){"use strict";var n=function(t,e){return function(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var s=e.promiseModule;return new s((function(n,o){e.multiArgs?i.push((function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.errorFirst?r[0]?o(r):(r.shift(),n(r)):n(r)})):e.errorFirst?i.push((function(t,e){t?o(t):n(e)})):i.push(n),t.apply(r,i)}))}};t.exports=function(t,e){e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);var r=typeof t;if(null===t||"object"!==r&&"function"!==r)throw new TypeError("Expected `input` to be a `Function` or `Object`, got `".concat(null===t?"null":r,"`"));var i,o=function(t){var r=function(e){return"string"===typeof e?t===e:e.test(t)};return e.include?e.include.some(r):!e.exclude.some(r)};for(var s in i="function"===r?function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e.excludeMain?t.apply(void 0,i):n(t,e).apply(this,i)}:Object.create(Object.getPrototypeOf(t)),t){var a=t[s];i[s]="function"===typeof a&&o(s)?n(a,e):a}return i}},1237:function(t,e,r){var n=r(809),i=r(255),o=r(935),s=r(1240),a=r(1241),u=function t(e,r){var i=[];return r.forEach((function(r){if("object"===typeof r.components){if("tuple"!==r.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var o="",s=r.type.indexOf("[");s>=0&&(o=r.type.substring(s));var a=t(e,r.components);n.isArray(a)&&e?i.push("tuple("+a.join(",")+")"+o):e?i.push("("+a+")"):i.push("("+a.join(",")+")"+o)}else i.push(r.type)})),i},h=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(t.substr(r,2),16);e+=String.fromCharCode(i)}return e},c=function(t){if(!t)return"0x00";for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r).toString(16);e+=n.length<2?"0"+n:n}return"0x"+e},f=function(t){if(t=t?t.toLowerCase():"ether",!i.unitMap[t])throw new Error('This unit "'+t+"\" doesn't exist, please use the one of the following units"+JSON.stringify(i.unitMap,null,2));return t};t.exports={_fireError:function(t,e,r,i){return!n.isObject(t)||t instanceof Error||!t.data||((n.isObject(t.data)||n.isArray(t.data))&&(t.data=JSON.stringify(t.data,null,2)),t=t.message+"\n"+t.data),n.isString(t)&&(t=new Error(t)),n.isFunction(i)&&i(t),n.isFunction(r)&&((e&&n.isFunction(e.listeners)&&e.listeners("error").length||n.isFunction(i))&&e.catch((function(){})),setTimeout((function(){r(t)}),1)),e&&n.isFunction(e.emit)&&setTimeout((function(){e.emit("error",t),e.removeAllListeners()}),1),e},_jsonInterfaceMethodToString:function(t){return n.isObject(t)&&t.name&&-1!==t.name.indexOf("(")?t.name:t.name+"("+u(!1,t.inputs).join(",")+")"},_flattenTypes:u,randomHex:a,_:n,BN:o.BN,isBN:o.isBN,isBigNumber:o.isBigNumber,isHex:o.isHex,isHexStrict:o.isHexStrict,sha3:o.sha3,keccak256:o.sha3,soliditySha3:s,isAddress:o.isAddress,checkAddressChecksum:o.checkAddressChecksum,toChecksumAddress:function(t){if("undefined"===typeof t)return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(t))throw new Error('Given address "'+t+'" is not a valid Ethereum address.');t=t.toLowerCase().replace(/^0x/i,"");for(var e=o.sha3(t).replace(/^0x/i,""),r="0x",n=0;n<t.length;n++)parseInt(e[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:h,toAscii:h,asciiToHex:c,fromAscii:c,unitMap:i.unitMap,toWei:function(t,e){if(e=f(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.toWei(t,e):i.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=f(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.fromWei(t,e):i.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement}},1238:function(t,e){},1239:function(t,e){var r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[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(t){var e,r,n,i,s,a,u,h,c,f,l,d,p,m,v,g,y,w,b,_,M,E,A,x,k,S,T,I,P,N,R,C,L,O,B,D,U,j,F,K,G,V,H,z,q,W,Z,Y,J,$,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|c>>>31),r=s^(c<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(f<<1|l>>>31),r=u^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=c^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(i<<1|s>>>31),r=l^(s<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],W=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,B=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,k=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,j=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,z=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,K=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~g&w,t[1]=v^~y&b,t[10]=x^~S&I,t[11]=k^~T&P,t[20]=O^~D&j,t[21]=B^~U&F,t[30]=z^~W&Y,t[31]=q^~Z&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=g^~w&_,t[3]=y^~b&M,t[12]=S^~I&N,t[13]=T^~P&R,t[22]=D^~j&K,t[23]=U^~F&G,t[32]=W^~Y&$,t[33]=Z^~J&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=w^~_&E,t[5]=b^~M&A,t[14]=I^~N&C,t[15]=P^~R&L,t[24]=j^~K&V,t[25]=F^~G&H,t[34]=Y^~$&Q,t[35]=J^~X&tt,t[44]=ot^~at&ht,t[45]=st^~ut&ct,t[6]=_^~E&m,t[7]=M^~A&v,t[16]=N^~C&x,t[17]=R^~L&k,t[26]=K^~V&O,t[27]=G^~H&B,t[36]=$^~Q&z,t[37]=X^~tt&q,t[46]=at^~ht&et,t[47]=ut^~ct&rt,t[8]=E^~m&g,t[9]=A^~v&y,t[18]=C^~x&S,t[19]=L^~k&T,t[28]=V^~O&D,t[29]=H^~B&U,t[38]=Q^~z&W,t[39]=tt^~q&Z,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},a=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var a=2,u=e.length;a<u;a+=2)o.push(parseInt(e.slice(a,a+2),16))}else o=e;return function(t,e){for(var o,a=e.length,u=t.blocks,h=t.blockCount<<2,c=t.blockCount,f=t.outputBlocks,l=t.s,d=0;d<a;){if(t.reset)for(t.reset=!1,u[0]=t.block,v=1;v<c+1;++v)u[v]=0;if("string"!==typeof e)for(v=t.start;d<a&&v<h;++d)u[v>>2]|=e[d]<<i[3&v++];else for(v=t.start;d<a&&v<h;++d)(o=e.charCodeAt(d))<128?u[v>>2]|=o<<i[3&v++]:o<2048?(u[v>>2]|=(192|o>>6)<<i[3&v++],u[v>>2]|=(128|63&o)<<i[3&v++]):o<55296||o>=57344?(u[v>>2]|=(224|o>>12)<<i[3&v++],u[v>>2]|=(128|o>>6&63)<<i[3&v++],u[v>>2]|=(128|63&o)<<i[3&v++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++d)),u[v>>2]|=(240|o>>18)<<i[3&v++],u[v>>2]|=(128|o>>12&63)<<i[3&v++],u[v>>2]|=(128|o>>6&63)<<i[3&v++],u[v>>2]|=(128|63&o)<<i[3&v++]);if(t.lastByteIndex=v,v>=h){for(t.start=v-h,t.block=u[c],v=0;v<c;++v)l[v]^=u[v];s(l),t.reset=!0}else t.start=v}if(u[(v=t.lastByteIndex)>>2]|=n[3&v],t.lastByteIndex===h)for(u[0]=u[c],v=1;v<c+1;++v)u[v]=0;for(u[c-1]|=2147483648,v=0;v<c;++v)l[v]^=u[v];s(l);for(var p,m="",v=0,g=0;g<f;){for(v=0;v<c&&g<f;++v,++g)p=l[v],m+=r[p>>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%c===0&&(s(l),v=0)}return"0x"+m}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:a(256),keccak512:a(512),keccak256s:a(256),keccak512s:a(512)}},1240:function(t,e,r){var n=r(809),i=r(936),o=r(935),s=function(t){var e=typeof t;if("string"===e)return o.isHexStrict(t)?new i(t.replace(/0x/i,""),16):new i(t,10);if("number"===e)return new i(t);if(o.isBigNumber(t))return new i(t.toString(10));if(o.isBN(t))return t;throw new Error(t+" is not a number")},a=function(t,e,r){var n,a,u;if("bytes"===(t=(u=t).startsWith("int[")?"int256"+u.slice(3):"int"===u?"int256":u.startsWith("uint[")?"uint256"+u.slice(4):"uint"===u?"uint256":u.startsWith("fixed[")?"fixed128x128"+u.slice(5):"fixed"===u?"fixed128x128":u.startsWith("ufixed[")?"ufixed128x128"+u.slice(6):"ufixed"===u?"ufixed128x128":u)){if(e.replace(/^0x/i,"").length%2!==0)throw new Error("Invalid bytes characters "+e.length);return e}if("string"===t)return o.utf8ToHex(e);if("bool"===t)return e?"01":"00";if(t.startsWith("address")){if(n=r?64:40,!o.isAddress(e))throw new Error(e+" is not a valid address, or the checksum is invalid.");return o.leftPad(e.toLowerCase(),n)}if(n=function(t){var e=/^\D+(\d+).*$/.exec(t);return e?parseInt(e[1],10):null}(t),t.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n<e.replace(/^0x/i,"").length/2)throw new Error("Invalid bytes"+n+" for "+e);return o.rightPad(e,2*n)}if(t.startsWith("uint")){if(n%8||n<8||n>256)throw new Error("Invalid uint"+n+" size");if((a=s(e)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+a.bitLength());if(a.lt(new i(0)))throw new Error("Supplied uint "+a.toString()+" is negative");return n?o.leftPad(a.toString("hex"),n/8*2):a}if(t.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((a=s(e)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+a.bitLength());return a.lt(new i(0))?a.toTwos(n).toString("hex"):n?o.leftPad(a.toString("hex"),n/8*2):a}throw new Error("Unsupported or invalid type: "+t)},u=function(t){if(n.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,s="";if(n.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,s=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),s=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!==typeof s||/^(-)?0x/i.test(s)||(s=new i(s)),n.isArray(s)){if((r=function(t){var e=/^\D+\d*\[(\d+)\]$/.exec(t);return e?parseInt(e[1],10):null}(e))&&s.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(s));r=s.length}return n.isArray(s)?s.map((function(t){return a(e,t,r).toString("hex").replace("0x","")})).join(""):a(e,s,r).toString("hex").replace("0x","")};t.exports=function(){var t=Array.prototype.slice.call(arguments),e=n.map(t,u);return o.sha3("0x"+e.join(""))}},1241:function(t,e,r){t.exports=function(t,e){var n=r(1242),i="function"===typeof e;if(t>65536){if(!i)throw new Error("Requested too many random bytes.");e(new Error("Requested too many random bytes."))}if("undefined"!==typeof n&&n.randomBytes){if(!i)return"0x"+n.randomBytes(t).toString("hex");n.randomBytes(t,(function(t,r){t?e(u):e(null,"0x"+r.toString("hex"))}))}else{var o;if("undefined"!==typeof n?o=n:"undefined"!==typeof msCrypto&&(o=msCrypto),o&&o.getRandomValues){var s=o.getRandomValues(new Uint8Array(t)),a="0x"+Array.from(s).map((function(t){return t.toString(16)})).join("");if(!i)return a;e(null,a)}else{var u=new Error('No "crypto" object available. This Browser doesn\'t support generating secure random bytes.');if(!i)throw u;e(u)}}}},1242:function(t,e,r){t.exports=r(1243)},1243:function(t,e){t.exports=window.crypto},1244:function(t,e,r){(function(e){var n=r(1245),i=r(1251);t.exports=function(t){if(!e.isBuffer(t)){if("string"!==typeof t)throw new Error("Expected Buffer or string as argument");t="0x"===t.slice(0,2)?t.slice(2):t,t=e.from(t,"hex")}return i(n(t))}}).call(this,r(8).Buffer)},1245:function(t,e,r){(function(e){var n=r(938).publicKeyCreate;t.exports=function(t){if(!e.isBuffer(t)){if("string"!==typeof t)throw new Error("Expected Buffer or string as argument");t="0x"===t.slice(0,2)?t.slice(2):t,t=e.from(t,"hex")}return n(t,!1)}}).call(this,r(8).Buffer)},1246:function(t,e,r){"use strict";var n=r(1247),i=r(1248),o=r(939);function s(t,e){return void 0===t?e:(n.isBoolean(t,o.COMPRESSED_TYPE_INVALID),t)}t.exports=function(t){return{privateKeyVerify:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),32===e.length&&t.privateKeyVerify(e)},privateKeyExport:function(e,r){n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=s(r,!0);var a=t.privateKeyExport(e,r);return i.privateKeyExport(e,a,r)},privateKeyImport:function(e){if(n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),(e=i.privateKeyImport(e))&&32===e.length&&t.privateKeyVerify(e))return e;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.privateKeyNegate(e)},privateKeyModInverse:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.privateKeyModInverse(e)},privateKeyTweakAdd:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),t.privateKeyTweakAdd(e,r)},privateKeyTweakMul:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),t.privateKeyTweakMul(e,r)},publicKeyCreate:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=s(r,!0),t.publicKeyCreate(e,r)},publicKeyConvert:function(e,r){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=s(r,!0),t.publicKeyConvert(e,r)},publicKeyVerify:function(e){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),t.publicKeyVerify(e)},publicKeyTweakAdd:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=s(i,!0),t.publicKeyTweakAdd(e,r,i)},publicKeyTweakMul:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=s(i,!0),t.publicKeyTweakMul(e,r,i)},publicKeyCombine:function(e,r){n.isArray(e,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(e,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i<e.length;++i)n.isBuffer(e[i],o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e[i],33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID);return r=s(r,!0),t.publicKeyCombine(e,r)},signatureNormalize:function(e){return n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(e,64,o.ECDSA_SIGNATURE_LENGTH_INVALID),t.signatureNormalize(e)},signatureExport:function(e){n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(e,64,o.ECDSA_SIGNATURE_LENGTH_INVALID);var r=t.signatureExport(e);return i.signatureExport(r)},signatureImport:function(e){n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(e,o.ECDSA_SIGNATURE_LENGTH_INVALID);var r=i.signatureImport(e);if(r)return t.signatureImport(r);throw new Error(o.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(e){n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(e,o.ECDSA_SIGNATURE_LENGTH_INVALID);var r=i.signatureImportLax(e);if(r)return t.signatureImport(r);throw new Error(o.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(e,r,i){n.isBuffer(e,o.MSG32_TYPE_INVALID),n.isBufferLength(e,32,o.MSG32_LENGTH_INVALID),n.isBuffer(r,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,o.EC_PRIVATE_KEY_LENGTH_INVALID);var s=null,a=null;return void 0!==i&&(n.isObject(i,o.OPTIONS_TYPE_INVALID),void 0!==i.data&&(n.isBuffer(i.data,o.OPTIONS_DATA_TYPE_INVALID),n.isBufferLength(i.data,32,o.OPTIONS_DATA_LENGTH_INVALID),s=i.data),void 0!==i.noncefn&&(n.isFunction(i.noncefn,o.OPTIONS_NONCEFN_TYPE_INVALID),a=i.noncefn)),t.sign(e,r,a,s)},verify:function(e,r,i){return n.isBuffer(e,o.MSG32_TYPE_INVALID),n.isBufferLength(e,32,o.MSG32_LENGTH_INVALID),n.isBuffer(r,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,o.ECDSA_SIGNATURE_LENGTH_INVALID),n.isBuffer(i,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(i,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),t.verify(e,r,i)},recover:function(e,r,i,a){return n.isBuffer(e,o.MSG32_TYPE_INVALID),n.isBufferLength(e,32,o.MSG32_LENGTH_INVALID),n.isBuffer(r,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,o.ECDSA_SIGNATURE_LENGTH_INVALID),n.isNumber(i,o.RECOVERY_ID_TYPE_INVALID),n.isNumberInInterval(i,-1,4,o.RECOVERY_ID_VALUE_INVALID),a=s(a,!0),t.recover(e,r,i,a)},ecdh:function(e,r){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.ecdh(e,r)},ecdhUnsafe:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),i=s(i,!0),t.ecdhUnsafe(e,r,i)}}}},1247:function(t,e,r){"use strict";(function(t){var r=Object.prototype.toString;e.isArray=function(t,e){if(!Array.isArray(t))throw TypeError(e)},e.isBoolean=function(t,e){if("[object Boolean]"!==r.call(t))throw TypeError(e)},e.isBuffer=function(e,r){if(!t.isBuffer(e))throw TypeError(r)},e.isFunction=function(t,e){if("[object Function]"!==r.call(t))throw TypeError(e)},e.isNumber=function(t,e){if("[object Number]"!==r.call(t))throw TypeError(e)},e.isObject=function(t,e){if("[object Object]"!==r.call(t))throw TypeError(e)},e.isBufferLength=function(t,e,r){if(t.length!==e)throw RangeError(r)},e.isBufferLength2=function(t,e,r,n){if(t.length!==e&&t.length!==r)throw RangeError(n)},e.isLengthGTZero=function(t,e){if(0===t.length)throw RangeError(e)},e.isNumberInInterval=function(t,e,r,n){if(t<=e||t>=r)throw RangeError(n)}}).call(this,r(8).Buffer)},1248:function(t,e,r){"use strict";var n=r(17).Buffer,i=r(1249),o=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),s=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(t,e,r){var i=n.from(r?o:s);return t.copy(i,r?8:9),e.copy(i,r?181:214),i},e.privateKeyImport=function(t){var e=t.length,r=0;if(!(e<r+1||48!==t[r])&&!(e<(r+=1)+1)&&128&t[r]){var n=127&t[r];if(r+=1,!(n<1||n>2)&&!(e<r+n)){var i=t[r+n-1]|(n>1?t[r+n-2]<<8:0);if(!(e<(r+=n)+i)&&!(e<r+3||2!==t[r]||1!==t[r+1]||1!==t[r+2])&&!(e<(r+=3)+2||4!==t[r]||t[r+1]>32||e<r+2+t[r+1]))return t.slice(r+2,r+2+t[r+1])}}},e.signatureExport=function(t){for(var e=n.concat([n.from([0]),t.r]),r=33,o=0;r>1&&0===e[o]&&!(128&e[o+1]);--r,++o);for(var s=n.concat([n.from([0]),t.s]),a=33,u=0;a>1&&0===s[u]&&!(128&s[u+1]);--a,++u);return i.encode(e.slice(o),s.slice(u))},e.signatureImport=function(t){var e=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(t);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(s){return}return o.r.copy(e,32-o.r.length),o.s.copy(r,32-o.s.length),{r:e,s:r}},e.signatureImportLax=function(t){var e=n.alloc(32,0),r=n.alloc(32,0),i=t.length,o=0;if(48===t[o++]){var s=t[o++];if(!(128&s&&(o+=s-128)>i)&&2===t[o++]){var a=t[o++];if(128&a){if(o+(s=a-128)>i)return;for(;s>0&&0===t[o];o+=1,s-=1);for(a=0;s>0;o+=1,s-=1)a=(a<<8)+t[o]}if(!(a>i-o)){var u=o;if(o+=a,2===t[o++]){var h=t[o++];if(128&h){if(o+(s=h-128)>i)return;for(;s>0&&0===t[o];o+=1,s-=1);for(h=0;s>0;o+=1,s-=1)h=(h<<8)+t[o]}if(!(h>i-o)){var c=o;for(o+=h;a>0&&0===t[u];a-=1,u+=1);if(!(a>32)){var f=t.slice(u,u+a);for(f.copy(e,32-f.length);h>0&&0===t[c];h-=1,c+=1);if(!(h>32)){var l=t.slice(c,c+h);return l.copy(r,32-l.length),{r:e,s:r}}}}}}}}}},1249:function(t,e,r){var n=r(17).Buffer;t.exports={check:function(t){if(t.length<8)return!1;if(t.length>72)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;var e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return 0!==r&&(6+e+r===t.length&&(!(128&t[4])&&(!(e>1&&0===t[4]&&!(128&t[5]))&&(!(128&t[e+6])&&!(r>1&&0===t[e+6]&&!(128&t[e+7]))))))},decode:function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},encode:function(t,e){var r=t.length,i=e.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(i>1&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=t.length,t.copy(o,4),o[4+r]=2,o[5+r]=e.length,e.copy(o,6+r),o}}},1250:function(t,e,r){"use strict";var n=r(17).Buffer,i=r(50),o=r(13),s=r(52).ec,a=r(939),u=new s("secp256k1"),h=u.curve;function c(t){var e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){var r=new o(e);if(r.cmp(h.p)>=0)return null;var n=(r=r.toRed(h.red)).redSqr().redIMul(r).redIAdd(h.b).redSqrt();return 3===t!==n.isOdd()&&(n=n.redNeg()),u.keyPair({pub:{x:r,y:n}})}(e,t.slice(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){var n=new o(e),i=new o(r);if(n.cmp(h.p)>=0||i.cmp(h.p)>=0)return null;if(n=n.toRed(h.red),i=i.toRed(h.red),(6===t||7===t)&&i.isOdd()!==(7===t))return null;var s=n.redSqr().redIMul(n);return i.redSqr().redISub(s.redIAdd(h.b)).isZero()?u.keyPair({pub:{x:n,y:i}}):null}(e,t.slice(1,33),t.slice(33,65));default:return null}}e.privateKeyVerify=function(t){var e=new o(t);return e.cmp(h.n)<0&&!e.isZero()},e.privateKeyExport=function(t,e){var r=new o(t);if(r.cmp(h.n)>=0||r.isZero())throw new Error(a.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(u.keyFromPrivate(t).getPublic(e,!0))},e.privateKeyNegate=function(t){var e=new o(t);return e.isZero()?n.alloc(32):h.n.sub(e).umod(h.n).toArrayLike(n,"be",32)},e.privateKeyModInverse=function(t){var e=new o(t);if(e.cmp(h.n)>=0||e.isZero())throw new Error(a.EC_PRIVATE_KEY_RANGE_INVALID);return e.invm(h.n).toArrayLike(n,"be",32)},e.privateKeyTweakAdd=function(t,e){var r=new o(e);if(r.cmp(h.n)>=0)throw new Error(a.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(t)),r.cmp(h.n)>=0&&r.isub(h.n),r.isZero())throw new Error(a.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},e.privateKeyTweakMul=function(t,e){var r=new o(e);if(r.cmp(h.n)>=0||r.isZero())throw new Error(a.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(t)),r.cmp(h.n)&&(r=r.umod(h.n)),r.toArrayLike(n,"be",32)},e.publicKeyCreate=function(t,e){var r=new o(t);if(r.cmp(h.n)>=0||r.isZero())throw new Error(a.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(u.keyFromPrivate(t).getPublic(e,!0))},e.publicKeyConvert=function(t,e){var r=c(t);if(null===r)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(e,!0))},e.publicKeyVerify=function(t){return null!==c(t)},e.publicKeyTweakAdd=function(t,e,r){var i=c(t);if(null===i)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new o(e)).cmp(h.n)>=0)throw new Error(a.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var s=h.g.mul(e).add(i.pub);if(s.isInfinity())throw new Error(a.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(s.encode(!0,r))},e.publicKeyTweakMul=function(t,e,r){var i=c(t);if(null===i)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new o(e)).cmp(h.n)>=0||e.isZero())throw new Error(a.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(e).encode(!0,r))},e.publicKeyCombine=function(t,e){for(var r=new Array(t.length),i=0;i<t.length;++i)if(r[i]=c(t[i]),null===r[i])throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);for(var o=r[0].pub,s=1;s<r.length;++s)o=o.add(r[s].pub);if(o.isInfinity())throw new Error(a.EC_PUBLIC_KEY_COMBINE_FAIL);return n.from(o.encode(!0,e))},e.signatureNormalize=function(t){var e=new o(t.slice(0,32)),r=new o(t.slice(32,64));if(e.cmp(h.n)>=0||r.cmp(h.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(t);return 1===r.cmp(u.nh)&&h.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},e.signatureExport=function(t){var e=t.slice(0,32),r=t.slice(32,64);if(new o(e).cmp(h.n)>=0||new o(r).cmp(h.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);return{r:e,s:r}},e.signatureImport=function(t){var e=new o(t.r);e.cmp(h.n)>=0&&(e=new o(0));var r=new o(t.s);return r.cmp(h.n)>=0&&(r=new o(0)),n.concat([e.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},e.sign=function(t,e,r,i){if("function"===typeof r){var s=r;r=function(r){var u=s(t,e,null,i,r);if(!n.isBuffer(u)||32!==u.length)throw new Error(a.ECDSA_SIGN_FAIL);return new o(u)}}var c=new o(e);if(c.cmp(h.n)>=0||c.isZero())throw new Error(a.ECDSA_SIGN_FAIL);var f=u.sign(t,e,{canonical:!0,k:r,pers:i});return{signature:n.concat([f.r.toArrayLike(n,"be",32),f.s.toArrayLike(n,"be",32)]),recovery:f.recoveryParam}},e.verify=function(t,e,r){var n={r:e.slice(0,32),s:e.slice(32,64)},i=new o(n.r),s=new o(n.s);if(i.cmp(h.n)>=0||s.cmp(h.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);if(1===s.cmp(u.nh)||i.isZero()||s.isZero())return!1;var f=c(r);if(null===f)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);return u.verify(t,n,{x:f.pub.x,y:f.pub.y})},e.recover=function(t,e,r,i){var s={r:e.slice(0,32),s:e.slice(32,64)},c=new o(s.r),f=new o(s.s);if(c.cmp(h.n)>=0||f.cmp(h.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);try{if(c.isZero()||f.isZero())throw new Error;var l=u.recoverPubKey(t,s,r);return n.from(l.encode(!0,i))}catch(d){throw new Error(a.ECDSA_RECOVER_FAIL)}},e.ecdh=function(t,r){var n=e.ecdhUnsafe(t,r,!0);return i("sha256").update(n).digest()},e.ecdhUnsafe=function(t,e,r){var i=c(t);if(null===i)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);var s=new o(e);if(s.cmp(h.n)>=0||s.isZero())throw new Error(a.ECDH_FAIL);return n.from(i.pub.mul(s).encode(!0,r))}},1251:function(t,e,r){(function(e){var n=r(938).publicKeyConvert,i=r(940),o=r(1258).toChecksumAddress;t.exports=function(t){if(!e.isBuffer(t)){if("string"!==typeof t)throw new Error("Expected Buffer or string as argument");t="0x"===t.slice(0,2)?t.slice(2):t,t=e.from(t,"hex")}return t=n(t,!1).slice(1),o(i(t).slice(-20).toString("hex"))}}).call(this,r(8).Buffer)},1252:function(t,e,r){t.exports=r(1253)(r(1256))},1253:function(t,e,r){var n=r(1254),i=r(1255);t.exports=function(t){var e=n(t),r=i(t);return function(t,n){switch("string"===typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}},1254:function(t,e,r){(function(e){var n=r(41),i=r(42),o=r(94),s=r(95),a=r(100).Transform;t.exports=function(t){return function(r){"use strict";o(u,r);var a=s(u);function u(e,r,i,o,s){var h;return n(this,u),(h=a.call(this,s))._rate=e,h._capacity=r,h._delimitedSuffix=i,h._hashBitLength=o,h._options=s,h._state=new t,h._state.initialize(e,r),h._finalized=!1,h}return i(u,[{key:"_transform",value:function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)}},{key:"_flush",value:function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)}},{key:"update",value:function(t,r){if(!e.isBuffer(t)&&"string"!==typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return e.isBuffer(t)||(t=e.from(t,r)),this._state.absorb(t),this}},{key:"digest",value:function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new u(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),u}(a)}}).call(this,r(8).Buffer)},1255:function(t,e,r){(function(e){var n=r(41),i=r(42),o=r(94),s=r(95),a=r(100).Transform;t.exports=function(t){return function(r){"use strict";o(u,r);var a=s(u);function u(e,r,i,o){var s;return n(this,u),(s=a.call(this,o))._rate=e,s._capacity=r,s._delimitedSuffix=i,s._options=o,s._state=new t,s._state.initialize(e,r),s._finalized=!1,s}return i(u,[{key:"_transform",value:function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)}},{key:"_flush",value:function(){}},{key:"_read",value:function(t){this.push(this.squeeze(t))}},{key:"update",value:function(t,r){if(!e.isBuffer(t)&&"string"!==typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return e.isBuffer(t)||(t=e.from(t,r)),this._state.absorb(t),this}},{key:"squeeze",value:function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new u(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),u}(a)}}).call(this,r(8).Buffer)},1256:function(t,e,r){(function(e){var n=r(1257);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(t){for(var e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!==(128&t)&&this.count===this.blockSize-1&&n.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,n.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);for(var r=e.alloc(t),i=0;i<t;++i)r[i]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return r},i.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing},t.exports=i}).call(this,r(8).Buffer)},1257:function(t,e){var r=[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];e.p1600=function(t){for(var e=0;e<24;++e){var n=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],f=t[8]^t[18]^t[28]^t[38]^t[48],l=t[9]^t[19]^t[29]^t[39]^t[49],d=f^(o<<1|s>>>31),p=l^(s<<1|o>>>31),m=t[0]^d,v=t[1]^p,g=t[10]^d,y=t[11]^p,w=t[20]^d,b=t[21]^p,_=t[30]^d,M=t[31]^p,E=t[40]^d,A=t[41]^p;d=n^(a<<1|u>>>31),p=i^(u<<1|a>>>31);var x=t[2]^d,k=t[3]^p,S=t[12]^d,T=t[13]^p,I=t[22]^d,P=t[23]^p,N=t[32]^d,R=t[33]^p,C=t[42]^d,L=t[43]^p;d=o^(h<<1|c>>>31),p=s^(c<<1|h>>>31);var O=t[4]^d,B=t[5]^p,D=t[14]^d,U=t[15]^p,j=t[24]^d,F=t[25]^p,K=t[34]^d,G=t[35]^p,V=t[44]^d,H=t[45]^p;d=a^(f<<1|l>>>31),p=u^(l<<1|f>>>31);var z=t[6]^d,q=t[7]^p,W=t[16]^d,Z=t[17]^p,Y=t[26]^d,J=t[27]^p,$=t[36]^d,X=t[37]^p,Q=t[46]^d,tt=t[47]^p;d=h^(n<<1|i>>>31),p=c^(i<<1|n>>>31);var et=t[8]^d,rt=t[9]^p,nt=t[18]^d,it=t[19]^p,ot=t[28]^d,st=t[29]^p,at=t[38]^d,ut=t[39]^p,ht=t[48]^d,ct=t[49]^p,ft=m,lt=v,dt=y<<4|g>>>28,pt=g<<4|y>>>28,mt=w<<3|b>>>29,vt=b<<3|w>>>29,gt=M<<9|_>>>23,yt=_<<9|M>>>23,wt=E<<18|A>>>14,bt=A<<18|E>>>14,_t=x<<1|k>>>31,Mt=k<<1|x>>>31,Et=T<<12|S>>>20,At=S<<12|T>>>20,xt=I<<10|P>>>22,kt=P<<10|I>>>22,St=R<<13|N>>>19,Tt=N<<13|R>>>19,It=C<<2|L>>>30,Pt=L<<2|C>>>30,Nt=B<<30|O>>>2,Rt=O<<30|B>>>2,Ct=D<<6|U>>>26,Lt=U<<6|D>>>26,Ot=F<<11|j>>>21,Bt=j<<11|F>>>21,Dt=K<<15|G>>>17,Ut=G<<15|K>>>17,jt=H<<29|V>>>3,Ft=V<<29|H>>>3,Kt=z<<28|q>>>4,Gt=q<<28|z>>>4,Vt=Z<<23|W>>>9,Ht=W<<23|Z>>>9,zt=Y<<25|J>>>7,qt=J<<25|Y>>>7,Wt=$<<21|X>>>11,Zt=X<<21|$>>>11,Yt=tt<<24|Q>>>8,Jt=Q<<24|tt>>>8,$t=et<<27|rt>>>5,Xt=rt<<27|et>>>5,Qt=nt<<20|it>>>12,te=it<<20|nt>>>12,ee=st<<7|ot>>>25,re=ot<<7|st>>>25,ne=at<<8|ut>>>24,ie=ut<<8|at>>>24,oe=ht<<14|ct>>>18,se=ct<<14|ht>>>18;t[0]=ft^~Et&Ot,t[1]=lt^~At&Bt,t[10]=Kt^~Qt&mt,t[11]=Gt^~te&vt,t[20]=_t^~Ct&zt,t[21]=Mt^~Lt&qt,t[30]=$t^~dt&xt,t[31]=Xt^~pt&kt,t[40]=Nt^~Vt&ee,t[41]=Rt^~Ht&re,t[2]=Et^~Ot&Wt,t[3]=At^~Bt&Zt,t[12]=Qt^~mt&St,t[13]=te^~vt&Tt,t[22]=Ct^~zt&ne,t[23]=Lt^~qt&ie,t[32]=dt^~xt&Dt,t[33]=pt^~kt&Ut,t[42]=Vt^~ee&gt,t[43]=Ht^~re&yt,t[4]=Ot^~Wt&oe,t[5]=Bt^~Zt&se,t[14]=mt^~St&jt,t[15]=vt^~Tt&Ft,t[24]=zt^~ne&wt,t[25]=qt^~ie&bt,t[34]=xt^~Dt&Yt,t[35]=kt^~Ut&Jt,t[44]=ee^~gt&It,t[45]=re^~yt&Pt,t[6]=Wt^~oe&ft,t[7]=Zt^~se&lt,t[16]=St^~jt&Kt,t[17]=Tt^~Ft&Gt,t[26]=ne^~wt&_t,t[27]=ie^~bt&Mt,t[36]=Dt^~Yt&$t,t[37]=Ut^~Jt&Xt,t[46]=gt^~It&Nt,t[47]=yt^~Pt&Rt,t[8]=oe^~ft&Et,t[9]=se^~lt&At,t[18]=jt^~Kt&Qt,t[19]=Ft^~Gt&te,t[28]=wt^~_t&Ct,t[29]=bt^~Mt&Lt,t[38]=Yt^~$t&dt,t[39]=Jt^~Xt&pt,t[48]=It^~Nt&Vt,t[49]=Pt^~Rt&Ht,t[0]^=r[2*e],t[1]^=r[2*e+1]}}},1258:function(t,e,r){var n=r(940);function i(t){return"0x"===t.slice(0,2)?t.slice(2):t}t.exports={toChecksumAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!==typeof t)return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(t))throw new Error('Given address "'.concat(t,'" is not a valid Ethereum address.'));for(var r=i(t).toLowerCase(),o=null!=e?e.toString()+"0x":"",s=n(o+r).toString("hex").replace(/^0x/i,""),a="0x",u=0;u<r.length;u++)a+=parseInt(s[u],16)>=8?r[u].toUpperCase():r[u];return a},checkAddressChecksum:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=i(t).toLowerCase(),o=null!=e?e.toString()+"0x":"",s=n(o+r).toString("hex").replace(/^0x/i,""),a=0;a<r.length;a++){var u=parseInt(s[a],16)>=8?r[a].toUpperCase():r[a];if(i(t)[a]!==u)return!1}return!0}}},1259:function(t,e,r){(function(e){var n=r(244),i=r(249),o=r(1260);t.exports=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s="";if(""!==(r=i({size:0,addPrefix:!1,evenLength:!1,default:""},r)).default&&(s=r.default),""!==t&&void 0!==t&&null!==t||(t=s),"0"===t&&(t=0),void 0===t||null===t);else if("number"===typeof t)s=t.toString(16);else if("string"===typeof t)(t=t.trim()).startsWith("0x")?s=o(t):""!==t&&Number.isFinite(+t)&&(s=Number(t).toString(16)),s===r.default&&(s=e.from(t,"utf8").toString("hex"));else if("boolean"===typeof t)s=t?"1":"0";else if("object"===typeof t&&null!==t)if(e.isBuffer(t))s=t.toString("hex");else if(/(BN|BigNumber|Big|Decimal)/.test(t.constructor.name))s=t.toString(16);else if(t instanceof Uint8Array)s=e.from(n(t)).toString("hex");else if(t.toString&&"function"===typeof t.toString)try{var a=t.toString(16);/^[a-fA-F0-9]+$/.test(a)&&(s=a)}catch(u){}return"string"===typeof s&&(s=s.toLowerCase(),r.size>s.length&&(s="".concat("0".repeat(r.size-s.length)).concat(s)),r.evenLength&&s.length%2&&(s="0".concat(s)),r.addPrefix&&(s="0x".concat(s))),s}}).call(this,r(8).Buffer)},1260:function(t,e,r){(function(e){var n=r(249);t.exports=function(t,r){r=n({evenLength:!1,addPrefix:!1},r);var i="";e.isBuffer(t)&&(t=t.toString("hex")),"number"===typeof t&&(t=t.toString()),"string"===typeof t&&(i=t.toLowerCase()),i.startsWith("0x")&&(i=i.slice(2));var o=i.length%2?"0".concat(i):i;return e.from(o,"hex")&&(i=r.evenLength?o:i),r.addPrefix&&(i="0x".concat(i)),i}}).call(this,r(8).Buffer)},1261:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1788);e.uuid=function(){return n.v4()};var i={v4:/(?:^[0-9a-f]{8}\x2D[0-9a-f]{4}\x2D4[0-9a-f]{3}\x2D[0-9a-f]{4}\x2D[0-9a-f]{12}$)|(?:^0{8}\x2D0{4}\x2D0{4}\x2D0{4}\x2D0{12}$)/,v5:/(?:^[0-9a-f]{8}\x2D[0-9a-f]{4}\x2D5[0-9a-f]{3}\x2D[0-9a-f]{4}\x2D[0-9a-f]{12}$)|(?:^0{8}\x2D0{4}\x2D0{4}\x2D0{4}\x2D0{12}$)/};e.regex=i;e.isUuid=function(t){return i.v4.test(t)||i.v5.test(t)};e.empty=function(){return"00000000-0000-0000-0000-000000000000"};e.fromString=function(t){return n.v5(t,"bb5d0ffa-9a4c-4d7c-8fc2-0a7d2220ba45")}},1262:function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(1263).Buffer}catch(S){}function a(t,e,r){for(var i=0,o=Math.min(t.length,r),s=0,a=e;a<o;a++){var u,h=t.charCodeAt(a)-48;i<<=4,i|=u=h>=49&&h<=54?h-49+10:h>=17&&h<=22?h-17+10:h,s|=u}return n(!(240&s),"Invalid character in "+t),i}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var h=t.charCodeAt(u)-48;o*=i,s=h>=49?h-49+10:h>=17?h-17+10:h,n(h>=0&&s<i,"Invalid character"),o+=s}return o}function h(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=n)h=u(t,c,c+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){h(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c:o.prototype.inspect=c;var f=["","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"],l=[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],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],c=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(c).toString(t);r=(p=p.idivn(c)).isZero()?m+r:f[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],E=8191&M,A=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,T=0|s[6],I=8191&T,P=T>>>13,N=0|s[7],R=8191&N,C=N>>>13,L=0|s[8],O=8191&L,B=L>>>13,D=0|s[9],U=8191&D,j=D>>>13,F=0|a[0],K=8191&F,G=F>>>13,V=0|a[1],H=8191&V,z=V>>>13,q=0|a[2],W=8191&q,Z=q>>>13,Y=0|a[3],J=8191&Y,$=Y>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(f,K))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,G))+Math.imul(m,K)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,z)|0)+Math.imul(l,H)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,G))+Math.imul(y,K)|0,o=Math.imul(y,G),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,z)|0;var yt=(h+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,G))+Math.imul(_,K)|0,o=Math.imul(_,G),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Z)|0;var wt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,G))+Math.imul(A,K)|0,o=Math.imul(A,G),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,z)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,z)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,K),i=(i=Math.imul(k,G))+Math.imul(S,K)|0,o=Math.imul(S,G),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,G))+Math.imul(P,K)|0,o=Math.imul(P,G),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,K),i=(i=Math.imul(R,G))+Math.imul(C,K)|0,o=Math.imul(C,G),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,G))+Math.imul(B,K)|0,o=Math.imul(B,G),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,z)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,z)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,z)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,z)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var xt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var kt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var St=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(j,J)|0,o=Math.imul(j,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,lt)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,lt)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,lt)|0;var It=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,lt)|0;var Pt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(C,ft)|0,o=o+Math.imul(C,lt)|0;var Nt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ft),i=(i=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ct=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Lt=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,mt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=Et,u[8]=At,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Tt,u[13]=It,u[14]=Pt,u[15]=Nt,u[16]=Rt,u[17]=Ct,u[18]=Lt,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(t,e,r){return v(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?v(this,t,e):g(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},y.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],v=r[c+d+s],g=n[c+d+s],y=f*v-l*g;g=f*g+l*v,v=y,r[c+d]=p+v,n[c+d]=m+g,r[c+d+s]=p-v,n[c+d+s]=m-g,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},y.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},y.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},y.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),g(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"===typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0===(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0===(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0===(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(_,b),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(M,b),i(E,b),i(A,b),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new M;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();n(v<p);var g=this.pow(f,new o(1).iushln(p-v-1));l=l.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return l},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(26)(t))},1263:function(t,e){},1264:function(t,e,r){"use strict";var n=r(2),i=r(41),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=function t(e){var r=this;i(this,t),this.send=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"providerRpc",params:{method:t,params:e}}));case 1:case"end":return r.stop()}}),r,this)})))},this.getStarkKey=function(){return o(r,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum._postMessageToChild({method:"starkAccount"}));case 1:case"end":return t.stop()}}),t,this)})))},this.getPublicKey=function(){return o(r,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum._postMessageToChild({method:"starkPublicKey"}));case 1:case"end":return t.stop()}}),t,this)})))},this.getEthAddress=function(){return o(r,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum._postMessageToChild({method:"starkEthAddress"}));case 1:case"end":return t.stop()}}),t,this)})))},this.signNonce=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkSignNonce",params:{nonce:t}}));case 1:case"end":return e.stop()}}),e,this)})))},this.starkSignMessage=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkSignMessage",params:{message:t}}));case 1:case"end":return e.stop()}}),e,this)})))},this.setContractAddress=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkContractAddress",params:{contractAddress:t}}));case 1:case"end":return e.stop()}}),e,this)})))},this.getContractAddress=function(){return o(r,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum._postMessageToChild({method:"starkContractAddress"}));case 1:case"end":return t.stop()}}),t,this)})))},this.registerUser=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkRegisterUser",params:{ethKey:t,operatorSignature:e}}));case 1:case"end":return r.stop()}}),r,this)})))},this.deposit=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkDeposit",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.depositEth=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.deposit({vaultId:t,amount:e,assetStandard:"ETH",quantum:i}));case 1:case"end":return r.stop()}}),r,this)})))},this.depositErc20=function(t,e,i,s){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.deposit({vaultId:t,amount:e,assetStandard:"ERC20",quantum:i,assetContractAddress:s}));case 1:case"end":return r.stop()}}),r,this)})))},this.depositErc721=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.deposit({vaultId:t,amount:e,assetStandard:"ERC721",assetContractAddress:i}));case 1:case"end":return r.stop()}}),r,this)})))},this.cancelDeposit=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositCancel",params:{assetType:e,vaultId:t}}));case 1:case"end":return r.stop()}}),r,this)})))},this.cancelEthDeposit=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositCancel",params:{vaultId:t,quantum:e,assetStandard:"ETH"}}));case 1:case"end":return r.stop()}}),r,this)})))},this.cancelErc20Deposit=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositCancel",params:{vaultId:t,quantum:e,token:i,assetStandard:"ERC20"}}));case 1:case"end":return r.stop()}}),r,this)})))},this.cancelErc721Deposit=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositCancel",params:{vaultId:t,tokenId:e,token:i,assetStandard:"ERC721"}}));case 1:case"end":return r.stop()}}),r,this)})))},this.reclaimDeposit=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositReclaim",params:{assetType:e,vaultId:t}}));case 1:case"end":return r.stop()}}),r,this)})))},this.reclaimEthDeposit=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositReclaim",params:{vaultId:t,quantum:e,assetStandard:"ETH"}}));case 1:case"end":return r.stop()}}),r,this)})))},this.reclaimErc20Deposit=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositReclaim",params:{vaultId:t,quantum:e,token:i,assetStandard:"ERC20"}}));case 1:case"end":return r.stop()}}),r,this)})))},this.reclaimErc721Deposit=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkDepositReclaim",params:{vaultId:t,tokenId:e,token:i,assetStandard:"ERC721"}}));case 1:case"end":return r.stop()}}),r,this)})))},this.withdraw=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3?arguments[3]:void 0;return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkWithdrawTo",params:{assetStandard:t,quantum:e,assetContractAddress:i,recipient:s}}));case 1:case"end":return r.stop()}}),r,this)})))},this.withdrawEth=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.withdraw("ETH",t,null,e));case 1:case"end":return r.stop()}}),r,this)})))},this.withdrawErc20=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.withdraw("ERC20",t,e,i));case 1:case"end":return r.stop()}}),r,this)})))},this.withdrawErc721=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.withdraw("ERC721",t,e,i));case 1:case"end":return r.stop()}}),r,this)})))},this.fullWithdrawalRequest=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkFullWithdrawalRequest",params:{vaultId:t}}));case 1:case"end":return e.stop()}}),e,this)})))},this.withdrawAndMint=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkWithdrawAndMint",params:{assetType:t,mintingBlob:e}}));case 1:case"end":return r.stop()}}),r,this)})))},this.freezeRequest=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkFreezeRequest",params:{vaultId:t}}));case 1:case"end":return e.stop()}}),e,this)})))},this.escape=function(t,e,i){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum._postMessageToChild({method:"starkEscape",params:{vaultId:t,assetType:e,quantizedAmount:i}}));case 1:case"end":return r.stop()}}),r,this)})))},this.transfer=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkTransfer",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.transferEth=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.assetStandard="ETH",e.abrupt("return",this.authereum._postMessageToChild({method:"starkTransfer",params:t}));case 2:case"end":return e.stop()}}),e,this)})))},this.transferErc20=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.assetStandard="ERC20",e.abrupt("return",this.authereum._postMessageToChild({method:"starkTransfer",params:t}));case 2:case"end":return e.stop()}}),e,this)})))},this.transferErc721=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.assetStandard="ERC721",e.abrupt("return",this.authereum._postMessageToChild({method:"starkTransfer",params:t}));case 2:case"end":return e.stop()}}),e,this)})))},this.createOrder=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkCreateOrder",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.getAssetType=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"starkAssetType",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.getConditionHash=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return o(r,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum._postMessageToChild({method:"starkConditionHash",params:e}));case 1:case"end":return t.stop()}}),t,this)})))},this.signTransaction=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.signTransaction(t));case 1:case"end":return e.stop()}}),e,this)})))},this.sendTransaction=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.sendTransaction(t));case 1:case"end":return e.stop()}}),e,this)})))},this.signMessage=function(t,e){return o(r,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.authereum.signMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))},this.signPersonalMessage=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.signPersonalMessage(t));case 1:case"end":return e.stop()}}),e,this)})))},this.getAccountAddress=function(){return o(r,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.getAccountAddress());case 1:case"end":return t.stop()}}),t,this)})))},this.estimateGas=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.estimateGas(t));case 1:case"end":return e.stop()}}),e,this)})))},this.authereum=e}},1265:function(t,e,r){"use strict";var n=r(2),i=r(41),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=function t(e){var r=this;i(this,t),this.deposit=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"zksyncDeposit",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.withdraw=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"zksyncWithdraw",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.transfer=function(t){return o(r,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum._postMessageToChild({method:"zksyncTransfer",params:t}));case 1:case"end":return e.stop()}}),e,this)})))},this.authereum=e}},1266:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.defaultConfig={xsUri:function(t){var e="mainnet"===t?"":"".concat(t,".");return"https://".concat(e,"x.").concat("authereum.com")}}},1267:function(t,e,r){"use strict";var n=r(2),i=r(41),o=r(42),s=r(94),a=r(95),u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},h=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=h(r(792)),f=function(t){s(r,t);var e=a(r);function r(t){var n;return i(this,r),(n=e.call(this)).config=t||{},n.authereum=new c.default(n.config),n.provider=n.authereum.getProvider(),n}return o(r,[{key:"getAddress",value:function(){return u(this,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.getAccountAddress());case 1:case"end":return t.stop()}}),t,this)})))}},{key:"signMessage",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sign(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sign",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sign(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransaction",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sendTransaction(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransactionBatch",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.sendTransactionBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGasBatch",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.provider.estimateGasBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}}]),r}(r(941).Signer);e.default=f},1788:function(t,e,r){"use strict";r.r(e),r.d(e,"v1",(function(){return d})),r.d(e,"v3",(function(){return _})),r.d(e,"v4",(function(){return M})),r.d(e,"v5",(function(){return x}));var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),i=new Uint8Array(16);function o(){if(!n)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}for(var s=[],a=0;a<256;++a)s[a]=(a+256).toString(16).substr(1);var u,h,c=function(t,e){var r=e||0,n=s;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")},f=0,l=0;var d=function(t,e,r){var n=e&&r||0,i=e||[],s=(t=t||{}).node||u,a=void 0!==t.clockseq?t.clockseq:h;if(null==s||null==a){var d=t.random||(t.rng||o)();null==s&&(s=u=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==a&&(a=h=16383&(d[6]<<8|d[7]))}var p=void 0!==t.msecs?t.msecs:(new Date).getTime(),m=void 0!==t.nsecs?t.nsecs:l+1,v=p-f+(m-l)/1e4;if(v<0&&void 0===t.clockseq&&(a=a+1&16383),(v<0||p>f)&&void 0===t.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=p,l=m,h=a;var g=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;i[n++]=g>>>24&255,i[n++]=g>>>16&255,i[n++]=g>>>8&255,i[n++]=255&g;var y=p/4294967296*1e4&268435455;i[n++]=y>>>8&255,i[n++]=255&y,i[n++]=y>>>24&15|16,i[n++]=y>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var w=0;w<6;++w)i[n+w]=s[w];return e||c(i)};var p=function(t,e,r){var n=function(t,n,i,o){var s=i&&o||0;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}(t)),"string"==typeof n&&(n=function(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,(function(t){e.push(parseInt(t,16))})),e}(n)),!Array.isArray(t))throw TypeError("value must be an array of bytes");if(!Array.isArray(n)||16!==n.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var a=r(n.concat(t));if(a[6]=15&a[6]|e,a[8]=63&a[8]|128,i)for(var u=0;u<16;++u)i[s+u]=a[u];return i||c(a)};try{n.name=t}catch(i){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n};function m(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function v(t,e,r,n,i,o){return m((s=m(m(e,t),m(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function g(t,e,r,n,i,o,s){return v(e&r|~e&n,t,e,i,o,s)}function y(t,e,r,n,i,o,s){return v(e&n|r&~n,t,e,i,o,s)}function w(t,e,r,n,i,o,s){return v(e^r^n,t,e,i,o,s)}function b(t,e,r,n,i,o,s){return v(r^(e|~n),t,e,i,o,s)}var _=p("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var r=0;r<e.length;r++)t[r]=e.charCodeAt(r)}return function(t){var e,r,n,i=[],o=32*t.length,s="0123456789abcdef";for(e=0;e<o;e+=8)r=t[e>>5]>>>e%32&255,n=parseInt(s.charAt(r>>>4&15)+s.charAt(15&r),16),i.push(n);return i}(function(t,e){var r,n,i,o,s;t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var a=1732584193,u=-271733879,h=-1732584194,c=271733878;for(r=0;r<t.length;r+=16)n=a,i=u,o=h,s=c,a=g(a,u,h,c,t[r],7,-680876936),c=g(c,a,u,h,t[r+1],12,-389564586),h=g(h,c,a,u,t[r+2],17,606105819),u=g(u,h,c,a,t[r+3],22,-1044525330),a=g(a,u,h,c,t[r+4],7,-176418897),c=g(c,a,u,h,t[r+5],12,1200080426),h=g(h,c,a,u,t[r+6],17,-1473231341),u=g(u,h,c,a,t[r+7],22,-45705983),a=g(a,u,h,c,t[r+8],7,1770035416),c=g(c,a,u,h,t[r+9],12,-1958414417),h=g(h,c,a,u,t[r+10],17,-42063),u=g(u,h,c,a,t[r+11],22,-1990404162),a=g(a,u,h,c,t[r+12],7,1804603682),c=g(c,a,u,h,t[r+13],12,-40341101),h=g(h,c,a,u,t[r+14],17,-1502002290),a=y(a,u=g(u,h,c,a,t[r+15],22,1236535329),h,c,t[r+1],5,-165796510),c=y(c,a,u,h,t[r+6],9,-1069501632),h=y(h,c,a,u,t[r+11],14,643717713),u=y(u,h,c,a,t[r],20,-373897302),a=y(a,u,h,c,t[r+5],5,-701558691),c=y(c,a,u,h,t[r+10],9,38016083),h=y(h,c,a,u,t[r+15],14,-660478335),u=y(u,h,c,a,t[r+4],20,-405537848),a=y(a,u,h,c,t[r+9],5,568446438),c=y(c,a,u,h,t[r+14],9,-1019803690),h=y(h,c,a,u,t[r+3],14,-187363961),u=y(u,h,c,a,t[r+8],20,1163531501),a=y(a,u,h,c,t[r+13],5,-1444681467),c=y(c,a,u,h,t[r+2],9,-51403784),h=y(h,c,a,u,t[r+7],14,1735328473),a=w(a,u=y(u,h,c,a,t[r+12],20,-1926607734),h,c,t[r+5],4,-378558),c=w(c,a,u,h,t[r+8],11,-2022574463),h=w(h,c,a,u,t[r+11],16,1839030562),u=w(u,h,c,a,t[r+14],23,-35309556),a=w(a,u,h,c,t[r+1],4,-1530992060),c=w(c,a,u,h,t[r+4],11,1272893353),h=w(h,c,a,u,t[r+7],16,-155497632),u=w(u,h,c,a,t[r+10],23,-1094730640),a=w(a,u,h,c,t[r+13],4,681279174),c=w(c,a,u,h,t[r],11,-358537222),h=w(h,c,a,u,t[r+3],16,-722521979),u=w(u,h,c,a,t[r+6],23,76029189),a=w(a,u,h,c,t[r+9],4,-640364487),c=w(c,a,u,h,t[r+12],11,-421815835),h=w(h,c,a,u,t[r+15],16,530742520),a=b(a,u=w(u,h,c,a,t[r+2],23,-995338651),h,c,t[r],6,-198630844),c=b(c,a,u,h,t[r+7],10,1126891415),h=b(h,c,a,u,t[r+14],15,-1416354905),u=b(u,h,c,a,t[r+5],21,-57434055),a=b(a,u,h,c,t[r+12],6,1700485571),c=b(c,a,u,h,t[r+3],10,-1894986606),h=b(h,c,a,u,t[r+10],15,-1051523),u=b(u,h,c,a,t[r+1],21,-2054922799),a=b(a,u,h,c,t[r+8],6,1873313359),c=b(c,a,u,h,t[r+15],10,-30611744),h=b(h,c,a,u,t[r+6],15,-1560198380),u=b(u,h,c,a,t[r+13],21,1309151649),a=b(a,u,h,c,t[r+4],6,-145523070),c=b(c,a,u,h,t[r+11],10,-1120210379),h=b(h,c,a,u,t[r+2],15,718787259),u=b(u,h,c,a,t[r+9],21,-343485551),a=m(a,n),u=m(u,i),h=m(h,o),c=m(c,s);return[a,u,h,c]}(function(t){var e,r=[];for(r[(t.length>>2)-1]=void 0,e=0;e<r.length;e+=1)r[e]=0;var n=8*t.length;for(e=0;e<n;e+=8)r[e>>5]|=(255&t[e/8])<<e%32;return r}(t),8*t.length))}));var M=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;++s)e[n+s]=i[s];return e||c(i)};function E(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function A(t,e){return t<<e|t>>>32-e}var x=p("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=new Array(n.length);for(var i=0;i<n.length;i++)t[i]=n.charCodeAt(i)}t.push(128);var o=t.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(i=0;i<s;i++){a[i]=new Array(16);for(var u=0;u<16;u++)a[i][u]=t[64*i+4*u]<<24|t[64*i+4*u+1]<<16|t[64*i+4*u+2]<<8|t[64*i+4*u+3]}for(a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295,i=0;i<s;i++){for(var h=new Array(80),c=0;c<16;c++)h[c]=a[i][c];for(c=16;c<80;c++)h[c]=A(h[c-3]^h[c-8]^h[c-14]^h[c-16],1);var f=r[0],l=r[1],d=r[2],p=r[3],m=r[4];for(c=0;c<80;c++){var v=Math.floor(c/20),g=A(f,5)+E(v,l,d,p)+m+e[v]+h[c]>>>0;m=p,p=d,d=A(l,30)>>>0,l=f,f=g}r[0]=r[0]+f>>>0,r[1]=r[1]+l>>>0,r[2]=r[2]+d>>>0,r[3]=r[3]+p>>>0,r[4]=r[4]+m>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}))},643:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=void 0;var n,i=r(1191),o=(n=i)&&n.__esModule?n:{default:n};var s="function"===typeof Symbol;function a(t){return s&&"AsyncFunction"===t[Symbol.toStringTag]}e.default=function(t){return a(t)?(0,o.default)(t):t},e.isAsync=a},729:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DATA_CLONE_ERROR=e.MESSAGE=e.REJECTED=e.FULFILLED=e.REPLY=e.CALL=e.HANDSHAKE_REPLY=e.HANDSHAKE=void 0;e.HANDSHAKE="handshake";e.HANDSHAKE_REPLY="handshake-reply";e.CALL="call";e.REPLY="reply";e.FULFILLED="fulfilled";e.REJECTED="rejected";e.MESSAGE="message";e.DATA_CLONE_ERROR="DataCloneError"},730:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERR_NO_IFRAME_SRC=e.ERR_NOT_IN_IFRAME=e.ERR_CONNECTION_TIMEOUT=e.ERR_CONNECTION_DESTROYED=void 0;e.ERR_CONNECTION_DESTROYED="ConnectionDestroyed";e.ERR_CONNECTION_TIMEOUT="ConnectionTimeout";e.ERR_NOT_IN_IFRAME="NotInIframe";e.ERR_NO_IFRAME_SRC="NoIframeSrc"},734:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){e|=0;for(var r=Math.max(t.length-e,0),n=Array(r),i=0;i<r;i++)n[i]=t[e+i];return n},t.exports=e.default},736:function(t,e,r){var n=r(1203),i=r(138);t.exports=function(t){return i({id:n(),jsonrpc:"2.0",params:[]},t)}},792:function(t,e,r){"use strict";var n=r(2),i=r(41),o=r(42),s=r(254),a=r(139),u=r(94),h=r(95),c=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},f=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=f(r(1147)),d=f(r(1152)),p=f(r(1153)),m=f(r(915)),v=f(r(916)),g=f(r(1264)),y=f(r(1265)),w=r(1266),b=r(937),_=function(t){var e={};for(var r in t){var n=t[r];"object"===typeof n&&"function"===n.toString&&(n=n.toString("hex")),e[r]=n}return e},M={width:0,height:0,top:0,left:0,zIndex:1},E=function(){},A={notify:function(t,e){return console.debug(t,e),{dismiss:E}}},x=function(t){u(r,t);var e=h(r);function r(t){var o;i(this,r),(o=e.call(this))._debug=!!b.getQueryParamValue("debug"),o._notifier=A,o._cacheReady=!1,o._iframeReady=!1,o._configReady=!1,o._iframeConnecting=null,o._readyEmitted=!1,o._widgetEnabled=!1,o._iframeStyle=M,o._notificationIframeStyle=M,o._blockedPopupRedirect=!0,o._forceRedirect=!1,o._heartbeatStarted=!1,o._backoffTimeout=1,o._userConfig=null,o._asymmetricEncryptionKey=null,o._authereumQueryParams={},o._injectedElements=[],o._notificationsMap={},o._destroyed=!1,o._starkProvider=null,o._zkSyncProvider=null,o._isPreload=!1,o._disableGoogleAnalytics=!1,o._eventListeners=[],o._init=function(t){o._initConfig(t),o._iframeStyle={width:0,height:0,top:0,left:0,zIndex:0},o._provider=new v.default(a(o)),o._connectToChildIframe().catch((function(){o._startHeartbeat(!0)})).catch((function(t){console.warn("ping error:",t.message)})),o._setupCache().catch(E),o._cacheAuthereumQueryParams(),o._setupSigningKey().catch(E),o._setupResizeListener(),o._setupFocusListener(),o._setupActionKeyListener(),o._emitReadyEvent()},o._initConfig=function(t){if("string"===typeof t){var e=t;if(o._networkName=(e||"").trim().toLowerCase(),["mainnet","ropsten","rinkeby","kovan","goerli"].includes(o._networkName))o._xsUri=w.defaultConfig.xsUri(o._networkName);else{if("localhost"!==t)throw new Error("Unsupported network");o._xsUri="http://localhost:3002",o._networkName="kovan"}}else t=t||{},o._networkName=t.networkName||"mainnet",o._xsUri=t.xsUri||w.defaultConfig.xsUri(o._networkName),o._apiKey=t.apiKey;t.redirectUri?o._redirectUri=t.redirectUri:o._redirectUri=window.location.href,o._redirectUri=o._redirectUri||window.location.href},o._setConfig=function(t){if("string"===typeof o._userConfig){var e=o._userConfig;o._networkName=(e||"").trim().toLowerCase(),o._userConfig={networkName:o._networkName,xsUri:w.defaultConfig.xsUri(o._networkName)}}var r=o._userConfig||{},n=r.apiKey,i=r.apiUri,s=r.rpcUri,a=r.webUri,u=r.notifierUri,h=r.networkName,c=r.networkId,f=r.disableNotifications,l=r.blockedPopupRedirect,d=r.forceRedirect;n&&(o._apiKey=n),i?o._apiUri=i:t.apiUri&&(o._apiUri=t.apiUri),s?o._rpcUri=s:t.rpcUri&&(o._rpcUri=t.rpcUri),a?o._webUri=a:t.webUri&&(o._webUri=t.webUri),u?o._notifierUri=u:t.notifierUri&&(o._notifierUri=t.notifierUri),h?o._networkName=h:t.networkName&&(o._networkName=t.networkName),c?o._networkId=c:t.networkId&&(o._networkId=t.networkId),"boolean"===typeof f?o._disableNotifications=f:"boolean"===typeof t.disableNotifications&&(o._disableNotifications=t.disableNotifications),"boolean"===typeof l?o._blockedPopupRedirect=l:"boolean"===typeof t.blockedPopupRedirect&&(o._blockedPopupRedirect=t.blockedPopupRedirect),"boolean"===typeof d?o._forceRedirect=d:"boolean"===typeof t.forceRedirect&&(o._forceRedirect=t.forceRedirect)},o._setupCache=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([this._cacheLoginKeyAddress(),this._cacheIsAuthenticated(),this._cacheAccountAddress()]);case 2:this._cacheReady=!0;case 3:case"end":return t.stop()}}),t,this)})))},o._handleWindowFocus=function(){if(!o._destroyed&&o._bodyContainsIframe())return o._postMessageToChild({method:"onWindowFocus"})},o._resetCache=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._setupCache());case 1:case"end":return t.stop()}}),t,this)})))},o._injectScript=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return c(a(o),void 0,void 0,n.mark((function r(){var i=this;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._tilDomReady();case 2:return r.abrupt("return",new Promise((function(r,n){if(!t)throw new Error("sourceUrl is required");if(document.getElementById(e))r();else{var o=document.createElement("script");o.id=e,o.type="text/javascript",o.async=!0,o.onload=function(){r()},o.onerror=function(t){n(t)},o.src=t,i._injectedElements.push(o),document.getElementsByTagName("head")[0].appendChild(o)}})));case 3:case"end":return r.stop()}}),r,this)})))},o._setupResizeListener=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.addEventListener("resize",this._handleResizeThrottled,!1),this.addEventListener("resize",this._handleResizeDebounced,!1);case 2:case"end":return t.stop()}}),t,this)})))},o._handleActionKeyPress=function(t){if(!o._destroyed&&o._bodyContainsIframe()){var e="";return"Escape"===t.key||"Esc"===t.key||27===t.keyCode?e="escape":"Enter"===t.key||13===t.keyCode?e="enter":"ArrowLeft"===t.key||37===t.keyCode?e="left":"ArrowUp"===t.key||38===t.keyCode?e="up":"ArrowRight"===t.key||39===t.keyCode?e="right":"ArrowDown"!==t.key&&40!==t.keyCode||(e="down"),e?o._postMessageToChild({method:"actionKeyPress",params:e}):void 0}},o._handleResize=function(t){return c(a(o),void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=2;break}return t.abrupt("return");case 2:if(this._bodyContainsIframe()){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,this._getWindowSize();case 6:return e=t.sent,t.abrupt("return",this._postMessageToChild({method:"onResize",params:e}));case 8:case"end":return t.stop()}}),t,this)})))},o._handleResizeThrottled=b.throttle((function(t){return o._handleResize(t)}),10),o._handleResizeDebounced=b.debounce((function(t){return o._handleResize(t)}),10),o._cacheLoginKeyAddress=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"getOrCreateLoginKey"});case 2:e=t.sent,this._cachedLoginKeyAddress=e.publicAddress;case 4:case"end":return t.stop()}}),t,this)})))},o._cacheAccountAddress=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"getAccountAddress"});case 2:e=t.sent,this._cachedAccountAddress=e;case 4:case"end":return t.stop()}}),t,this)})))},o._cacheIsAuthenticated=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"isAuthenticated"});case 2:e=t.sent,this._cachedIsAuthenticated=e;case 4:case"end":return t.stop()}}),t,this)})))},o.login=b.throttle((function(){return c(a(o),void 0,void 0,n.mark((function t(){var e,r,i,o=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this._iframeReady&&this._cacheReady,r=this._configReady,e&&r){t.next=7;break}return t.next=5,this._tilConfigReady();case 5:return t.next=7,this._tilReady();case 7:if(this._cachedIsAuthenticated){t.next=13;break}return t.next=10,this._signLoginKeyRequest(this._cachedLoginKeyAddress);case 10:return t.abrupt("return",this.getAuthenticatedAccount());case 13:this._notificationsMap.loggedIn||(this._postMessageToChild({method:"notification",params:{type:"success",message:"You are logged into Authereum",timeout:5e3}}).catch(E),this._notificationsMap.loggedIn=!0,setTimeout((function(){o._notificationsMap.loggedIn=null}),5e3));case 14:return t.next=16,this.getAuthenticatedAccount();case 16:return i=t.sent,t.abrupt("return",i);case 18:case"end":return t.stop()}}),t,this)})))}),250),o.authenticate=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.warn("Deprecation notice: `authereum.authenticate()` is deprecated. Use `authereum.login()` instead."),t.abrupt("return",this.login());case 2:case"end":return t.stop()}}),t,this)})))},o.isAuthenticated=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"isAuthenticated"})));case 1:case"end":return t.stop()}}),t,this)})))},o.logout=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"logout"});case 2:return e=t.sent,t.next=5,this._resetCache();case 5:return this.emit("logout",{}),t.abrupt("return",e);case 7:case"end":return t.stop()}}),t,this)})))},o.getAuthenticatedAccount=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getAuthenticatedAccount"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getDappKey=function(){return o._handleError(o._postMessageToChild({method:"getLoginKey"}))},o.getLoginKey=function(){return console.warn("Deprecation notice: `authereum.getLoginKey()` is deprecated. Use `authereum.getDappKey()` instead."),o.getDappKey()},o.signMessage=b.throttle((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(a(o),void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._handleError(this._postMessageToChild({method:"signMessage",params:[t,e]})));case 1:case"end":return r.stop()}}),r,this)})))}),250),o.signPersonalMessage=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"signMessage",params:[t,{personal:!0}]})));case 1:case"end":return e.stop()}}),e,this)})))}),250),o.signWithDappKey=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("Deprecation notice: `authereum.signWithDappKey()` is deprecated. Use `authereum.signMess()` instead."),e.abrupt("return",this.signMessage(t));case 2:case"end":return e.stop()}}),e,this)})))}),250),o.signWithLoginKey=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("Deprecation notice: `authereum.signWithLoginKey()` is deprecated. Use `authereum.signWithDappKey()` instead."),e.abrupt("return",this.signWithDappKey(t));case 2:case"end":return e.stop()}}),e,this)})))}),250),o.signTypedMessage=b.throttle((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(a(o),void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return console.warn("Deprecation notice: `authereum.signTypedMessage()` is deprecated. Use `authereum.signMessage()` instead."),r.abrupt("return",this.signMessage(t,e));case 2:case"end":return r.stop()}}),r,this)})))}),250),o.signTypedMessageWithDappKey=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("Deprecation notice: `authereum.signTypedMessageWithDappKey()` is deprecated. Use `authereum.signMessage()` instead."),e.abrupt("return",this.signTypedMessage(t));case 2:case"end":return e.stop()}}),e,this)})))}),250),o.signMessageWithAdminKey=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.warn("Deprecation notice: `authereum.signMessageWithAdminKey()` is deprecated. Use `authereum.signMessageWithSigningKey()` instead."),t.abrupt("return",null);case 2:case"end":return t.stop()}}),t)})))}),250),o.signMessageWithSigningKey=b.throttle((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(a(o),void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._handleError(this._postMessageToChild({method:"signMessageWithSigningKey",params:[t,e]})));case 1:case"end":return r.stop()}}),r,this)})))}),250),o.getSigningKeyAddress=function(t){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getSigningKeyAddress"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getLoginKeyAuthSignature=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getLoginKeyAuthSignature"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getLoginKeyRestrictionsData=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getLoginKeyRestrictionsData"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getSigningKeyAuthSignature=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getSigningKeyAuthSignature"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getAccountAddress=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getAccountAddress"})));case 3:case"end":return t.stop()}}),t,this)})))},o.getBalance=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getBalance"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getRpcUri=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilConfigReady();case 2:return t.abrupt("return",this._rpcUri);case 3:case"end":return t.stop()}}),t,this)})))},o.getNetworkId=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getNetworkId"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getNetworkName=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getNetworkName"})));case 1:case"end":return t.stop()}}),t,this)})))},o.getCachedNetworkName=function(){return o._networkName},o.getProvider=function(){return o._provider},o.getStarkProvider=function(){return o._starkProvider||(o._starkProvider=new g.default(a(o))),o._starkProvider},o.getZkSyncProvider=function(){return o._zkSyncProvider||(o._zkSyncProvider=new y.default(a(o))),o._zkSyncProvider},o._handleError=function(t){return c(a(o),void 0,void 0,n.mark((function e(){var r=this;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.catch((function(t){throw r.emit("error",t),t})));case 1:case"end":return e.stop()}}),e)})))},o.signTransaction=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"signTransaction",params:_(t)})));case 3:case"end":return e.stop()}}),e,this)})))}),250),o.signTransactionWithLoginKey=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.warn("Deprecation notice: `authereum.signTransactionWithLoginKey()` is deprecated. Use `authereum.signTransaction()` instead."),e.abrupt("return",this.signTransaction(t));case 2:case"end":return e.stop()}}),e,this)})))}),250),o.sendTransaction=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"sendTransaction",params:_(t)})));case 3:case"end":return e.stop()}}),e,this)})))}),250),o.sendTransactionBatch=b.throttle((function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"sendTransactionBatch",params:t.map(_)})));case 3:case"end":return e.stop()}}),e,this)})))}),250),o.estimateGas=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"estimateGasBatch",params:_(t)})));case 3:case"end":return e.stop()}}),e,this)})))},o.estimateGasBatch=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"estimateGasBatch",params:t.map(_)})));case 3:case"end":return e.stop()}}),e,this)})))},o.isReady=function(){return o._iframeReady&&o._cacheReady},o.updateConfig=function(t){o._userConfig=t,o._setConfig(t)},o.getConfig=function(){return{apiUri:o._apiUri,rpcUri:o._rpcUri,webUri:o._webUri,xsUri:o._xsUri,networkName:o._networkName,networkId:o._networkId,disableNotifications:o._disableNotifications}},o.showWidget=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return this._widgetEnabled=!1,e.abrupt("return",this._postMessageToChild({method:"hideWidget"}));case 3:return this._widgetEnabled=!0,e.abrupt("return",this._postMessageToChild({method:"showWidget"}));case 5:case"end":return e.stop()}}),e,this)})))},o.hideWidget=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._widgetEnabled=!1,t.abrupt("return",this._postMessageToChild({method:"hideWidget"}));case 2:case"end":return t.stop()}}),t,this)})))},o.widgetEnabled=function(){return o._widgetEnabled},o.addFunds=function(t){return o._postMessageToChild({method:"addFunds",params:t})},o._openUrl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,r=t.newWindow;r?window.open(e,"_blank"):window.location.href=e},o._tilIframeReady=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._iframeReady){t.next=4;break}return t.next=3,b.wait(100);case 3:return t.abrupt("return",this._tilIframeReady());case 4:return t.next=6,b.wait(100);case 6:return t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t,this)})))},o._tilConfigReady=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._configReady){t.next=4;break}return t.next=3,b.wait(100);case 3:return t.abrupt("return",this._tilConfigReady());case 4:return t.next=6,b.wait(100);case 6:return t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t,this)})))},o._tilReady=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isReady()){t.next=4;break}return t.next=3,b.wait(100);case 3:return t.abrupt("return",this._tilReady());case 4:return t.next=6,b.wait(100);case 6:return t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t,this)})))},o._emitReadyEvent=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:if(!this._readyEmitted){t.next=4;break}return t.abrupt("return");case 4:this._readyEmitted=!0,this.emit("ready",{});case 6:case"end":return t.stop()}}),t,this)})))},o._connectToChildIframe=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e,r=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._iframeConnecting){t.next=2;break}return t.abrupt("return",this._iframeConnecting);case 2:return this._iframeReady=!1,this._iframeConnecting=!0,t.next=6,this._getOrCreateMainIframe();case 6:return e=t.sent,this._iframeConnection=l.default.connectToChild({iframe:e,timeout:6e4,methods:{postMessage:function(t){return r._handlePostMessage(t)}}}),this._iframeConnecting=new Promise((function(t,e){var n=!1,i=setTimeout((function(){r._iframeReady||(n=!0,r._iframeConnecting=null,e(new Error("timedout")))}),6e3);r._iframeConnection.promise.then((function(e){clearTimeout(i),n||(r._iframeReady=!0,r._childIframeConnection=e,r._startHeartbeat(),r._iframeConnecting=null,t())})).catch((function(t){clearTimeout(i),n||e(t)}))})),t.abrupt("return",this._iframeConnecting);case 10:case"end":return t.stop()}}),t,this)})))},o._startHeartbeat=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o._heartbeatStarted||(o._heartbeat(t),o._heartbeatStarted=!0)},o._heartbeat=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._destroyed){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,b.wait(2e3);case 4:if(e.prev=4,!t){e.next=10;break}return e.next=8,this._connectToChildIframe();case 8:return this._backoffTimeout=1,e.abrupt("return",this._heartbeat());case 10:return e.next=12,this._ping();case 12:e.next=21;break;case 14:if(e.prev=14,e.t0=e.catch(4),!/destroy|timedout/gi.test(e.t0.message)){e.next=21;break}return e.next=19,b.wait(1e3*this._backoffTimeout);case 19:return this._backoffTimeout=this._backoffTimeout<<1,e.abrupt("return",this._heartbeat(!0));case 21:return e.abrupt("return",this._heartbeat());case 22:case"end":return e.stop()}}),e,this,[[4,14]])})))},o._ping=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=3;break}return console.warn("Authereum instance destroyed. Message not posted to child."),t.abrupt("return");case 3:return t.abrupt("return",new Promise((function(t,r){var n=!1,i=setTimeout((function(){n=!0}),5e3);e._postMessageToChild({method:"ping"}).then((function(e){clearTimeout(i),n?r(new Error("timedout")):"pong"===e?t(e):r(new Error("Invalid response"))})).catch((function(t){r(t)}))})));case 4:case"end":return t.stop()}}),t,this)})))},o._constructIframe=function(t){var e=function(t){var e=t.id,r=t.url,n=t.isPreload,i=t.disableGoogleAnalytics,o=window.location.href;try{o=parent.document.URL}catch(u){}var s=b.updateQueryParams({url:o,isPreload:n,disableGoogleAnalytics:i},r),a=document.createElement("iframe");return a.id=e,a.name=e.replace(/--.*/,""),a.title=e,a.src=s,["Safari","Firefox"].includes(b.browserInfo().browser)&&a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.style.position="fixed",a.style.bottom="0",a.style.right="0",a.style.width="0",a.style.height="0",a.style.border="0",a.style.background="transparent",a.style.zIndex="".concat(M.zIndex),a.setAttribute("frameborder","0"),a.setAttribute("scrolling","no"),a}(Object.assign(Object.assign({},t),{isPreload:o._isPreload,disableGoogleAnalytics:o._disableGoogleAnalytics}));return o._debug&&(e.style.outline="1px solid red"),o._injectedElements.push(e),e},o._getConfigFromChild=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"getConfig"}));case 1:case"end":return t.stop()}}),t,this)})))},o._postVersionToChild=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"version",params:this.version()}));case 1:case"end":return t.stop()}}),t,this)})))},o._postConfigToChild=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._postMessageToChild({method:"config",params:{apiKey:this._apiKey,disableNotifications:this._disableNotifications}}));case 1:case"end":return t.stop()}}),t,this)})))},o._loadAsymmetricEncryptionKeyFromChild=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._postMessageToChild({method:"getAsymmetricEncryptionKey"});case 2:this._asymmetricEncryptionKey=t.sent;case 3:case"end":return t.stop()}}),t,this)})))},o._postMessageToChild=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilIframeReady();case 2:if(!this._destroyed){e.next=4;break}throw new Error("Authereum instance destroyed.");case 4:if(this._bodyContainsIframe()){e.next=10;break}if(this._destroyed=!0,this._teardownEventListeners(),"destroy"!==t.method){e.next=9;break}return e.abrupt("return");case 9:throw new Error("Authereum instance or iframe destroyed.");case 10:return e.abrupt("return",this._handleError(this._childIframeConnection.postMessage(t)));case 11:case"end":return e.stop()}}),e,this)})))},o._handleChildLogoutEvent=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._resetCache();case 2:this.emit("logout",{});case 3:case"end":return t.stop()}}),t,this)})))},o._handleChildDappKeyExpired=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==this._cachedLoginKeyAddress){e.next=5;break}return e.next=3,this._resetCache();case 3:this.emit("dappKeyExpired",t),this.emit("logout");case 5:case"end":return e.stop()}}),e,this)})))},o._handlePostMessage=function(t){try{var e=t.method,r=t.params;switch(e){case"onError":var n=r;return o.emit("error",n),void o._notifier.notify({type:"error",message:n.message});case"onLogout":return o._handleChildLogoutEvent();case"onDappKeyExpired":return o._handleChildDappKeyExpired(r);case"login":return o.login();case"setWidgetPosition":return;case"setWidgetSize":var i=r,s=i.width,a=i.height;return o._iframeStyle.width=s,o._iframeStyle.height=a,o._refreshWidget();case"setWidgetStyle":var u=r;for(var h in u)o._iframeStyle[h]=u[h];return o._refreshWidget();case"setNotificationWidgetSize":var c=r,f=c.width,l=c.height;return o._notificationIframeStyle.width=f,o._notificationIframeStyle.height=l,o._refreshNotificationWidget();case"setNotificationWidgetStyle":var d=r;for(var p in d)o._notificationIframeStyle[p]=d[p];return o._refreshNotificationWidget();case"getWindowSize":return o._getWindowSize();case"hideWidget":return o.hideWidget();case"log":return o._handlePostMessageLog(r);case"openUrl":return o._openUrl(r)}}catch(n){}},o._handlePostMessageLog=function(t){if(!o._isPreload){var e=t.type,r=t.message;e||(e="log"),console[e](r)}},o._getWindowSize=function(){return{width:o._getWindowWidth(),height:o._getWindowHeight()}},o._getWindowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},o._getWindowHeight=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},o._setIframePositionLeft=function(t){o._iframe&&(o._iframe.style.left="".concat(t,"px"))},o._setIframeWidth=function(t){o._iframe&&(o._iframe.style.width="".concat(t,"px"))},o._setIframeHeight=function(t){o._iframe&&(o._iframe.style.height="".concat(t,"px"))},o._refreshWidget=function(){var t=o._iframeStyle,e=(t.top,t.left,t.width),r=t.height,n=t.zIndex;o._isPreload||o._iframe&&(o._setIframeWidth(e),o._setIframeHeight(r),o._iframe.style.zIndex="".concat(n||0))},o._refreshNotificationWidget=function(){var t=o._notificationIframeStyle,e=(t.top,t.left,t.width),r=t.height,n=t.zIndex;o._isPreload||(o._notificationIframe.style.width="".concat(e,"px"),o._notificationIframe.style.height="".concat(r,"px"),o._notificationIframe.style.zIndex="".concat(n||0))},o._loginKeyExists=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getLoginKey();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))},o._accountAddressExists=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAccountAddress();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))},o._getAccountAdminKeyNonce=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._handleError(this._postMessageToChild({method:"getAccountAuthKeyNonce"})));case 1:case"end":return t.stop()}}),t,this)})))},o._getAccountAuthKeyNonce=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.warn("Deprecation notice: `authereum._getAccountAuthKeyNonce()` is deprecated. Use `authereum._getAccountAdminKeyNonce()` instead."),t.abrupt("return",this._getAccountAdminKeyNonce());case 2:case"end":return t.stop()}}),t,this)})))},o._executeLoginKeyMetaTx=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"executeLoginKeyMetaTx",params:_(t)})));case 1:case"end":return e.stop()}}),e,this)})))},o._loadLoginKey=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tilReady();case 2:return e.abrupt("return",this._handleError(this._postMessageToChild({method:"loadLoginKey",params:t})));case 3:case"end":return e.stop()}}),e,this)})))},o._getAuthenticateUri=function(t){var e=o._asymmetricEncryptionKey,r=new Date;r.setDate(r.getDate()+30);var n=r.getTime()/1e3|0;return o._webUri+"/?slk="+encodeURIComponent(JSON.stringify({loginKey:{publicAddress:t,expiresAt:n},encryptionKey:e}))+"&redirect_uri="+o._redirectUri},o._getSignWithAdminKeyUri=function(t){return p.default(t)&&(t="0x".concat(t.toString("hex"))),o._webUri+"/?sm="+encodeURIComponent(JSON.stringify({message:t}))+"&redirect_uri="+o._redirectUri},o._openPopupOrRedirect=function(t){return c(a(o),void 0,void 0,n.mark((function e(){var r,i,o,s,a=this;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.emit("openPopup",{}),!this._forceRedirect){e.next=4;break}return window.location.href=t,e.abrupt("return");case 4:if(r=this._getAuthereumPopupWindow(t),!(i=this._isAuthereumPopupBlocked(r))||this._blockedPopupRedirect){e.next=12;break}throw o=new Error("Disable popup blocker and try again"),this._notifier.notify({type:"error",message:o.message,timeout:5e3}),o;case 12:if(!i){e.next=26;break}return this.emit("popupBlocked"),e.next=16,this._showConfirmPopupOrRedirectModal();case 16:if(e.sent){e.next=21;break}throw s="Popup or redirect rejected",this.emit("error",s),new Error(s);case 21:if(r=this._getAuthereumPopupWindow(t),!(i=this._isAuthereumPopupBlocked(r))){e.next=26;break}return window.location.href=t,e.abrupt("return");case 26:return r.focus(),e.abrupt("return",new Promise((function(t,e){var i=setInterval((function(){return c(a,void 0,void 0,n.mark((function t(){var i;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.closed&&(s(),i=new Error("Window closed"),this.emit("error",i),this.emit("closePopup",{}),e(i));case 1:case"end":return t.stop()}}),t,this)})))}),250),o=setTimeout((function(){s(),r.close(),u(new Error("Timedout"))}),6e5),s=function(){clearInterval(i),clearTimeout(o),a.emit("closePopup",{})},u=function(t){s(),a.emit("error",t),e(t)},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(),t(e)};a.addEventListener("message",(function(t){return c(a,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.origin.includes(this._webUri)){e.next=13;break}if(t.data.close&&(r.close(),h()),!t.data.login){e.next=11;break}if(h({success:!0}),this.emit("login",{}),this._cachedIsAuthenticated=!0,!t.data.encryptedSigningKey){e.next=9;break}return e.next=9,this._loadSigningKey(t.data.encryptedSigningKey);case 9:this._logAnalyticsEvent({eventType:"logged_in_dapp",properties:{dapp_url:window.location.href}}),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri);case 11:t.data.result&&(h(t.data.result),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri)),t.data.error&&(u(new Error(t.data.error)),this._redirectUri!==window.location.href&&(window.location.href=this._redirectUri));case 13:case"end":return e.stop()}}),e,this)})))}),!1)})));case 28:case"end":return e.stop()}}),e,this)})))},o.addEventListener=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];window.addEventListener(t,e,r),o._eventListeners.push({type:t,listener:e,useCapture:r})},o._showConfirmPopupOrRedirectModal=function(){return o._handleError(o._postMessageToChild({method:"showConfirmPopupOrRedirectModal"}))},o._signLoginKeyRequest=function(t){return c(a(o),void 0,void 0,n.mark((function e(){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._getAuthenticateUri(t),e.abrupt("return",this._openPopupOrRedirect(r));case 2:case"end":return e.stop()}}),e,this)})))},o._tilDomReady=function(){return c(a(o),void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){"undefined"!==typeof window&&("loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",(function(){return t()})))})));case 1:case"end":return t.stop()}}),t)})))},o.version=function(){return m.default},o.isAuthenticatedSync=function(){return o._cachedIsAuthenticated},o.getTransactionReceipt=function(t){return o._handleError(o._postMessageToChild({method:"getTransactionReceipt",params:t}))},o.waitForTransactionReceipt=function(t){return o._handleError(o._postMessageToChild({method:"waitForTransactionReceipt",params:t}))},o.hasRecoveryEnabled=function(){return o._handleError(o._postMessageToChild({method:"hasRecoveryEnabled"}))},o.getEncryptionPublicKey=function(){return o._handleError(o._postMessageToChild({method:"getEncryptionPublicKey"}))},o.encryptMessage=function(t){return o._handleError(o._postMessageToChild({method:"encryptMessage",params:t}))},o.decryptMessage=function(t){return o._handleError(o._postMessageToChild({method:"decryptMessage",params:t}))},o.isContractDeployed=function(t){return o._handleError(o._postMessageToChild({method:"isContractDeployed",params:t}))},o._loadSigningKey=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._destroyed){e.next=3;break}return console.warn("Authereum instance destroyed. Message not posted to child."),e.abrupt("return");case 3:return e.abrupt("return",this._postMessageToChild({method:"loadSigningKey",params:t}));case 4:case"end":return e.stop()}}),e,this)})))},o._logAnalyticsEvent=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._destroyed){e.next=3;break}return console.warn("Authereum instance destroyed. Message not posted to child."),e.abrupt("return");case 3:return e.abrupt("return",this._postMessageToChild({method:"logAnalyticsEvent",params:t}));case 4:case"end":return e.stop()}}),e,this)})))},o._setupSigningKey=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._tilReady();case 2:if(!(e=this._authereumQueryParams.encryptedSigningKey)){t.next=8;break}return t.next=6,this._loadSigningKey(e);case 6:if(t.sent)try{localStorage.removeItem("_authereum")}catch(r){}case 8:case"end":return t.stop()}}),t,this)})))},o._cacheAuthereumQueryParams=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e,r,i;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{if(e=b.getQueryParamValue("_authereum")){this._authereumQueryParams=JSON.parse(e);try{localStorage.setItem("_authereum",btoa(JSON.stringify(this._authereumQueryParams)))}catch(n){}r=b.removeQueryParam("_authereum"),b.replaceWindowUrl(r)}else try{(i=localStorage.getItem("_authereum"))&&(this._authereumQueryParams=JSON.parse(atob(i)))}catch(n){}}catch(n){}case 1:case"end":return t.stop()}}),t,this)})))},o.destroy=function(){return c(a(o),void 0,void 0,n.mark((function t(){var e,r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._destroyed){t.next=3;break}return console.warn("Authereum instance already destroyed."),t.abrupt("return",!0);case 3:if(t.prev=3,!this._iframeReady||!this._bodyContainsIframe()){t.next=7;break}return t.next=7,this._postMessageToChild({method:"destroy"});case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),console.warn(t.t0);case 12:for(e=0;e<this._injectedElements.length;e++){r=this._injectedElements[e];try{r.remove()}catch(n){console.error(n)}}return this._iframeReady=!1,this._destroyed=!0,console.warn("Authereum instance destroyed."),this._teardownEventListeners(),this.emit("destroy",{}),t.abrupt("return",!0);case 19:case"end":return t.stop()}}),t,this,[[3,9]])})))},o.isDestroyed=function(){return o._destroyed},o.getAddressQrCodeDataUri=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postMessageToChild({method:"getAddressQrCodeDataUri",params:{address:t}}));case 1:case"end":return e.stop()}}),e,this)})))},o._loadNotificationsIframe=function(t){return c(a(o),void 0,void 0,n.mark((function e(){var r,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="authereum__x-notification-iframe",!(i=document.getElementById(r))||i.src!==t){e.next=6;break}this._notificationIframe=i,e.next=15;break;case 6:return i&&i.remove(),this._notificationIframe=this._constructIframe({id:r,url:t}),this._notificationIframe.style.top="0",this._notificationIframe.style.right="0",e.next=12,this._tilDomReady();case 12:(i=document.getElementById(r))&&i.remove(),document.body.appendChild(this._notificationIframe);case 15:case"end":return e.stop()}}),e,this)})))},o._setDebug=function(t){return c(a(o),void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._debug=t,this._debug?(this._iframe.style.outline="1px solid red",this._notificationIframe.style.outline="1px solid red"):(this._iframe.style.outline="0",this._notificationIframe.style.outline="0");case 2:case"end":return e.stop()}}),e,this)})))},o._userConfig=t,t instanceof Object&&(o._isPreload=!!t.isPreload,o._disableGoogleAnalytics=!!t.disableGoogleAnalytics);var u=o._checkCachedInstance(t);return u?s(o,u):(o._init(t),window._authereumInstances&&window._authereumInstances.push(a(o)),o)}return o(r,[{key:"_checkCachedInstance",value:function(t){var e=null;if(Array.isArray(window._authereumInstances)&&window._authereumInstances.length&&(e=window._authereumInstances.pop()),e)if(e.isReady()){if("string"===typeof t){if(e.getCachedNetworkName()===t)return this._merge(e);e.destroy(),e=null}else if(t instanceof Object){if(e.getCachedNetworkName()===t.networkName&&!t.xsUri)return this._merge(e);e.destroy(),e=null}}else e.destroy(),e=null}},{key:"_merge",value:function(t){var e=this;return this._debug=t._debug,this._apiKey=t._apiKey,this._apiUri=t._apiUri,this._rpcUri=t._rpcUri,this._webUri=t._webUri,this._xsUri=t._xsUri,this._notifierUri=t._notifierUri,this._networkName=t._networkName,this._networkId=t._networkId,this._redirectUri=t._redirectUri,this._iframeConnection=t._iframeConnection,this._childIframeConnection=t._childIframeConnection,this._iframe=t._iframe,this._notificationIframe=t._notificationIframe,this._cacheReady=t._cacheReady,this._cachedLoginKeyAddress=t._cachedLoginKeyAddress,this._cachedAccountAddress=t._cachedAccountAddress,this._cachedIsAuthenticated=t._cachedIsAuthenticated,this._iframeReady=t._iframeReady,this._configReady=t._configReady,this._iframeStyle=t._iframeStyle,this._notificationIframeStyle=t._notificationIframeStyle,this._heartbeatStarted=t._heartbeatStarted,this._backoffTimeout=t._backoffTimeout,this._asymmetricEncryptionKey=t._asymmetricEncryptionKey,this._authereumQueryParams=t._authereumQueryParams,this._injectedElements=t._injectedElements,this._notificationsMap=t._notificationsMap,t._handlePostMessage=this._handlePostMessage.bind(t),this._initConfig(this._userConfig),this._cacheLoginKeyAddress(),this._getConfigFromChild().then((function(t){e._setConfig(t),e._postConfigToChild().catch(E),e.emit("iframeReady",{})})).catch(E),this._emitReadyEvent(),this._provider=new v.default(this),this._refreshWidget(),this}},{key:"_setupFocusListener",value:function(){this.addEventListener("focus",this._handleWindowFocus,!1)}},{key:"_setupActionKeyListener",value:function(){this.addEventListener("keydown",this._handleActionKeyPress,!1)}},{key:"_teardownEventListeners",value:function(){for(var t=0;t<this._eventListeners.length;t++){var e=this._eventListeners[t],r=e.type,n=e.listener,i=e.useCapture;window.removeEventListener(r,n,i)}}},{key:"_getOrCreateMainIframe",value:function(){return c(this,void 0,void 0,n.mark((function t(){var e=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._iframe&&(this._iframeConnection&&this._iframeConnection.destroy(),this._iframe.remove()),t.abrupt("return",new Promise((function(t){return c(e,void 0,void 0,n.mark((function e(){var r,i,o,s=this;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="authereum__x-iframe",!(i=document.getElementById(r))||i.src!==this._xsUri){e.next=6;break}this._iframe=i,e.next=16;break;case 6:return this._iframe=this._constructIframe({id:r,url:this._xsUri}),o="".concat(this._xsUri.replace(/\/$/,""),"/notifications"),this._loadNotificationsIframe(o).catch(E),t(this._iframe),e.next=12,this._tilDomReady();case 12:(i=document.getElementById(r))&&i.remove(),document.body.appendChild(this._iframe),this._iframe.onload=function(){s._postVersionToChild().catch(E),s._loadAsymmetricEncryptionKeyFromChild().catch(E),s._getConfigFromChild().then((function(t){o!==t.notifierIframeUri&&s._loadNotificationsIframe(t.notifierIframeUri),s._setConfig(t),s._postConfigToChild().catch(E),s._configReady=!0,s.emit("iframeReady",{})})).catch(E)};case 16:case"end":return e.stop()}}),e,this)})))})));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"_bodyContainsIframe",value:function(){return document.body.contains(this._iframe)}},{key:"_getAuthereumPopupWindow",value:function(t){return window.open(t,"Authereum","toolbar=no,\n      location=no,\n      status=no,\n      menubar=no,\n      scrollbars=no,\n      resizable=no,\n      width=470,\n      height=640")}},{key:"_isAuthereumPopupBlocked",value:function(t){return null===t||void 0===t}},{key:"isPreload",value:function(){return this._isPreload}}]),r}(d.default);if(e.default=x,x.version=function(){return m.default},"undefined"!==typeof window&&(window.Authereum=x,window._authereumInstances=[],b.getQueryParamValue("authereum_debug"))){for(var k="mainnet",S=["kovan","goerli","rinkeby","ropsten"],T=0;T<S.length;T++)if(window.location.href.includes(S[T])){k=S[T];break}var I=new x({networkName:k,isPreload:!0});window._authereumInstances.push(I)}},794:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}},t.exports=e.default},797:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}},t.exports=e.default},798:function(t,e,r){var n=r(620),i=r(737);function o(t){var e=new Error("Expect argument to be non-empty array");if("object"!==typeof t||!t.length)throw e;var r=t.map((function(t){return"bytes"===t.type?n.toBuffer(t.value):t.value})),o=t.map((function(t){return t.type})),s=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return i.soliditySHA3(["bytes32","bytes32"],[i.soliditySHA3(new Array(t.length).fill("string"),s),i.soliditySHA3(o,r)])}function s(t,e){var r=n.toBuffer(e),i=n.fromRpcSig(r);return n.ecrecover(t,i.v,i.r,i.s)}function a(t){var e=n.toBuffer(t.data);return s(n.hashPersonalMessage(e),t.sig)}function u(t,e){for(var r=""+t;r.length<e;)r="0"+r;return r}t.exports={concatSig:function(t,e,r){var i=n.fromSigned(e),o=n.fromSigned(r),s=n.bufferToInt(t),a=u(n.toUnsigned(i).toString("hex"),64),h=u(n.toUnsigned(o).toString("hex"),64),c=n.stripHexPrefix(n.intToHex(s));return n.addHexPrefix(a.concat(h,c)).toString("hex")},normalize:function(t){if(t){if("number"===typeof t){var e=n.toBuffer(t);t=n.bufferToHex(e)}if("string"!==typeof t){var r="eth-sig-util.normalize() requires hex string or integer input.";throw new Error(r+=" received "+typeof t+": "+t)}return n.addHexPrefix(t.toLowerCase())}},personalSign:function(t,e){var r=n.toBuffer(e.data),i=n.hashPersonalMessage(r),o=n.ecsign(i,t);return n.bufferToHex(this.concatSig(o.v,o.r,o.s))},recoverPersonalSignature:function(t){var e=a(t),r=n.publicToAddress(e);return n.bufferToHex(r)},extractPublicKey:function(t){return"0x"+a(t).toString("hex")},typedSignatureHash:function(t){var e=o(t);return n.bufferToHex(e)},signTypedData:function(t,e){var r=o(e.data),i=n.ecsign(r,t);return n.bufferToHex(this.concatSig(i.v,i.r,i.s))},recoverTypedSignature:function(t){var e=s(o(t.data),t.sig),r=n.publicToAddress(e);return n.bufferToHex(r)}}},802:function(t,e,r){var n=r(736);function i(){}t.exports=i,i.prototype.setEngine=function(t){var e=this;e.engine||(e.engine=t,t.on("block",(function(t){e.currentBlock=t})),t.on("start",(function(){e.start()})),t.on("stop",(function(){e.stop()})))},i.prototype.handleRequest=function(t,e,r){throw new Error("Subproviders should override `handleRequest`.")},i.prototype.emitPayload=function(t,e){this.engine.sendAsync(n(t),e)},i.prototype.stop=function(){},i.prototype.start=function(){}},803:function(t,e,r){var n=r(41),i=r(42),o=r(94),s=r(95),a=r(619),u=r(738),h=function(t){"use strict";o(r,t);var e=s(r);function r(t,i,o){var s;if(n(this,r),!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!i||"string"!==typeof i)throw new Error('"message" must be a nonempty string.');return(s=e.call(this,i)).code=t,void 0!==o&&(s.data=o),s}return i(r,[{key:"serialize",value:function(){var t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}},{key:"toString",value:function(){return u(this.serialize(),f,2)}}]),r}(a(Error)),c=function(t){"use strict";o(r,t);var e=s(r);function r(t,i,o){if(n(this,r),!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return e.call(this,t,i,o)}return r}(h);function f(t,e){if("[Circular]"!==e)return e}t.exports={JsonRpcError:h,EthJsonRpcError:c}},804:function(t){t.exports=JSON.parse('{"jsonRpc":{"parse":-32700,"invalidRequest":-32600,"methodNotFound":-32601,"invalidParams":-32602,"internal":-32603},"eth":{"userRejectedRequest":4001,"unauthorized":4100,"unsupportedMethod":4200}}')},809:function(t,e,r){(function(t,r){var n;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,s=Array.prototype,a=Object.prototype,u="undefined"!==typeof Symbol?Symbol.prototype:null,h=s.push,c=s.slice,f=a.toString,l=a.hasOwnProperty,d=Array.isArray,p=Object.keys,m=Object.create,v=function(){},g=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};e.nodeType?i._=g:(!r.nodeType&&r.exports&&(e=r.exports=g),e._=g),g.VERSION="1.9.1";var y,w=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)}}return function(){return t.apply(e,arguments)}},b=function(t,e,r){return g.iteratee!==y?g.iteratee(t,e):null==t?g.identity:g.isFunction(t)?w(t,e,r):g.isObject(t)&&!g.isArray(t)?g.matcher(t):g.property(t)};g.iteratee=y=function(t,e){return b(t,e,1/0)};var _=function(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;i<r;i++)n[i]=arguments[i+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n);case 2:return t.call(this,arguments[0],arguments[1],n)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=n,t.apply(this,o)}},M=function(t){if(!g.isObject(t))return{};if(m)return m(t);v.prototype=t;var e=new v;return v.prototype=null,e},E=function(t){return function(e){return null==e?void 0:e[t]}},A=function(t,e){return null!=t&&l.call(t,e)},x=function(t,e){for(var r=e.length,n=0;n<r;n++){if(null==t)return;t=t[e[n]]}return r?t:void 0},k=Math.pow(2,53)-1,S=E("length"),T=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=k};g.each=g.forEach=function(t,e,r){var n,i;if(e=w(e,r),T(t))for(n=0,i=t.length;n<i;n++)e(t[n],n,t);else{var o=g.keys(t);for(n=0,i=o.length;n<i;n++)e(t[o[n]],o[n],t)}return t},g.map=g.collect=function(t,e,r){e=b(e,r);for(var n=!T(t)&&g.keys(t),i=(n||t).length,o=Array(i),s=0;s<i;s++){var a=n?n[s]:s;o[s]=e(t[a],a,t)}return o};var I=function(t){var e=function(e,r,n,i){var o=!T(e)&&g.keys(e),s=(o||e).length,a=t>0?0:s-1;for(i||(n=e[o?o[a]:a],a+=t);a>=0&&a<s;a+=t){var u=o?o[a]:a;n=r(n,e[u],u,e)}return n};return function(t,r,n,i){var o=arguments.length>=3;return e(t,w(r,i,4),n,o)}};g.reduce=g.foldl=g.inject=I(1),g.reduceRight=g.foldr=I(-1),g.find=g.detect=function(t,e,r){var n=(T(t)?g.findIndex:g.findKey)(t,e,r);if(void 0!==n&&-1!==n)return t[n]},g.filter=g.select=function(t,e,r){var n=[];return e=b(e,r),g.each(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n},g.reject=function(t,e,r){return g.filter(t,g.negate(b(e)),r)},g.every=g.all=function(t,e,r){e=b(e,r);for(var n=!T(t)&&g.keys(t),i=(n||t).length,o=0;o<i;o++){var s=n?n[o]:o;if(!e(t[s],s,t))return!1}return!0},g.some=g.any=function(t,e,r){e=b(e,r);for(var n=!T(t)&&g.keys(t),i=(n||t).length,o=0;o<i;o++){var s=n?n[o]:o;if(e(t[s],s,t))return!0}return!1},g.contains=g.includes=g.include=function(t,e,r,n){return T(t)||(t=g.values(t)),("number"!=typeof r||n)&&(r=0),g.indexOf(t,e,r)>=0},g.invoke=_((function(t,e,r){var n,i;return g.isFunction(e)?i=e:g.isArray(e)&&(n=e.slice(0,-1),e=e[e.length-1]),g.map(t,(function(t){var o=i;if(!o){if(n&&n.length&&(t=x(t,n)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),g.pluck=function(t,e){return g.map(t,g.property(e))},g.where=function(t,e){return g.filter(t,g.matcher(e))},g.findWhere=function(t,e){return g.find(t,g.matcher(e))},g.max=function(t,e,r){var n,i,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,u=(t=T(t)?t:g.values(t)).length;a<u;a++)null!=(n=t[a])&&n>o&&(o=n);else e=b(e,r),g.each(t,(function(t,r,n){((i=e(t,r,n))>s||i===-1/0&&o===-1/0)&&(o=t,s=i)}));return o},g.min=function(t,e,r){var n,i,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,u=(t=T(t)?t:g.values(t)).length;a<u;a++)null!=(n=t[a])&&n<o&&(o=n);else e=b(e,r),g.each(t,(function(t,r,n){((i=e(t,r,n))<s||i===1/0&&o===1/0)&&(o=t,s=i)}));return o},g.shuffle=function(t){return g.sample(t,1/0)},g.sample=function(t,e,r){if(null==e||r)return T(t)||(t=g.values(t)),t[g.random(t.length-1)];var n=T(t)?g.clone(t):g.values(t),i=S(n);e=Math.max(Math.min(e,i),0);for(var o=i-1,s=0;s<e;s++){var a=g.random(s,o),u=n[s];n[s]=n[a],n[a]=u}return n.slice(0,e)},g.sortBy=function(t,e,r){var n=0;return e=b(e,r),g.pluck(g.map(t,(function(t,r,i){return{value:t,index:n++,criteria:e(t,r,i)}})).sort((function(t,e){var r=t.criteria,n=e.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return t.index-e.index})),"value")};var P=function(t,e){return function(r,n,i){var o=e?[[],[]]:{};return n=b(n,i),g.each(r,(function(e,i){var s=n(e,i,r);t(o,e,s)})),o}};g.groupBy=P((function(t,e,r){A(t,r)?t[r].push(e):t[r]=[e]})),g.indexBy=P((function(t,e,r){t[r]=e})),g.countBy=P((function(t,e,r){A(t,r)?t[r]++:t[r]=1}));var N=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;g.toArray=function(t){return t?g.isArray(t)?c.call(t):g.isString(t)?t.match(N):T(t)?g.map(t,g.identity):g.values(t):[]},g.size=function(t){return null==t?0:T(t)?t.length:g.keys(t).length},g.partition=P((function(t,e,r){t[r?0:1].push(e)}),!0),g.first=g.head=g.take=function(t,e,r){return null==t||t.length<1?null==e?void 0:[]:null==e||r?t[0]:g.initial(t,t.length-e)},g.initial=function(t,e,r){return c.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))},g.last=function(t,e,r){return null==t||t.length<1?null==e?void 0:[]:null==e||r?t[t.length-1]:g.rest(t,Math.max(0,t.length-e))},g.rest=g.tail=g.drop=function(t,e,r){return c.call(t,null==e||r?1:e)},g.compact=function(t){return g.filter(t,Boolean)};var R=function t(e,r,n,i){for(var o=(i=i||[]).length,s=0,a=S(e);s<a;s++){var u=e[s];if(T(u)&&(g.isArray(u)||g.isArguments(u)))if(r)for(var h=0,c=u.length;h<c;)i[o++]=u[h++];else t(u,r,n,i),o=i.length;else n||(i[o++]=u)}return i};g.flatten=function(t,e){return R(t,e,!1)},g.without=_((function(t,e){return g.difference(t,e)})),g.uniq=g.unique=function(t,e,r,n){g.isBoolean(e)||(n=r,r=e,e=!1),null!=r&&(r=b(r,n));for(var i=[],o=[],s=0,a=S(t);s<a;s++){var u=t[s],h=r?r(u,s,t):u;e&&!r?(s&&o===h||i.push(u),o=h):r?g.contains(o,h)||(o.push(h),i.push(u)):g.contains(i,u)||i.push(u)}return i},g.union=_((function(t){return g.uniq(R(t,!0,!0))})),g.intersection=function(t){for(var e=[],r=arguments.length,n=0,i=S(t);n<i;n++){var o=t[n];if(!g.contains(e,o)){var s;for(s=1;s<r&&g.contains(arguments[s],o);s++);s===r&&e.push(o)}}return e},g.difference=_((function(t,e){return e=R(e,!0,!0),g.filter(t,(function(t){return!g.contains(e,t)}))})),g.unzip=function(t){for(var e=t&&g.max(t,S).length||0,r=Array(e),n=0;n<e;n++)r[n]=g.pluck(t,n);return r},g.zip=_(g.unzip),g.object=function(t,e){for(var r={},n=0,i=S(t);n<i;n++)e?r[t[n]]=e[n]:r[t[n][0]]=t[n][1];return r};var C=function(t){return function(e,r,n){r=b(r,n);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(r(e[o],o,e))return o;return-1}};g.findIndex=C(1),g.findLastIndex=C(-1),g.sortedIndex=function(t,e,r,n){for(var i=(r=b(r,n,1))(e),o=0,s=S(t);o<s;){var a=Math.floor((o+s)/2);r(t[a])<i?o=a+1:s=a}return o};var L=function(t,e,r){return function(n,i,o){var s=0,a=S(n);if("number"==typeof o)t>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(r&&o&&a)return n[o=r(n,i)]===i?o:-1;if(i!==i)return(o=e(c.call(n,s,a),g.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&o<a;o+=t)if(n[o]===i)return o;return-1}};g.indexOf=L(1,g.findIndex,g.sortedIndex),g.lastIndexOf=L(-1,g.findLastIndex),g.range=function(t,e,r){null==e&&(e=t||0,t=0),r||(r=e<t?-1:1);for(var n=Math.max(Math.ceil((e-t)/r),0),i=Array(n),o=0;o<n;o++,t+=r)i[o]=t;return i},g.chunk=function(t,e){if(null==e||e<1)return[];for(var r=[],n=0,i=t.length;n<i;)r.push(c.call(t,n,n+=e));return r};var O=function(t,e,r,n,i){if(!(n instanceof e))return t.apply(r,i);var o=M(t.prototype),s=t.apply(o,i);return g.isObject(s)?s:o};g.bind=_((function(t,e,r){if(!g.isFunction(t))throw new TypeError("Bind must be called on a function");var n=_((function(i){return O(t,n,e,this,r.concat(i))}));return n})),g.partial=_((function(t,e){var r=g.partial.placeholder;return function n(){for(var i=0,o=e.length,s=Array(o),a=0;a<o;a++)s[a]=e[a]===r?arguments[i++]:e[a];for(;i<arguments.length;)s.push(arguments[i++]);return O(t,n,this,this,s)}})),g.partial.placeholder=g,g.bindAll=_((function(t,e){var r=(e=R(e,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=e[r];t[n]=g.bind(t[n],t)}})),g.memoize=function(t,e){var r=function r(n){var i=r.cache,o=""+(e?e.apply(this,arguments):n);return A(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return r.cache={},r},g.delay=_((function(t,e,r){return setTimeout((function(){return t.apply(null,r)}),e)})),g.defer=g.partial(g.delay,g,1),g.throttle=function(t,e,r){var n,i,o,s,a=0;r||(r={});var u=function(){a=!1===r.leading?0:g.now(),n=null,s=t.apply(i,o),n||(i=o=null)},h=function(){var h=g.now();a||!1!==r.leading||(a=h);var c=e-(h-a);return i=this,o=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=null),a=h,s=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),s};return h.cancel=function(){clearTimeout(n),a=0,n=i=o=null},h},g.debounce=function(t,e,r){var n,i,o=function(e,r){n=null,r&&(i=t.apply(e,r))},s=_((function(s){if(n&&clearTimeout(n),r){var a=!n;n=setTimeout(o,e),a&&(i=t.apply(this,s))}else n=g.delay(o,e,this,s);return i}));return s.cancel=function(){clearTimeout(n),n=null},s},g.wrap=function(t,e){return g.partial(e,t)},g.negate=function(t){return function(){return!t.apply(this,arguments)}},g.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},g.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},g.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},g.once=g.partial(g.before,2),g.restArguments=_;var B=!{toString:null}.propertyIsEnumerable("toString"),D=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],U=function(t,e){var r=D.length,n=t.constructor,i=g.isFunction(n)&&n.prototype||a,o="constructor";for(A(t,o)&&!g.contains(e,o)&&e.push(o);r--;)(o=D[r])in t&&t[o]!==i[o]&&!g.contains(e,o)&&e.push(o)};g.keys=function(t){if(!g.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)A(t,r)&&e.push(r);return B&&U(t,e),e},g.allKeys=function(t){if(!g.isObject(t))return[];var e=[];for(var r in t)e.push(r);return B&&U(t,e),e},g.values=function(t){for(var e=g.keys(t),r=e.length,n=Array(r),i=0;i<r;i++)n[i]=t[e[i]];return n},g.mapObject=function(t,e,r){e=b(e,r);for(var n=g.keys(t),i=n.length,o={},s=0;s<i;s++){var a=n[s];o[a]=e(t[a],a,t)}return o},g.pairs=function(t){for(var e=g.keys(t),r=e.length,n=Array(r),i=0;i<r;i++)n[i]=[e[i],t[e[i]]];return n},g.invert=function(t){for(var e={},r=g.keys(t),n=0,i=r.length;n<i;n++)e[t[r[n]]]=r[n];return e},g.functions=g.methods=function(t){var e=[];for(var r in t)g.isFunction(t[r])&&e.push(r);return e.sort()};var j=function(t,e){return function(r){var n=arguments.length;if(e&&(r=Object(r)),n<2||null==r)return r;for(var i=1;i<n;i++)for(var o=arguments[i],s=t(o),a=s.length,u=0;u<a;u++){var h=s[u];e&&void 0!==r[h]||(r[h]=o[h])}return r}};g.extend=j(g.allKeys),g.extendOwn=g.assign=j(g.keys),g.findKey=function(t,e,r){e=b(e,r);for(var n,i=g.keys(t),o=0,s=i.length;o<s;o++)if(e(t[n=i[o]],n,t))return n};var F,K,G=function(t,e,r){return e in r};g.pick=_((function(t,e){var r={},n=e[0];if(null==t)return r;g.isFunction(n)?(e.length>1&&(n=w(n,e[1])),e=g.allKeys(t)):(n=G,e=R(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var s=e[i],a=t[s];n(a,s,t)&&(r[s]=a)}return r})),g.omit=_((function(t,e){var r,n=e[0];return g.isFunction(n)?(n=g.negate(n),e.length>1&&(r=e[1])):(e=g.map(R(e,!1,!1),String),n=function(t,r){return!g.contains(e,r)}),g.pick(t,n,r)})),g.defaults=j(g.allKeys,!0),g.create=function(t,e){var r=M(t);return e&&g.extendOwn(r,e),r},g.clone=function(t){return g.isObject(t)?g.isArray(t)?t.slice():g.extend({},t):t},g.tap=function(t,e){return e(t),t},g.isMatch=function(t,e){var r=g.keys(e),n=r.length;if(null==t)return!n;for(var i=Object(t),o=0;o<n;o++){var s=r[o];if(e[s]!==i[s]||!(s in i))return!1}return!0},F=function(t,e,r,n){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return!1;if(t!==t)return e!==e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&K(t,e,r,n)},K=function(t,e,r,n){t instanceof g&&(t=t._wrapped),e instanceof g&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t===""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e;case"[object Symbol]":return u.valueOf.call(t)===u.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,a=e.constructor;if(s!==a&&!(g.isFunction(s)&&s instanceof s&&g.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}n=n||[];for(var h=(r=r||[]).length;h--;)if(r[h]===t)return n[h]===e;if(r.push(t),n.push(e),o){if((h=t.length)!==e.length)return!1;for(;h--;)if(!F(t[h],e[h],r,n))return!1}else{var c,l=g.keys(t);if(h=l.length,g.keys(e).length!==h)return!1;for(;h--;)if(c=l[h],!A(e,c)||!F(t[c],e[c],r,n))return!1}return r.pop(),n.pop(),!0},g.isEqual=function(t,e){return F(t,e)},g.isEmpty=function(t){return null==t||(T(t)&&(g.isArray(t)||g.isString(t)||g.isArguments(t))?0===t.length:0===g.keys(t).length)},g.isElement=function(t){return!(!t||1!==t.nodeType)},g.isArray=d||function(t){return"[object Array]"===f.call(t)},g.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},g.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],(function(t){g["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}})),g.isArguments(arguments)||(g.isArguments=function(t){return A(t,"callee")});var V=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof V&&(g.isFunction=function(t){return"function"==typeof t||!1}),g.isFinite=function(t){return!g.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},g.isNaN=function(t){return g.isNumber(t)&&isNaN(t)},g.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},g.isNull=function(t){return null===t},g.isUndefined=function(t){return void 0===t},g.has=function(t,e){if(!g.isArray(e))return A(t,e);for(var r=e.length,n=0;n<r;n++){var i=e[n];if(null==t||!l.call(t,i))return!1;t=t[i]}return!!r},g.noConflict=function(){return i._=o,this},g.identity=function(t){return t},g.constant=function(t){return function(){return t}},g.noop=function(){},g.property=function(t){return g.isArray(t)?function(e){return x(e,t)}:E(t)},g.propertyOf=function(t){return null==t?function(){}:function(e){return g.isArray(e)?x(t,e):t[e]}},g.matcher=g.matches=function(t){return t=g.extendOwn({},t),function(e){return g.isMatch(e,t)}},g.times=function(t,e,r){var n=Array(Math.max(0,t));e=w(e,r,1);for(var i=0;i<t;i++)n[i]=e(i);return n},g.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},g.now=Date.now||function(){return(new Date).getTime()};var H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},z=g.invert(H),q=function(t){var e=function(e){return t[e]},r="(?:"+g.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,e):t}};g.escape=q(H),g.unescape=q(z),g.result=function(t,e,r){g.isArray(e)||(e=[e]);var n=e.length;if(!n)return g.isFunction(r)?r.call(t):r;for(var i=0;i<n;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=r,i=n),t=g.isFunction(o)?o.call(t):o}return t};var W=0;g.uniqueId=function(t){var e=++W+"";return t?t+e:e},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Z=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+Y[t]};g.template=function(t,e,r){!e&&r&&(e=r),e=g.defaults({},e,g.templateSettings);var n,i=RegExp([(e.escape||Z).source,(e.interpolate||Z).source,(e.evaluate||Z).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(i,(function(e,r,n,i,a){return s+=t.slice(o,a).replace(J,$),o=a+e.length,r?s+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(s+="';\n"+i+"\n__p+='"),e})),s+="';\n",e.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{n=new Function(e.variable||"obj","_",s)}catch(h){throw h.source=s,h}var a=function(t){return n.call(this,t,g)},u=e.variable||"obj";return a.source="function("+u+"){\n"+s+"}",a},g.chain=function(t){var e=g(t);return e._chain=!0,e};var X=function(t,e){return t._chain?g(e).chain():e};g.mixin=function(t){return g.each(g.functions(t),(function(e){var r=g[e]=t[e];g.prototype[e]=function(){var t=[this._wrapped];return h.apply(t,arguments),X(this,r.apply(g,t))}})),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[t];g.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],X(this,r)}})),g.each(["concat","join","slice"],(function(t){var e=s[t];g.prototype[t]=function(){return X(this,e.apply(this._wrapped,arguments))}})),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(n=function(){return g}.apply(e,[]))||(r.exports=n)}()}).call(this,r(19),r(26)(t))},910:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(){var t=[],e=!1;return{destroy:function(){e=!0,t.forEach((function(t){t()}))},onDestroy:function(r){e?r():t.push(r)}}},t.exports=e.default},911:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){return function(){if(t){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(e=console).log.apply(e,["[Penpal]"].concat(n))}}},t.exports=e.default},912:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(729),i=r(913);e.default=function(t,e,r){var o=t.localName,s=t.local,a=t.remote,u=t.originForSending,h=t.originForReceiving,c=!1;r("".concat(o,": Connecting call receiver"));var f=function(t){if(t.source===a&&t.data.penpal===n.CALL)if(t.origin===h){var s=t.data,f=s.methodName,l=s.args,d=s.id;r("".concat(o,": Received ").concat(f,"() call"));var p=function(t){return function(e){if(r("".concat(o,": Sending ").concat(f,"() reply")),c)r("".concat(o,": Unable to send ").concat(f,"() reply due to destroyed connection"));else{var s={penpal:n.REPLY,id:d,resolution:t,returnValue:e};t===n.REJECTED&&e instanceof Error&&(s.returnValue=(0,i.serializeError)(e),s.returnValueIsError=!0);try{a.postMessage(s,u)}catch(h){throw h.name===n.DATA_CLONE_ERROR&&a.postMessage({penpal:n.REPLY,id:d,resolution:n.REJECTED,returnValue:(0,i.serializeError)(h),returnValueIsError:!0},u),h}}}};new Promise((function(t){return t(e[f].apply(e,l))})).then(p(n.FULFILLED),p(n.REJECTED))}else r("".concat(o," received message from origin ").concat(t.origin," which did not match expected origin ").concat(h))};return s.addEventListener(n.MESSAGE,f),function(){c=!0,s.removeEventListener(n.MESSAGE,f)}},t.exports=e.default},913:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeError=e.serializeError=void 0;e.serializeError=function(t){return{name:t.name,message:t.message,stack:t.stack}};e.deserializeError=function(t){var e=new Error;return Object.keys(t).forEach((function(r){return e[r]=t[r]})),e}},914:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=r(729),o=r(730),s=(n=r(1150))&&n.__esModule?n:{default:n},a=r(913);e.default=function(t,e,r,n,u){var h=e.localName,c=e.local,f=e.remote,l=e.originForSending,d=e.originForReceiving,p=!1;u("".concat(h,": Connecting call sender"));return r.reduce((function(t,e){return t[e]=function(t){return function(){for(var e=arguments.length,r=new Array(e),m=0;m<e;m++)r[m]=arguments[m];var v;u("".concat(h,": Sending ").concat(t,"() call"));try{f.closed&&(v=!0)}catch(y){v=!0}if(v&&n(),p){var g=new Error("Unable to send ".concat(t,"() call due ")+"to destroyed connection");throw g.code=o.ERR_CONNECTION_DESTROYED,g}return new Promise((function(e,n){var o=(0,s.default)();c.addEventListener(i.MESSAGE,(function r(s){if(s.source===f&&s.data.penpal===i.REPLY&&s.data.id===o)if(s.origin===d){u("".concat(h,": Received ").concat(t,"() reply")),c.removeEventListener(i.MESSAGE,r);var l=s.data.returnValue;s.data.returnValueIsError&&(l=(0,a.deserializeError)(l)),(s.data.resolution===i.FULFILLED?e:n)(l)}else u("".concat(h," received message from origin ").concat(s.origin," which did not match expected origin ").concat(d))})),f.postMessage({penpal:i.CALL,id:o,methodName:t,args:r},l)}))}}(e),t}),t),function(){p=!0}},t.exports=e.default},915:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="0.1.14"},916:function(t,e,r){"use strict";var n=r(2),i=r(41),o=r(42),s=r(94),a=r(95),u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},h=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},c=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var f=h(r(1154)),l=c(r(620)),d=h(r(138)),p=h(r(1164)),m=h(r(1204)),v=h(r(1217)),g=h(r(1222)),y=h(r(1235)),w=h(r(1236)),b=c(r(1237)),_=h(r(792)),M=r(937),E=function(t){s(r,t);var e=a(r);function r(t){var n;i(this,r),(n=e.call(this)).isAuthereum=!0,n.lastSignTx="",n.lastSignTxTimeout=null,n.lastTx="",n.lastTxTimeout=null,n.lastMsg="",n.lastMsgTimeout=null,n.lastTypedMsg="",n.lastTypedMsgTimeout=null;var o=null;return t instanceof _.default&&(t=(o=t).config),n.config=t||{},n.authereum=o||new _.default(n.config),n.initSubprovider(),n.isAuthereum=!0,n}return o(r,[{key:"initSubprovider",value:function(){return u(this,void 0,void 0,n.mark((function t(){var e,r,i=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.authereum._tilReady();case 2:if(t.t0=this.config.rpcUri,t.t0){t.next=7;break}return t.next=6,this.authereum.getRpcUri();case 6:t.t0=t.sent;case 7:this.rpcUri=t.t0,e=2e3,r=new m.default({getAccounts:function(t){return u(i,void 0,void 0,n.mark((function e(){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.isAuthenticated();case 2:if(e.sent){e.next=6;break}return t&&t(null,[]),e.abrupt("return",[]);case 6:return e.next=8,this.authereum.getAccountAddress();case 8:if(r=e.sent){e.next=12;break}return t&&t(null,[]),e.abrupt("return",[]);case 12:return t&&t(null,[r]),e.abrupt("return",[r]);case 14:case"end":return e.stop()}}),e,this)})))},approveTransaction:function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},approveMessage:function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},approveTypedMessage:function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},signMessage:function(t,r){return u(i,void 0,void 0,n.mark((function i(){var o,s,a=this;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=t;try{o=JSON.stringify(t)}catch(i){}if(clearTimeout(this.lastMsgTimeout),this.lastMsg!==o){n.next=5;break}return n.abrupt("return",this._throttledSignMessage(t,r));case 5:if(s=!this.lastMsg,this.lastMsg=o,this.lastMsgTimeout=setTimeout((function(){a.lastMsg=""}),e),!s){n.next=10;break}return n.abrupt("return",this._throttledSignMessage(t,r));case 10:return n.abrupt("return",this._signMessage(t,r));case 11:case"end":return n.stop()}}),i,this)})))},signTransaction:function(t,r){return u(i,void 0,void 0,n.mark((function i(){var o,s,a,u=this;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((o=Object.assign({},t)).nonce=null,s=JSON.stringify(o),clearTimeout(this.lastSignTxTimeout),this.lastSignTx!==s){n.next=6;break}return n.abrupt("return",this._throttledSignTransaction(t,r));case 6:if(a=!this.lastSignTx,this.lastSignTx=s,this.lastSignTxTimeout=setTimeout((function(){u.lastSignTx=""}),e),!a){n.next=11;break}return n.abrupt("return",this._throttledSignTransaction(t,r));case 11:return n.abrupt("return",this._signTransaction(t,r));case 12:case"end":return n.stop()}}),i,this)})))},processSignTransaction:function(t,o){return u(i,void 0,void 0,n.mark((function i(){var s,a,u,h=this;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((s=Object.assign({},t)).nonce=null,a=JSON.stringify(s),clearTimeout(this.lastTxTimeout),this.lastTx!==a){n.next=6;break}return n.abrupt("return",this._throttledProcessSignTransaction(t,o));case 6:if(u=!this.lastTx,this.lastTx=a,this.lastTxTimeout=setTimeout((function(){h.lastTx=""}),e),!u){n.next=11;break}return n.abrupt("return",this._throttledProcessSignTransaction(t,o));case 11:return n.abrupt("return",r.finalizeTx(t,o));case 12:case"end":return n.stop()}}),i,this)})))},processTransaction:function(t,r){return u(i,void 0,void 0,n.mark((function i(){var o,s,a,u=this;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((o=Object.assign({},t)).nonce=null,s=JSON.stringify(o),clearTimeout(this.lastTxTimeout),this.lastTx!==s){n.next=6;break}return n.abrupt("return",this._throttledProcessTransaction(t,r));case 6:if(a=!this.lastTx,this.lastTx=s,this.lastTxTimeout=setTimeout((function(){u.lastTx=""}),e),!a){n.next=11;break}return n.abrupt("return",this._throttledProcessTransaction(t,r));case 11:return n.abrupt("return",this._processTransaction(t,r));case 12:case"end":return n.stop()}}),i,this)})))},finalizeTx:function(t,e){return u(i,void 0,void 0,n.mark((function r(){var i,o;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this._signTransaction(t);case 3:return i=r.sent,o={raw:i,tx:t},e&&e(null,o),r.abrupt("return",o);case 9:throw r.prev=9,r.t0=r.catch(0),e&&e(r.t0),r.t0;case 13:case"end":return r.stop()}}),r,this,[[0,9]])})))},approvePersonalMessage:function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},signPersonalMessage:function(t,e){return u(i,void 0,void 0,n.mark((function i(){return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.personal=!0,n.abrupt("return",r.signMessage(t,e));case 2:case"end":return n.stop()}}),i)})))},signTypedMessage:function(t,r){return u(i,void 0,void 0,n.mark((function i(){var o,s,a=this;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=t;try{o=JSON.stringify(t)}catch(i){}if(clearTimeout(this.lastTypedMsgTimeout),this.lastTypedMsg!==o){n.next=5;break}return n.abrupt("return",this._throttledSignTypedMessage(t,r));case 5:if(s=!this.lastTypedMsg,this.lastTypedMsg=o,this.lastTypedMsgTimeout=setTimeout((function(){a.lastTypedMsg=""}),e),!s){n.next=10;break}return n.abrupt("return",this._throttledSignTypedMessage(t,r));case 10:return n.abrupt("return",this._signTypedMessage(t,r));case 11:case"end":return n.stop()}}),i,this)})))}}),this.walletSubprovider=r,this._processTransaction=function(t,e){return u(i,void 0,void 0,n.mark((function i(){var o,s;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,w.default(r.signTransaction.bind(r))(t);case 3:return o=n.sent,s=b.sha3(o),e&&e(null,s),n.abrupt("return",s);case 9:if(n.prev=9,n.t0=n.catch(0),!e){n.next=14;break}return e(n.t0),n.abrupt("return");case 14:throw n.t0;case 15:case"end":return n.stop()}}),i,null,[[0,9]])})))},this._throttledProcessSignTransaction=M.throttle((function(t,e){return u(i,void 0,void 0,n.mark((function i(){return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",r.finalizeTx(t,e));case 1:case"end":return n.stop()}}),i)})))}),e),this._throttledProcessTransaction=M.throttle((function(t,e){return u(i,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._processTransaction(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),e),this._signMessage=function(t,e){return u(i,void 0,void 0,n.mark((function r(){var i;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signMessage(t.data,{personal:t.personal,includeAuthSignature:!0});case 3:return i=r.sent,e&&e(null,i),r.abrupt("return",i);case 8:r.prev=8,r.t0=r.catch(0),e&&e(r.t0);case 11:case"end":return r.stop()}}),r,this,[[0,8]])})))},this._throttledSignMessage=M.throttle((function(t,e){return u(i,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),e),this._signTypedMessage=function(t,e){return u(i,void 0,void 0,n.mark((function r(){var i;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signMessage(t.data,{includeAuthSignature:!0});case 3:return i=r.sent,e&&e(null,i),r.abrupt("return",i);case 8:r.prev=8,r.t0=r.catch(0),e&&e(r.t0);case 11:case"end":return r.stop()}}),r,this,[[0,8]])})))},this._throttledSignTypedMessage=M.throttle((function(t,e){return u(i,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signTypedMessage(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),e),this._signTransaction=function(t,e){return u(i,void 0,void 0,n.mark((function r(){var i;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.authereum.signTransaction(t);case 3:if(i=r.sent){r.next=6;break}throw new Error("Error signing transaction");case 6:return e&&e(null,i.signedTransactionData),r.abrupt("return",i.signedTransactionData);case 10:r.prev=10,r.t0=r.catch(0),e(r.t0);case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))},this._throttledSignTransaction=M.throttle((function(t,e){return u(i,void 0,void 0,n.mark((function r(){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._signTransaction(t,e));case 1:case"end":return r.stop()}}),r,this)})))}),e),this._sendAsync=this.sendAsync,this.sendAsync=function(t,e){return u(i,void 0,void 0,n.mark((function r(){var i=this;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,n){e||(e=function(t,e){t?n(t):r(e)}),i._sendAsync(t,e)})));case 1:case"end":return r.stop()}}),r)})))},this.send=function(t,e){if("string"===typeof t)return new Promise((function(r,n){i.sendAsync({jsonrpc:"2.0",id:1,method:t,params:e||[]},(function(t,e){t?n(t):r(e.result)}))}));if(!e){var r=null;switch(t.method){case"eth_uninstallFilter":i.sendAsync(t,(function(){})),r=!0;break;default:var n="The Authereum Web3 object does not support synchronous methods like ".concat(t.method," without a callback parameter.");throw new Error(n)}return{id:t.id,jsonrpc:t.jsonrpc,result:r}}i.sendAsync(t,e)},r.handleRequest=function(t,e,n){var o,s,a,u,h,c=r;c._parityRequests={},c._parityRequestCount=0;var l=t.method;if(l&&l.startsWith("stark_"))i.authereum.getStarkProvider().send(l,t.params).then((function(t){return n(null,t)})).catch((function(t){return n(t)}));else switch(l){case"eth_coinbase":return void c.getAccounts((function(t,e){if(t)return n(t);var r=e[0]||null;n(null,r)}));case"eth_accounts":return void c.getAccounts((function(t,e){if(t)return n(t);n(null,e)}));case"eth_sendTransaction":return o=t.params[0],void f.default([function(t){return c.processTransaction(o,t)}],n);case"eth_signTransaction":return o=t.params[0],void f.default([function(t){return c.processSignTransaction(o,t)}],n);case"eth_sign":return h=t.params[0],u=t.params[1],a=t.params[2]||{},s=d.default(a,{from:h,data:u}),void f.default([function(t){return c.processMessage(s,t)}],n);case"personal_sign":return function(){var e=t.params[0];if(x(t.params[1])&&A(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_personalSign method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),h=t.params[0],u=t.params[1]}else u=t.params[0],h=t.params[1];a=t.params[2]||{},s=d.default(a,{from:h,data:u}),f.default([function(t){return c.processPersonalMessage(s,t)}],n)}();case"eth_decryptMessage":return function(){var e=t.params[0];if(x(t.params[1])&&A(e)){"[message, address]. This was previously handled incorrectly, ","and has been corrected automatically. ","Please switch this param order for smooth behavior in the future.",console.warn("The eth_decryptMessage method requires params ordered [message, address]. This was previously handled incorrectly, and has been corrected automatically. Please switch this param order for smooth behavior in the future."),h=t.params[0],u=t.params[1]}else u=t.params[0],h=t.params[1];a=t.params[2]||{},s=d.default(a,{from:h,data:u}),f.default([function(t){return c.validateDecryptMessage(s,t)},function(t){return c.processDecryptMessage(s,t)}],n)}();case"eth_getEncryptionKey":return void i.authereum.getEncryptionPublicKey().then((function(t){return n(null,t)})).catch((function(t){return n(t)}));case"eth_decrypt":t.params[0];return void i.authereum.decryptMessage().then((function(t){return n(null,t)})).catch((function(t){return n(t)}));case"encryption_public_key":return h=t.params[0],void f.default([function(t){return c.validateEncryptionPublicKey(h,t)},function(t){return c.processEncryptionPublicKey(h,t)}],n);case"personal_ecRecover":return function(){u=t.params[0];var e=t.params[1];a=t.params[2]||{},s=d.default(a,{sig:e,data:u}),c.recoverPersonalSignature(s,n)}();case"eth_signTypedData":return u=t.params[0],h=t.params[1],a=t.params[2]||{},s=d.default(a,{from:h,data:u}),void f.default([function(t){return c.processTypedMessage(s,t)}],n);case"eth_signTypedData_v3":return h=t.params[0],u=t.params[1],a=t.params[2]||{},s=d.default(a,{from:h,data:u}),void f.default([function(t){return c.processTypedMessage(s,t)}],n);case"parity_postTransaction":return o=t.params[0],void c.parityPostTransaction(o,n);case"parity_postSign":return h=t.params[0],u=t.params[1],void c.parityPostSign(h,u,n);case"parity_checkRequest":return function(){var e=t.params[0];c.parityCheckRequest(e,n)}();case"parity_defaultAccount":return void c.getAccounts((function(t,e){if(t)return n(t);var r=e[0]||null;n(null,r)}));case"eth_requestAccounts":return void c.getAccounts((function(t,e){if(t)return n(t);n(null,e)}));default:return void e()}},r.validatePersonalMessage=function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},r.validateMessage=function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},r.validateTypedMessage=function(t,e){return u(i,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(null,!0),t.abrupt("return",!0);case 2:case"end":return t.stop()}}),t)})))},this.addProvider(r),this.rpcSubProvider=new v.default({rpcUrl:this.rpcUri}),this.addProvider(new g.default),this.addProvider(new y.default),this.addProvider({setEngine:function(t){return t},handleRequest:function(t,e,r){return u(i,void 0,void 0,n.mark((function i(){return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:this.rpcSubProvider.handleRequest(t,e,r);case 1:case"end":return n.stop()}}),i,this)})))}}),this.on("error",(function(t){console.error(t.stack)})),this.start(),this._blockTracker.removeAllListeners();case 35:case"end":return t.stop()}}),t,this)})))}},{key:"getAccounts",value:function(t){return u(this,void 0,void 0,n.mark((function e(){var r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.authereum.isAuthenticated();case 2:if(e.sent){e.next=6;break}return t&&t(null,[]),e.abrupt("return",[]);case 6:return e.next=8,this.authereum.getAccountAddress();case 8:if(r=e.sent){e.next=12;break}return t&&t(null,[]),e.abrupt("return",[]);case 12:return t&&t(null,[r]),e.abrupt("return",[r]);case 14:case"end":return e.stop()}}),e,this)})))}},{key:"isConnected",value:function(){return this.authereum.isAuthenticatedSync()}},{key:"enable",value:function(){return u(this,void 0,void 0,n.mark((function t(){var e;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.authereum.login();case 2:return t.next=4,this.authereum.getAccountAddress();case 4:if(!(e=t.sent)){t.next=7;break}return t.abrupt("return",[e]);case 7:return t.abrupt("return",[]);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"disable",value:function(){return u(this,void 0,void 0,n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.authereum.logout());case 1:case"end":return t.stop()}}),t,this)})))}},{key:"tilDomReady",value:function(){return new Promise((function(t){"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",(function(){return t()}))}))}},{key:"sendTransaction",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendTransactionBatch([t]));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sendTransactionBatch",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.sendTransactionBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGasBatch",value:function(t){return u(this,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.authereum.estimateGasBatch(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"sign",value:function(t){return this._signMessage(t)}},{key:"signMessageWithAdminKey",value:function(t){return this.authereum.signMessageWithAdminKey(t)}},{key:"signMessageWithSigningKey",value:function(){var t;return(t=this.authereum).signMessageWithSigningKey.apply(t,arguments)}},{key:"showWidget",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.authereum.showWidget(t)}},{key:"widgetEnabled",value:function(){return this.authereum.widgetEnabled()}},{key:"getTransactionReceipt",value:function(t){return this.authereum.getTransactionReceipt(t)}},{key:"waitForTransactionReceipt",value:function(t){return this.authereum.waitForTransactionReceipt(t)}},{key:"isContractDeployed",value:function(t){return this.authereum.isContractDeployed(t)}},{key:"getEncryptionPublicKey",value:function(){return this.authereum.getEncryptionPublicKey()}},{key:"encryptMessage",value:function(t){return this.authereum.encryptMessage(t)}},{key:"decryptMessage",value:function(t){return this.authereum.decryptMessage(t)}}]),r}(p.default);function A(t){var e=l.addHexPrefix(t);return l.isValidAddress(e)}function x(t){var e=l.addHexPrefix(t);return!l.isValidAddress(e)&&function(t){if("string"!==typeof t)return!1;if("0x"!==t.slice(0,2))return!1;var e=t.slice(2),r=/^[0-9A-Fa-f]+$/g;return e.match(r)}(t)}e.default=E},917:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=e.isAsyncGenerator=e.isAsync=void 0;var n,i=r(1157),o=(n=i)&&n.__esModule?n:{default:n};function s(t){return"AsyncFunction"===t[Symbol.toStringTag]}e.default=function(t){if("function"!==typeof t)throw new Error("expected a function");return s(t)?(0,o.default)(t):t},e.isAsync=s,e.isAsyncGenerator=function(t){return"AsyncGenerator"===t[Symbol.toStringTag]},e.isAsyncIterable=function(t){return"function"===typeof t[Symbol.asyncIterator]}},920:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){((0,n.default)(t)?l:d)(t,(0,c.default)(e),r)};var n=f(r(621)),i=f(r(925)),o=f(r(1173)),s=f(r(927)),a=f(r(603)),u=f(r(794)),h=f(r(797)),c=f(r(643));function f(t){return t&&t.__esModule?t:{default:t}}function l(t,e,r){r=(0,u.default)(r||a.default);var n=0,o=0,s=t.length;function c(t,e){t?r(t):++o!==s&&e!==i.default||r(null)}for(0===s&&r(null);n<s;n++)e(t[n],n,(0,h.default)(c))}var d=(0,s.default)(o.default,1/0);t.exports=e.default},925:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default},926:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(e,r,u){if(u=(0,i.default)(u||n.default),t<=0||!e)return u(null);var h=(0,o.default)(e),c=!1,f=0,l=!1;function d(t,e){if(f-=1,t)c=!0,u(t);else{if(e===a.default||c&&f<=0)return c=!0,u(null);l||p()}}function p(){for(l=!0;f<t&&!c;){var e=h();if(null===e)return c=!0,void(f<=0&&u(null));f+=1,r(e.value,e.key,(0,s.default)(d))}l=!1}p()}};var n=u(r(603)),i=u(r(794)),o=u(r(1174)),s=u(r(797)),a=u(r(925));function u(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},927:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return function(r,n,i){return t(r,e,n,i)}},t.exports=e.default},928:function(t,e,r){var n=r(1220),i=r(804).jsonRpc.internal,o=r(803).JsonRpcError,s="Unspecified server error.",a="Unspecified error message. This is  bug, please report it.",u={code:i,message:h(i)};function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if(Number.isInteger(t)){var r=t.toString();if(n[r])return n[r].message;if(f(t))return s}return e}function c(t){if(!Number.isInteger(t))return!1;var e=t.toString();return!!n[e]||!!f(t)}function f(t){return t>=-32099&&t<=-32e3}function l(t){return t&&"object"===typeof t&&!Array.isArray(t)?Object.assign({},t):t}t.exports={getMessageFromCode:h,isValidCode:c,serializeError:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;if(!e||!Number.isInteger(e.code)||"string"!==typeof e.message)throw new Error("fallbackError must contain integer number code and string message.");if("object"===typeof t&&t instanceof o)return t.serialize();var r={};return t&&c(t.code)?(r.code=t.code,t.message&&"string"===typeof t.message?(r.message=t.message,t.hasOwnProperty("data")&&(r.data=t.data)):(r.message=h(r.code),r.data={originalError:l(t)})):(r.code=e.code,r.message=t&&t.message?t.message:e.message,r.data={originalError:l(t)}),t&&t.stack&&(r.stack=t.stack),r},JSON_RPC_SERVER_ERROR_MESSAGE:s}},929:function(t,e,r){var n=r(41),i=r(42),o=r(94),s=r(95),a=function(t){"use strict";o(r,t);var e=s(r);function r(t){var i;if(n(this,r),i=e.call(this),!t)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");return i._constructorFn=t,i}return i(r,[{key:"setEngine",value:function(t){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");var e=t._blockTracker,r=this._constructorFn({engine:t,provider:t,blockTracker:e});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!==typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}},{key:"handleRequest",value:function(t,e,r){var n={id:t.id};this.middleware(t,n,(function(t){e((function(e,r,i){e?(delete n.result,n.error={message:e.message||e}):n.result=r,t?t(i):i()}))}),(function(t){if(t)return r(t);r(null,n.result)}))}}]),r}(r(802));t.exports=a},935:function(t,e,r){var n=r(809),i=r(936),o=r(149),s=r(256),a=r(1239),u=function(t){return t instanceof i||t&&t.constructor&&"BN"===t.constructor.name},h=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},c=function(t){try{return o.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},f=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||l(t))},l=function(t){t=t.replace(/^0x/i,"");for(var e=g(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},d=function(t){var e="";t=(t=(t=(t=(t=s.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r<t.length;r++){var n=t.charCodeAt(r).toString(16);e+=n.length<2?"0"+n:n}return"0x"+e},p=function(t){if(n.isNull(t)||n.isUndefined(t))return t;if(!isFinite(t)&&!v(t))throw new Error('Given input "'+t+'" is not a number.');var e=c(t),r=e.toString(16);return e.lt(new i(0))?"-0x"+r.substr(1):"0x"+r},m=function(t){if(t=t.toString(16),!v(t))throw new Error('Given value "'+t+'" is not a valid hex string.');t=t.replace(/^0x/i,"");for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},v=function(t){return(n.isString(t)||n.isNumber(t))&&/^(-)?0x[0-9a-f]*$/i.test(t)},g=function(t){u(t)&&(t=t.toString()),v(t)&&/^0x/i.test(t.toString())&&(t=m(t));var e=a.keccak256(t);return"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"===e?null:e};g._Hash=a,t.exports={BN:i,isBN:u,isBigNumber:h,toBN:c,isAddress:f,isBloom:function(t){return!!/^(0x)?[0-9a-f]{512}$/i.test(t)&&!(!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))},isTopic:function(t){return!!/^(0x)?[0-9a-f]{64}$/i.test(t)&&!(!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))},checkAddressChecksum:l,utf8ToHex:d,hexToUtf8:function(t){if(!v(t))throw new Error('The parameter "'+t+'" must be a valid HEX string.');for(var e="",r=0,n=(t=(t=(t=(t=(t=t.replace(/^0x/i,"")).replace(/^(?:00)*/,"")).split("").reverse().join("")).replace(/^(?:00)*/,"")).split("").reverse().join("")).length,i=0;i<n;i+=2)r=parseInt(t.substr(i,2),16),e+=String.fromCharCode(r);return s.decode(e)},hexToNumber:function(t){return t?c(t).toNumber():t},hexToNumberString:function(t){return t?c(t).toString(10):t},numberToHex:p,toHex:function(t,e){if(f(t))return e?"address":"0x"+t.toLowerCase().replace(/^0x/i,"");if(n.isBoolean(t))return e?"bool":t?"0x01":"0x00";if(n.isObject(t)&&!h(t)&&!u(t))return e?"string":d(JSON.stringify(t));if(n.isString(t)){if(0===t.indexOf("-0x")||0===t.indexOf("-0X"))return e?"int256":p(t);if(0===t.indexOf("0x")||0===t.indexOf("0X"))return e?"bytes":t;if(!isFinite(t))return e?"string":d(t)}return e?t<0?"int256":"uint256":p(t)},hexToBytes:m,bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(n.isString(t)||n.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:v,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"===typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"===typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+c(t).toTwos(256).toString(16,64)},sha3:g}},936:function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(1238).Buffer}catch(A){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=n)h=u(t,c,c+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],E=8191&M,A=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,T=0|s[6],I=8191&T,P=T>>>13,N=0|s[7],R=8191&N,C=N>>>13,L=0|s[8],O=8191&L,B=L>>>13,D=0|s[9],U=8191&D,j=D>>>13,F=0|a[0],K=8191&F,G=F>>>13,V=0|a[1],H=8191&V,z=V>>>13,q=0|a[2],W=8191&q,Z=q>>>13,Y=0|a[3],J=8191&Y,$=Y>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(f,K))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,G))+Math.imul(m,K)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,z)|0)+Math.imul(l,H)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,G))+Math.imul(y,K)|0,o=Math.imul(y,G),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,z)|0;var yt=(h+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,G))+Math.imul(_,K)|0,o=Math.imul(_,G),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Z)|0;var wt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,G))+Math.imul(A,K)|0,o=Math.imul(A,G),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,z)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,z)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,K),i=(i=Math.imul(k,G))+Math.imul(S,K)|0,o=Math.imul(S,G),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,G))+Math.imul(P,K)|0,o=Math.imul(P,G),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,K),i=(i=Math.imul(R,G))+Math.imul(C,K)|0,o=Math.imul(C,G),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,G))+Math.imul(B,K)|0,o=Math.imul(B,G),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,z)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,z)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,z)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,z)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var xt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var kt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var St=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(j,J)|0,o=Math.imul(j,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,lt)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,lt)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,lt)|0;var It=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,lt)|0;var Pt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(C,ft)|0,o=o+Math.imul(C,lt)|0;var Nt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ft),i=(i=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ct=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Lt=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,mt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=Et,u[8]=At,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Tt,u[13]=It,u[14]=Pt,u[15]=Nt,u[16]=Rt,u[17]=Ct,u[18]=Lt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],v=r[c+d+s],g=n[c+d+s],y=f*v-l*g;g=f*g+l*v,v=y,r[c+d]=p+v,n[c+d]=m+g,r[c+d+s]=p-v,n[c+d+s]=m-g,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0===(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0===(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0===(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,g),i(b,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();n(v<p);var g=this.pow(f,new o(1).iushln(p-v-1));l=l.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return l},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(26)(t))},937:function(t,e,r){"use strict";var n=r(2),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(1244)),u=o(r(941)),h=s(r(1259)),c=o(r(1261)),f=s(r(257)),l=s(r(1262)),d=c.uuid;e.uuidv4=d,e.privateKeyToAddress=a,e.wait=function(t){return i(void 0,void 0,void 0,n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout((function(){return e()}),t)})));case 1:case"end":return e.stop()}}),e)})))},e.toHex=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===e.addPrefix&&(e.addPrefix=!0),e.default=0,h.default(t,e)},e.signWithPrivateKey=function(t,r,o){return i(void 0,void 0,void 0,n.mark((function i(){var s,a,h,c;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r){n.next=2;break}throw new Error("private key is required");case 2:return s=new u.providers.JsonRpcProvider(o),a=new u.Wallet(r,s),h=t,t.startsWith("0x")&&(h=u.utils.arrayify(t)),n.next=8,a.signMessage(h);case 8:return c=n.sent,e.privateKeyToAddress(r),n.abrupt("return",c);case 11:case"end":return n.stop()}}),i)})))},e.debounce=function(t,e){var r;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];clearTimeout(r),r=setTimeout((function(){r=null,t.apply(void 0,i)}),e)}},e.throttle=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=new Map,i=0,o=0,s=function(){for(var s,a=this,u=arguments.length,h=new Array(u),c=0;c<u;c++)h[c]=arguments[c];return new Promise((function(u,c){var f=Date.now();f-i>e?(o=1,i=f,s=setTimeout((function(){u(t.apply(a,h)),n.delete(s)}),i-f)):o<r?o++:o=1,n.set(s,c)}))};return s},e.getQueryParamValue=function(t){var e=window.location.search.substr(1),r=f.default.parse(e);return r[t]?r[t]:null},e.removeQueryParam=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var r=new URL(e);if("URLSearchParams"in window){var n=new URLSearchParams(r.search);return n.delete(t),r.search=n.toString(),r.toString()}}catch(i){}return e},e.updateQueryParams=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;try{var r=new URL(e);if("URLSearchParams"in window){var n=new URLSearchParams(r.search);for(var i in t){var o=t[i];o&&n.set(i,o)}return r.search=n.toString(),r.toString()}}catch(s){}return e},e.replaceWindowUrl=function(t){try{window.history.replaceState({},document.title,t)}catch(e){}},e.browserInfo=function(){var t,e=navigator.userAgent,r=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];/trident/i.test(r[1])&&(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1],"Chrome"===r[1]&&null!=(t=e.match(/\b(OPR|Edge?)\/(\d+)/))&&t.slice(1).join(" ").replace("OPR","Opera").replace("Edg ","Edge "),r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&r.splice(1,1,t[1]);var n=r.join(" ").split(" ");return{browser:n[0],version:n[1]}},e.exportRecoveryParam=function(t){return"number"===typeof t?new l.default(t).add(new l.default(27)).toString(16):null},e.importRecoveryParam=function(t){return t.trim()?new l.default(t,16).sub(new l.default(27)).toNumber():void 0}},938:function(t,e,r){"use strict";t.exports=r(1246)(r(1250))},939:function(t){t.exports=JSON.parse('{"COMPRESSED_TYPE_INVALID":"compressed should be a boolean","EC_PRIVATE_KEY_TYPE_INVALID":"private key should be a Buffer","EC_PRIVATE_KEY_LENGTH_INVALID":"private key length is invalid","EC_PRIVATE_KEY_RANGE_INVALID":"private key range is invalid","EC_PRIVATE_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting private key is invalid","EC_PRIVATE_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PRIVATE_KEY_EXPORT_DER_FAIL":"couldn\'t export to DER format","EC_PRIVATE_KEY_IMPORT_DER_FAIL":"couldn\'t import from DER format","EC_PUBLIC_KEYS_TYPE_INVALID":"public keys should be an Array","EC_PUBLIC_KEYS_LENGTH_INVALID":"public keys Array should have at least 1 element","EC_PUBLIC_KEY_TYPE_INVALID":"public key should be a Buffer","EC_PUBLIC_KEY_LENGTH_INVALID":"public key length is invalid","EC_PUBLIC_KEY_PARSE_FAIL":"the public key could not be parsed or is invalid","EC_PUBLIC_KEY_CREATE_FAIL":"private was invalid, try again","EC_PUBLIC_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting public key is invalid","EC_PUBLIC_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PUBLIC_KEY_COMBINE_FAIL":"the sum of the public keys is not valid","ECDH_FAIL":"scalar was invalid (zero or overflow)","ECDSA_SIGNATURE_TYPE_INVALID":"signature should be a Buffer","ECDSA_SIGNATURE_LENGTH_INVALID":"signature length is invalid","ECDSA_SIGNATURE_PARSE_FAIL":"couldn\'t parse signature","ECDSA_SIGNATURE_PARSE_DER_FAIL":"couldn\'t parse DER signature","ECDSA_SIGNATURE_SERIALIZE_DER_FAIL":"couldn\'t serialize signature to DER format","ECDSA_SIGN_FAIL":"nonce generation function failed or private key is invalid","ECDSA_RECOVER_FAIL":"couldn\'t recover public key from signature","MSG32_TYPE_INVALID":"message should be a Buffer","MSG32_LENGTH_INVALID":"message length is invalid","OPTIONS_TYPE_INVALID":"options should be an Object","OPTIONS_DATA_TYPE_INVALID":"options.data should be a Buffer","OPTIONS_DATA_LENGTH_INVALID":"options.data length is invalid","OPTIONS_NONCEFN_TYPE_INVALID":"options.noncefn should be a Function","RECOVERY_ID_TYPE_INVALID":"recovery should be a Number","RECOVERY_ID_VALUE_INVALID":"recovery should have value between -1 and 4","TWEAK_TYPE_INVALID":"tweak should be a Buffer","TWEAK_LENGTH_INVALID":"tweak length is invalid"}')},940:function(t,e,r){"use strict";(function(e){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(1252),o=r(13);function s(t){var e=t;if("string"!==typeof e)throw new Error("while padding to even, value must be string, is currently "+("undefined"===typeof e?"undefined":n(e))+", while padToEven.");return e.length%2&&(e="0"+e),e}t.exports=function(t){return t=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"===typeof t)t=function(t,e){if("string"!==typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))return!1;if(e&&t.length!==2+2*e)return!1;return!0}(t)?e.from(s(function(t){if("string"!==typeof t)return t;return function(t){if("string"!==typeof t)throw new Error("value must be type 'string', is currently type "+("undefined"===typeof t?"undefined":n(t))+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}(t)?t.slice(2):t}(t)),"hex"):e.from(t);else if("number"===typeof t)t=function(t){var r=function(t){return"0x"+t.toString(16)}(t);return e.from(s(r.slice(2)),"hex")}(t);else if(null===t||void 0===t)t=e.allocUnsafe(0);else if(o.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t}(t),i("keccak256").update(t).digest()}}).call(this,r(8).Buffer)},941:function(t,e,r){(function(e){t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};e[s][0].call(h.exports,(function(t){return i(e[s][1][t]||t)}),h,h.exports,t,e,r,n)}return r[s].exports}for(var o=!1,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.version="4.0.47"},{}],2:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./utils/properties"),i=(o.isSigner=function(t){return n.isType(t,"Signer")},o);function o(){n.setType(this,"Signer")}r.Signer=i},{"./utils/properties":74}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./utils/bignumber");r.AddressZero="0x0000000000000000000000000000000000000000",r.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",r.EtherSymbol="\u039e";var i=n.bigNumberify(-1);r.NegativeOne=i;var o=n.bigNumberify(0);r.Zero=o;var s=n.bigNumberify(1);r.One=s;var a=n.bigNumberify(2);r.Two=a;var u=n.bigNumberify("1000000000000000000");r.WeiPerEther=u;var h=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");r.MaxUint256=h},{"./utils/bignumber":63}],4:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./constants"),u=o(t("./errors")),h=t("./utils/abi-coder"),c=t("./utils/address"),f=t("./utils/bignumber"),l=t("./utils/bytes"),d=t("./utils/interface"),p=t("./utils/properties"),m=t("./providers/abstract-provider"),v=t("./abstract-signer"),g=(i(y,s=v.Signer),y.prototype.getAddress=function(){return Promise.resolve(this.address)},y.prototype._fail=function(t,e){return Promise.resolve().then((function(){u.throwError(t,u.UNSUPPORTED_OPERATION,{operation:e})}))},y.prototype.signMessage=function(t){return this._fail("VoidSigner cannot sign messages","signMessage")},y.prototype.sendTransaction=function(t){return this._fail("VoidSigner cannot sign transactions","sendTransaction")},y.prototype.connect=function(t){return new y(this.address,t)},y);function y(t,e){var r=s.call(this)||this;return p.defineReadOnly(r,"address",t),p.defineReadOnly(r,"provider",e),r}r.VoidSigner=g;var w={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function b(t,e,r){var n=t.interface.functions[e];return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o={},s=null;if(e.length===n.inputs.length+1&&"object"==typeof e[e.length-1])for(var c in null!=(o=p.shallowCopy(e.pop())).blockTag&&(s=o.blockTag),delete o.blockTag,o)if(!w[c])throw new Error("unknown transaction override "+c);if(e.length!=n.inputs.length)throw new Error("incorrect number of arguments");return["data","to"].forEach((function(t){null!=o[t]&&u.throwError("cannot override "+t,u.UNSUPPORTED_OPERATION,{operation:t})})),o.to=t._deployed(s).then((function(){return t.addressPromise})),function t(e,r,n){if(Array.isArray(n)){var i=[];return n.forEach((function(n,o){var s=null;s=Array.isArray(r)?r[o]:r[n.name],i.push(t(e,s,n))})),Promise.all(i)}if("address"===n.type)return e.resolveName(r);if("tuple"===n.type)return t(e,r,n.components);var o=n.type.match(/(.*)(\[[0-9]*\]$)/);if(o){if(!Array.isArray(r))throw new Error("invalid value for array");var s=[],a={components:n.components,type:o[1]};return r.forEach((function(r){s.push(t(e,r,a))})),Promise.all(s)}return Promise.resolve(r)}(t.provider,e,n.inputs).then((function(e){if(o.data=n.encode(e),"call"===n.type)return r?Promise.resolve(a.Zero):(t.provider||u.throwError("call (constant functions) require a provider or a signer with a provider",u.UNSUPPORTED_OPERATION,{operation:"call"}),["gasLimit","gasPrice","value"].forEach((function(t){if(null!=o[t])throw new Error("call cannot override "+t)})),null==o.from&&t.signer&&(o.from=t.signer.getAddress()),t.provider.call(o,s).then((function(r){if(l.hexDataLength(r)%32==4&&"0x08c379a0"===l.hexDataSlice(r,0,4)){var i=h.defaultAbiCoder.decode(["string"],l.hexDataSlice(r,4));u.throwError("call revert exception",u.CALL_EXCEPTION,{address:t.address,args:e,method:n.signature,errorSignature:"Error(string)",errorArgs:[i],reason:i,transaction:o})}try{var s=n.decode(r);return 1===n.outputs.length&&(s=s[0]),s}catch(i){throw"0x"===r&&0<n.outputs.length&&u.throwError("call exception",u.CALL_EXCEPTION,{address:t.address,method:n.signature,args:e}),i}})));if("transaction"===n.type)return r?(t.provider||u.throwError("estimate gas require a provider or a signer with a provider",u.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),null==o.from&&t.signer&&(o.from=t.signer.getAddress()),t.provider.estimateGas(o)):(null==o.gasLimit&&null!=n.gas&&(o.gasLimit=f.bigNumberify(n.gas).add(21e3)),t.signer||u.throwError("sending a transaction requires a signer",u.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=o.from&&u.throwError("cannot override from in a transaction",u.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.signer.sendTransaction(o).then((function(e){var r=e.wait.bind(e);return e.wait=function(e){return r(e).then((function(e){return e.events=e.logs.map((function(r){var n=p.deepCopy(r),i=t.interface.parseLog(r);return i&&(n.args=i.values,n.decode=i.decode,n.event=i.name,n.eventSignature=i.signature),n.removeListener=function(){return t.provider},n.getBlock=function(){return t.provider.getBlock(e.blockHash)},n.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(e)},n})),e}))},e})));throw new Error("invalid type - "+n.type)}))}}function _(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.join(":"):""):"*"}var M=(E.prototype.deployed=function(){return this._deployed()},E.prototype._deployed=function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&u.throwError("contract not deployed",u.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise},E.prototype.fallback=function(t){var e=this;this.signer||u.throwError("sending a transaction requires a signer",u.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=p.shallowCopy(t||{});return["from","to"].forEach((function(t){null!=r[t]&&u.throwError("cannot override "+t,u.UNSUPPORTED_OPERATION,{operation:t})})),r.to=this.addressPromise,this.deployed().then((function(){return e.signer.sendTransaction(r)}))},E.prototype.connect=function(t){"string"==typeof t&&(t=new g(t,this.provider));var e=new E(this.address,this.interface,t);return this.deployTransaction&&p.defineReadOnly(e,"deployTransaction",this.deployTransaction),e},E.prototype.attach=function(t){return new E(t,this.interface,this.signer||this.provider)},E.isIndexed=function(t){return d.Interface.isIndexed(t)},E.prototype._getEventFilter=function(t){var e=this;if("string"==typeof t){if("*"===t)return{prepareEvent:function(t){var r=e.interface.parseLog(t);return r&&(t.args=r.values,t.decode=r.decode,t.event=r.name,t.eventSignature=r.signature),[t]},eventTag:"*",filter:{address:this.address}};-1!==t.indexOf("(")&&(t=h.formatSignature(h.parseSignature("event "+t)));var r=this.interface.events[t];r||u.throwError("unknown event - "+t,u.INVALID_ARGUMENT,{argumnet:"eventName",value:t});var n={address:this.address,topics:[r.topic]};return{prepareEvent:function(t){var e=r.decode(t.data,t.topics);t.args=e;var n=Array.prototype.slice.call(e);return n.push(t),n},event:r,eventTag:_(n),filter:n}}var i={address:this.address},o=null;if(t.topics&&t.topics[0])for(var s in i.topics=t.topics,this.interface.events)if(-1!==s.indexOf("(")){var a=this.interface.events[s];if(a.topic===t.topics[0].toLowerCase()){o=a;break}}return{prepareEvent:function(t){if(!o)return[t];var e=o.decode(t.data,t.topics);t.args=e;var r=Array.prototype.slice.call(e);return r.push(t),r},event:o,eventTag:_(i),filter:i}},E.prototype._addEventListener=function(t,e,r){var n=this;function i(r){var i=p.deepCopy(r),o=t.prepareEvent(i);t.event&&(i.decode=t.event.decode,i.event=t.event.name,i.eventSignature=t.event.signature),i.removeListener=function(){n.removeListener(t.filter,e)},i.getBlock=function(){return n.provider.getBlock(r.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(r.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(r.transactionHash)},n.emit.apply(n,[t.filter].concat(o))}this.provider||u.throwError("events require a provider or a signer with a provider",u.UNSUPPORTED_OPERATION,{operation:"once"}),this.provider.on(t.filter,i),this._events.push({eventFilter:t,listener:e,wrappedListener:i,once:r})},E.prototype.on=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!1),this},E.prototype.once=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!0),this},E.prototype.addListener=function(t,e){return this.on(t,e)},E.prototype.emit=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this.provider)return!1;var i=!1,o=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==o.eventTag||(setTimeout((function(){t.listener.apply(e,r)}),0),i=!0,!t.once)})),i},E.prototype.listenerCount=function(t){if(!this.provider)return 0;var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).length},E.prototype.listeners=function(t){if(!this.provider)return[];var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).map((function(t){return t.listener}))},E.prototype.removeAllListeners=function(t){var e=this;if(!this.provider)return this;var r=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==r.eventTag||(e.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!1)})),this},E.prototype.removeListener=function(t,e){var r=this;if(!this.provider)return this;var n=!1,i=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==i.eventTag||t.listener!==e||(r.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!!n||!(n=!0))})),this},E);function E(t,e,r){var n=this;if(u.checkNew(this,E),d.Interface.isInterface(e)?p.defineReadOnly(this,"interface",e):p.defineReadOnly(this,"interface",new d.Interface(e)),v.Signer.isSigner(r)?(p.defineReadOnly(this,"provider",r.provider),p.defineReadOnly(this,"signer",r)):m.Provider.isProvider(r)?(p.defineReadOnly(this,"provider",r),p.defineReadOnly(this,"signer",null)):u.throwError("invalid signer or provider",u.INVALID_ARGUMENT,{arg:"signerOrProvider",value:r}),p.defineReadOnly(this,"estimate",{}),p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"filters",{}),Object.keys(this.interface.events).forEach((function(t){var e=n.interface.events[t];p.defineReadOnly(n.filters,t,(function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return{address:n.address,topics:e.encodeTopics(t)}}))})),this._events=[],p.defineReadOnly(this,"address",t),this.provider)p.defineReadOnly(this,"addressPromise",this.provider.resolveName(t).then((function(t){if(null==t)throw new Error("name not found");return t})).catch((function(t){throw t})));else try{p.defineReadOnly(this,"addressPromise",Promise.resolve(c.getAddress(t)))}catch(e){u.throwError("provider is required to use non-address contract address",u.INVALID_ARGUMENT,{argument:"addressOrName",value:t})}Object.keys(this.interface.functions).forEach((function(t){var e=b(n,t,!1);null==n[t]?p.defineReadOnly(n,t,e):u.warn("WARNING: Multiple definitions for "+t),null==n.functions[t]&&(p.defineReadOnly(n.functions,t,e),p.defineReadOnly(n.estimate,t,b(n,t,!0)))}))}r.Contract=M;var A=(x.prototype.getDeployTransaction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r={};if(t.length===this.interface.deployFunction.inputs.length+1)for(var n in r=p.shallowCopy(t.pop()))if(!w[n])throw new Error("unknown transaction override "+n);return["data","from","to"].forEach((function(t){null!=r[t]&&u.throwError("cannot override "+t,u.UNSUPPORTED_OPERATION,{operation:t})})),u.checkArgumentCount(t.length,this.interface.deployFunction.inputs.length," in Contract constructor"),r.data=this.interface.deployFunction.encode(this.bytecode,t),r},x.prototype.deploy=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.getDeployTransaction.apply(this,e);return this.signer.sendTransaction(n).then((function(e){var r=new M(c.getContractAddress(e),t.interface,t.signer);return p.defineReadOnly(r,"deployTransaction",e),r}))},x.prototype.attach=function(t){return new M(t,this.interface,this.signer)},x.prototype.connect=function(t){return new x(this.interface,this.bytecode,t)},x.fromSolidity=function(t,e){null==t&&u.throwError("missing compiler output",u.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new x(r,n,e)},x);function x(t,e,r){var n=null;"string"==typeof e?n=e:l.isArrayish(e)?n=l.hexlify(e):"string"==typeof e.object?n=e.object:u.throwError("bytecode must be a valid hex string",u.INVALID_ARGUMENT,{arg:"bytecode",value:e}),"0x"!==n.substring(0,2)&&(n="0x"+n),l.isHexString(n)||u.throwError("bytecode must be a valid hex string",u.INVALID_ARGUMENT,{arg:"bytecode",value:e}),n.length%2!=0&&u.throwError("bytecode must be valid data (even length)",u.INVALID_ARGUMENT,{arg:"bytecode",value:e}),p.defineReadOnly(this,"bytecode",n),d.Interface.isInterface(t)?p.defineReadOnly(this,"interface",t):p.defineReadOnly(this,"interface",new d.Interface(t)),r&&!v.Signer.isSigner(r)&&u.throwError("invalid signer",u.INVALID_ARGUMENT,{arg:"signer",value:null}),p.defineReadOnly(this,"signer",r||null)}r.ContractFactory=A},{"./abstract-signer":2,"./constants":3,"./errors":5,"./providers/abstract-provider":50,"./utils/abi-coder":59,"./utils/address":60,"./utils/bignumber":63,"./utils/bytes":64,"./utils/interface":69,"./utils/properties":74}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./_version");r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.MISSING_NEW="MISSING_NEW",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.NUMERIC_FAULT="NUMERIC_FAULT",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED";var i=!(r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION"),o=!1;function s(t,e,i){if(o)throw new Error("unknown error");e=e||r.UNKNOWN_ERROR,i=i||{};var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=e,Object.keys(i).forEach((function(t){u[t]=i[t]})),u}r.throwError=s,r.checkNew=function(t,e){t instanceof e||s("missing new",r.MISSING_NEW,{name:e.name})},r.checkArgumentCount=function(t,e,n){n=n||"",t<e&&s("missing argument"+n,r.MISSING_ARGUMENT,{count:t,expectedCount:e}),e<t&&s("too many arguments"+n,r.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})},r.setCensorship=function(t,e){i&&s("error censorship permanent",r.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,i=!!e},r.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",r.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("warn",t)}r.setLogLevel=function(t){var e=a[t];null!=e?u=e:c("invliad log level - "+t)},r.warn=c,r.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("info",t)}},{"./_version":1}],6:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./contract");r.Contract=i.Contract,r.ContractFactory=i.ContractFactory,r.VoidSigner=i.VoidSigner;var o=t("./abstract-signer");r.Signer=o.Signer;var s=t("./wallet");r.Wallet=s.Wallet;var a=n(t("./constants"));r.constants=a;var u=n(t("./errors"));r.errors=u;var h=n(t("./providers"));r.providers=h;var c=n(t("./utils"));r.utils=c;var f=n(t("./wordlists"));r.wordlists=f;var l=t("./utils/shims");r.platform=l.platform;var d=t("./_version");r.version=d.version,r.getDefaultProvider=function(t){null==t&&(t="homestead");var e=c.getNetwork(t);return e&&e._defaultProvider||u.throwError("unsupported getDefaultProvider network",u.UNSUPPORTED_OPERATION,{operation:"getDefaultProvider",network:t}),e._defaultProvider(h)}},{"./_version":1,"./abstract-signer":2,"./constants":3,"./contract":4,"./errors":5,"./providers":54,"./utils":68,"./utils/shims":80,"./wallet":88,"./wordlists":89}],7:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("./ethers"));r.ethers=i,function(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}(t("./ethers"))},{"./ethers":6}],8:[function(t,e,r){"use strict";!function(t){function n(t){return parseInt(t)===t}function i(t){if(!n(t.length))return!1;for(var e=0;e<t.length;e++)if(!n(t[e])||t[e]<0||255<t[e])return!1;return!0}function o(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!i(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(n(t.length)&&i(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function s(t){return new Uint8Array(t)}function a(t,e,r,n,i){null==n&&null==i||(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var u,h={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r<t.length;){var n=t.charCodeAt(r++);37===n?(e.push(parseInt(t.substr(r,2),16)),r+=2):e.push(n)}return o(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var n=t[r];n<128?(e.push(String.fromCharCode(n)),r++):191<n&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},c=(u="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(u[(240&n)>>4]+u[15&n])}return e.join("")}}),f={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],p=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],m=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],M=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],E=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var T=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(e,!0)}),this._prepare()};T.prototype._prepare=function(){var t=f[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(t+1),i=this.key.length/4,o=S(this.key);for(e=0;e<i;e++)r=e>>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,u=i;u<n;){if(s=o[i-1],o[0]^=d[s>>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^l[a]<<24,a+=1,8!=i)for(e=1;e<i;e++)o[e]^=o[e-1];else{for(e=1;e<i/2;e++)o[e]^=o[e-1];for(s=o[i/2-1],o[i/2]^=d[255&s]^d[s>>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24,e=i/2+1;e<i;e++)o[e]^=o[e-1]}for(e=0;e<i&&u<n;)h=u>>2,c=u%4,this._Ke[h][c]=o[e],this._Kd[t-h][c]=o[e++],u++}for(var h=1;h<t;h++)for(var c=0;c<4;c++)s=this._Kd[h][c],this._Kd[h][c]=E[s>>24&255]^A[s>>16&255]^x[s>>8&255]^k[255&s]},T.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=S(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o<e;o++){for(i=0;i<4;i++)r[i]=m[n[i]>>24&255]^v[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=255&(d[n[i]>>24&255]^a>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^a>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^a);return u},T.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=S(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o<e;o++){for(i=0;i<4;i++)r[i]=w[n[i]>>24&255]^b[n[(i+3)%4]>>16&255]^_[n[(i+2)%4]>>8&255]^M[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var a,u=s(16);for(i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=255&(p[n[i]>>24&255]^a>>24),u[4*i+1]=255&(p[n[(i+3)%4]>>16&255]^a>>16),u[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(p[255&n[(i+1)%4]]^a);return u};var I=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(e)};I.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.encrypt(r),e,n);return e},I.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16)a(t,r,0,n,n+16),a(r=this._aes.decrypt(r),e,n);return e};var P=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=s(16);this._lastCipherblock=o(r,!0),this._aes=new T(e)};P.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16);for(var i=0;i<16;i++)r[i]^=this._lastCipherblock[i];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,e,n)}return e},P.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),r=s(16),n=0;n<t.length;n+=16){a(t,r,0,n,n+16),r=this._aes.decrypt(r);for(var i=0;i<16;i++)e[n+i]=r[i]^this._lastCipherblock[i];a(t,this._lastCipherblock,0,n,n+16)}return e};var N=function t(e,r,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 size)")}else r=s(16);n=n||1,this.segmentSize=n,this._shiftRegister=o(r,!0),this._aes=new T(e)};N.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},N.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var R=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",r){if(16!=r.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else r=s(16);this._lastPrecipher=o(r,!0),this._lastPrecipherIndex=16,this._aes=new T(e)};R.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},R.prototype.decrypt=R.prototype.encrypt;var C=function t(e){if(!(this instanceof t))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=s(16),this.setValue(e)):this.setBytes(e)};C.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;0<=e;--e)this._counter[e]=t%256,t>>=8},C.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},C.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var L=function t(e,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof C||(r=new C(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(e)};L.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[r]^=this._remainingCounter[this._remainingCounterIndex++];return e},L.prototype.decrypt=L.prototype.encrypt;var O={AES:T,Counter:C,ModeOfOperation:{ecb:I,cbc:P,cfb:N,ofb:R,ctr:L},utils:{hex:c,utf8:h},padding:{pkcs7:{pad:function(t){var e=16-(t=o(t,!0)).length%16,r=s(t.length+e);a(t,r);for(var n=t.length;n<r.length;n++)r[n]=e;return r},strip:function(t){if((t=o(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(16<e)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n<e;n++)if(t[r+n]!==e)throw new Error("PKCS#7 invalid padding byte");var i=s(r);return a(t,i,0,0,r),i}}},_arrayTest:{coerceArray:o,createArray:s,copyArray:a}};void 0!==r?e.exports=O:(t.aesjs&&(O._aesjs=t.aesjs),t.aesjs=O)}(this)},{}],9:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,(this.red=null)!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof e?e.exports=o:r.BN=o,(o.BN=o).wordSize=26;try{s=t("buffer").Buffer}catch(e){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=49<=a?a-49+10:17<=a?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return 0<t.cmp(e)?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&2<=e&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;0<=i;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);else if("le"===r)for(o=i=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,26<=(a+=24)&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;e<=r;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,h=0,c=r;c<a;c+=n)h=u(t,c,c+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!=s){var f=1;for(h=u(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,26<=(i+=2)&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var l=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2<this.length&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(0<o,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},o.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var e=t,r=0;return 4096<=e&&(r+=13,e>>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0<r&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return 0<r&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&0<=t);var r=t/26|0,i=t%26;return this._expand(1+r),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();n=this.length>t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;n=0<i?(r=this,t):(r=t,this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],b=8191&w,_=w>>>13,M=0|s[4],E=8191&M,A=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,T=0|s[6],I=8191&T,P=T>>>13,N=0|s[7],R=8191&N,C=N>>>13,L=0|s[8],O=8191&L,B=L>>>13,D=0|s[9],U=8191&D,j=D>>>13,F=0|a[0],K=8191&F,G=F>>>13,V=0|a[1],H=8191&V,z=V>>>13,q=0|a[2],W=8191&q,Z=q>>>13,Y=0|a[3],J=8191&Y,$=Y>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(f,K))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(l,K)|0))<<13)|0;h=((o=Math.imul(l,G))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,G))+Math.imul(m,K)|0,o=Math.imul(m,G);var gt=(h+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,z)|0)+Math.imul(l,H)|0))<<13)|0;h=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,G))+Math.imul(y,K)|0,o=Math.imul(y,G),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,z)|0;var yt=(h+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,G))+Math.imul(_,K)|0,o=Math.imul(_,G),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Z)|0;var wt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,G))+Math.imul(A,K)|0,o=Math.imul(A,G),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,z)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,z)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0;var bt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,K),i=(i=Math.imul(k,G))+Math.imul(S,K)|0,o=Math.imul(S,G),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,G))+Math.imul(P,K)|0,o=Math.imul(P,G),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,K),i=(i=Math.imul(R,G))+Math.imul(C,K)|0,o=Math.imul(C,G),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,G))+Math.imul(B,K)|0,o=Math.imul(B,G),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,z)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,z)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,z)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,z)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var xt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var kt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var St=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,$))+Math.imul(j,J)|0,o=Math.imul(j,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,lt)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,lt)|0;var Tt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,lt)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,lt)|0;var It=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,lt)|0;var Pt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(C,ft)|0,o=o+Math.imul(C,lt)|0;var Nt=(h+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,lt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ft),i=(i=Math.imul(U,lt))+Math.imul(j,ft)|0,o=Math.imul(j,lt);var Ct=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Lt=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,mt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,u[0]=vt,u[1]=gt,u[2]=yt,u[3]=wt,u[4]=bt,u[5]=_t,u[6]=Mt,u[7]=Et,u[8]=At,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Tt,u[13]=It,u[14]=Pt,u[15]=Nt,u[16]=Rt,u[17]=Ct,u[18]=Lt,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],v=r[c+d+s],g=n[c+d+s],y=f*v-l*g;g=f*g+l*v,v=y,r[c+d]=p+v,n[c+d]=m+g,r[c+d+s]=p-v,n[c+d+s]=m-g,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&0<=t);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!=r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!=i){for(e=this.length-1;0<=e;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&0<=t),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;0<=h&&(0!==c||i<=h);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!=e&&r++,this.length=Math.min(r,this.length),0!=e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),i=a=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=1+u,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;0<=f;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!=r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;0<=i;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(0<l)for(e.iushrn(l);0<l--;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(0<p)for(r.iushrn(p);0<p--;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);0<=e.cmp(r)?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();0<e.cmpn(1)&&0<r.cmpn(1);){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(0<h)for(e.iushrn(h);0<h--;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(0<f)for(r.iushrn(f);0<f--;)a.isOdd()&&a.iadd(u),a.iushrn(1);0<=e.cmp(r)?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0;for(var n=r.negative=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(1+r),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1<this.length)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;0<=r;r--){var n=0|this.words[r],i=0|t.words[r];if(n!=i){n<i?e=-1:i<n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return 0<=this.cmpn(t)},o.prototype.gte=function(t){return 0<=this.cmp(t)},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){for(var e,r=t;this.split(r,this.tmp),(e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):0<n?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10<t.length?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,g),i(b,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,v=0;0!==m.cmp(a);v++)m=m.redSqr();n(v<p);var g=this.pow(f,new o(1).iushln(p-v-1));l=l.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return l},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;0<=n;n--){for(var h=e.words[n],c=u-1;0<=c;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!=f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),s=a=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return 0<=i.cmp(this.m)?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:11}],10:[function(t,r,n){(function(t){r.exports=function(e){var r=new Uint8Array(e);return(t.crypto||t.msCrypto).getRandomValues(r),r}}).call(this,"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,r){},{}],12:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":25,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/utils":24,brorand:10}],13:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||0<r.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(t,e){this.curve=t,this.type=e,this.precomputed=null}(e.exports=u).prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],u=0;u<n.length;u+=r.step){var h=0;for(e=u+r.step-1;u<=e;e--)h=(h<<1)+n[e];s.push(h)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),l=i;0<l;l--){for(u=0;u<s.length;u++)(h=s[u])===l?f=f.mixedAdd(r.points[u]):h===-l&&(f=f.mixedAdd(r.points[u].neg()));c=c.add(f)}return c.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),h=s.length-1;0<=h;h--){for(e=0;0<=h&&0===s[h];h--)e++;if(0<=h&&e++,u=u.dblp(e),h<0)break;var c=s[h];a(0!==c),u="affine"===t.type?0<c?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):0<c?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,u=this._wnafT2,h=this._wnafT3,c=0,f=0;f<n;f++){var l=(x=e[f])._getNAFPoints(t);a[f]=l.wnd,u[f]=l.points}for(f=n-1;1<=f;f-=2){var d=f-1,p=f;if(1===a[d]&&1===a[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[d],r[p]);c=Math.max(g[0].length,c),h[d]=new Array(c),h[p]=new Array(c);for(var y=0;y<c;y++){var w=0|g[0][y],b=0|g[1][y];h[d][y]=v[3*(1+w)+(1+b)],h[p][y]=0,u[d]=m}}else h[d]=o(r[d],a[d],this._bitLength),h[p]=o(r[p],a[p],this._bitLength),c=Math.max(h[d].length,c),c=Math.max(h[p].length,c)}var _=this.jpoint(null,null,null),M=this._wnafT4;for(f=c;0<=f;f--){for(var E=0;0<=f;){var A=!0;for(y=0;y<n;y++)M[y]=0|h[y][f],0!==M[y]&&(A=!1);if(!A)break;E++,f--}if(0<=f&&E++,_=_.dblp(E),f<0)break;for(y=0;y<n;y++){var x,k=M[y];0!==k&&(0<k?x=u[y][k-1>>1]:k<0&&(x=u[y][-k-1>>1].neg()),_="affine"===x.type?_.mixedAdd(x):_.add(x))}}for(f=0;f<n;f++)u[f]=null;return i?_:_.toP()},(u.BasePoint=h).prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},h.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},h.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},h.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},h.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1==r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../utils":24,"bn.js":9}],14:[function(t,e,r){e.exports={}},{}],15:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":13,"./edwards":14,"./mont":16,"./short":17}],16:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],17:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),(e.exports=u).prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,h,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new i(1),m=new i(0),v=new i(0),g=new i(1),y=0;0!==l.cmpn(0);){var w=d.div(l);h=d.sub(w.mul(l)),c=v.sub(w.mul(p));var b=g.sub(w.mul(m));if(!n&&h.cmp(f)<0)e=u.neg(),r=p,n=h.neg(),o=c;else if(n&&2==++y)break;d=l,l=u=h,v=p,p=c,g=m,m=b}s=h.neg(),a=c;var _=n.sqr().add(o.sqr());return 0<=s.sqr().add(a.sqr()).cmp(_)&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(h).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return h},o(h,s.BasePoint),u.prototype.point=function(t,e,r){return new h(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return h.fromJSON(this,t,e)},h.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};(t.beta=e).precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},h.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),c=h.redMul(a),f=n.redMul(h),l=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(l)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),c=r.redMul(u),f=a.redSqr().redIAdd(h).redISub(c).redISub(c),l=a.redMul(c.redISub(f)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(f,l,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(r=0;r<t;r++){var c=o.redSqr(),f=h.redSqr(),l=f.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=o.redMul(f),m=d.redSqr().redISub(p.redAdd(p)),v=p.redISub(m),g=d.redMul(v);g=g.redIAdd(g).redISub(l);var y=h.redMul(a);r+1<t&&(u=u.redMul(l)),o=m,a=y,h=g}return this.curve.jpoint(o,h.redMul(i),a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(c).redISub(l);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),v=l.redIAdd(l);v=(v=v.redIAdd(v)).redIAdd(v),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(c);var v=f.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),e=d.redMul(p.redISub(t)).redISub(v)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),c=a.redSqr().redISub(h.redAdd(h)),f=h.redISub(c),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,d,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),c=e.redMul(h);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.x.redMul(a).redISub(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,l,d)},c.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),0<=n.cmp(this.curve.p))return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":24,"./base":13,"bn.js":9,inherits:39}],18:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),s=t("./curve"),a=t("./utils").assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}h("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",n]})},{"./curve":15,"./precomputed/secp256k1":23,"./utils":24,"hash.js":26}],19:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("hmac-drbg"),o=t("../utils"),s=t("../curves"),a=t("brorand"),u=o.assert,h=t("./key"),c=t("./signature");function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(u(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=f).prototype.keyPair=function(t){return new h(this,t)},f.prototype.keyFromPrivate=function(t,e){return h.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return h.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t=t||{};for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(0<s.cmp(o)))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return 0<r&&(t=t.ushrn(r)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o=o||{},e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),h=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),l=0;;l++){var d=o.k?o.k(l):new n(h.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||0<=d.cmp(f))){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var g=d.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return o.canonical&&0<g.cmp(this.nh)&&(g=this.n.sub(g),y^=1),new c({r:v,s:g,recoveryParam:y})}}}}}},f.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new c(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||0<=o.cmp(this.n))return!1;if(s.cmpn(1)<0||0<=s.cmp(this.n))return!1;var a,u=s.invm(this.n),h=u.mul(t).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(h,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new c(e,i);var o=this.n,s=new n(t),a=e.r,h=e.s,f=1&r,l=r>>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=h.mul(d).umod(o);return this.g.mulAdd(p,a,m)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":18,"../utils":24,"./key":20,"./signature":21,"bn.js":9,brorand:10,"hmac-drbg":38}],20:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":24,"bn.js":9}],21:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s];return e.place=s,i}function h(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(u(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=u(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var h=u(t,r);if(t.length!==h+r.place)return!1;var c=t.slice(r.place,h+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new n(s),this.s=new n(c),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../utils":24,"bn.js":9}],22:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],23:[function(t,e,r){e.exports=void 0},{}],24:[function(t,e,r){"use strict";var n=r,i=t("bn.js"),o=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=(i>>1)-1<u?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0<t.cmpn(-n)||0<e.cmpn(-i);){var o,s,a,u=t.andln(3)+n&3,h=e.andln(3)+i&3;3===u&&(u=-1),3===h&&(h=-1),o=0==(1&u)?0:3!==(a=t.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[0].push(o),s=0==(1&h)?0:3!==(a=e.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[1].push(s),2*n===o+1&&(n=1-n),2*i===s+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":9,"minimalistic-assert":41,"minimalistic-crypto-utils":42}],25:[function(t,e,r){e.exports={version:"6.5.2"}},{}],26:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":27,"./hash/hmac":28,"./hash/ripemd":29,"./hash/sha":30,"./hash/utils":37}],27:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(){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}(r.BlockHash=o).prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":37,"minimalistic-assert":41}],28:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}(e.exports=o).prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":37,"minimalistic-assert":41}],29:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./common"),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,h=i.BlockHash;function c(){if(!(this instanceof c))return new c;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,h),(r.ripemd160=c).blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],h=this.h[3],c=this.h[4],y=r,w=n,b=i,_=h,M=c,E=0;E<80;E++){var A=s(o(u(r,f(E,n,i,h),t[p[E]+e],l(E)),v[E]),c);r=c,c=h,h=o(i,10),i=n,n=A,A=s(o(u(y,f(79-E,w,b,_),t[m[E]+e],d(E)),g[E]),M),y=M,M=_,_=o(b,10),b=w,w=A}A=a(this.h[1],i,_),this.h[1]=a(this.h[2],h,M),this.h[2]=a(this.h[3],c,y),this.h[3]=a(this.h[4],r,w),this.h[4]=a(this.h[0],n,b),this.h[0]=A},c.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[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],v=[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]},{"./common":27,"./utils":37}],30:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":31,"./sha/224":32,"./sha/256":33,"./sha/384":34,"./sha/512":35}],31:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],32:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],33:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=t("minimalistic-assert"),a=n.sum32,u=n.sum32_4,h=n.sum32_5,c=o.ch32,f=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,v=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,v),(e.exports=y).blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],v=this.h[2],g=this.h[3],y=this.h[4],w=this.h[5],b=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var M=h(_,d(y),c(y,w,b),this.k[n],r[n]),E=a(l(i),f(i,o,v));_=b,b=w,w=y,y=a(g,M),g=v,v=o,o=i,i=a(M,E)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],v),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],w),this.h[6]=a(this.h[6],b),this.h[7]=a(this.h[7],_)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":27,"../utils":37,"./common":36,"minimalistic-assert":41}],34:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],35:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("minimalistic-assert"),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,h=n.shr64_lo,c=n.sum64,f=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,v=n.sum64_5_lo,g=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function w(){if(!(this instanceof w))return new w;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function b(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function M(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function A(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function S(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function N(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(w,g),(e.exports=w).blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=P(r[n-4],r[n-3]),o=N(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=T(r[n-30],r[n-29]),h=I(r[n-30],r[n-29]),c=r[n-32],f=r[n-31];r[n]=d(i,o,s,a,u,h,c,f),r[n+1]=p(i,o,s,a,u,h,c,f)}},w.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],h=this.h[5],d=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],w=this.h[10],T=this.h[11],I=this.h[12],P=this.h[13],N=this.h[14],R=this.h[15];o(this.k.length===r.length);for(var C=0;C<r.length;C+=2){var L=N,O=R,B=k(g,y),D=S(g,y),U=b(g,y,w,T,I),j=_(g,y,w,T,I,P),F=this.k[C],K=this.k[C+1],G=r[C],V=r[C+1],H=m(L,O,B,D,U,j,F,K,G,V),z=v(L,O,B,D,U,j,F,K,G,V);L=A(n,i),O=x(n,i),B=M(n,i,s,a,u),D=E(n,i,s,a,u,h);var q=f(L,O,B,D),W=l(L,O,B,D);N=I,R=P,I=w,P=T,w=g,T=y,g=f(d,p,H,z),y=l(p,p,H,z),d=u,p=h,u=s,h=a,s=n,a=i,n=f(H,z,q,W),i=l(H,z,q,W)}c(this.h,0,n,i),c(this.h,2,s,a),c(this.h,4,u,h),c(this.h,6,d,p),c(this.h,8,g,y),c(this.h,10,w,T),c(this.h,12,I,P),c(this.h,14,N,R)},w.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":27,"../utils":37,"minimalistic-assert":41}],36:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":37}],37:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},r.htonl=o,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=a(i.toString(16))}return r},r.zero2=s,r.zero8=a,r.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var h;h="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var c=0,f=e;return c+=(f=f+n>>>0)<e?1:0,c+=(f=f+o>>>0)<o?1:0,c+=(f=f+a>>>0)<a?1:0,t+r+i+s+u+(c+=(f=f+h>>>0)<h?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:39,"minimalistic-assert":41}],38:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}(e.exports=s).prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},{"hash.js":26,"minimalistic-assert":41,"minimalistic-crypto-utils":42}],39:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],40:[function(t,r,n){(function(t,e){!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node&&(n=e);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof r&&r.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],a=[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],u=[224,256,384,512],h=["hex","buffer","arrayBuffer","array"],c=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},f=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},l=function(t,e){var r=c(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};for(var n=0;n<h.length;++n){var i=h[n];r[i]=c(t,e,i)}return r},d=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:l},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:l},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=f(t,e,"hex");r.create=function(r){return new _(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var n=0;n<h.length;++n){var i=h[n];r[i]=f(t,e,i)}return r}}],p={},m=[],v=0;v<d.length;++v)for(var g=d[v],y=g.bits,w=0;w<y.length;++w){var b=g.name+"_"+y[w];m.push(b),p[b]=g.createMethod(y[w],g.padding)}function _(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,a=this.byteCount,u=this.blockCount,h=0,c=this.s;h<i;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(e)for(r=this.start;h<i&&r<a;++h)o[r>>2]|=t[h]<<s[3&r++];else for(r=this.start;h<i&&r<a;++h)(n=t.charCodeAt(h))<128?o[r>>2]|=n<<s[3&r++]:(n<2048?o[r>>2]|=(192|n>>6)<<s[3&r++]:(n<55296||57344<=n?o[r>>2]|=(224|n>>12)<<s[3&r++]:(n=65536+((1023&n)<<10|1023&t.charCodeAt(++h)),o[r>>2]|=(240|n>>18)<<s[3&r++],o[r>>2]|=(128|n>>12&63)<<s[3&r++]),o[r>>2]|=(128|n>>6&63)<<s[3&r++]),o[r>>2]|=(128|63&n)<<s[3&r++]);if(a<=(this.lastByteIndex=r)){for(this.start=r-a,this.block=o[u],r=0;r<u;++r)c[r]^=o[r];M(c),this.reset=!0}else this.start=r}return this},_.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];M(n)},_.prototype.toString=_.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,s=0,a=0,u="";a<n;){for(s=0;s<e&&a<n;++s,++a)t=r[s],u+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(M(r),s=0)}return i&&(t=r[s],0<i&&(u+=o[t>>4&15]+o[15&t]),1<i&&(u+=o[t>>12&15]+o[t>>8&15]),2<i&&(u+=o[t>>20&15]+o[t>>16&15])),u},_.prototype.buffer=_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&M(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},_.prototype.digest=_.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&M(n)}return o&&(t=a<<2,e=n[s],0<o&&(u[t]=255&e),1<o&&(u[t+1]=e>>8&255),2<o&&(u[t+2]=e>>16&255)),u};var M=function(t){var e,r,n,i,o,s,u,h,c,f,l,d,p,m,v,g,y,w,b,_,M,E,A,x,k,S,T,I,P,N,R,C,L,O,B,D,U,j,F,K,G,V,H,z,q,W,Z,Y,J,$,X,Q,tt,et,rt,nt,it,ot,st,at,ut,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(h<<1|c>>>31),r=o^(c<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(f<<1|l>>>31),r=u^(l<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|p>>>31),r=c^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],v=t[1],W=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,B=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,k=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,j=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,z=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,K=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~g&w,t[1]=v^~y&b,t[10]=x^~S&I,t[11]=k^~T&P,t[20]=O^~D&j,t[21]=B^~U&F,t[30]=z^~W&Y,t[31]=q^~Z&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=g^~w&_,t[3]=y^~b&M,t[12]=S^~I&N,t[13]=T^~P&R,t[22]=D^~j&K,t[23]=U^~F&G,t[32]=W^~Y&$,t[33]=Z^~J&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=w^~_&E,t[5]=b^~M&A,t[14]=I^~N&C,t[15]=P^~R&L,t[24]=j^~K&V,t[25]=F^~G&H,t[34]=Y^~$&Q,t[35]=J^~X&tt,t[44]=ot^~at&ht,t[45]=st^~ut&ct,t[6]=_^~E&m,t[7]=M^~A&v,t[16]=N^~C&x,t[17]=R^~L&k,t[26]=K^~V&O,t[27]=G^~H&B,t[36]=$^~Q&z,t[37]=X^~tt&q,t[46]=at^~ht&et,t[47]=ut^~ct&rt,t[8]=E^~m&g,t[9]=A^~v&y,t[18]=C^~x&S,t[19]=L^~k&T,t[28]=V^~O&D,t[29]=H^~B&U,t[38]=Q^~z&W,t[39]=tt^~q&Z,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=a[n],t[1]^=a[n+1]};if(i)r.exports=p;else for(v=0;v<m.length;++v)n[m[v]]=p[m[v]]}()}).call(this,t("_process"),"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:43}],41:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}(e.exports=n).equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],42:[function(t,e,r){"use strict";var n=r;function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],43:[function(t,e,r){e.exports={browser:!0}},{}],44:[function(t,e,r){(function(t){"use strict";function n(t){var e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,h=1541459225,c=new Array(64);function f(t){for(var f=0,l=t.length;64<=l;){var d,p,m,v,g,y=r,w=n,b=i,_=o,M=s,E=a,A=u,x=h;for(p=0;p<16;p++)m=f+4*p,c[p]=(255&t[m])<<24|(255&t[m+1])<<16|(255&t[m+2])<<8|255&t[m+3];for(p=16;p<64;p++)v=((d=c[p-2])>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,g=((d=c[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,c[p]=(v+c[p-7]|0)+(g+c[p-16]|0)|0;for(p=0;p<64;p++)v=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&E^~M&A)|0)+(x+(e[p]+c[p]|0)|0)|0,g=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&w^y&b^w&b)|0,x=A,A=E,E=M,M=_+v|0,_=b,b=w,w=y,y=v+g|0;r=r+y|0,n=n+w|0,i=i+b|0,o=o+_|0,s=s+M|0,a=a+E|0,u=u+A|0,h=h+x|0,f+=64,l-=64}}f(t);var l,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,v=d<56?56:120,g=t.slice(t.length-d,t.length);for(g.push(128),l=1+d;l<v;l++)g.push(0);return g.push(p>>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(m>>>24&255),g.push(m>>>16&255),g.push(m>>>8&255),g.push(m>>>0&255),f(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255]}function i(t,e,r){var i;t=t.length<=64?t:n(t);var o=64+e.length+4,s=new Array(o),a=new Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i<t.length;i++)s[i]^=t[i];for(i=0;i<e.length;i++)s[64+i]=e[i];for(i=o-4;i<o;i++)s[i]=0;for(i=0;i<64;i++)a[i]=92;for(i=0;i<t.length;i++)a[i]^=t[i];function h(){for(var t=o-1;o-4<=t;t--){if(s[t]++,s[t]<=255)return;s[t]=0}}for(;32<=r;)h(),u=u.concat(n(a.concat(n(s)))),r-=32;return 0<r&&(h(),u=u.concat(n(a.concat(n(s))).slice(0,r))),u}function o(t,e,r,n,i){var o;for(h(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(t,16*o,i,16),a(i,n),h(i,0,t,e+16*o,16);for(o=0;o<r;o++)h(t,e+2*o*16,t,16*o,16);for(o=0;o<r;o++)h(t,e+16*(2*o+1),t,16*(o+r),16)}function s(t,e){return t<<e|t>>>32-e}function a(t,e){h(t,0,e,0,16);for(var r=8;0<r;r-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(r=0;r<16;++r)t[r]+=e[r]}function u(t,e,r,n){for(var i=0;i<n;i++)r[i]^=t[e+i]}function h(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}function c(t){if(!t||"number"!=typeof t.length)return!1;for(var e=0;e<t.length;e++){if("number"!=typeof t[e])return!1;var r=parseInt(t[e]);if(r!=t[e]||r<0||256<=r)return!1}return!0}function f(t,e){var r=parseInt(t);if(t!=r)throw new Error("invalid "+e);return r}function l(e,r,n,s,a,l,d){if(!d)throw new Error("missing callback");if(n=f(n,"N"),s=f(s,"r"),a=f(a,"p"),l=f(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(p/128/s<n)throw new Error("N too large");if(p/128/a<s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!c(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);for(var m=i(e,r,128*a*s),v=new Uint32Array(32*a*s),g=0;g<v.length;g++){var y=4*g;v[g]=(255&m[3+y])<<24|(255&m[2+y])<<16|(255&m[1+y])<<8|(255&m[0+y])<<0}var w,b,_=new Uint32Array(64*s),M=new Uint32Array(32*s*n),E=32*s,A=new Uint32Array(16),x=new Uint32Array(16),k=a*n*2,S=0,T=null,I=!1,P=0,N=0,R=parseInt(1e3/s),C=void 0!==t?t:setTimeout;!function t(){if(I)return d(new Error("cancelled"),S/k);switch(P){case 0:h(v,b=32*N*s,_,0,E),P=1,w=0;case 1:R<(c=n-w)&&(c=R);for(var r=0;r<c;r++)h(_,0,M,(w+r)*E,E),o(_,E,s,A,x);if(w+=c,S+=c,(f=parseInt(1e3*S/k))!==T){if(I=d(null,S/k))break;T=f}if(w<n)break;w=0,P=2;case 2:var c,f;for(R<(c=n-w)&&(c=R),r=0;r<c;r++){var p=_[16*(2*s-1)]&n-1;u(M,p*E,_,E),o(_,E,s,A,x)}if(w+=c,S+=c,(f=parseInt(1e3*S/k))!==T){if(I=d(null,S/k))break;T=f}if(w<n)break;if(h(_,0,v,b,E),++N<a){P=0;break}for(m=[],r=0;r<v.length;r++)m.push(v[r]>>0&255),m.push(v[r]>>8&255),m.push(v[r]>>16&255),m.push(v[r]>>24&255);var g=i(e,m,l);return d(null,1,g)}C(t)}()}var d,p;d=this,p=2147483647,void 0!==r?e.exports=l:d&&(d.scrypt&&(d._scrypt=d.scrypt),d.scrypt=l)}).call(this,t("timers").setImmediate)},{timers:46}],45:[function(t,r,n){(function(t,e,r){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,s,a=1,u={},h=!1,c=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,n="[object process]"==={}.toString.call(e.process)?function(){var e=l(arguments);return t.nextTick(d(p,e)),e}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",v,!1):e.attachEvent("onmessage",v),function(){var t=l(arguments);return e.postMessage(s+t,"*"),t}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},function(){var t=l(arguments);return o.port2.postMessage(t),t}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(){var t=l(arguments),e=c.createElement("script");return e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e),t}):function(){var t=l(arguments);return setTimeout(d(p,t),0),t},f.setImmediate=n,f.clearImmediate=m}function l(t){return u[a]=d.apply(r,t),a++}function d(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(r,e):new Function(""+t)()}}function p(t){if(h)setTimeout(d(p,t),0);else{var e=u[t];if(e){h=!0;try{e()}finally{m(t),h=!1}}}}function m(t){delete u[t]}function v(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,t("_process"),"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").clearImmediate)},{_process:43,timers:46}],46:[function(t,r,n){(function(t){r.exports={setImmediate:t.setImmediate}}).call(this,"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,r,n){(function(t){var e;if(t.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);e=function(){return crypto.getRandomValues(n),n}}if(!e){var i=new Array(16);e=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}r.exports=e}).call(this,"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],48:[function(t,e,r){for(var n=t("./rng"),i=[],o={},s=0;s<256;s++)i[s]=(s+256).toString(16).substr(1),o[i[s]]=s;function a(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var u=n(),h=[1|u[0],u[1],u[2],u[3],u[4],u[5]],c=16383&(u[6]<<8|u[7]),f=0,l=0;function d(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;s++)e[i+s]=o[s];return e||a(o)}var p=d;p.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:c,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:l+1,d=s-f+(u-l)/1e4;if(d<0&&void 0===t.clockseq&&(o=o+1&16383),(d<0||f<s)&&void 0===t.nsecs&&(u=0),1e4<=u)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=s,c=o;var p=(1e4*(268435455&(s+=122192928e5))+(l=u))%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var m=s/4294967296*1e4&268435455;i[n++]=m>>>8&255,i[n++]=255&m,i[n++]=m>>>24&15|16,i[n++]=m>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var v=t.node||h,g=0;g<6;g++)i[n+g]=v[g];return e||a(i)},p.v4=d,p.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){i<16&&(e[n+i++]=o[t])}));i<16;)e[n+i++]=0;return e},p.unparse=a,e.exports=p},{"./rng":47}],49:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],50:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/properties"),i=(o.isProvider=function(t){return n.isType(t,"Provider")},o);function o(){n.setType(this,"Provider")}r.Provider=i},{"../utils/properties":74}],51:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("../utils/address"),a=t("../utils/bignumber"),u=t("../utils/bytes"),h=t("../constants"),c=t("../utils/hash"),f=t("../utils/networks"),l=t("../utils/properties"),d=t("../utils/rlp"),p=t("../utils/transaction"),m=t("../utils/utf8"),v=t("../utils/web"),g=o(t("../errors")),y=t("./abstract-provider");function w(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}function b(t,e){return function(r){return null==r?e:t(r)}}function _(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}function M(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),32===u.hexDataLength(t))?t.toLowerCase():(g.throwError("invalid hash",g.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function E(t){return a.bigNumberify(t).toNumber()}function A(t){if(!u.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function x(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return u.hexStripZeros(u.hexlify(t));if(u.isHexString(t))return u.hexStripZeros(t);throw new Error("invalid blockTag")}var k={hash:M,blockHash:b(M,null),blockNumber:b(E,null),transactionIndex:b(E,null),confirmations:b(E,null),from:s.getAddress,gasPrice:a.bigNumberify,gasLimit:a.bigNumberify,to:b(s.getAddress,null),value:a.bigNumberify,nonce:E,data:u.hexlify,r:b(A),s:b(A),v:b(E),creates:b(s.getAddress,null),raw:b(u.hexlify)};function S(t){if(null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&a.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=s.getContractAddress(t)),!t.raw&&t.v&&t.r&&t.s){var e=[u.stripZeros(u.hexlify(t.nonce)),u.stripZeros(u.hexlify(t.gasPrice)),u.stripZeros(u.hexlify(t.gasLimit)),t.to||"0x",u.stripZeros(u.hexlify(t.value||"0x")),u.hexlify(t.data||"0x"),u.stripZeros(u.hexlify(t.v||"0x")),u.stripZeros(u.hexlify(t.r)),u.stripZeros(u.hexlify(t.s))];t.raw=d.encode(e)}var r=w(k,t),n=t.networkId;return null!=t.chainId&&null==n&&null==r.v&&(n=t.chainId),u.isHexString(n)&&(n=a.bigNumberify(n).toNumber()),"number"!=typeof n&&null!=r.v&&((n=(r.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),r.networkId=n,null==r.chainId&&null!=n&&(r.chainId=n),r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}var T={hash:M,parentHash:M,number:E,timestamp:E,nonce:b(u.hexlify),difficulty:function(t){var e=a.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:a.bigNumberify,gasUsed:a.bigNumberify,miner:s.getAddress,extraData:u.hexlify,transactions:b(_(M))},I=l.shallowCopy(T);function P(t,e){return null!=t.author&&null==t.miner&&(t.miner=t.author),w(e?I:T,t)}I.transactions=b(_(S));var N={from:b(s.getAddress),nonce:b(E),gasLimit:b(a.bigNumberify),gasPrice:b(a.bigNumberify),to:b(s.getAddress),value:b(a.bigNumberify),data:b(u.hexlify)};function R(t){return w(N,t)}var C={transactionLogIndex:b(E),transactionIndex:E,blockNumber:E,transactionHash:M,address:s.getAddress,topics:_(M),data:u.hexlify,logIndex:E,blockHash:M},L={to:b(s.getAddress,null),from:b(s.getAddress,null),contractAddress:b(s.getAddress,null),transactionIndex:E,root:b(M),gasUsed:a.bigNumberify,logsBloom:b(u.hexlify),blockHash:M,transactionHash:M,logs:_((function(t){return w(C,t)})),blockNumber:E,confirmations:b(E,null),cumulativeGasUsed:a.bigNumberify,status:b(E)};function O(t){return Array.isArray(t)?t.forEach((function(t){O(t)})):null!=t&&M(t),t}var B,D,U={fromBlock:b(x,void 0),toBlock:b(x,void 0),address:b(s.getAddress,void 0),topics:b(O,void 0)},j={blockHash:b(M,void 0),address:b(s.getAddress,void 0),topics:b(O,void 0)},F={blockNumber:b(E),blockHash:b(M),transactionIndex:E,removed:b((function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)})),address:s.getAddress,data:(B=u.hexlify,D="0x",function(t){return t?B(t):D}),topics:_(M),transactionHash:M,logIndex:E};function K(t){return w(F,t)}function G(t){return t.map((function(t){return"string"==typeof t?t:Array.isArray(t)?(t.forEach((function(t){null!==t&&32!==u.hexDataLength(t)&&g.throwError("invalid topic",g.INVALID_ARGUMENT,{argument:"topic",value:t})})),t.join(",")):null===t?"":g.throwError("invalid topic value",g.INVALID_ARGUMENT,{argument:"topic",value:t})})).join("&")}function V(t){if("string"==typeof t){if(20===u.hexDataLength(t))return"address:"+s.getAddress(t);if(t=t.toLowerCase(),32===u.hexDataLength(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter::"+G(t);if(t&&"object"==typeof t)return"filter:"+(t.address||"")+":"+G(t.topics||[])}throw new Error("invalid event - "+t)}function H(){return(new Date).getTime()}var z,q=(i(W,z=y.Provider),W.prototype._doPoll=function(){var t=this;this.getBlockNumber().then((function(e){if(t.polling&&(t._setFastBlockNumber(e),e!==t._lastBlockNumber)){-2===t._emitted.block&&(t._emitted.block=e-1);for(var r=t._emitted.block+1;r<=e;r++)t.emit("block",r);t._emitted.block!==e&&(t._emitted.block=e,Object.keys(t._emitted).forEach((function(r){if("block"!==r){var n=t._emitted[r];"pending"!==n&&12<e-n&&delete t._emitted[r]}}))),-2===t._lastBlockNumber&&(t._lastBlockNumber=e-1);var n={},i={};return t._events.forEach((function(t){i[t.tag]=!0})),Object.keys(i).forEach((function(r){var i=r.split(":");switch(i[0]){case"tx":var o=i[1];t.getTransactionReceipt(o).then((function(e){return e&&null!=e.blockNumber&&(t._emitted["t:"+o]=e.blockNumber,t.emit(o,e)),null})).catch((function(e){t.emit("error",e)}));break;case"address":var s=i[1];t._balances[s]&&(n[s]=t._balances[s]),t.getBalance(s,"latest").then((function(e){var r=t._balances[s];if(!r||!e.eq(r))return t._balances[s]=e,t.emit(s,e),null})).catch((function(e){t.emit("error",e)}));break;case"filter":var a=function(t){return t.split(/&/g).map((function(t){var e=t.split(",");return 1===e.length?""===e[0]?null:t:e.map((function(t){return""===t?null:t}))}))}(i[2]),u={address:i[1],fromBlock:t._lastBlockNumber+1,toBlock:e,topics:a};u.address||delete u.address,t.getLogs(u).then((function(e){if(0!==e.length)return e.forEach((function(e){t._emitted["b:"+e.blockHash]=e.blockNumber,t._emitted["t:"+e.transactionHash]=e.blockNumber,t.emit(u,e)})),null})).catch((function(e){t.emit("error",e)}))}})),t._lastBlockNumber=e,t._balances=n,null}})).catch((function(t){})),this.doPoll()},W.prototype.resetEventsBlock=function(t){this._lastBlockNumber=t-1,this.polling&&this._doPoll()},Object.defineProperty(W.prototype,"network",{get:function(){return this._network},enumerable:!0,configurable:!0}),W.prototype.getNetwork=function(){return this.ready},Object.defineProperty(W.prototype,"blockNumber",{get:function(){return this._fastBlockNumber},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"polling",{get:function(){return null!=this._poller},set:function(t){var e=this;setTimeout((function(){t&&!e._poller?(e._poller=setInterval(e._doPoll.bind(e),e.pollingInterval),e._doPoll()):!t&&e._poller&&(clearInterval(e._poller),e._poller=null)}),0)},enumerable:!0,configurable:!0}),Object.defineProperty(W.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e._doPoll()}),this._pollingInterval))},enumerable:!0,configurable:!0}),W.prototype._getFastBlockNumber=function(){var t=this,e=H();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise},W.prototype._setFastBlockNumber=function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=H(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))},W.prototype.waitForTransaction=function(t,e){var r=this;return null==e&&(e=1),this.getTransactionReceipt(t).then((function(n){return 0===e||n&&n.confirmations>=e?n:new Promise((function(n){var i=function i(o){o.confirmations<e||(r.removeListener(t,i),n(o))};r.on(t,i)}))}))},W.prototype.getBlockNumber=function(){var t=this;return this.ready.then((function(){return t.perform("getBlockNumber",{}).then((function(e){var r=parseInt(e);if(r!=e)throw new Error("invalid response - getBlockNumber");return t._setFastBlockNumber(r),r}))}))},W.prototype.getGasPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getGasPrice",{}).then((function(t){return a.bigNumberify(t)}))}))},W.prototype.getBalance=function(t,e){var r=this;return this.ready.then((function(){return l.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,n=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:x(n)};return r.perform("getBalance",e).then((function(t){return a.bigNumberify(t)}))}))}))}))},W.prototype.getTransactionCount=function(t,e){var r=this;return this.ready.then((function(){return l.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,n=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:x(n)};return r.perform("getTransactionCount",e).then((function(t){return a.bigNumberify(t).toNumber()}))}))}))}))},W.prototype.getCode=function(t,e){var r=this;return this.ready.then((function(){return l.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,n=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:x(n)};return r.perform("getCode",e).then((function(t){return u.hexlify(t)}))}))}))}))},W.prototype.getStorageAt=function(t,e,r){var n=this;return this.ready.then((function(){return l.resolveProperties({addressOrName:t,position:e,blockTag:r}).then((function(t){var e=t.addressOrName,r=t.position,i=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:x(i),position:u.hexStripZeros(u.hexlify(r))};return n.perform("getStorageAt",e).then((function(t){return u.hexlify(t)}))}))}))}))},W.prototype.sendTransaction=function(t){var e=this;return this.ready.then((function(){return l.resolveProperties({signedTransaction:t}).then((function(t){var r=t.signedTransaction,n={signedTransaction:u.hexlify(r)};return e.perform("sendTransaction",n).then((function(t){return e._wrapTransaction(p.parse(r),t)}),(function(t){throw t.transaction=p.parse(r),t.transaction.hash&&(t.transactionHash=t.transaction.hash),t}))}))}))},W.prototype._wrapTransaction=function(t,e){var r=this;if(null!=e&&32!==u.hexDataLength(e))throw new Error("invalid response - sendTransaction");var n=t;return null!=e&&t.hash!==e&&g.throwError("Transaction hash mismatch from Provider.sendTransaction.",g.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=function(e){return 0!==e&&(r._emitted["t:"+t.hash]="pending"),r.waitForTransaction(t.hash,e).then((function(n){return null==n&&0===e?null:(r._emitted["t:"+t.hash]=n.blockNumber,0===n.status&&g.throwError("transaction failed",g.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t}),n)}))},n},W.prototype.call=function(t,e){var r=this,n=l.shallowCopy(t);return this.ready.then((function(){return l.resolveProperties({blockTag:e,tx:n}).then((function(t){var e=t.blockTag,n=t.tx;return r._resolveNames(n,["to","from"]).then((function(t){var n={blockTag:x(e),transaction:R(t)};return r.perform("call",n).then((function(t){return u.hexlify(t)}))}))}))}))},W.prototype.estimateGas=function(t){var e=this,r={to:t.to,from:t.from,data:t.data,gasPrice:t.gasPrice,value:t.value};return this.ready.then((function(){return l.resolveProperties(r).then((function(t){return e._resolveNames(t,["to","from"]).then((function(t){var r={transaction:R(t)};return e.perform("estimateGas",r).then((function(t){return a.bigNumberify(t)}))}))}))}))},W.prototype.getBlock=function(t,e){var r=this;return this.ready.then((function(){return l.resolveProperties({blockHashOrBlockTag:t}).then((function(t){var n=t.blockHashOrBlockTag;try{var i=u.hexlify(n);if(32===u.hexDataLength(i))return v.poll((function(){return r.perform("getBlock",{blockHash:i,includeTransactions:!!e}).then((function(t){return null==t?null==r._emitted["b:"+i]?null:void 0:P(t,e)}))}),{onceBlock:r})}catch(t){}try{var o=-128,s=x(n);return u.isHexString(s)&&(o=parseInt(s.substring(2),16)),v.poll((function(){return r.perform("getBlock",{blockTag:s,includeTransactions:!!e}).then((function(t){return null!=t?P(t,e):o<=r._emitted.block?void 0:null}))}),{onceBlock:r})}catch(t){}throw new Error("invalid block hash or block tag")}))}))},W.prototype.getTransaction=function(t){var e=this;return this.ready.then((function(){return l.resolveProperties({transactionHash:t}).then((function(t){var r=t.transactionHash,n={transactionHash:M(r,!0)};return v.poll((function(){return e.perform("getTransaction",n).then((function(t){if(null==t)return null==e._emitted["t:"+r]?null:void 0;var n=W.checkTransactionResponse(t);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations)return e._getFastBlockNumber().then((function(t){var r=t-n.blockNumber+1;return r<=0&&(r=1),n.confirmations=r,e._wrapTransaction(n)}));return e._wrapTransaction(n)}))}),{onceBlock:e})}))}))},W.prototype.getTransactionReceipt=function(t){var e=this;return this.ready.then((function(){return l.resolveProperties({transactionHash:t}).then((function(t){var r=t.transactionHash,n={transactionHash:M(r,!0)};return v.poll((function(){return e.perform("getTransactionReceipt",n).then((function(t){if(null==t)return null==e._emitted["t:"+r]?null:void 0;if(null!=t.blockHash){var n=function(t){var e=w(L,t);return e.logs.forEach((function(t,e){null==t.transactionLogIndex&&(t.transactionLogIndex=e)})),null!=t.status&&(e.byzantium=!0),e}(t);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations)return e._getFastBlockNumber().then((function(t){var e=t-n.blockNumber+1;return e<=0&&(e=1),n.confirmations=e,n}));return n}}))}),{onceBlock:e})}))}))},W.prototype.getLogs=function(t){var e=this;return this.ready.then((function(){return l.resolveProperties(t).then((function(t){return e._resolveNames(t,["address"]).then((function(t){var r={filter:function(t){return t&&t.blockHash?w(j,t):w(U,t)}(t)};return e.perform("getLogs",r).then((function(t){return _(K)(t)}))}))}))}))},W.prototype.getEtherPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getEtherPrice",{}).then((function(t){return t}))}))},W.prototype._getAddress=function(t){return this.resolveName(t).then((function(e){return null==e&&g.throwError("ENS name not configured",g.UNSUPPORTED_OPERATION,{operation:"resolveName("+JSON.stringify(t)+")"}),e}))},W.prototype._resolveNames=function(t,e){var r=[],n=l.shallowCopy(t);return e.forEach((function(t){null!=n[t]&&r.push(this._getAddress(n[t]).then((function(e){n[t]=e})))}),this),Promise.all(r).then((function(){return n}))},W.prototype._getResolver=function(t){var e=this;return this.getNetwork().then((function(r){r.ensAddress||g.throwError("network does not support ENS",g.UNSUPPORTED_OPERATION,{operation:"ENS",network:r.name});var n="0x0178b8bf"+c.namehash(t).substring(2),i={to:r.ensAddress,data:n};return e.call(i).then((function(t){if(32!==u.hexDataLength(t))return null;var e=s.getAddress(u.hexDataSlice(t,12));return e===h.AddressZero?null:e}))}))},W.prototype.resolveName=function(e){var r=this;if(e instanceof Promise)return e.then((function(t){return r.resolveName(t)}));try{return Promise.resolve(s.getAddress(e))}catch(t){if(u.isHexString(e))throw t}var n=this,i=c.namehash(e);return this._getResolver(e).then((function(t){if(null==t)return null;var e={to:t,data:"0x3b3b57de"+i.substring(2)};return n.call(e)})).then((function(t){if(32!==u.hexDataLength(t))return null;var e=s.getAddress(u.hexDataSlice(t,12));return e===h.AddressZero?null:e}))},W.prototype.lookupAddress=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.lookupAddress(t)}));var r=(t=s.getAddress(t)).substring(2)+".addr.reverse",n=c.namehash(r),i=this;return this._getResolver(r).then((function(t){if(!t)return null;var e={to:t,data:"0x691f3431"+n.substring(2)};return i.call(e)})).then((function(e){if(null==e)return null;if((e=e.substring(2)).length<64)return null;if((e=e.substring(64)).length<64)return null;var r=a.bigNumberify("0x"+e.substring(0,64)).toNumber();if(2*r>(e=e.substring(64)).length)return null;var n=m.toUtf8String("0x"+e.substring(0,2*r));return i.resolveName(n).then((function(e){return e!=t?null:n}))}))},W.checkTransactionResponse=function(t){return S(t)},W.prototype.doPoll=function(){},W.prototype.perform=function(t,e){return g.throwError(t+" not implemented",g.NOT_IMPLEMENTED,{operation:t}),null},W.prototype._startPending=function(){g.warn("WARNING: this provider does not support pending events")},W.prototype._stopPending=function(){},W.prototype._addEventListener=function(t,e,r){this._events.push({tag:V(t),listener:e,once:r}),"pending"===t&&this._startPending(),this.polling=!0},W.prototype.on=function(t,e){return this._addEventListener(t,e,!1),this},W.prototype.once=function(t,e){return this._addEventListener(t,e,!0),this},W.prototype.addEventListener=function(t,e){return this.on(t,e)},W.prototype.emit=function(t){for(var e=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=!1,o=V(t);return this._events=this._events.filter((function(t){return t.tag!==o||(setTimeout((function(){t.listener.apply(e,r)}),0),i=!0,!t.once)})),0===this.listenerCount()&&(this.polling=!1),i},W.prototype.listenerCount=function(t){if(!t)return this._events.length;var e=V(t);return this._events.filter((function(t){return t.tag===e})).length},W.prototype.listeners=function(t){var e=V(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))},W.prototype.removeAllListeners=function(t){if(null==t)this._events=[],this._stopPending();else{var e=V(t);this._events=this._events.filter((function(t){return t.tag!==e})),"pending"===t&&this._stopPending()}return 0===this._events.length&&(this.polling=!1),this},W.prototype.removeListener=function(t,e){var r=!1,n=V(t);return this._events=this._events.filter((function(t){return t.tag!==n||t.listener!=e||!!r||!(r=!0)})),"pending"===t&&0===this.listenerCount("pending")&&this._stopPending(),0===this.listenerCount()&&(this.polling=!1),this},W);function W(t){var e=z.call(this)||this;if(g.checkNew(e,y.Provider),t instanceof Promise)l.defineReadOnly(e,"ready",t.then((function(t){return l.defineReadOnly(e,"_network",t),t}))),e.ready.catch((function(t){}));else{var r=f.getNetwork(null==t?"homestead":t);r?(l.defineReadOnly(e,"_network",r),l.defineReadOnly(e,"ready",Promise.resolve(e._network))):g.throwError("invalid network",g.INVALID_ARGUMENT,{arg:"network",value:t})}return e._lastBlockNumber=-2,e._balances={},e._events=[],e._pollingInterval=4e3,e._emitted={block:-2},e._fastQueryDate=0,e}r.BaseProvider=q,l.defineReadOnly(y.Provider,"inherits",l.inheritable(y.Provider))},{"../constants":3,"../errors":5,"../utils/address":60,"../utils/bignumber":63,"../utils/bytes":64,"../utils/hash":65,"../utils/networks":72,"../utils/properties":74,"../utils/rlp":76,"../utils/transaction":83,"../utils/utf8":85,"../utils/web":86,"./abstract-provider":50}],52:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./base-provider"),a=t("../utils/bytes"),u=t("../utils/properties"),h=t("../utils/web"),c=o(t("../errors"));function f(t){var e=[];for(var r in t)if(null!=t[r]){var n=a.hexlify(t[r]);!{gasLimit:!0,gasPrice:!0,nonce:!0,value:!0}[r]||(n=a.hexStripZeros(n)),e.push(r+"="+n)}return e.join("&")}function l(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1==t.status&&"OK"==t.message)return t.result;var e=new Error("invalid response");throw e.result=JSON.stringify(t),e}function d(t){if("2.0"!=t.jsonrpc)throw(e=new Error("invalid response")).result=JSON.stringify(t),e;if(t.error){var e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function p(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}var m,v=(i(g,m=s.BaseProvider),g.prototype.perform=function(t,e){var r=this,n=this.baseUrl,i="";function o(t,e){return h.fetchJson(t,null,e||d).then((function(e){return r.emit("debug",{action:"perform",request:t,response:e,provider:r}),e}))}switch(this.apiKey&&(i+="&apikey="+this.apiKey),t){case"getBlockNumber":return o(n+="/api?module=proxy&action=eth_blockNumber"+i);case"getGasPrice":return o(n+="/api?module=proxy&action=eth_gasPrice"+i);case"getBalance":return n+="/api?module=account&action=balance&address="+e.address,o(n+="&tag="+e.blockTag+i,l);case"getTransactionCount":return n+="/api?module=proxy&action=eth_getTransactionCount&address="+e.address,o(n+="&tag="+e.blockTag+i);case"getCode":return n+="/api?module=proxy&action=eth_getCode&address="+e.address,o(n+="&tag="+e.blockTag+i,d);case"getStorageAt":return n+="/api?module=proxy&action=eth_getStorageAt&address="+e.address,n+="&position="+e.position,o(n+="&tag="+e.blockTag+i,d);case"sendTransaction":return n+="/api?module=proxy&action=eth_sendRawTransaction&hex="+e.signedTransaction,o(n+=i).catch((function(t){throw t.responseText&&(0<=t.responseText.toLowerCase().indexOf("insufficient funds")&&c.throwError("insufficient funds",c.INSUFFICIENT_FUNDS,{}),0<=t.responseText.indexOf("same hash was already imported")&&c.throwError("nonce has already been used",c.NONCE_EXPIRED,{}),0<=t.responseText.indexOf("another transaction with same nonce")&&c.throwError("replacement fee too low",c.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?(n+="/api?module=proxy&action=eth_getBlockByNumber&tag="+e.blockTag,e.includeTransactions?n+="&boolean=true":n+="&boolean=false",o(n+=i)):Promise.reject(new Error("getBlock by blockHash not implemeneted"));case"getTransaction":return n+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+e.transactionHash,o(n+=i);case"getTransactionReceipt":return n+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+e.transactionHash,o(n+=i);case"call":return n+="/api?module=proxy&action=eth_call"+(s=(s=f(e.transaction))&&"&"+s),"latest"!==e.blockTag?Promise.reject(new Error("EtherscanProvider does not support blockTag for call")):o(n+=i);case"estimateGas":var s;return n+="/api?module=proxy&action=eth_estimateGas&"+(s=(s=f(e.transaction))&&"&"+s),o(n+=i);case"getLogs":n+="/api?module=logs&action=getLogs";try{if(e.filter.fromBlock&&(n+="&fromBlock="+p(e.filter.fromBlock)),e.filter.toBlock&&(n+="&toBlock="+p(e.filter.toBlock)),e.filter.blockHash)try{c.throwError("Etherscan does not support blockHash filters",c.UNSUPPORTED_OPERATION,{operation:"getLogs(blockHash)"})}catch(t){return Promise.reject(t)}if(e.filter.address&&(n+="&address="+e.filter.address),e.filter.topics&&0<e.filter.topics.length){if(1<e.filter.topics.length)throw new Error("unsupported topic format");var a=e.filter.topics[0];if("string"!=typeof a||66!==a.length)throw new Error("unsupported topic0 format");n+="&topic0="+a}}catch(t){return Promise.reject(t)}var u=this;return o(n+=i,l).then((function(t){var e={},r=Promise.resolve();return t.forEach((function(t){r=r.then((function(){return null!=t.blockHash?null:(t.blockHash=e[t.transactionHash],null==t.blockHash?u.getTransaction(t.transactionHash).then((function(r){return e[t.transactionHash]=r.blockHash,t.blockHash=r.blockHash,null})):null)}))})),r.then((function(){return t}))}));case"getEtherPrice":return"homestead"!==this.network.name?Promise.resolve(0):(n+="/api?module=stats&action=ethprice",o(n+=i,l).then((function(t){return parseFloat(t.ethusd)})))}return m.prototype.perform.call(this,t,e)},g.prototype.getHistory=function(t,e,r){var n=this,i=this.baseUrl,o="";return this.apiKey&&(o+="&apikey="+this.apiKey),null==e&&(e=0),null==r&&(r=99999999),this.resolveName(t).then((function(t){return i+="/api?module=account&action=txlist&address="+t,i+="&startblock="+e,i+="&endblock="+r,i+="&sort=asc"+o,h.fetchJson(i,null,l).then((function(t){n.emit("debug",{action:"getHistory",request:i,response:t,provider:n});var e=[];return t.forEach((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var r=s.BaseProvider.checkTransactionResponse(t);t.timeStamp&&(r.timestamp=parseInt(t.timeStamp)),e.push(r)})),e}))}))},g);function g(t,e){var r=m.call(this,t)||this;c.checkNew(r,g);var n="invalid";r.network&&(n=r.network.name);var i=null;switch(n){case"homestead":i="https://api.etherscan.io";break;case"ropsten":i="https://api-ropsten.etherscan.io";break;case"rinkeby":i="https://api-rinkeby.etherscan.io";break;case"kovan":i="https://api-kovan.etherscan.io";break;case"goerli":i="https://api-goerli.etherscan.io";break;default:throw new Error("unsupported network")}return u.defineReadOnly(r,"baseUrl",i),u.defineReadOnly(r,"apiKey",e||"8FG3JMZ9USS4NTA6YKEKHINU56SEPPVBJR"),r}r.EtherscanProvider=v},{"../errors":5,"../utils/bytes":64,"../utils/properties":74,"../utils/web":86,"./base-provider":51}],53:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./base-provider"),a=o(t("../errors"));function u(t){var e=!0,r=null;return t.forEach((function(n){null!=n?null!=r?r.name===n.name&&r.chainId===n.chainId&&(r.ensAddress===n.ensAddress||null==r.ensAddress&&null==n.ensAddress)||a.throwError("provider mismatch",a.INVALID_ARGUMENT,{arg:"networks",value:t}):r=n:e=!1})),e}var h,c=(i(f,h=s.BaseProvider),Object.defineProperty(f.prototype,"providers",{get:function(){return this._providers.slice(0)},enumerable:!0,configurable:!0}),f.prototype.perform=function(t,e){var r=this.providers;return new Promise((function(n,i){var o=null;!function s(){r.length?r.shift().perform(t,e).then((function(t){return n(t)})).catch((function(t){o=o||t,setTimeout(s,0)})):i(o)}()}))},f);function f(t){var e=this;if(0===t.length)throw new Error("no providers");if(u(t.map((function(t){return t.network}))))e=h.call(this,t[0].network)||this;else{var r=Promise.all(t.map((function(t){return t.getNetwork()}))).then((function(t){return u(t)||a.throwError("getNetwork returned null",a.UNKNOWN_ERROR,{}),t[0]}));e=h.call(this,r)||this}return a.checkNew(e,f),e._providers=t.slice(0),e}r.FallbackProvider=c},{"../errors":5,"./base-provider":51}],54:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./abstract-provider");r.Provider=n.Provider;var i=t("./base-provider");r.BaseProvider=i.BaseProvider;var o=t("./etherscan-provider");r.EtherscanProvider=o.EtherscanProvider;var s=t("./fallback-provider");r.FallbackProvider=s.FallbackProvider;var a=t("./ipc-provider");r.IpcProvider=a.IpcProvider;var u=t("./infura-provider");r.InfuraProvider=u.InfuraProvider;var h=t("./json-rpc-provider");r.JsonRpcProvider=h.JsonRpcProvider,r.JsonRpcSigner=h.JsonRpcSigner;var c=t("./web3-provider");r.Web3Provider=c.Web3Provider},{"./abstract-provider":50,"./base-provider":51,"./etherscan-provider":52,"./fallback-provider":53,"./infura-provider":55,"./ipc-provider":56,"./json-rpc-provider":57,"./web3-provider":58}],55:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./json-rpc-provider"),u=t("../utils/bytes"),h=t("../utils/networks"),c=t("../utils/properties"),f=o(t("../errors")),l=(i(d,s=a.JsonRpcProvider),d.prototype._startPending=function(){f.warn("WARNING: INFURA does not support pending filters")},d.prototype.getSigner=function(t){return f.throwError("INFURA does not support signing",f.UNSUPPORTED_OPERATION,{operation:"getSigner"})},d.prototype.listAccounts=function(){return Promise.resolve([])},d);function d(t,e){var r=this,n=h.getNetwork(null==t?"homestead":t);null==e&&(e="7d0d81d0919f4f05b9ab6634be01ee73");var i=null;switch(n.name){case"homestead":i="mainnet.infura.io";break;case"ropsten":i="ropsten.infura.io";break;case"rinkeby":i="rinkeby.infura.io";break;case"goerli":i="goerli.infura.io";break;case"kovan":i="kovan.infura.io";break;default:f.throwError("unsupported network",f.INVALID_ARGUMENT,{argument:"network",value:t})}return u.isHexString("0x"+e,16)?(r=s.call(this,"https://"+i+"/v3/"+e,n)||this,c.defineReadOnly(r,"apiAccessToken",null),c.defineReadOnly(r,"projectId",e)):(f.warn("The legacy INFURA apiAccesToken API is deprecated; please upgrade to a Project ID instead (see INFURA dshboard; https://infura.io)"),r=s.call(this,"https://"+i+"/"+e,n)||this,c.defineReadOnly(r,"apiAccessToken",e),c.defineReadOnly(r,"projectId",null)),f.checkNew(r,d),r}r.InfuraProvider=l},{"../errors":5,"../utils/bytes":64,"../utils/networks":72,"../utils/properties":74,"./json-rpc-provider":57}],56:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},{}],57:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./base-provider"),a=t("../abstract-signer"),u=o(t("../errors")),h=t("../utils/address"),c=t("../utils/bytes"),f=t("../utils/networks"),l=t("../utils/properties"),d=t("../utils/utf8"),p=t("../utils/web");function m(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function v(t){return t?t.toLowerCase():t}var g,y={},w=42,b=(i(_,g=a.Signer),_.prototype.getAddress=function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&u.throwError("unknown account #"+t._index,u.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t._address=h.getAddress(e[t._index]),t._address}))},_.prototype.getBalance=function(t){return this.provider.getBalance(this.getAddress(),t)},_.prototype.getTransactionCount=function(t){return this.provider.getTransactionCount(this.getAddress(),t)},_.prototype.sendUncheckedTransaction=function(t){var e=this;t=l.shallowCopy(t);var r=this.getAddress().then((function(t){return t&&t.toLowerCase()}));if(null==t.gasLimit){var n=l.shallowCopy(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return Promise.all([l.resolveProperties(t),r]).then((function(t){var r=t[0],n=A.hexlifyTransaction(r);return n.from=t[1],e.provider.send("eth_sendTransaction",[n]).then((function(t){return t}),(function(t){throw t.responseText&&(0<=t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{transaction:r}),0<=t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{transaction:r}),0<=t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{transaction:r})),t}))}))},_.prototype.sendTransaction=function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return p.poll((function(){return e.provider.getTransaction(t).then((function(r){if(null!==r)return e.provider._wrapTransaction(r,t)}))}),{fastRetry:250,onceBlock:e.provider}).catch((function(e){throw e.transactionHash=t,e}))}))},_.prototype.signMessage=function(t){var e=this,r="string"==typeof t?d.toUtf8Bytes(t):t;return this.getAddress().then((function(t){return e.provider.send("eth_sign",[t.toLowerCase(),c.hexlify(r)])}))},_.prototype.unlock=function(t){var e=this.provider;return this.getAddress().then((function(r){return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))},_);function _(t,e,r){var n=g.call(this)||this;if(u.checkNew(n,_),t!==y)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return l.defineReadOnly(n,"provider",e),r?"string"==typeof r?l.defineReadOnly(n,"_address",h.getAddress(r)):"number"==typeof r?l.defineReadOnly(n,"_index",r):u.throwError("invalid address or index",u.INVALID_ARGUMENT,{argument:"addressOrIndex",value:r}):l.defineReadOnly(n,"_index",0),n}r.JsonRpcSigner=b;var M,E={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0},A=(i(x,M=s.BaseProvider),x.prototype.getSigner=function(t){return new b(y,this,t)},x.prototype.listAccounts=function(){return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return h.getAddress(t)}))}))},x.prototype.send=function(t,e){var r=this,n={method:t,params:e,id:w++,jsonrpc:"2.0"};return p.fetchJson(this.connection,JSON.stringify(n),m).then((function(t){return r.emit("debug",{action:"send",request:n,response:t,provider:r}),t}))},x.prototype.perform=function(t,e){switch(t){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":return this.send("eth_getBalance",[v(e.address),e.blockTag]);case"getTransactionCount":return this.send("eth_getTransactionCount",[v(e.address),e.blockTag]);case"getCode":return this.send("eth_getCode",[v(e.address),e.blockTag]);case"getStorageAt":return this.send("eth_getStorageAt",[v(e.address),e.position,e.blockTag]);case"sendTransaction":return this.send("eth_sendRawTransaction",[e.signedTransaction]).catch((function(t){throw t.responseText&&(0<t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{}),0<t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{}),0<t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?this.send("eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]):e.blockHash?this.send("eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[e.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[e.transactionHash]);case"call":return this.send("eth_call",[x.hexlifyTransaction(e.transaction,{from:!0}),e.blockTag]);case"estimateGas":return this.send("eth_estimateGas",[x.hexlifyTransaction(e.transaction,{from:!0})]);case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=v(e.filter.address)),this.send("eth_getLogs",[e.filter])}return u.throwError(t+" not implemented",u.NOT_IMPLEMENTED,{operation:t}),null},x.prototype._startPending=function(){if(null==this._pendingFilter){var t=this,e=this.send("eth_newPendingTransactionFilter",[]);(this._pendingFilter=e).then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;var n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return function(t){return new Promise((function(e){setTimeout((function(){e()}),t)}))}(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((function(t){}))}(),r})).catch((function(t){}))}},x.prototype._stopPending=function(){this._pendingFilter=null},x.hexlifyTransaction=function(t,e){var r=l.shallowCopy(E);if(e)for(var n in e)e[n]&&(r[n]=!0);l.checkProperties(t,r);var i={};return["gasLimit","gasPrice","nonce","value"].forEach((function(e){if(null!=t[e]){var r=c.hexStripZeros(c.hexlify(t[e]));"gasLimit"===e&&(e="gas"),i[e]=r}})),["from","to","data"].forEach((function(e){null!=t[e]&&(i[e]=c.hexlify(t[e]))})),i},x);function x(t,e){var r=this;if("string"==typeof t&&null===e&&f.getNetwork(t)&&(e=t,t=null),e)r=M.call(this,e)||this;else{var n=new Promise((function(t,e){setTimeout((function(){r.send("net_version",[]).then((function(e){return t(f.getNetwork(parseInt(e)))})).catch((function(t){e(t)}))}))}));r=M.call(this,n)||this}return u.checkNew(r,x),t=t||"http://localhost:8545",r.connection="string"==typeof t?{url:t}:t,r}r.JsonRpcProvider=A},{"../abstract-signer":2,"../errors":5,"../utils/address":60,"../utils/bytes":64,"../utils/networks":72,"../utils/properties":74,"../utils/utf8":85,"../utils/web":86,"./base-provider":51}],58:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./json-rpc-provider"),u=t("../utils/properties"),h=o(t("../errors")),c=42,f=(i(l,s=a.JsonRpcProvider),l.prototype.send=function(t,e){var r=this;return"eth_sign"==t&&this._web3Provider.isMetaMask&&(t="personal_sign",e=[e[1],e[0]]),new Promise((function(n,i){var o={method:t,params:e,id:c++,jsonrpc:"2.0"};r._sendAsync(o,(function(t,e){if(t)i(t);else{if(e.error){var r=new Error(e.error.message);return r.code=e.error.code,r.data=e.error.data,void i(r)}n(e.result)}}))}))},l);function l(t,e){var r=s.call(this,t.host||t.path||"",e)||this;return h.checkNew(r,l),t&&(t.sendAsync?r._sendAsync=t.sendAsync.bind(t):t.send&&(r._sendAsync=t.send.bind(t))),t&&r._sendAsync||h.throwError("invalid web3Provider",h.INVALID_ARGUMENT,{arg:"web3Provider",value:t}),u.defineReadOnly(r,"_web3Provider",t),u.defineReadOnly(r,"provider",t),r}r.Web3Provider=f},{"../errors":5,"../utils/properties":74,"./json-rpc-provider":57}],59:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("../constants"),a=o(t("../errors")),u=t("./address"),h=t("./bignumber"),c=t("./bytes"),f=t("./utf8"),l=t("./properties"),d=new RegExp(/^bytes([0-9]*)$/),p=new RegExp(/^(u?int)([0-9]*)$/),m=new RegExp(/^(.*)\[([0-9]*)\]$/);r.defaultCoerceFunc=function(t,e){var r=t.match(p);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),g=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function w(t,e){var r=t;function n(t){throw new Error('unexpected character "'+r[t]+'" at position '+t+' in "'+r+'"')}t=t.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,s=0;s<t.length;s++){var a=t[s];switch(a){case"(":o.state.allowParams||n(s),o.state.allowType=!1,o.type=y(o.type),o.components=[{type:"",name:"",parent:o,state:{allowType:!0}}],o=o.components[0];break;case")":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=y(o.type);var u=o;(o=o.parent)||n(s),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=y(o.type);var h={type:"",name:"",parent:o.parent,state:{allowType:!0}};o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&""!==o.type&&(o.type=y(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&(e&&"indexed"===o.name?(o.indexed=!0,o.name=""):o.state.allowName=!1);break;case"[":o.state.allowArray||n(s),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(s),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:n(s)}}if(o.parent)throw new Error("unexpected eof");return delete i.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),i.type=y(i.type),i}function b(t){return st(r.defaultCoerceFunc,t).type}function _(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}r.parseParamType=function(t){return w(t,!0)},r.formatParamType=b,r.formatSignature=function(t){return t.name+"("+t.inputs.map((function(t){return b(t)})).join(",")+")"},r.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},r=t.match(v);if(!r)throw new Error("invalid event: "+t);if(e.name=r[1].trim(),it(r[2]).forEach((function(t){(t=w(t,!0)).indexed=!!t.indexed,e.inputs.push(t)})),r[3].split(" ").forEach((function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:a.info("unknown modifier: "+t)}})),e.name&&!e.name.match(g))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},r=t.split("@");if(1!==r.length){if(2<r.length)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var n=(r=t.split(" returns "))[0].match(v);if(!n)throw new Error("invalid signature");if(e.name=n[1].trim(),!e.name.match(g))throw new Error('invalid identifier: "'+n[1]+'"');if(it(n[2]).forEach((function(t){e.inputs.push(w(t))})),n[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),1<r.length){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");it(i[2]).forEach((function(t){e.outputs.push(w(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var M,E=(i(A,M=_),A.prototype.encode=function(t){return this.coder.encode(t)},A.prototype.decode=function(t,e){return this.coder.decode(t,e)},A);function A(t){var e=M.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(e,"coder",t),e}var x,k=(i(S,x=_),S.prototype.encode=function(t){return c.arrayify([])},S.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},S);function S(t,e){return x.call(this,t,"null","",e,!1)||this}var T,I=(i(P,T=_),P.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},P.prototype.decode=function(t,e){t.length<e+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:c.hexlify(t.slice(e,e+32))});var r=32-this.size,n=h.bigNumberify(t.slice(e+r,e+32));return n=this.signed?n.fromTwos(8*this.size):n.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,n)}},P);function P(t,e,r,n){var i=this,o=(r?"int":"uint")+8*e;return(i=T.call(this,t,o,o,n,!1)||this).size=e,i.signed=r,i}var N,R=new I((function(t,e){return e}),32,!1,"none"),C=(i(L,N=_),L.prototype.encode=function(t){return R.encode(t?1:0)},L.prototype.decode=function(t,e){try{var r=R.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&a.throwError("insufficient data for boolean type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:r.consumed,value:this.coerceFunc("bool",!r.value.isZero())}},L);function L(t,e){return N.call(this,t,"bool","bool",e,!1)||this}var O,B=(i(D,O=_),D.prototype.encode=function(t){var e=new Uint8Array(32);try{var r=c.arrayify(t);if(r.length!==this.length)throw new Error("incorrect data length");e.set(r)}catch(e){a.throwError("invalid "+this.name+" value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},D.prototype.decode=function(t,e){return t.length<e+32&&a.throwError("insufficient data for "+this.name+" type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:c.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,c.hexlify(t.slice(e,e+this.length)))}},D);function D(t,e,r){var n=this,i="bytes"+e;return(n=O.call(this,t,i,i,r,!1)||this).length=e,n}var U,j=(i(F,U=_),F.prototype.encode=function(t){var e=new Uint8Array(32);try{e.set(c.arrayify(u.getAddress(t)),12)}catch(e){a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:t})}return e},F.prototype.decode=function(t,e){return t.length<e+32&&a.throwError("insufficient data for address type",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:c.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",u.getAddress(c.hexlify(t.slice(e+12,e+32))))}},F);function F(t,e){return U.call(this,t,"address","address",e,!1)||this}function K(t){var e=32*Math.ceil(t.length/32),r=new Uint8Array(e-t.length);return c.concat([R.encode(t.length),t,r])}function G(t,e,r){t.length<e+32&&a.throwError("insufficient data for dynamicBytes length",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:c.hexlify(t.slice(e,e+32))});var n=R.decode(t,e).value;try{n=n.toNumber()}catch(t){a.throwError("dynamic bytes count too large",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:n.toString()})}return t.length<e+32+n&&a.throwError("insufficient data for dynamicBytes type",a.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:c.hexlify(t.slice(e,e+32+n))}),{consumed:32+32*Math.ceil(n/32),value:t.slice(e+32,e+32+n)}}var V,H=(i(z,V=_),z.prototype.encode=function(t){try{return K(c.arrayify(t))}catch(t){a.throwError("invalid bytes value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:t.value})}return null},z.prototype.decode=function(t,e){var r=G(t,e,this.localName);return r.value=this.coerceFunc("bytes",c.hexlify(r.value)),r},z);function z(t,e){return V.call(this,t,"bytes","bytes",e,!0)||this}var q,W=(i(Z,q=_),Z.prototype.encode=function(t){return"string"!=typeof t&&a.throwError("invalid string value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:t}),K(f.toUtf8Bytes(t))},Z.prototype.decode=function(t,e){var r=G(t,e,this.localName);return r.value=this.coerceFunc("string",f.toUtf8String(r.value)),r},Z);function Z(t,e){return q.call(this,t,"string","string",e,!0)||this}function Y(t){return 32*Math.ceil(t/32)}function J(t,e){if(Array.isArray(e));else if(e&&"object"==typeof e){var r=[];t.forEach((function(t){r.push(e[t.localName])})),e=r}else a.throwError("invalid tuple value",a.INVALID_ARGUMENT,{coderType:"tuple",value:e});t.length!==e.length&&a.throwError("types/value length mismatch",a.INVALID_ARGUMENT,{coderType:"tuple",value:e});var n=[];t.forEach((function(t,r){n.push({dynamic:t.dynamic,value:t.encode(e[r])})}));var i=0,o=0;n.forEach((function(t){t.dynamic?(i+=32,o+=Y(t.value.length)):i+=Y(t.value.length)}));var s=0,u=i,h=new Uint8Array(i+o);return n.forEach((function(t){t.dynamic?(h.set(R.encode(u),s),s+=32,h.set(t.value,u),u+=Y(t.value.length)):(h.set(t.value,s),s+=Y(t.value.length))})),h}function $(t,e,r){var n=r,i=0,o=[];return t.forEach((function(t){if(t.dynamic){var s=R.decode(e,r);(a=t.decode(e,n+s.value.toNumber())).consumed=s.consumed}else var a=t.decode(e,r);null!=a.value&&o.push(a.value),r+=a.consumed,i+=a.consumed})),t.forEach((function(t,e){var r=t.localName;r&&("length"===r&&(r="_length"),null==o[r]&&(o[r]=o[e]))})),{value:o,consumed:i}}var X,Q=(i(tt,X=_),tt.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=R.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return c.concat([r,J(n,t)])},tt.prototype.decode=function(t,e){var r=0,n=this.length;if(-1===n){try{var i=R.decode(t,e)}catch(t){a.throwError("insufficient data for dynamic array length",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{n=i.value.toNumber()}catch(t){a.throwError("array count too large",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:i.value.toString()})}r+=i.consumed,e+=i.consumed}for(var o=[],s=0;s<n;s++)o.push(new E(this.coder));var u=$(o,t,e);return u.consumed+=r,u.value=this.coerceFunc(this.type,u.value),u},tt);function tt(t,e,r,n){var i=this,o=e.type+"["+(0<=r?r:"")+"]",s=-1===r||e.dynamic;return(i=X.call(this,t,"array",o,n,s)||this).coder=e,i.length=r,i}var et,rt=(i(nt,et=_),nt.prototype.encode=function(t){return J(this.coders,t)},nt.prototype.decode=function(t,e){var r=$(this.coders,t,e);return r.value=this.coerceFunc(this.type,r.value),r},nt);function nt(t,e,r){var n=this,i=!1,o=[];e.forEach((function(t){t.dynamic&&(i=!0),o.push(t.type)}));var s="tuple("+o.join(",")+")";return(n=et.call(this,t,"tuple",s,r,i)||this).coders=e,n}function it(t){t=t.trim();for(var e=[],r="",n=0,i=0;i<t.length;i++){var o=t[i];if(","===o&&0===n)e.push(r),r="";else if(r+=o,"("===o)n++;else if(")"===o&&-1===--n)throw new Error("unbalanced parenthsis")}return r&&e.push(r),e}var ot={address:j,bool:C,string:W,bytes:H};function st(t,e){var r,n=ot[e.type];if(n)return new n(t,e.name);if(r=e.type.match(p))return(0===(i=parseInt(r[2]||"256"))||256<i||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,i/8,"int"===r[1],e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[1]))||32<i)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new B(t,i,e.name);if(r=e.type.match(m)){var i=parseInt(r[2]||"-1");return(e=l.shallowCopy(e)).type=r[1],e=l.deepCopy(e),new Q(t,st(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){var n=[];return(e=e||[]).forEach((function(e){n.push(st(t,e))})),new rt(t,n,r)}(t,e.components,e.name):""===e.type?new k(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var at=(ut.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e=null;e="string"==typeof t?w(t):t,r.push(st(this.coerceFunc,e))}),this),c.hexlify(new rt(this.coerceFunc,r,"_").encode(e))},ut.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e=null;e="string"==typeof t?w(t):l.deepCopy(t),r.push(st(this.coerceFunc,e))}),this),new rt(this.coerceFunc,r,"_").decode(c.arrayify(e),0).value},ut);function ut(t){a.checkNew(this,ut),t=t||r.defaultCoerceFunc,l.defineReadOnly(this,"coerceFunc",t)}r.AbiCoder=at,r.defaultAbiCoder=new at},{"../constants":3,"../errors":5,"./address":60,"./bignumber":63,"./bytes":64,"./properties":74,"./utf8":85}],60:[function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("bn.js")),o=t("./bytes"),s=t("./keccak256"),a=t("./rlp"),u=t("../errors");function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)8<=r[i>>1]>>4&&(e[i]=e[i].toUpperCase()),8<=(15&r[i>>1])&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},f=0;f<10;f++)c[String(f)]=String(f);for(f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);var l,d=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=c[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}r.getAddress=m,r.getIcapAddress=function(t){for(var e=new i.default.BN(m(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},r.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return m("0x"+s.keccak256(a.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},r.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=m(t.from),n=o.arrayify(t.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),m("0x"+s.keccak256(o.concat(["0xff",r,n,e])).substring(26))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return n.arrayify(e)},encode:function(t){t=n.arrayify(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}}},{"../utils/bytes":64}],62:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./bytes"),i=t("./properties"),o=(s.prototype.encode=function(t){var e=n.arrayify(t);if(0===e.length)return"";for(var r=[0],i=0;i<e.length;++i){for(var o=e[i],s=0;s<r.length;++s)o+=r[s]<<8,r[s]=o%this.base,o=o/this.base|0;for(;0<o;)r.push(o%this.base),o=o/this.base|0}for(var a="",u=0;0===e[u]&&u<e.length-1;++u)a+=this._leader;for(var h=r.length-1;0<=h;--h)a+=this.alphabet[r[h]];return a},s.prototype.decode=function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var r=0;r<t.length;r++){var i=this._alphabetMap[t[r]];if(void 0===i)throw new Error("Non-base"+this.base+" character");for(var o=i,s=0;s<e.length;++s)o+=e[s]*this.base,e[s]=255&o,o>>=8;for(;0<o;)e.push(255&o),o>>=8}for(var a=0;t[a]===this._leader&&a<t.length-1;++a)e.push(0);return n.arrayify(new Uint8Array(e.reverse()))},s);function s(t){i.defineReadOnly(this,"alphabet",t),i.defineReadOnly(this,"base",t.length),i.defineReadOnly(this,"_alphabetMap",{}),i.defineReadOnly(this,"_leader",t.charAt(0));for(var e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}var a=new(r.BaseX=o)("abcdefghijklmnopqrstuvwxyz234567");r.Base32=a;var u=new o("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");r.Base58=u},{"./bytes":64,"./properties":74}],63:[function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("bn.js")),s=t("./bytes"),a=t("./properties"),u=i(t("../errors")),h=new o.default.BN(-1);function c(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function f(t){return d(v(t))}function l(t){return new p(c(t))}function d(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=(m.prototype.fromTwos=function(t){return l(d(this).fromTwos(t))},m.prototype.toTwos=function(t){return l(d(this).toTwos(t))},m.prototype.abs=function(){return"-"===this._hex[0]?l(d(this).mul(h)):this},m.prototype.add=function(t){return l(d(this).add(f(t)))},m.prototype.sub=function(t){return l(d(this).sub(f(t)))},m.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(d(this).div(f(t)))},m.prototype.mul=function(t){return l(d(this).mul(f(t)))},m.prototype.mod=function(t){return l(d(this).mod(f(t)))},m.prototype.pow=function(t){return l(d(this).pow(f(t)))},m.prototype.maskn=function(t){return l(d(this).maskn(t))},m.prototype.eq=function(t){return d(this).eq(f(t))},m.prototype.lt=function(t){return d(this).lt(f(t))},m.prototype.lte=function(t){return d(this).lte(f(t))},m.prototype.gt=function(t){return d(this).gt(f(t))},m.prototype.gte=function(t){return d(this).gte(f(t))},m.prototype.isZero=function(){return d(this).isZero()},m.prototype.toNumber=function(){try{return d(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},m.prototype.toString=function(){return d(this).toString(10)},m.prototype.toHexString=function(){return this._hex},m.isBigNumber=function(t){return a.isType(t,"BigNumber")},m);function m(t){if(u.checkNew(this,m),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else t instanceof m?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(f(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}function v(t){return p.isBigNumber(t)?t:new p(t)}r.BigNumber=p,r.bigNumberify=v},{"../errors":5,"./bytes":64,"./properties":74,"bn.js":9}],64:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(r<0||256<=r||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"!=typeof t)return a(t)?s(new Uint8Array(t)):(i.throwError("invalid arrayify value",null,{arg:"value",value:t,type:typeof t}),null);var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],n=0;n<t.length;n+=2)r.push(parseInt(t.substr(n,2),16));return s(new Uint8Array(r))}function h(t){for(var e=[],r=0,n=0;n<t.length;n++){var i=u(t[n]);e.push(i),r+=i.length}var o=new Uint8Array(r),a=0;for(n=0;n<e.length;n++)o.set(e[n],a),a+=e[n].length;return s(o)}function c(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}r.isHexable=o,r.isArrayish=a,r.arrayify=u,r.concat=h,r.stripZeros=function(t){var e=u(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},r.padZeros=function(t,e){if(e<(t=u(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),s(r)},r.isHexString=c;var f="0123456789abcdef";function l(t){if(o(t))return t.toHexString();if("number"==typeof t){t<0&&i.throwError("cannot hexlify negative value",i.INVALID_ARGUMENT,{arg:"value",value:t}),9007199254740991<=t&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=f[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var n=[],s=0;s<t.length;s++){var u=t[s];n.push(f[(240&u)>>4]+f[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(t,e){for(c(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e=0,r="0x",n="0x";if(function(t){return t&&null!=t.r&&null!=t.s}(t)){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),r=d(t.r,32),n=d(t.s,32),"string"==typeof(e=t.v)&&(e=parseInt(e,16));var o=t.recoveryParam;null==o&&null!=t.v&&(o=1-e%2),e=27+o}else{var s=u(t);if(65!==s.length)throw new Error("invalid signature");r=l(s.slice(0,32)),n=l(s.slice(32,64)),27!==(e=s[64])&&28!==e&&(e=27+e%2)}return{r:r,s:n,recoveryParam:e-27,v:e}}r.hexlify=l,r.hexDataLength=function(t){return c(t)&&t.length%2==0?(t.length-2)/2:null},r.hexDataSlice=function(t,e,r){return c(t)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},r.hexStripZeros=function(t){for(c(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});3<t.length&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},r.hexZeroPad=d,r.splitSignature=p,r.joinSignature=function(t){return l(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},{"../errors":5}],65:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors")),o=t("./bytes"),s=t("./utf8"),a=t("./keccak256"),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),h=new RegExp("^((.*)\\.)?([^.]+)$"),c=new RegExp("^[a-z0-9.-]*$");r.namehash=function(t){"string"!=typeof t&&i.throwError("invalid address - "+String(t),i.INVALID_ARGUMENT,{argument:"name",value:t}),(t=t.toLowerCase()).match(c)||i.throwError("contains invalid UseSTD3ASCIIRules characters",i.INVALID_ARGUMENT,{argument:"name",value:t});for(var e=u;t.length;){var r=t.match(h),n=s.toUtf8Bytes(r[3]);e=a.keccak256(o.concat([e,a.keccak256(n)])),t=r[2]||""}return o.hexlify(e)},r.id=function(t){return a.keccak256(s.toUtf8Bytes(t))},r.hashMessage=function(t){return a.keccak256(o.concat([s.toUtf8Bytes("\x19Ethereum Signed Message:\n"),s.toUtf8Bytes(String(t.length)),"string"==typeof t?s.toUtf8Bytes(t):t]))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./utf8":85}],66:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors")),o=t("../wordlists/lang-en"),s=t("./basex"),a=t("./bytes"),u=t("./bignumber"),h=t("./utf8"),c=t("./pbkdf2"),f=t("./hmac"),l=t("./properties"),d=t("./secp256k1"),p=t("./sha2"),m=u.bigNumberify("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),v=h.toUtf8Bytes("Bitcoin seed"),g=2147483648;function y(t){return(1<<t)-1<<8-t}function w(t){return a.hexZeroPad(a.hexlify(t),32)}function b(t){var e=a.hexDataSlice(p.sha256(p.sha256(t)),0,4);return s.Base58.encode(a.concat([t,e]))}var _={};r.defaultPath="m/44'/60'/0'/0/0";var M=(Object.defineProperty(E.prototype,"extendedKey",{get:function(){if(256<=this.depth)throw new Error("Depth too large!");return b(a.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",a.hexlify(this.depth),this.parentFingerprint,a.hexZeroPad(a.hexlify(this.index),4),this.chainCode,null!=this.privateKey?a.concat(["0x00",this.privateKey]):this.publicKey]))},enumerable:!0,configurable:!0}),E.prototype.neuter=function(){return new E(_,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,null,this.path)},E.prototype._derive=function(t){if(4294967295<t)throw new Error("invalid index - "+String(t));var e=this.path;e&&(e+="/"+(t&~g));var r=new Uint8Array(37);if(t&g){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(a.arrayify(this.privateKey),1),e&&(e+="'")}else r.set(a.arrayify(this.publicKey));for(var n=24;0<=n;n-=8)r[33+(n>>3)]=t>>24-n&255;var i=f.computeHmac(f.SupportedAlgorithms.sha512,this.chainCode,r),o=i.slice(0,32),s=i.slice(32),h=null,c=null;return this.privateKey?h=w(u.bigNumberify(o).add(this.privateKey).mod(m)):c=new d.KeyPair(a.hexlify(o))._addPoint(this.publicKey),new E(_,h,c,this.fingerprint,w(s),t,this.depth+1,this.mnemonic,e)},E.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var i=e[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(g<=o)throw new Error("invalid path index - "+i);r=r._derive(g+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);if(o=parseInt(i),g<=o)throw new Error("invalid path index - "+i);r=r._derive(o)}}return r},E.isHDNode=function(t){return l.isType(t,"HDNode")},E);function E(t,e,r,n,o,s,u,h,c){if(i.checkNew(this,E),t!==_)throw new Error("HDNode constructor cannot be called directly");if(e){var f=new d.KeyPair(e);l.defineReadOnly(this,"privateKey",f.privateKey),l.defineReadOnly(this,"publicKey",f.compressedPublicKey)}else l.defineReadOnly(this,"privateKey",null),l.defineReadOnly(this,"publicKey",a.hexlify(r));l.defineReadOnly(this,"parentFingerprint",n),l.defineReadOnly(this,"fingerprint",a.hexDataSlice(p.ripemd160(p.sha256(this.publicKey)),0,4)),l.defineReadOnly(this,"address",d.computeAddress(this.publicKey)),l.defineReadOnly(this,"chainCode",o),l.defineReadOnly(this,"index",s),l.defineReadOnly(this,"depth",u),l.defineReadOnly(this,"mnemonic",h),l.defineReadOnly(this,"path",c),l.setType(this,"HDNode")}function A(t,e){var r=a.arrayify(t);if(r.length<16||64<r.length)throw new Error("invalid seed");var n=a.arrayify(f.computeHmac(f.SupportedAlgorithms.sha512,v,r));return new M(_,w(n.slice(0,32)),null,"0x00000000",w(n.slice(32)),0,0,e,"m")}function x(t,e){e=e||"";var r=h.toUtf8Bytes("mnemonic"+e,h.UnicodeNormalizationForm.NFKD);return a.hexlify(c.pbkdf2(h.toUtf8Bytes(t,h.UnicodeNormalizationForm.NFKD),r,2048,64,"sha512"))}function k(t,e){e=e||o.langEn,i.checkNormalize();var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=a.arrayify(new Uint8Array(Math.ceil(11*r.length/8))),s=0,u=0;u<r.length;u++){var h=e.getWordIndex(r[u].normalize("NFKD"));if(-1===h)throw new Error("invalid mnemonic");for(var c=0;c<11;c++)h&1<<10-c&&(n[s>>3]|=1<<7-s%8),s++}var f=32*r.length/3,l=y(r.length/3),d=a.arrayify(p.sha256(n.slice(0,f/8)))[0];if((d&=l)!=(n[n.length-1]&l))throw new Error("invalid checksum");return a.hexlify(n.slice(0,f/8))}function S(t,e){if((t=a.arrayify(t)).length%4!=0||t.length<16||32<t.length)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<t.length;i++)8<n?(r[r.length-1]<<=8,r[r.length-1]|=t[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[i]>>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var s=a.arrayify(p.sha256(t))[0],u=t.length/4;return s&=y(u),r[r.length-1]<<=u,r[r.length-1]|=s>>8-u,(e=e||o.langEn).join(r.map((function(t){return e.getWord(t)})))}r.HDNode=M,r.fromExtendedKey=function(t){var e=s.Base58.decode(t);82===e.length&&b(e.slice(0,78))===t||i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var r=e[4],n=a.hexlify(e.slice(5,9)),o=parseInt(a.hexlify(e.slice(9,13)).substring(2),16),u=a.hexlify(e.slice(13,45)),h=e.slice(45,78);switch(a.hexlify(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new M(_,null,a.hexlify(h),n,u,o,r,null,null);case"0x0488ade4":case"0x04358394":if(0!==h[0])break;return new M(_,a.hexlify(h.slice(1)),null,n,u,o,r,null,null)}return i.throwError("invalid extended key",i.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},r.fromMnemonic=function(t,e,r){return A(x(t=S(k(t,e),e),r),t)},r.fromSeed=function(t){return A(t,null)},r.mnemonicToSeed=x,r.mnemonicToEntropy=k,r.entropyToMnemonic=S,r.isValidMnemonic=function(t,e){try{return k(t,e),!0}catch(t){}return!1}},{"../errors":5,"../wordlists/lang-en":90,"./basex":62,"./bignumber":63,"./bytes":64,"./hmac":67,"./pbkdf2":73,"./properties":74,"./secp256k1":77,"./sha2":79,"./utf8":85}],67:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o,s=n(t("hash.js")),a=t("../utils/bytes"),u=n(t("../errors"));(o=i=r.SupportedAlgorithms||(r.SupportedAlgorithms={})).sha256="sha256",o.sha512="sha512",r.computeHmac=function(t,e,r){return i[t]||u.throwError("unsupported algorithm "+t,u.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),a.arrayify(s.hmac(s[t],a.arrayify(e)).update(a.arrayify(r)).digest())}},{"../errors":5,"../utils/bytes":64,"hash.js":26}],68:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./abi-coder");r.AbiCoder=i.AbiCoder,r.defaultAbiCoder=i.defaultAbiCoder,r.formatSignature=i.formatSignature,r.formatParamType=i.formatParamType,r.parseSignature=i.parseSignature,r.parseParamType=i.parseParamType;var o=t("./address");r.getAddress=o.getAddress,r.getContractAddress=o.getContractAddress,r.getCreate2Address=o.getCreate2Address,r.getIcapAddress=o.getIcapAddress;var s=n(t("./base64"));r.base64=s;var a=t("./bignumber");r.BigNumber=a.BigNumber,r.bigNumberify=a.bigNumberify;var u=t("./bytes");r.arrayify=u.arrayify,r.concat=u.concat,r.hexDataSlice=u.hexDataSlice,r.hexDataLength=u.hexDataLength,r.hexlify=u.hexlify,r.hexStripZeros=u.hexStripZeros,r.hexZeroPad=u.hexZeroPad,r.isHexString=u.isHexString,r.joinSignature=u.joinSignature,r.padZeros=u.padZeros,r.splitSignature=u.splitSignature,r.stripZeros=u.stripZeros;var h=t("./hash");r.hashMessage=h.hashMessage,r.id=h.id,r.namehash=h.namehash;var c=n(t("./hdnode"));r.HDNode=c;var f=t("./interface");r.Interface=f.Interface;var l=t("./json-wallet");r.getJsonWalletAddress=l.getJsonWalletAddress;var d=t("./keccak256");r.keccak256=d.keccak256;var p=t("./sha2");r.sha256=p.sha256;var m=t("./solidity");r.solidityKeccak256=m.keccak256,r.solidityPack=m.pack,r.soliditySha256=m.sha256;var v=t("./random-bytes");r.randomBytes=v.randomBytes;var g=t("./networks");r.getNetwork=g.getNetwork;var y=t("./properties");r.checkProperties=y.checkProperties,r.deepCopy=y.deepCopy,r.defineReadOnly=y.defineReadOnly,r.resolveProperties=y.resolveProperties,r.shallowCopy=y.shallowCopy;var w=n(t("./rlp"));r.RLP=w;var b=t("./secp256k1");r.computeAddress=b.computeAddress,r.computePublicKey=b.computePublicKey,r.recoverAddress=b.recoverAddress,r.recoverPublicKey=b.recoverPublicKey,r.verifyMessage=b.verifyMessage;var _=t("./signing-key");r.SigningKey=_.SigningKey;var M=t("./transaction");r.populateTransaction=M.populateTransaction;var E=t("./transaction");r.parseTransaction=E.parse,r.serializeTransaction=E.serialize;var A=t("./utf8");r.formatBytes32String=A.formatBytes32String,r.parseBytes32String=A.parseBytes32String,r.toUtf8Bytes=A.toUtf8Bytes,r.toUtf8String=A.toUtf8String;var x=t("./units");r.commify=x.commify,r.formatEther=x.formatEther,r.parseEther=x.parseEther,r.formatUnits=x.formatUnits,r.parseUnits=x.parseUnits;var k=t("./web");r.fetchJson=k.fetchJson,r.poll=k.poll;var S=t("./hmac");r.SupportedAlgorithms=S.SupportedAlgorithms;var T=t("./utf8");r.UnicodeNormalizationForm=T.UnicodeNormalizationForm;var I=t("./wordlist");r.Wordlist=I.Wordlist},{"./abi-coder":59,"./address":60,"./base64":61,"./bignumber":63,"./bytes":64,"./hash":65,"./hdnode":66,"./hmac":67,"./interface":69,"./json-wallet":70,"./keccak256":71,"./networks":72,"./properties":74,"./random-bytes":75,"./rlp":76,"./secp256k1":77,"./sha2":79,"./signing-key":81,"./solidity":82,"./transaction":83,"./units":84,"./utf8":85,"./web":86,"./wordlist":87}],69:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};function s(t){for(var e in p.setType(this,"Description"),t)p.defineReadOnly(this,e,p.deepCopy(t[e],!0));Object.freeze(this)}Object.defineProperty(r,"__esModule",{value:!0});var a,u=t("./address"),h=t("./abi-coder"),c=t("./bignumber"),f=t("./bytes"),l=t("./hash"),d=t("./keccak256"),p=t("./properties"),m=o(t("../errors")),v=function(t){p.setType(this,"Indexed"),p.defineReadOnly(this,"hash",t)},g=(i(y,a=s),y.prototype.encode=function(t,e){f.isHexString(t)||m.throwError("invalid contract bytecode",m.INVALID_ARGUMENT,{arg:"bytecode",value:t}),m.checkArgumentCount(e.length,this.inputs.length," in Interface constructor");try{return t+h.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){m.throwError("invalid constructor argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},y);function y(){return null!==a&&a.apply(this,arguments)||this}var w,b=(i(_,w=s),_.prototype.encode=function(t){m.checkArgumentCount(t.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+h.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){m.throwError("invalid input argument",m.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},_.prototype.decode=function(e){try{return h.defaultAbiCoder.decode(this.outputs,f.arrayify(e))}catch(t){m.throwError("invalid data for function output",m.INVALID_ARGUMENT,{arg:"data",errorArg:t.arg,errorValue:t.value,value:e,reason:t.reason})}},_);function _(){return null!==w&&w.apply(this,arguments)||this}var M,E=(i(A,M=s),A);function A(){return null!==M&&M.apply(this,arguments)||this}var x,k=(i(S,x=s),S.prototype.encodeTopics=function(t){var e=this;t.length>this.inputs.length&&m.throwError("too many arguments for "+this.name,m.UNEXPECTED_ARGUMENT,{maxCount:t.length,expectedCount:this.inputs.length});var r=[];for(this.anonymous||r.push(this.topic),t.forEach((function(t,n){var i=e.inputs[n];i.indexed?null==t?r.push(null):"string"===i.type?r.push(l.id(t)):"bytes"===i.type?r.push(d.keccak256(t)):-1!==i.type.indexOf("[")||"tuple"===i.type.substring(0,5)?m.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",m.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===i.type&&u.getAddress(t),r.push(f.hexZeroPad(f.hexlify(t),32).toLowerCase())):null!=t&&m.throwError("cannot filter non-indexed parameters; must be null",m.INVALID_ARGUMENT,{argument:i.name||n,value:t})}));r.length&&null===r[r.length-1];)r.pop();return r},S.prototype.decode=function(t,e){null==e||this.anonymous||(e=e.slice(1));var r=[],n=[],i=[];if(this.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(r.push({type:"bytes32",name:t.name||""}),i.push(!0)):(r.push(t),i.push(!1)):(n.push(t),i.push(!1))})),null!=e)var o=h.defaultAbiCoder.decode(r,f.concat(e));var s=h.defaultAbiCoder.decode(n,f.arrayify(t)),a={},u=0,c=0;return this.inputs.forEach((function(t,r){t.indexed?null==e?a[r]=new v(null):i[r]?a[r]=new v(o[c++]):a[r]=o[c++]:a[r]=s[u++],t.name&&(a[t.name]=a[r])})),a.length=this.inputs.length,new E(a)},S);function S(){return null!==x&&x.apply(this,arguments)||this}var T,I=(i(P,T=s),P);function P(){return null!==T&&T.apply(this,arguments)||this}var N,R=(i(C,N=s),C);function C(){return null!==N&&N.apply(this,arguments)||this}function L(t){switch(t.type){case"constructor":var e=new g({inputs:t.inputs,payable:null==t.payable||!!t.payable});this.deployFunction||(this.deployFunction=e);break;case"function":var r=h.formatSignature(t).replace(/tuple/g,""),n=l.id(r).substring(0,10),i=!1;null!=t.constant?i=t.constant:null!=t.stateMutability&&(i="view"==t.stateMutability||"pure"==t.stateMutability),e=new b({inputs:t.inputs,outputs:t.outputs,gas:t.gas,payable:null==t.payable||!!t.payable,type:i?"call":"transaction",name:t.name,signature:r,sighash:n}),t.name&&(null==this.functions[t.name]?p.defineReadOnly(this.functions,t.name,e):m.warn("WARNING: Multiple definitions for "+t.name)),null==this.functions[e.signature]&&p.defineReadOnly(this.functions,e.signature,e);break;case"event":r=h.formatSignature(t).replace(/tuple/g,""),e=new k({name:t.name,signature:r,inputs:t.inputs,topic:l.id(r),anonymous:!!t.anonymous}),t.name&&null==this.events[t.name]&&p.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&p.defineReadOnly(this.events,e.signature,e);break;case"receive":case"fallback":break;default:m.warn("WARNING: unsupported ABI type - "+t.type)}}var O=(B.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var r in this.functions)if(-1!==r.indexOf("(")){var n=this.functions[r];if(n.sighash===e){var i=h.defaultAbiCoder.decode(n.inputs,"0x"+t.data.substring(10));return new I({args:i,decode:n.decode,name:n.name,signature:n.signature,sighash:n.sighash,value:c.bigNumberify(t.value||"0")})}}return null},B.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var r=this.events[e];if(!r.anonymous&&r.topic===t.topics[0])return new R({decode:r.decode,name:r.name,signature:r.signature,topic:r.topic,values:r.decode(t.data,t.topics)})}return null},B.isInterface=function(t){return p.isType(t,"Interface")},B.isIndexed=function(t){return p.isType(t,"Indexed")},B);function B(e){if(m.checkNew(this,B),"string"==typeof e){try{e=JSON.parse(e)}catch(t){m.throwError("could not parse ABI JSON",m.INVALID_ARGUMENT,{arg:"abi",errorMessage:t.message,value:e})}if(!Array.isArray(e))return m.throwError("invalid abi",m.INVALID_ARGUMENT,{arg:"abi",value:e}),null}p.defineReadOnly(this,"functions",{}),p.defineReadOnly(this,"events",{});var r=[];e.forEach((function(t){"string"==typeof t&&(t=h.parseSignature(t)),r.push(t)})),p.defineReadOnly(this,"abi",p.deepCopy(r,!0)),r.forEach(L,this),this.deployFunction||L.call(this,{type:"constructor",inputs:[]}),p.setType(this,"Interface")}r.Interface=O},{"../errors":5,"./abi-coder":59,"./address":60,"./bignumber":63,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74}],70:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./address");function i(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function o(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}r.isCrowdsaleWallet=i,r.isSecretStorageWallet=o,r.getJsonWalletAddress=function(t){if(i(t))try{return n.getAddress(JSON.parse(t).ethaddr)}catch(t){return null}if(o(t))try{return n.getAddress(JSON.parse(t).address)}catch(t){return null}return null}},{"./address":60}],71:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("js-sha3"),i=t("./bytes");r.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},{"./bytes":64,"js-sha3":40}],72:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t){return function(e){var r=[];return e.InfuraProvider&&r.push(new e.InfuraProvider(t)),e.EtherscanProvider&&r.push(new e.EtherscanProvider(t)),0===r.length?null:e.FallbackProvider?new e.FallbackProvider(r):r[0]}}function s(t,e){return function(r){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null}}var a={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},h={unspecified:{chainId:0,name:"unspecified"},homestead:a,mainnet:a,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:s("https://web3.gastracker.io/morden","classicTestnet")}};r.getNetwork=function(t){if(null==t)return null;if("number"==typeof t){for(var e in h){var r=h[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=h[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var o=h[t.name];return o?(0!==t.chainId&&t.chainId!==o.chainId&&i.throwError("network chainId mismatch",i.INVALID_ARGUMENT,{arg:"network",value:t}),{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:t._defaultProvider||o._defaultProvider||null}):("number"!=typeof t.chainId&&i.throwError("invalid network chainId",i.INVALID_ARGUMENT,{arg:"network",value:t}),t)}},{"../errors":5}],73:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),i=t("./hmac");r.pbkdf2=function(t,e,r,o,s){var a;t=n.arrayify(t),e=n.arrayify(e);var u,h,c=1,f=new Uint8Array(o),l=new Uint8Array(e.length+4);l.set(e);for(var d=1;d<=c;d++){l[e.length]=d>>24&255,l[e.length+1]=d>>16&255,l[e.length+2]=d>>8&255,l[e.length+3]=255&d;var p=i.computeHmac(s,t,l);a||(a=p.length,h=new Uint8Array(a),u=o-((c=Math.ceil(o/a))-1)*a),h.set(p);for(var m=1;m<r;m++){p=i.computeHmac(s,t,p);for(var v=0;v<a;v++)h[v]^=p[v]}var g=(d-1)*a,y=d===c?u:a;f.set(n.arrayify(h).slice(0,y),g)}return n.arrayify(f)}},{"../utils/bytes":64,"./hmac":67}],74:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("../errors"));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}r.defineReadOnly=o,r.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},r.isType=s,r.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(n){var i=t[n];i instanceof Promise?r.push(i.then((function(t){return e[n]=t,null}))):e[n]=i})),Promise.all(r).then((function(){return e}))},r.checkProperties=function(t,e){t&&"object"==typeof t||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},r.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};r.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var n=e.map((function(e){return t(e,r)}));return r&&Object.freeze(n),n}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var i in n={},e){var u=e[i];void 0!==u&&o(n,i,t(u,r))}return r&&Object.freeze(n),n}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},r.inheritable=function t(e){return function(r){!function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}(r,e),o(r,"inherits",t(r))}}},{"../errors":5}],75:[function(t,r,n){(function(e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/bytes"),i=t("../utils/properties"),o=e.crypto||e.msCrypto;function s(t){if(t<=0||1024<t||parseInt(String(t))!=t)throw new Error("invalid length");var e=new Uint8Array(t);return o.getRandomValues(e),r.arrayify(e)}o&&o.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),o={getRandomValues:function(t){for(var e=0;e<20;e++)for(var r=0;r<t.length;r++)e?t[r]^=Math.trunc(256*Math.random()):t[r]=Math.trunc(256*Math.random());return t},_weakCrypto:!0}),n.randomBytes=s,!0===o._weakCrypto&&i.defineReadOnly(s,"_weakCrypto",!0)}).call(this,"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/bytes":64,"../utils/properties":74}],76:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./bytes");function i(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+t[e+i];return n}function s(t,e,r,n){for(var i=[];r<e+1+n;){var o=a(t,r);if(i.push(o.result),e+1+n<(r+=o.consumed))throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function a(t,e){if(0===t.length)throw new Error("invalid rlp data");if(248<=t[e]){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(192<=t[e]){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}if(184<=t[e]){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(128<=t[e]){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}r.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},r.decode=function(t){var e=n.arrayify(t),r=a(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":64}],77:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("elliptic"),o=t("./address"),s=t("./bytes"),a=t("./hash"),u=t("./keccak256"),h=t("./properties"),c=n(t("../errors")),f=null;function l(){return f=f||new i.ec("secp256k1")}var d=(p.prototype.sign=function(t){var e=l().keyFromPrivate(s.arrayify(this.privateKey)).sign(s.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:s.hexZeroPad("0x"+e.r.toString(16),32),s:s.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},p.prototype.computeSharedSecret=function(t){var e=l().keyFromPrivate(s.arrayify(this.privateKey)),r=l().keyFromPublic(s.arrayify(m(t)));return s.hexZeroPad("0x"+e.derive(r.getPublic()).toString(16),32)},p.prototype._addPoint=function(t){var e=l().keyFromPublic(s.arrayify(this.publicKey)),r=l().keyFromPublic(s.arrayify(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")},p);function p(t){var e=l().keyFromPrivate(s.arrayify(t));h.defineReadOnly(this,"privateKey",s.hexlify(e.priv.toArray("be",32))),h.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),h.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),h.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}function m(t,e){var r=s.arrayify(t);if(32!==r.length)return 33===r.length?e?s.hexlify(r):"0x"+l().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+l().keyFromPublic(r).getPublic(!0,"hex"):s.hexlify(r):(c.throwError("invalid public or private key",c.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var n=new d(r);return e?n.compressedPublicKey:n.publicKey}function v(t){var e="0x"+m(t).slice(4);return o.getAddress("0x"+u.keccak256(e).substring(26))}function g(t,e){var r=s.splitSignature(e),n={r:s.arrayify(r.r),s:s.arrayify(r.s)};return"0x"+l().recoverPubKey(s.arrayify(t),n,r.recoveryParam).encode("hex",!1)}function y(t,e){return v(g(s.arrayify(t),e))}r.KeyPair=d,r.computePublicKey=m,r.computeAddress=v,r.recoverPublicKey=g,r.recoverAddress=y,r.verifyMessage=function(t,e){return y(a.hashMessage(t),e)}},{"../errors":5,"./address":60,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74,elliptic:12}],78:[function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("aes-js")),s=n(t("scrypt-js")),a=n(t("uuid")),u=t("./signing-key"),h=i(t("./hdnode")),c=t("./address"),f=t("./bytes"),l=t("./pbkdf2"),d=t("./keccak256"),p=t("./utf8"),m=t("./random-bytes");function v(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),f.arrayify(t)}function g(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function y(t){return"string"==typeof t?p.toUtf8Bytes(t,p.UnicodeNormalizationForm.NFKC):f.arrayify(t)}function w(t,e){for(var r=t,n=e.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var s in r)if(s.toLowerCase()===n[i]){o=r[s];break}if(null===o)return null;r=o}return r}r.decryptCrowdsale=function(t,e){var r=JSON.parse(t);e=y(e);var n=c.getAddress(w(r,"ethaddr")),i=v(w(r,"encseed"));if(!i||i.length%16!=0)throw new Error("invalid encseed");var s=l.pbkdf2(e,e,2e3,32,"sha256").slice(0,16),a=i.slice(0,16),h=i.slice(16),m=new o.default.ModeOfOperation.cbc(s,a),g=f.arrayify(m.decrypt(h));g=o.default.padding.pkcs7.strip(g);for(var b="",_=0;_<g.length;_++)b+=String.fromCharCode(g[_]);var M=p.toUtf8Bytes(b),E=new u.SigningKey(d.keccak256(M));if(E.address!==n)throw new Error("corrupt crowdsale wallet");return E},r.decrypt=function(t,e,r){function n(t,e){var r=v(w(i,"crypto/ciphertext"));if(f.hexlify(function(t,e){return d.keccak256(f.concat([t,e]))}(t.slice(16,32),r)).substring(2)!==w(i,"crypto/mac").toLowerCase())return e(new Error("invalid password")),null;var n=function(t,e){if("aes-128-ctr"!==w(i,"crypto/cipher"))return null;var r=v(w(i,"crypto/cipherparams/iv")),n=new o.default.Counter(r),s=new o.default.ModeOfOperation.ctr(t,n);return f.arrayify(s.decrypt(e))}(t.slice(0,16),r),s=t.slice(32,64);if(!n)return e(new Error("unsupported cipher")),null;var a=new u.SigningKey(n);if(i.address&&a.address!==c.getAddress(i.address))return e(new Error("address mismatch")),null;var l=w(i,"x-ethers/locale");if("0.1"===w(i,"x-ethers/version")&&(null==l||"en"===l)){var p=v(w(i,"x-ethers/mnemonicCiphertext")),m=v(w(i,"x-ethers/mnemonicCounter")),g=new o.default.Counter(m),y=new o.default.ModeOfOperation.ctr(s,g),b=w(i,"x-ethers/path")||h.defaultPath,_=f.arrayify(y.decrypt(p)),M=h.entropyToMnemonic(_),E=h.fromMnemonic(M).derivePath(b);if(E.privateKey!=f.hexlify(n))return e(new Error("mnemonic mismatch")),null;a=new u.SigningKey(E)}return a}var i=JSON.parse(t),a=y(e);return new Promise((function(t,e){var o=w(i,"crypto/kdf");if(o&&"string"==typeof o)if("scrypt"===o.toLowerCase()){var u=v(w(i,"crypto/kdfparams/salt")),h=parseInt(w(i,"crypto/kdfparams/n")),c=parseInt(w(i,"crypto/kdfparams/r")),d=parseInt(w(i,"crypto/kdfparams/p"));if(!h||!c||!d)return void e(new Error("unsupported key-derivation function parameters"));if(0!=(h&h-1))return void e(new Error("unsupported key-derivation function parameter value for N"));if(32!==(g=parseInt(w(i,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));r&&r(0),s.default(a,u,h,c,d,64,(function(i,o,s){if(i)i.progress=o,e(i);else if(s){var a=n(s=f.arrayify(s),e);if(!a)return;r&&r(1),t(a)}else if(r)return r(o)}))}else if("pbkdf2"===o.toLowerCase()){u=v(w(i,"crypto/kdfparams/salt"));var p=null,m=w(i,"crypto/kdfparams/prf");if("hmac-sha256"===m)p="sha256";else{if("hmac-sha512"!==m)return void e(new Error("unsupported prf"));p="sha512"}var g,y=parseInt(w(i,"crypto/kdfparams/c"));if(32!==(g=parseInt(w(i,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));var b=n(l.pbkdf2(a,u,y,g,p),e);if(!b)return;t(b)}else e(new Error("unsupported key-derivation function"));else e(new Error("unsupported key-derivation function"))}))},r.encrypt=function(t,e,r,n){"function"!=typeof r||n||(n=r,r={}),r=r||{};var i=null;if(32!==(i=u.SigningKey.isSigningKey(t)?f.arrayify(t.privateKey):f.arrayify(t)).length)throw new Error("invalid private key");var c=y(e),l=null;if(r.entropy&&(l=f.arrayify(r.entropy)),r.mnemonic)if(l){if(h.entropyToMnemonic(l)!==r.mnemonic)throw new Error("entropy and mnemonic mismatch")}else l=f.arrayify(h.mnemonicToEntropy(r.mnemonic,r.wordlist));var p=r.path;l&&!p&&(p=h.defaultPath);var v=r.client;v=v||"ethers.js";var w=null;w=r.salt?f.arrayify(r.salt):m.randomBytes(32);var b=null;if(r.iv){if(16!==(b=f.arrayify(r.iv)).length)throw new Error("invalid iv")}else b=m.randomBytes(16);var _=null;if(r.uuid){if(16!==(_=f.arrayify(r.uuid)).length)throw new Error("invalid uuid")}else _=m.randomBytes(16);var M=1<<17,E=8,A=1;return r.scrypt&&(r.scrypt.N&&(M=r.scrypt.N),r.scrypt.r&&(E=r.scrypt.r),r.scrypt.p&&(A=r.scrypt.p)),new Promise((function(t,e){n&&n(0),s.default(c,w,M,E,A,64,(function(s,h,c){if(s)s.progress=h,e(s);else if(c){var y=(c=f.arrayify(c)).slice(0,16),x=c.slice(16,32),k=c.slice(32,64),S=new u.SigningKey(i).address,T=new o.default.Counter(b),I=new o.default.ModeOfOperation.ctr(y,T),P=f.arrayify(I.encrypt(i)),N=d.keccak256(f.concat([x,P])),R={address:S.substring(2).toLowerCase(),id:a.default.v4({random:_}),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:f.hexlify(b).substring(2)},ciphertext:f.hexlify(P).substring(2),kdf:"scrypt",kdfparams:{salt:f.hexlify(w).substring(2),n:M,dklen:32,p:A,r:E},mac:N.substring(2)}};if(l){var C=m.randomBytes(16),L=new o.default.Counter(C),O=new o.default.ModeOfOperation.ctr(k,L),B=f.arrayify(O.encrypt(l)),D=new Date,U=D.getUTCFullYear()+"-"+g(D.getUTCMonth()+1,2)+"-"+g(D.getUTCDate(),2)+"T"+g(D.getUTCHours(),2)+"-"+g(D.getUTCMinutes(),2)+"-"+g(D.getUTCSeconds(),2)+".0Z";R["x-ethers"]={client:v,gethFilename:"UTC--"+U+"--"+R.address,mnemonicCounter:f.hexlify(C).substring(2),mnemonicCiphertext:f.hexlify(B).substring(2),path:p,version:"0.1"},r.wordlist&&"string"==typeof r.wordlist.locale&&(R["x-ethers"].locale=r.wordlist.locale)}n&&n(1),t(JSON.stringify(R))}else if(n)return n(h)}))}))}},{"./address":60,"./bytes":64,"./hdnode":66,"./keccak256":71,"./pbkdf2":73,"./random-bytes":75,"./signing-key":81,"./utf8":85,"aes-js":8,"scrypt-js":44,uuid:48}],79:[function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("hash.js")),o=t("./bytes");r.ripemd160=function(t){return"0x"+i.default.ripemd160().update(o.arrayify(t)).digest("hex")},r.sha256=function(t){return"0x"+i.default.sha256().update(o.arrayify(t)).digest("hex")},r.sha512=function(t){return"0x"+i.default.sha512().update(o.arrayify(t)).digest("hex")}},{"./bytes":64,"hash.js":26}],80:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),t("setimmediate"),r.platform="browser"},{setimmediate:45}],81:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./hdnode"),o=t("./bytes"),s=t("./properties"),a=t("./secp256k1"),u=n(t("../errors")),h=(c.prototype.signDigest=function(t){return this.keyPair.sign(t)},c.prototype.computeSharedSecret=function(t){return this.keyPair.computeSharedSecret(o.arrayify(t))},c.isSigningKey=function(t){return s.isType(t,"SigningKey")},c);function c(t){u.checkNew(this,c);var e=null;e=i.HDNode.isHDNode(t)?(s.defineReadOnly(this,"mnemonic",t.mnemonic),s.defineReadOnly(this,"path",t.path),o.arrayify(t.privateKey)):("string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t),o.arrayify(t));try{32!==e.length&&u.throwError("exactly 32 bytes required",u.INVALID_ARGUMENT,{arg:"privateKey",value:"[REDACTED]"})}catch(t){var r={arg:"privateKey",reason:t.reason,value:"[REDACTED]"};t.value&&("number"==typeof t.value.length&&(r.length=t.value.length),r.type=typeof t.value),u.throwError("invalid private key",t.code,r)}s.defineReadOnly(this,"privateKey",o.hexlify(e)),s.defineReadOnly(this,"keyPair",new a.KeyPair(e)),s.defineReadOnly(this,"publicKey",this.keyPair.publicKey),s.defineReadOnly(this,"address",a.computeAddress(this.keyPair.publicKey)),s.setType(this,"SigningKey")}r.SigningKey=h},{"../errors":5,"./bytes":64,"./hdnode":66,"./properties":74,"./secp256k1":77}],82:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./bignumber"),i=t("./bytes"),o=t("./utf8"),s=t("./keccak256"),a=t("./sha2"),u=new RegExp("^bytes([0-9]+)$"),h=new RegExp("^(u?int)([0-9]*)$"),c=new RegExp("^(.*)\\[([0-9]*)\\]$"),f="0000000000000000000000000000000000000000000000000000000000000000";function l(t,e){if(t.length!=e.length)throw new Error("type/value count mismatch");var r=[];return t.forEach((function(t,s){r.push(function t(e,r,s){switch(e){case"address":return s?i.padZeros(r,32):i.arrayify(r);case"string":return o.toUtf8Bytes(r);case"bytes":return i.arrayify(r);case"bool":return r=r?"0x01":"0x00",s?i.padZeros(r,32):i.arrayify(r)}var a=e.match(h);if(a){if((l=parseInt(a[2]||"256"))%8!=0||0===l||256<l)throw new Error("invalid number type - "+e);return s&&(l=256),r=n.bigNumberify(r).toTwos(l),i.padZeros(r,l/8)}if(a=e.match(u)){var l=parseInt(a[1]);if(String(l)!=a[1]||0===l||32<l)throw new Error("invalid number type - "+e);if(i.arrayify(r).byteLength!==l)throw new Error("invalid value for "+e);return s?i.arrayify((r+f).substring(0,66)):r}if((a=e.match(c))&&Array.isArray(r)){var d=a[1];if(parseInt(a[2]||String(r.length))!=r.length)throw new Error("invalid value for "+e);var p=[];return r.forEach((function(e){p.push(t(d,e,!0))})),i.concat(p)}throw new Error("unknown type - "+e)}(t,e[s]))})),i.hexlify(i.concat(r))}r.pack=l,r.keccak256=function(t,e){return s.keccak256(l(t,e))},r.sha256=function(t,e){return a.sha256(l(t,e))}},{"./bignumber":63,"./bytes":64,"./keccak256":71,"./sha2":79,"./utf8":85}],83:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("../constants"),o=n(t("../errors")),s=t("./secp256k1"),a=t("./address"),u=t("./bignumber"),h=t("./bytes"),c=t("./keccak256"),f=t("./properties"),l=n(t("./rlp")),d=t("../providers/abstract-provider");function p(t){return"0x"===t?i.Zero:u.bigNumberify(t)}var m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}],v={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};r.serialize=function(t,e){f.checkProperties(t,v);var r=[];m.forEach((function(e){var n=t[e.name]||[];n=h.arrayify(h.hexlify(n)),e.length&&n.length!==e.length&&0<n.length&&o.throwError("invalid length for "+e.name,o.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:n}),e.maxLength&&(n=h.stripZeros(n)).length>e.maxLength&&o.throwError("invalid length for "+e.name,o.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:n}),r.push(h.hexlify(n))})),null!=t.chainId&&0!==t.chainId&&(r.push(h.hexlify(t.chainId)),r.push("0x"),r.push("0x"));var n=l.encode(r);if(!e)return n;var i=h.splitSignature(e),s=27+i.recoveryParam;return 9===r.length&&(r.pop(),r.pop(),r.pop(),s+=2*t.chainId+8),r.push(h.hexlify(s)),r.push(h.stripZeros(h.arrayify(i.r))),r.push(h.stripZeros(h.arrayify(i.s))),l.encode(r)},r.parse=function(t){var e=l.decode(t);9!==e.length&&6!==e.length&&o.throwError("invalid raw transaction",o.INVALID_ARGUMENT,{arg:"rawTransactin",value:t});var r={nonce:p(e[0]).toNumber(),gasPrice:p(e[1]),gasLimit:p(e[2]),to:function(t){return"0x"===t?null:a.getAddress(t)}(e[3]),value:p(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=u.bigNumberify(e[6]).toNumber()}catch(t){return o.info(t),r}if(r.r=h.hexZeroPad(e[7],32),r.s=h.hexZeroPad(e[8],32),u.bigNumberify(r.r).isZero()&&u.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push(h.hexlify(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var f=c.keccak256(l.encode(i));try{r.from=s.recoverAddress(f,{r:h.hexlify(r.r),s:h.hexlify(r.s),recoveryParam:n})}catch(t){o.info(t)}r.hash=c.keccak256(t)}return r},r.populateTransaction=function(t,e,r){d.Provider.isProvider(e)||o.throwError("missing provider",o.INVALID_ARGUMENT,{argument:"provider",value:e}),f.checkProperties(t,v);var n=f.shallowCopy(t);if(null!=n.to&&(n.to=e.resolveName(n.to)),null==n.gasPrice&&(n.gasPrice=e.getGasPrice()),null==n.nonce&&(n.nonce=e.getTransactionCount(r)),null==n.gasLimit){var i=f.shallowCopy(n);i.from=r,n.gasLimit=e.estimateGas(i)}return null==n.chainId&&(n.chainId=e.getNetwork().then((function(t){return t.chainId}))),f.resolveProperties(n)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":50,"./address":60,"./bignumber":63,"./bytes":64,"./keccak256":71,"./properties":74,"./rlp":76,"./secp256k1":77}],84:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i,o=t("../constants"),s=n(t("../errors")),a=t("./bignumber"),u={};function h(t){return{decimals:t.length-1,tenPower:a.bigNumberify(t)}}function c(t){var e=u[String(t).toLowerCase()];if(!e&&"number"==typeof t&&parseInt(String(t))==t&&0<=t&&t<=256){for(var r="1",n=0;n<t;n++)r+="0";e=h(r)}return e||s.throwError("invalid unitType",s.INVALID_ARGUMENT,{argument:"name",value:t}),e}function f(t,e){var r=c(e),n=(t=a.bigNumberify(t)).lt(o.Zero);n&&(t=t.mul(o.NegativeOne));for(var i=t.mod(r.tenPower).toString();i.length<r.decimals;)i="0"+i;return i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1],t=t.div(r.tenPower).toString()+"."+i,n&&(t="-"+t),t}function l(t,e){null==e&&(e=18);var r=c(e);if("string"==typeof t&&t.match(/^-?[0-9.,]+$/)||s.throwError("invalid decimal value",s.INVALID_ARGUMENT,{arg:"value",value:t}),0===r.decimals)return a.bigNumberify(t);var n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&s.throwError("missing value",s.INVALID_ARGUMENT,{arg:"value",value:t});var i=t.split(".");2<i.length&&s.throwError("too many decimal points",s.INVALID_ARGUMENT,{arg:"value",value:t});var u=i[0],h=i[1];for(u=u||"0",(h=h||"0").length>r.decimals&&s.throwError("underflow occurred",s.NUMERIC_FAULT,{operation:"division",fault:"underflow"});h.length<r.decimals;)h+="0";var f=a.bigNumberify(u),l=a.bigNumberify(h),d=f.mul(r.tenPower).add(l);return n&&(d=d.mul(o.NegativeOne)),d}i="1",["wei","kwei","Mwei","Gwei","szabo","finney","ether"].forEach((function(t){var e=h(i);u[t.toLowerCase()]=e,u[String(e.decimals)]=e,i+="000"})),r.commify=function(t){var e=String(t).split(".");(2<e.length||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&s.throwError("invalid value",s.INVALID_ARGUMENT,{argument:"value",value:t});var r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";2===e.length&&(i="."+(e[1]||"0"));for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i},r.formatUnits=f,r.parseUnits=l,r.formatEther=function(t){return f(t,18)},r.parseEther=function(t){return l(t,18)}},{"../constants":3,"../errors":5,"./bignumber":63}],85:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i,o=t("../constants"),s=t("../errors"),a=t("./bytes");function u(t,e){void 0===e&&(e=n.current),e!=n.current&&(s.checkNormalize(),t=t.normalize(e));for(var r=[],i=0;i<t.length;i++){var o=t.charCodeAt(i);if(o<128)r.push(o);else if(o<2048)r.push(o>>6|192),r.push(63&o|128);else if(55296==(64512&o)){i++;var u=t.charCodeAt(i);if(i>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");o=65536+((1023&o)<<10)+(1023&u),r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)}return a.arrayify(r)}function h(t,e){t=a.arrayify(t);for(var r="",n=0;n<t.length;){var i=t[n++];if(i>>7!=0){var o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){if(e)continue;if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}o=3,s=65535}if(n+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;n<t.length&&t[n]>>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,h=0;h<o;h++){var c=t[n];if(128!=(192&c)){u=null;break}u=u<<6|63&c,n++}if(null!==u)if(u<=s){if(!e)throw new Error("invalid utf8 byte sequence; overlong")}else if(1114111<u){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(55296<=u&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}(i=n=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={})).current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD",r.toUtf8Bytes=u,r.toUtf8String=h,r.formatBytes32String=function(t){var e=u(t);if(31<e.length)throw new Error("bytes32 string must be less than 32 bytes");return a.hexlify(a.concat([e,o.HashZero]).slice(0,32))},r.parseBytes32String=function(t){var e=a.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return h(e.slice(0,r))}},{"../constants":3,"../errors":5,"./bytes":64}],86:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("xmlhttprequest"),o=t("./base64"),s=t("./properties"),a=t("./utf8"),u=n(t("../errors"));r.fetchJson=function(t,e,r){var n={},s=null,h=12e4;if("string"==typeof t)s=t;else if("object"==typeof t){if(null==t.url&&u.throwError("missing URL",u.MISSING_ARGUMENT,{arg:"url"}),s=t.url,"number"==typeof t.timeout&&0<t.timeout&&(h=t.timeout),t.headers)for(var c in t.headers)n[c.toLowerCase()]={key:c,value:String(t.headers[c])};if(null!=t.user&&null!=t.password){"https:"!==s.substring(0,6)&&!0!==t.allowInsecure&&u.throwError("basic authentication requires a secure https url",u.INVALID_ARGUMENT,{arg:"url",url:s,user:t.user,password:"[REDACTED]"});var f=t.user+":"+t.password;n.authorization={key:"Authorization",value:"Basic "+o.encode(a.toUtf8Bytes(f))}}}return new Promise((function(t,o){var a=new i.XMLHttpRequest,u=null;function c(){null!=u&&(clearTimeout(u),u=null)}u=setTimeout((function(){null!=u&&(u=null,o(new Error("timeout")),setTimeout((function(){a.abort()}),0))}),h),e?(a.open("POST",s,!0),n["content-type"]={key:"Content-Type",value:"application/json"}):a.open("GET",s,!0),Object.keys(n).forEach((function(t){var e=n[t];a.setRequestHeader(e.key,e.value)})),a.onreadystatechange=function(){if(4===a.readyState){if(200!=a.status){c();var n=new Error("invalid response - "+a.status);return n.statusCode=a.status,a.responseText&&(n.responseText=a.responseText),void o(n)}var i=null;try{i=JSON.parse(a.responseText)}catch(n){c();var u=new Error("invalid json response");return u.orginialError=n,u.responseText=a.responseText,null!=e&&(u.requestBody=e),u.url=s,void o(u)}if(r)try{i=r(i)}catch(n){return c(),n.url=s,n.body=e,n.responseText=a.responseText,void o(n)}c(),t(i)}},a.onerror=function(t){c(),o(t)};try{null!=e?a.send(e):a.send()}catch(u){c();var f=new Error("connection error");f.error=u,o(f)}}))},r.poll=function(t,e){return e=e||{},null==(e=s.shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){var i=null,o=!1,s=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};e.timeout&&(i=setTimeout((function(){s()&&n(new Error("timeout"))}),e.timeout));var a=e.fastRetry||null,u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){u++;var n=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));n<e.floor&&(n=e.floor),n>e.ceiling&&(n=e.ceiling),a&&(u--,n=a,a=null),setTimeout(i,n)}return null}),(function(t){s()&&n(t)}))}()}))}},{"../errors":5,"./base64":61,"./properties":74,"./utf8":85,xmlhttprequest:49}],87:[function(t,r,n){(function(e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/hash"),i=t("../utils/properties");n.check=function(t){for(var e=[],n=0;n<2048;n++){var i=t.getWord(n);if(n!==t.getWordIndex(i))return"0x";e.push(i)}return r.id(e.join("\n")+"\n")};var o=(s.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},s.prototype.join=function(t){return t.join(" ")},s);function s(t){i.defineReadOnly(this,"locale",t)}n.Wordlist=o,n.register=function(t,e){e=e||t.locale}}).call(this,"undefined"!=typeof e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":65,"../utils/properties":74}],88:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s,a=t("./utils/bytes"),u=t("./utils/hash"),h=t("./utils/hdnode"),c=t("./utils/json-wallet"),f=t("./utils/keccak256"),l=t("./utils/properties"),d=t("./utils/random-bytes"),p=o(t("./utils/secret-storage")),m=t("./utils/signing-key"),v=t("./utils/transaction"),g=t("./abstract-signer"),y=t("./providers/abstract-provider"),w=o(t("./errors")),b=(i(_,s=g.Signer),Object.defineProperty(_.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),_.prototype.connect=function(t){return y.Provider.isProvider(t)||w.throwError("invalid provider",w.INVALID_ARGUMENT,{argument:"provider",value:t}),new _(this.signingKey,t)},_.prototype.getAddress=function(){return Promise.resolve(this.address)},_.prototype.sign=function(t){var e=this;return l.resolveProperties(t).then((function(t){var r=v.serialize(t),n=e.signingKey.signDigest(f.keccak256(r));return v.serialize(t,n)}))},_.prototype.signMessage=function(t){return Promise.resolve(a.joinSignature(this.signingKey.signDigest(u.hashMessage(t))))},_.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},_.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},_.prototype.sendTransaction=function(t){var e=this;if(!this.provider)throw new Error("missing provider");return null==t.nonce&&((t=l.shallowCopy(t)).nonce=this.getTransactionCount("pending")),v.populateTransaction(t,this.provider,this.address).then((function(t){return e.sign(t).then((function(t){return e.provider.sendTransaction(t)}))}))},_.prototype.encrypt=function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e=e||{},this.mnemonic&&((e=l.shallowCopy(e)).mnemonic=this.mnemonic,e.path=this.path),p.encrypt(this.privateKey,t,e,r)},_.createRandom=function(t){var e=d.randomBytes(16);(t=t||{}).extraEntropy&&(e=a.arrayify(f.keccak256(a.concat([e,t.extraEntropy])).substring(0,34)));var r=h.entropyToMnemonic(e,t.locale);return _.fromMnemonic(r,t.path,t.locale)},_.fromEncryptedJson=function(t,e,r){if(c.isCrowdsaleWallet(t))try{r&&r(0);var n=p.decryptCrowdsale(t,e);return r&&r(1),Promise.resolve(new _(n))}catch(t){return Promise.reject(t)}else if(c.isSecretStorageWallet(t))return p.decrypt(t,e,r).then((function(t){return new _(t)}));return Promise.reject("invalid wallet JSON")},_.fromMnemonic=function(t,e,r){return e=e||h.defaultPath,new _(h.fromMnemonic(t,r).derivePath(e))},_);function _(t,e){var r=s.call(this)||this;return w.checkNew(r,_),m.SigningKey.isSigningKey(t)?l.defineReadOnly(r,"signingKey",t):l.defineReadOnly(r,"signingKey",new m.SigningKey(t)),l.defineReadOnly(r,"provider",e),r}r.Wallet=b},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":50,"./utils/bytes":64,"./utils/hash":65,"./utils/hdnode":66,"./utils/json-wallet":70,"./utils/keccak256":71,"./utils/properties":74,"./utils/random-bytes":75,"./utils/secret-storage":78,"./utils/signing-key":81,"./utils/transaction":83}],89:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../wordlists/lang-en").langEn;r.en=n},{"../wordlists/lang-en":90}],90:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var o,s=t("../utils/wordlist"),a="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",u=null;function h(t){if(null==u&&(u=a.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.check(t)))throw u=null,new Error("BIP39 Wordlist for en (English) FAILED")}function c(){return o.call(this,"en")||this}var f=new(i(c,o=s.Wordlist),c.prototype.getWord=function(t){return h(this),u[t]},c.prototype.getWordIndex=function(t){return h(this),u.indexOf(t)},c);r.langEn=f,s.register(f)},{"../utils/wordlist":87}]},{},[7])(7)}).call(this,r(19))}}]);