/*! For license information please see jcchain.js.LICENSE.txt */
(()=>{var e={38586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNonce=t.logout=t.login=t.getUserInfo=t.defaultUser=void 0;var n=r(82898);t.defaultUser={id:"",username:"",showname:"",comment:"",locked:!1,password:"",avatar:"",account:""},t.getUserInfo=function(e){return n.request({url:"/webapp/index.php?c=BcUser&a=info",method:"GET",params:e})},t.login=function(e){return n.request({url:"/webapp/index.php?c=Market&a=auth",method:"GET",params:e})},t.logout=function(){return n.request({url:"/api/user/logout",method:"POST"})},t.getNonce=function(e){return n.request({url:"/webapp/index.php?c=Market&a=getNonce",method:"GET",params:e})}},86039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWalletInfo=t.queryQrStatus=t.registBridgeClient=void 0;var n=r(82898),a="https://wallet.cebggame.com";t.registBridgeClient=function(e){return n.request({url:a+"/bridge/regist",method:"POST",params:e})},t.queryQrStatus=function(e){return n.request({url:a+"/bridge/status",method:"POST",params:e})},t.getWalletInfo=function(){return n.request({url:a+"/wallet/info",method:"GET"})}},17315:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var f=r(17315),d=r(82265),s=r(65560),u=r(54737),b=r(22002),h=r(76692),l=r(28995),p=r(38586),x=r(44325),m=function(){function e(){var e,t;this.chainMap=new Map,this._availableChains=new Map,this.bc=new h.Blockchain,this.instanceMap=new Map;try{for(var r=c(s.AllChains),n=r.next();!n.done;n=r.next()){var a=n.value;this.chainMap.set(a.id,a)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}}return Object.defineProperty(e.prototype,"availableChains",{get:function(){var e,t;if(0===this._availableChains.size)try{for(var r=c(d.AVAILABLE_CHAINS),n=r.next();!n.done;n=r.next()){var a=n.value,i=this.chainMap.get(a);i&&this._availableChains.set(a,i)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return this._availableChains},enumerable:!1,configurable:!0}),e.prototype.init=function(){return i(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:if(!this.bc.isWalletConnect)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.bc.connect()];case 2:return t.sent(),[4,this.getNance()];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),console.log("connect chain error: ",e),[3,5];case 5:return[2]}}))}))},Object.defineProperty(e.prototype,"isLogined",{get:function(){return!!l.UserModule.token&&!!l.UserModule.step},enumerable:!1,configurable:!0}),e.prototype.logout=function(){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.bc.disconnect()];case 1:return e.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"currentChain",{get:function(){return this.bc.currentChain},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentAccount",{get:function(){return l.UserModule.accountId},enumerable:!1,configurable:!0}),e.prototype.login=function(){return i(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:if(l.UserModule.step)return[3,6];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.bc.connect(!0)];case 2:return t.sent(),[4,this.checkNance()];case 3:return t.sent(),[3,6];case 4:return e=t.sent(),x.EventBus.$emit(x.SHOW_ERR_MSG,e.message),[4,Promise.reject(e)];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.checkNance=function(){return i(this,void 0,void 0,(function(){var e,t,r;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,6]),(e=l.UserModule.nonce)?[3,2]:[4,p.getNonce({account:l.UserModule.accountId,net_id:l.UserModule.chainId})];case 1:t=n.sent(),e=t.nonce+"",l.UserModule.updateNonce(e),n.label=2;case 2:return[4,l.UserModule.Login({bcInstance:this.bc,account:l.UserModule.accountId,chainId:l.UserModule.chainId,nonce:e})];case 3:return n.sent(),l.UserModule.updateStep(1),[3,6];case 4:return r=n.sent(),console.log(r),[4,Promise.reject(r)];case 5:return n.sent(),[3,6];case 6:return[2]}}))}))},e.prototype.getNance=function(){return i(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:console.log("need get nance"),t.label=1;case 1:return t.trys.push([1,7,,8]),[4,p.getNonce({account:l.UserModule.accountId,net_id:l.UserModule.chainId})];case 2:return e=t.sent(),console.log("success get nonce: ",e),e.state?(l.UserModule.updateStep(1),[3,6]):[3,3];case 3:return e.state||!e.nonce?[3,6]:l.UserModule.token?[4,l.UserModule.LogOut()]:[3,5];case 4:t.sent(),t.label=5;case 5:l.UserModule.updateStep(0),t.label=6;case 6:return e.nonce&&l.UserModule.updateNonce(e.nonce+""),[3,8];case 7:return t.sent(),x.EventBus.$emit(x.SHOW_ERR_MSG,"Error get login nonce"),[3,8];case 8:return[2]}}))}))},e.prototype.getInstance=function(e,t,r){return i(this,void 0,void 0,(function(){var n,a;return o(this,(function(i){switch(i.label){case 0:return n=t+"_"+e,this.instanceMap.has(n)?[3,2]:[4,new f.Chain(this.chainMap.get(t).rpc).initContractInstance(e,r)];case 1:a=i.sent(),this.instanceMap.set(n,a),i.label=2;case 2:return[2,this.instanceMap.get(n)]}}))}))},e.prototype.getBalance=function(e,t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return[4,this.getInstance(e,t)];case 1:return[4,n.sent().methods.balanceOf(l.UserModule.accountId).call()];case 2:return r=n.sent(),console.log("balance: ",r),[2,r]}}))}))},e.prototype.getNftBalance=function(e,t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return[4,this.getInstance(e,t,u.MYSTERY_BOX_ABI)];case 1:return[4,n.sent().methods.balanceOf(l.UserModule.accountId).call()];case 2:return r=n.sent(),console.log("nft balance: ",r),[2,r]}}))}))},e.prototype.getNftList=function(e,t,r,n){return void 0===r&&(r=0),void 0===n&&(n=8),i(this,void 0,void 0,(function(){return o(this,(function(a){switch(a.label){case 0:return[4,this.getInstance(e,t,u.MYSTERY_BOX_ABI)];case 1:return[2,a.sent().methods.userTokens(l.UserModule.accountId,r,n).call()]}}))}))},e.prototype.getNftIdOfIndex=function(e,t,r){return i(this,void 0,void 0,(function(){var n;return o(this,(function(a){switch(a.label){case 0:return[4,this.getInstance(e,t,u.MYSTERY_BOX_ABI)];case 1:return[4,a.sent().methods.tokenOfOwnerByIndex(l.UserModule.accountId,r).call()];case 2:return n=a.sent(),console.log("address: "+e+", chainId: "+t+", index: "+r+", token: "+n),[2,n]}}))}))},e.prototype.openMysteryBox=function(e,t,r,n,a){return i(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.bc.getContractInstance(e,u.MYSTERY_PROXY_ABI)];case 1:return[2,i.sent().methods.openBox(t,r,n,a).send({gas:1e6})]}}))}))},e.prototype.activateOneNft=function(e,t,r,n,a,c){return i(this,void 0,void 0,(function(){var i,f;return o(this,(function(o){switch(o.label){case 0:return[4,this.bc.getContractInstance(e,u.ACTIVATE_PROXY_ABI)];case 1:return[4,(i=o.sent()).methods.activateOne(t,r,n,a,c).estimateGas({gas:1e6})];case 2:return f=o.sent(),console.log("nftProxyInstance activateOne need gas: ",f),[2,i.methods.activateOne(t,r,n,a,c).send({gas:1.1*f|0})]}}))}))},e.prototype.transferToAccount=function(e){var t=e.to,r=e.amount,n=e.chainId,a=e.address;return i(this,void 0,void 0,(function(){var e,i=this;return o(this,(function(o){return e=this,n!==this.bc.currentChain?[2,new Promise((function(o,c){i.bc.switchEthereumChain(n,(function(){e.bc.transferToAccount(t,r,a).then((function(e){o&&o(e)})).catch((function(e){c&&c(e)}))}))}))]:[2,this.bc.transferToAccount(t,r,a)]}))}))},a([b.singleton],e)}();t.default=m},94223:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var a,i=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRetryProviderError=t.HttpRetryProvider=void 0;var s=d(r(61002)),u=r(47347),b={retry:{retries:5}},h=function(){function e(e,t){if(void 0===t&&(t={}),!e||!e.length)throw new TypeError("Invalid URLs: '"+e+"'");this.urls=e,this.options=s.default(b,t),this.currentIndex=0}return e.prototype.updateUrls=function(e){this.urls=e},e.prototype.supportsSubscriptions=function(){return!1},e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){var r,n,a,i,o=this;return c(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,u.retry((function(){return p(e,o.urls,o.currentIndex)}),this.options.retry)];case 1:return r=f.apply(void 0,[c.sent(),2]),n=r[0],a=r[1],this.currentIndex=a,t(null,n),[3,3];case 2:return i=c.sent(),t(i),[3,3];case 3:return[2]}}))}))},e.prototype.sendAsync=function(e,t){return o(this,void 0,void 0,(function(){var r,n,a,i,o=this;return c(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,u.retry((function(){return p(e,o.urls,o.currentIndex)}),this.options.retry)];case 1:return r=f.apply(void 0,[c.sent(),2]),n=r[0],a=r[1],this.currentIndex=a,t(null,n),[3,3];case 2:return i=c.sent(),t(i),[3,3];case 3:return[2]}}))}))},e.prototype.on=function(e,t){},e.prototype.removeListener=function(e,t){},e.prototype.disconnect=function(){},e}();t.HttpRetryProvider=h;var l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errors=r,n}return i(t,e),t}(Error);function p(e,t,r){return o(this,void 0,void 0,(function(){var a,i,f,d,s,u=this;return c(this,(function(b){switch(b.label){case 0:a=[],i=r,f=function(r){var n,f;return c(this,(function(r){switch(r.label){case 0:n=t[i],r.label=1;case 1:return r.trys.push([1,3,,4]),[4,fetch(n,{headers:{"Content-type":"application/json"},method:"POST",body:JSON.stringify(e)}).then((function(e){return o(u,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return e.ok?[3,2]:[4,e.text()];case 1:throw t=r.sent(),new Error("["+e.status+": "+n+"]: "+t);case 2:return[2,e.json()]}}))}))}))];case 2:return[2,{value:[r.sent(),i]}];case 3:return f=r.sent(),console.log({error:f.message},"fetch fail"),a.push(f),[3,4];case 4:return i=(i+1)%t.length,[2]}}))},d=0,b.label=1;case 1:return d=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Blockchain=t.WALLET_TYPE=void 0;var s,u=d(r(12536)),b=d(r(32358)),h=r(82265),l=r(44325),p=r(62186),x=r(65560),m=r(54737),y=r(22002),v=r(93907),g=r(28995),w=r(97408),M=r(37868),_=r(27683),k=r(63546),S=r(33606),A=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],E="cebg_chain_cache_key";!function(e){e[e.METAMAEK=1]="METAMAEK",e[e.WALLETCONNET=2]="WALLETCONNET",e[e.NATIVE=3]="NATIVE"}(s=t.WALLET_TYPE||(t.WALLET_TYPE={}));var T=function(){function e(){var e,t,r,n,a=this;this.currentChain=0,this.walletType=s.METAMAEK,this.dataCached=!1,this.chainMap=new Map,this.rpc={},this.subscribeToEvents=function(){a.provider.on("accountsChanged",(function(e){return o(a,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return console.log("accountsChanged: ",e),e&&e.length>0?g.UserModule.accountId===e[0]?[3,2]:(this.clearCachedProvider(),[4,g.UserModule.LogOut()]):[3,2];case 1:r.sent(),l.EventBus.$emit(l.ACCOUNT_CHANGE,e[0]),t=new Event("account_change",{bubbles:!0,cancelable:!1}),window.dispatchEvent(t),setTimeout((function(){location.reload()}),1e3),r.label=2;case 2:return[2]}}))}))})),a.provider.on("chainChanged",(function(e){return o(a,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return t=parseInt(e),console.log("chainChanged",e,t),[4,this.checkChain(t)];case 1:return r.sent(),this.currentChain=t,this.saveProvider(),g.UserModule.updateChainID(this.currentChain),[2]}}))}))})),a.provider.on("disconnect",(function(e){console.log("disconnect",e)}))};var i=new Map;try{for(var d=f(x.AllChains),u=d.next();!u.done;u=d.next()){var b=u.value,p=b.id;this.rpc[p]=b.rpc,i.set(p,b)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var m=f(h.AVAILABLE_CHAINS),y=m.next();!y.done;y=m.next())p=y.value,this.chainMap.set(p,i.get(p))}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}this.loadCachedProvider(),this.instanceCacheMap=new Map,l.EventBus.$on(l.NEED_LOGIN,this.connect.bind(this))}return Object.defineProperty(e.prototype,"isWalletConnect",{get:function(){return!!this.walletType&&!!this.currentChain},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mallAddress",{get:function(){var e;return null===(e=h.CONTRACT_ADDRESS[this.currentChain])||void 0===e?void 0:e.mall},enumerable:!1,configurable:!0}),e.prototype.updateAccount=function(){return o(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return[4,this.web3.eth.getAccounts()];case 1:return(e=t.sent())&&e.length>0&&g.UserModule.updateAccount(e[0]),[2]}}))}))},Object.defineProperty(e.prototype,"hexChainId",{get:function(){return p.toHexChainId(this.currentChain)},enumerable:!1,configurable:!0}),e.prototype.chainSelected=function(e){return o(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return this.chainMap.has(e)?(this.currentChain=e,this.provider?[4,this.switchEthereumChain()]:[3,2]):[2];case 1:return t.sent(),[3,4];case 2:return[4,this.connectWallet(!0)];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},e.prototype.connectWallet=function(e){return o(this,void 0,void 0,(function(){var t,r,n,a,i;return c(this,(function(o){switch(o.label){case 0:return console.log("begin connect to wallet: ",this.walletType,this.currentChain),this.walletType!==s.METAMAEK?[3,2]:(t=this,[4,this.connectMetaMask()]);case 1:return t.provider=o.sent(),[3,6];case 2:return this.walletType!==s.WALLETCONNET?[3,4]:(r=this,[4,this.connectWalletConnect()]);case 3:return r.provider=o.sent(),[3,6];case 4:return this.walletType!==s.NATIVE?[3,6]:(n=this,[4,this.connectNativeWallet()]);case 5:n.provider=o.sent(),o.label=6;case 6:return this.provider?(this.web3=new b.default(this.provider),a=[],this.walletType!==s.NATIVE?[3,7]:(a.push((new _.NativeWallet).createAccount(this.web3)),[3,9])):[2];case 7:return[4,this.web3.eth.getAccounts()];case 8:a=o.sent(),o.label=9;case 9:return[4,this.web3.eth.getChainId()];case 10:return i=o.sent(),this.subscribeToEvents(),a&&a.length>0&&g.UserModule.updateAccount(a[0]),this.currentChain||(this.currentChain=i),this.saveProvider(),g.UserModule.updateChainID(i),g.UserModule.updateWalletStatus(!0),console.log("current login chain: ",i),console.log("accountsLogin: ",a,g.UserModule.accountId),e?l.EventBus.$emit(l.NEED_NONCE):g.UserModule.updateStep(1),[2,{account:a[0],chainId:i}]}}))}))},e.prototype.checkChain=function(e){return o(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:if(this.chainMap.has(e))return[3,5];t.label=1;case 1:return t.trys.push([1,3,,5]),[4,this.selectChain()];case 2:return t.sent(),[3,5];case 3:return t.sent(),[4,this.disconnect()];case 4:return t.sent(),[3,5];case 5:return[2]}}))}))},e.prototype.connect=function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return v.isMobile()?(p.hasMetamask()?this.walletType=s.METAMAEK:this.walletType=s.WALLETCONNET,[3,5]):[3,1];case 1:return p.hasMetamask()?!e||this.walletType?[3,3]:(t=this,[4,this.selectWallet()]):[3,4];case 2:t.walletType=r.sent(),console.log("wallet selected: ",this.walletType),r.label=3;case 3:return[3,5];case 4:this.walletType=s.WALLETCONNET,r.label=5;case 5:return e||this.isWalletConnect?[4,this.connectWallet(e)]:[3,7];case 6:r.sent(),r.label=7;case 7:return[2]}}))}))},e.prototype.selectWallet=function(){return(new M.WalletModal).selectWallet()},e.prototype.selectChain=function(){var e=this;return new Promise((function(t,r){l.EventBus.$emit(l.NEED_CHANGE_CHAIN,{confirm:function(r){return o(e,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return console.log("select chain: ",r),this.currentChain=r,this.provider?[4,this.switchEthereumChain()]:[3,2];case 1:e.sent(),e.label=2;case 2:return t&&t(r),[2]}}))}))},cancel:function(e){console.log("cancel select chain: ",e),r&&r(e)}})}))},e.prototype.connectMetaMask=function(){return o(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:if(e=null,void 0===window.ethereum)return[3,5];e=window.ethereum,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.request({method:"eth_requestAccounts"})];case 2:return t.sent(),[3,4];case 3:throw-32002===t.sent().code?new Error("MeatMask not login, Open MeatMask and login first"):new Error("User Rejected");case 4:return[3,6];case 5:if(window.web3)e=window.web3.currentProvider;else{if(!window.celo)throw new Error("No Web3 Provider found");e=window.celo}t.label=6;case 6:return[2,e]}}))}))},e.prototype.connectNativeWallet=function(){return o(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,(new _.NativeWallet).enable()];case 1:return[2,e.sent()]}}))}))},e.prototype.connectWalletConnect=function(){return o(this,void 0,void 0,(function(){var e,t;return c(this,(function(r){switch(r.label){case 0:e=new u.default({infuraId:k.WALLET_INFURAID,rpc:this.rpc}),r.label=1;case 1:return r.trys.push([1,3,,5]),[4,e.enable()];case 2:return r.sent(),[3,5];case 3:return t=r.sent(),console.log("connect to wallet connect error: ",t),[4,Promise.reject(t)];case 4:return r.sent(),[3,5];case 5:return[2,e]}}))}))},e.prototype.getContractInstance=function(e,t){return void 0===t&&(t=m.ERC20ABI),o(this,void 0,void 0,(function(){var r;return c(this,(function(n){return this.instanceCacheMap.has(e)||(r=new this.web3.eth.Contract(t,e,{from:g.UserModule.accountId}),this.instanceCacheMap.set(e,r)),[2,this.instanceCacheMap.get(e)]}))}))},e.prototype.clearCachedProvider=function(){console.log("clear cached provider"),w.removeItem(E)},e.prototype.loadCachedProvider=function(){var e=w.getItem(E);if(e)try{var t=JSON.parse(e);this.walletType=t.walletType,this.currentChain=t.chainId}catch(e){console.log("err parse cached json"),this.clearCachedProvider()}},e.prototype.saveProvider=function(){var e={walletType:this.walletType,chainId:this.currentChain};w.setItem(E,JSON.stringify(e))},e.prototype.disconnect=function(){var e;return o(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,g.UserModule.LogOut()];case 1:return t.sent(),[4,null===(e=this.provider)||void 0===e?void 0:e.disconnect()];case 2:case 3:return t.sent(),[3,4];case 4:return this.currentChain=0,this.walletType=0,this.instanceCacheMap.clear(),this.clearCachedProvider(),g.UserModule.updateStep(0),g.UserModule.updateChainID(0),g.UserModule.updateNonce(""),g.UserModule.updateAccount(""),g.UserModule.updateWalletStatus(!1),[2]}}))}))},e.prototype.switchEthereumChain=function(e,t){return o(this,void 0,void 0,(function(){var r,n,a,i,o,f=this;return c(this,(function(c){switch(c.label){case 0:e=e||this.currentChain,r=p.toHexChainId(e),n=function(e){console.log("switchEthereumChain: ",e),f.provider.removeListener("chainChanged",n),t&&t()},this.provider.on("chainChanged",n),c.label=1;case 1:return c.trys.push([1,3,,8]),[4,this.provider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})];case 2:return c.sent(),console.log("switch chain success"),[3,8];case 3:if(a=c.sent(),console.log("switch chain error: ",a),!(4902===a.code||a.message.indexOf("Unrecognized chain ID")>=0))return[3,7];c.label=4;case 4:return c.trys.push([4,6,,7]),i=this.chainMap.get(e),[4,this.provider.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:i.name,nativeCurrency:{name:i.symbol,symbol:i.symbol,decimals:i.decimals||18},blockExplorerUrls:[i.explorerurl],rpcUrls:[i.rpc]}]})];case 5:return c.sent(),console.log("add chain success"),[3,7];case 6:return o=c.sent(),console.error("add chain error: ",o),this.provider.removeListener("chainChanged",n),[3,7];case 7:return[3,8];case 8:return[2]}}))}))},e.prototype.getTransactionReceipt=function(e){return o(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.web3.eth.getTransactionReceipt(e)]}))}))},e.prototype.getTxConfirms=function(e){return o(this,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return[4,this.getTransactionReceipt(e)];case 1:return t=r.sent(),[4,this.web3.eth.getBlockNumber()];case 2:return[2,r.sent()-t.blockNumber+1]}}))}))},e.prototype.signPresale=function(e){var t=e.type,r=e.paymentTokenAddress,n=e.price,a=e.buyerAddress,i=e.netId;return o(this,void 0,void 0,(function(){var e,o,f,d,s;return c(this,(function(c){switch(c.label){case 0:return e=1e5*Math.random()|0,o={item:t,token:r,price:n,salt:e},(f=i)?[3,2]:[4,this.web3.eth.getChainId()];case 1:f=c.sent(),c.label=2;case 2:return d={types:{EIP712Domain:A,set:[{name:"item",type:"uint256"},{name:"token",type:"address"},{name:"price",type:"uint256"},{name:"salt",type:"uint256"}]},primaryType:"set",domain:{name:"BEBoxMall",version:"1",chainId:i=f,verifyingContract:this.mallAddress},message:o},[4,this.signData(d,a)];case 3:return s=c.sent(),[2,{nonce:e,signature:s}]}}))}))},e.prototype.increaseAllowance=function(e,t){return o(this,void 0,void 0,(function(){var r;return c(this,(function(n){switch(n.label){case 0:return[4,this.getContractInstance(e)];case 1:return[4,n.sent().methods.increaseAllowance(this.mallAddress,t).send({gas:1e6})];case 2:return r=n.sent(),console.log("increaseAllowance: ",r),[2]}}))}))},e.prototype.getBalance=function(e,t){return o(this,void 0,void 0,(function(){return c(this,(function(r){switch(r.label){case 0:return t=t||g.UserModule.accountId,[4,this.getContractInstance(e)];case 1:return[4,r.sent().methods.balanceOf(t).call()];case 2:return[2,r.sent()]}}))}))},e.prototype.transferToAccount=function(e,t,r){return o(this,void 0,void 0,(function(){var n;return c(this,(function(a){switch(a.label){case 0:return n=this.web3.utils.toBN(this.web3.utils.toWei(t+"")),[4,this.getContractInstance(r)];case 1:return[2,a.sent().methods.transfer(e,n).send({gas:1e6})]}}))}))},e.prototype.getBalanceEth=function(e){return o(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return e=e||g.UserModule.accountId,[4,this.web3.eth.getBalance(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.sendEth=function(e,t){return o(this,void 0,void 0,(function(){var r,n,a;return c(this,(function(i){switch(i.label){case 0:return r=g.UserModule.accountId,n=this.web3.utils.toWei(t+"","ether"),[4,this.web3.eth.estimateGas({from:r,to:e,value:n})];case 1:return a=i.sent(),console.log("send eth from: "+r+", to: "+e+", value: "+t),[2,this.web3.eth.sendTransaction({from:r,to:e,gas:a,value:n})]}}))}))},e.prototype.signData=function(e,t){return o(this,void 0,void 0,(function(){var r,a,i,o,f;return c(this,(function(c){switch(c.label){case 0:return r=JSON.stringify(e),a=t,console.log("clicked, sending personal sign req","from",a,r),this.walletType===s.NATIVE?(i=""+k.NATIVE_PK_PREFIX+t.slice(2),[2,S.signTypedData({data:e,privateKey:n.from(i.replace("0x",""),"hex"),version:S.SignTypedDataVersion.V4})]):(o=[a,r],[4,this.sendCmd({method:"eth_signTypedData_v4",params:o,from:a})]);case 1:return f=c.sent(),console.log(f),[2,f.result]}}))}))},e.prototype.sendCmd=function(e){var t=e.method,r=e.params,n=e.from;return o(this,void 0,void 0,(function(){var e=this;return c(this,(function(a){return[2,new Promise((function(a,i){e.web3.currentProvider.sendAsync({method:t,params:r,from:n},(function(e,t){return o(this,void 0,void 0,(function(){return c(this,(function(r){return e?(i&&i(e),[2]):(a&&a(t),[2])}))}))}))}))]}))}))},i([y.singleton],e)}();t.Blockchain=T},65560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllChains=void 0,t.AllChains=[{name:"Ethereum Mainnet RPC",type:"Mainnet",rpc:"https://rpc.ankr.com/eth",id:1,symbol:"ETH",explorerurl:"https://etherscan.io"},{name:"Ethereum Ropsten Testnet RPC",type:"Testnet",rpc:"https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",id:3,symbol:"ETH",explorerurl:"https://ropsten.etherscan.io"},{name:"Ethereum Rinkeby Testnet RPC",type:"Testnet",rpc:"https://rinkey.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",id:4,symbol:"ETH",explorerurl:"https://rinkey.etherscan.io"},{name:"Ethereum Goerli Testnet RPC",type:"Testnet",rpc:"https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",id:5,symbol:"ETH",explorerurl:"https://goerli.etherscan.io"},{name:"Ethereum Kovan Testnet RPC",type:"Testnet",rpc:"https://kovan.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",id:6,symbol:"ETH",explorerurl:"https://kovan.etherscan.io"},{name:"Ubiq Mainnet RPC",type:"Mainnet",rpc:"https://rpc.octano.dev/",id:8,symbol:"UBQ",explorerurl:"https://ubiqscan.io/"},{name:"Elastos ETH Mainnet RPC",type:"Mainnet",rpc:"https://api.elastos.io/eth",id:20,symbol:"ELA",explorerurl:"https://explorer.elaeth.io/"},{name:"Cronos Mainnet RPC",type:"Mainnet",rpc:"https://evm-cronos.crypto.org",id:25,symbol:"CRO",explorerurl:"https://cronos.crypto.org/explorer/"},{name:"Telos EVM Mainnet RPC",type:"Mainnet",rpc:"https://mainnet.telos.net/evm",id:40,symbol:"TLOS",explorerurl:"https://telos.net/"},{name:"Binance Smart Chain",type:"Mainnet",rpc:"https://rpc.ankr.com/bsc",logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAwIiBoZWlnaHQ9IjI1MDAiIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiPjxnIGZpbGw9IiNmM2JhMmYiPjxwYXRoIGQ9Ik02MTEuNTkgODQwLjQybDM4OC40LTM4OC4zOSAzODguNiAzODguNTkgMjI2LTIyNkw5OTkuOTkgMCAzODUuNiA2MTQuNDJsMjI1Ljk5IDIyNk0uMDA2IDk5OS45NjlsMjI2LjAwNy0yMjYuMDA3IDIyNS45OTIgMjI1Ljk5M0wyMjYgMTIyNS45NnpNNjExLjU5IDExNTkuNThsMzg4LjQgMzg4LjM5IDM4OC41OS0zODguNTggMjI2LjEyIDIyNS44OC0uMTEuMTJMOTk5Ljk5IDIwMDBsLTYxNC40MS02MTQuNC0uMzItLjMyIDIyNi4zMy0yMjUuN00xNTQ4LjAxMyAxMDAwLjA5M2wyMjYuMDA3LTIyNi4wMDYgMjI1Ljk5MiAyMjUuOTkyLTIyNi4wMDYgMjI2LjAwN3oiLz48cGF0aCBkPSJNMTIyOS4yMiA5OTkuODhoLjFMOTk5Ljk5IDc3MC41NSA4MzAuNTEgOTQwLjAzaC0uMDFsLTE5LjQ3IDE5LjQ4LTQwLjE2IDQwLjE3LS4zMi4zMS4zMi4zMyAyMjkuMTIgMjI5LjEzIDIyOS4zMy0yMjkuMzMuMTEtLjEzLS4yMS0uMTEiLz48L2c+PC9zdmc+",id:56,symbol:"BNB",explorerurl:"https://bscscan.com"},{name:"OKExChain Mainnet RPC",type:"Mainnet",rpc:"https://exchainrpc.okex.org",id:66,symbol:"OKT",explorerurl:"https://www.oklink.com/okexchain"},{name:"Hoo Mainnet RPC",type:"Mainnet",rpc:"https://http-mainnet.hoosmartchain.com",id:70,symbol:"HOO",explorerurl:"https://hooscan.com"},{name:"Binance Smart Chain Testnet RPC",type:"Testnet",rpc:"https://data-seed-prebsc-1-s1.binance.org:8545/",id:97,logo:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAwIiBoZWlnaHQ9IjI1MDAiIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiPjxnIGZpbGw9IiNmM2JhMmYiPjxwYXRoIGQ9Ik02MTEuNTkgODQwLjQybDM4OC40LTM4OC4zOSAzODguNiAzODguNTkgMjI2LTIyNkw5OTkuOTkgMCAzODUuNiA2MTQuNDJsMjI1Ljk5IDIyNk0uMDA2IDk5OS45NjlsMjI2LjAwNy0yMjYuMDA3IDIyNS45OTIgMjI1Ljk5M0wyMjYgMTIyNS45NnpNNjExLjU5IDExNTkuNThsMzg4LjQgMzg4LjM5IDM4OC41OS0zODguNTggMjI2LjEyIDIyNS44OC0uMTEuMTJMOTk5Ljk5IDIwMDBsLTYxNC40MS02MTQuNC0uMzItLjMyIDIyNi4zMy0yMjUuN00xNTQ4LjAxMyAxMDAwLjA5M2wyMjYuMDA3LTIyNi4wMDYgMjI1Ljk5MiAyMjUuOTkyLTIyNi4wMDYgMjI2LjAwN3oiLz48cGF0aCBkPSJNMTIyOS4yMiA5OTkuODhoLjFMOTk5Ljk5IDc3MC41NSA4MzAuNTEgOTQwLjAzaC0uMDFsLTE5LjQ3IDE5LjQ4LTQwLjE2IDQwLjE3LS4zMi4zMS4zMi4zMyAyMjkuMTIgMjI5LjEzIDIyOS4zMy0yMjkuMzMuMTEtLjEzLS4yMS0uMTEiLz48L2c+PC9zdmc+",symbol:"BNB",explorerurl:"https://testnet.bscscan.com"},{name:"xDai Mainnet RPC",type:"Mainnet",rpc:"https://rpc.xdaichain.com/",id:100,symbol:"XDAI",explorerurl:"https://blockscout.com/xdai/mainnet/"},{name:"Fuse Mainnet RPC",type:"Mainnet",rpc:"https://rpc.fuse.io",id:122,symbol:"FUSE",explorerurl:"https://explorer.fuse.io/"},{name:"HECO Mainnet RPC",type:"Mainnet",rpc:"https://http-mainnet-node.huobichain.com/",id:128,symbol:"HT",explorerurl:"https://hecoinfo.com/"},{name:"Matic Mainnet RPC",type:"Mainnet",rpc:"https://polygon-rpc.com",id:137,symbol:"MATIC",explorerurl:"https://explorer.matic.network/"},{name:"Fantom Opera Mainnet RPC",type:"Mainnet",rpc:"https://rpc.ftm.tools/",id:250,symbol:"FTM",explorerurl:"https://ftmscan.com"},{name:"HECO Testnet RPC",type:"Testnet",rpc:"https://http-testnet.hecochain.com",id:256,symbol:"HT",explorerurl:"https://testnet.hecoinfo.com/"},{name:"KCC Mainnet",type:"Mainnet",rpc:"https://rpc-mainnet.kcc.network",id:321,logo:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIgMzI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojMDA5M0REO30KCS5zdDF7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojRkZGRkZGO30KPC9zdHlsZT4KPGc+Cgk8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIvPgoJPHBhdGggY2xhc3M9InN0MSIgZD0iTTEzLjUsMTZsNS4yLDUuM0wyMiwxOGMwLjYtMC42LDEuNS0wLjYsMiwwYzAsMCwwLDAsMCwwYzAuNiwwLjYsMC42LDEuNiwwLDIuMmwtNC4zLDQuNAoJCWMtMC42LDAuNi0xLjUsMC42LTIuMSwwYzAsMCwwLDAsMCwwbC02LjItNi40VjIyYzAsMC44LTAuNywxLjUtMS41LDEuNWMtMC44LDAtMS41LTAuNy0xLjUtMS41VjEwYzAtMC44LDAuNy0xLjUsMS41LTEuNQoJCWMwLjgsMCwxLjUsMC43LDEuNSwxLjV2My44bDYuMi02LjRjMC42LTAuNiwxLjUtMC42LDIuMSwwYzAsMCwwLDAsMCwwbDQuMyw0LjRjMC42LDAuNiwwLjYsMS42LDAsMi4yYy0wLjYsMC42LTEuNSwwLjYtMiwwCgkJYzAsMCwwLDAsMCwwbC0zLjMtMy40TDEzLjUsMTZ6IE0xOC43LDE0LjVjMC44LDAsMS41LDAuNywxLjUsMS41cy0wLjcsMS41LTEuNSwxLjVzLTEuNS0wLjctMS41LTEuNQoJCUMxNy4yLDE1LjIsMTcuOSwxNC41LDE4LjcsMTQuNXoiLz4KPC9nPgo8L3N2Zz4K",symbol:"KCS",explorerurl:"https://scan.kcc.network"},{name:"KCC Testnet",type:"Testnet",logo:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIgMzI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojMDA5M0REO30KCS5zdDF7ZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojRkZGRkZGO30KPC9zdHlsZT4KPGc+Cgk8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIvPgoJPHBhdGggY2xhc3M9InN0MSIgZD0iTTEzLjUsMTZsNS4yLDUuM0wyMiwxOGMwLjYtMC42LDEuNS0wLjYsMiwwYzAsMCwwLDAsMCwwYzAuNiwwLjYsMC42LDEuNiwwLDIuMmwtNC4zLDQuNAoJCWMtMC42LDAuNi0xLjUsMC42LTIuMSwwYzAsMCwwLDAsMCwwbC02LjItNi40VjIyYzAsMC44LTAuNywxLjUtMS41LDEuNWMtMC44LDAtMS41LTAuNy0xLjUtMS41VjEwYzAtMC44LDAuNy0xLjUsMS41LTEuNQoJCWMwLjgsMCwxLjUsMC43LDEuNSwxLjV2My44bDYuMi02LjRjMC42LTAuNiwxLjUtMC42LDIuMSwwYzAsMCwwLDAsMCwwbDQuMyw0LjRjMC42LDAuNiwwLjYsMS42LDAsMi4yYy0wLjYsMC42LTEuNSwwLjYtMiwwCgkJYzAsMCwwLDAsMCwwbC0zLjMtMy40TDEzLjUsMTZ6IE0xOC43LDE0LjVjMC44LDAsMS41LDAuNywxLjUsMS41cy0wLjcsMS41LTEuNSwxLjVzLTEuNS0wLjctMS41LTEuNQoJCUMxNy4yLDE1LjIsMTcuOSwxNC41LDE4LjcsMTQuNXoiLz4KPC9nPgo8L3N2Zz4K",rpc:"https://rpc-testnet.kcc.network",id:322,symbol:"tKCS",explorerurl:"https://scan-testnet.kcc.network"},{name:"Moonriver Mainnet RPC",type:"Mainnet",rpc:"https://rpc.moonriver.moonbeam.network",id:1285,symbol:"MOVR",explorerurl:"https://blockscout.moonriver.moonbeam.network/"},{name:"Fantom Testnet RPC",type:"Testnet",rpc:"https://rpc.testnet.fantom.network/",id:4002,symbol:"FTM",explorerurl:"https://testnet.ftmscan.com"},{name:"IoTeX Mainnet RPC",type:"Mainnet",rpc:"https://babel-api.mainnet.iotex.io",id:4689,symbol:"IOTEX",explorerurl:"https://iotexscan.io/"},{name:"Nahmii Mainnet RPC",type:"Mainnet",rpc:"https://l2.nahmii.io/",id:5551,symbol:"ETH",explorerurl:"https://explorer.nahmii.io/"},{name:"Nahmii Testnet RPC",type:"Testnet",rpc:"https://l2.testnet.nahmii.io/",id:5553,symbol:"ETH",explorerurl:"https://explorer.testnet.nahmii.io/"},{name:"Arbitrum Mainnet RPC",type:"Mainnet",rpc:"https://rpc.ankr.com/arbitrum",id:42161,symbol:"ETH",explorerurl:"https://arbiscan.io/"},{name:"Celo Mainnet RPC",type:"Mainnet",rpc:"https://rpc.ankr.com/celo",id:42220,symbol:"CELO",explorerurl:"https://celoscan.com"},{name:"Avalanche C Chain Local RPC",type:"Testnet",rpc:"https://localhost:9650/ext/bc/C/rpc",id:43112,symbol:"AVAX",explorerurl:"https://snowtrace.io"},{name:"Avalanche FUJI Testnet RPC",type:"Testnet",rpc:"https://api.avax-test.network/ext/bc/C/rpc",id:43113,symbol:"AVAX",explorerurl:"https://testnet.explorer.avax.network/"},{name:"Avalanche C Chain Mainnet RPC",type:"Mainnet",rpc:"https://rpc.ankr.com/avalanche",id:43114,symbol:"AVAX",explorerurl:"https://snowtrace.io"},{name:"Matic Testnet RPC",type:"Testnet",rpc:"https://rpc-mumbai.maticvigil.com",id:80001,symbol:"MATIC",explorerurl:"https://mumbai.polygonscan.com/"},{name:"Harmony Mainnet RPC",type:"Mainnet",rpc:"https://api.harmony.one/",id:16666e5,symbol:"ONE",explorerurl:"https://explorer.harmony.one"},{name:"Harmony Testnet RPC",type:"Testnet",rpc:"https://api.s0.b.hmny.io/",id:16667e5,symbol:"ONE",explorerurl:"https://explorer.harmony.one"},{name:"Local Testnet",type:"Local",rpc:"http://192.168.100.22:8545",id:1338,symbol:"ETH",explorerurl:"https://explorer.harmony.one"}]},82265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTRACT_ADDRESS=t.OFFICE_ACCOUNT=t.AVAILABLE_CHAINS=t.ALL_PROVIDERS=void 0,t.ALL_PROVIDERS=[{id:1,name:"MetaMask",logo:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM1NSIgdmlld0JveD0iMCAwIDM5NyAzNTUiIHdpZHRoPSIzOTciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMSAtMSkiPjxwYXRoIGQ9Im0xMTQuNjIyNjQ0IDMyNy4xOTU0NzIgNTIuMDA0NzE3IDEzLjgxMDE5OHYtMTguMDU5NDlsNC4yNDUyODMtNC4yNDkyOTJoMjkuNzE2OTgydjIxLjI0NjQ1OSAxNC44NzI1MjNoLTMxLjgzOTYyNGwtMzkuMjY4ODY4LTE2Ljk5NzE2OXoiIGZpbGw9IiNjZGJkYjIiLz48cGF0aCBkPSJtMTk5LjUyODMwNSAzMjcuMTk1NDcyIDUwLjk0MzM5NyAxMy44MTAxOTh2LTE4LjA1OTQ5bDQuMjQ1MjgzLTQuMjQ5MjkyaDI5LjcxNjk4MXYyMS4yNDY0NTkgMTQuODcyNTIzaC0zMS44Mzk2MjNsLTM5LjI2ODg2OC0xNi45OTcxNjl6IiBmaWxsPSIjY2RiZGIyIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSA0ODMuOTYyMjcgMCkiLz48cGF0aCBkPSJtMTcwLjg3MjY0NCAyODcuODg5NTIzLTQuMjQ1MjgzIDM1LjA1NjY1NyA1LjMwNjYwNC00LjI0OTI5Mmg1NS4xODg2OGw2LjM2NzkyNSA0LjI0OTI5Mi00LjI0NTI4NC0zNS4wNTY2NTctOC40OTA1NjUtNS4zMTE2MTUtNDIuNDUyODMyIDEuMDYyMzIzeiIgZmlsbD0iIzM5MzkzOSIvPjxwYXRoIGQ9Im0xNDIuMjE2OTg0IDUwLjk5MTUwMjIgMjUuNDcxNjk4IDU5LjQ5MDA4NTggMTEuNjc0NTI4IDE3My4xNTg2NDNoNDEuMzkxNTExbDEyLjczNTg0OS0xNzMuMTU4NjQzIDIzLjM0OTA1Ni01OS40OTAwODU4eiIgZmlsbD0iI2Y4OWMzNSIvPjxwYXRoIGQ9Im0zMC43NzgzMDIzIDE4MS42NTcyMjYtMjkuNzE2OTgxNTMgODYuMDQ4MTYxIDc0LjI5MjQ1MzkzLTQuMjQ5MjkzaDQ3Ljc1OTQzNDN2LTM3LjE4MTMwM2wtMi4xMjI2NDEtNzYuNDg3MjUzLTEwLjYxMzIwOCA4LjQ5ODU4M3oiIGZpbGw9IiNmODlkMzUiLz48cGF0aCBkPSJtODcuMDI4MzAzMiAxOTEuMjE4MTM0IDg3LjAyODMwMjggMi4xMjQ2NDYtOS41NTE4ODYgNDQuNjE3NTYzLTQxLjM5MTUxMS0xMC42MjMyMjl6IiBmaWxsPSIjZDg3YzMwIi8+PHBhdGggZD0ibTg3LjAyODMwMzIgMTkyLjI4MDQ1NyAzNi4wODQ5MDU4IDMzLjk5NDMzNHYzMy45OTQzMzR6IiBmaWxsPSIjZWE4ZDNhIi8+PHBhdGggZD0ibTEyMy4xMTMyMDkgMjI3LjMzNzExNCA0Mi40NTI4MzEgMTAuNjIzMjI5IDEzLjc5NzE3IDQ1LjY3OTg4OC05LjU1MTg4NiA1LjMxMTYxNS00Ni42OTgxMTUtMjcuNjIwMzk4eiIgZmlsbD0iI2Y4OWQzNSIvPjxwYXRoIGQ9Im0xMjMuMTEzMjA5IDI2MS4zMzE0NDgtOC40OTA1NjUgNjUuODY0MDI0IDU2LjI1LTM5LjMwNTk0OXoiIGZpbGw9IiNlYjhmMzUiLz48cGF0aCBkPSJtMTc0LjA1NjYwNiAxOTMuMzQyNzggNS4zMDY2MDQgOTAuMjk3NDUxLTE1LjkxOTgxMi00Ni4yMTEwNDl6IiBmaWxsPSIjZWE4ZTNhIi8+PHBhdGggZD0ibTc0LjI5MjQ1MzkgMjYyLjM5Mzc3MSA0OC44MjA3NTUxLTEuMDYyMzIzLTguNDkwNTY1IDY1Ljg2NDAyNHoiIGZpbGw9IiNkODdjMzAiLz48cGF0aCBkPSJtMjQuNDEwMzc3NyAzNTUuODc4MTkzIDkwLjIxMjI2NjMtMjguNjgyNzIxLTQwLjMzMDE5MDEtNjQuODAxNzAxLTczLjIzMTEzMzEzIDUuMzExNjE2eiIgZmlsbD0iI2ViOGYzNSIvPjxwYXRoIGQ9Im0xNjcuNjg4NjgyIDExMC40ODE1ODgtNDUuNjM2NzkzIDM4LjI0MzYyNy0zNS4wMjM1ODU4IDQyLjQ5MjkxOSA4Ny4wMjgzMDI4IDMuMTg2OTY5eiIgZmlsbD0iI2U4ODIxZSIvPjxwYXRoIGQ9Im0xMTQuNjIyNjQ0IDMyNy4xOTU0NzIgNTYuMjUtMzkuMzA1OTQ5LTQuMjQ1MjgzIDMzLjk5NDMzNHYxOS4xMjE4MTNsLTM4LjIwNzU0OC03LjQzNjI2eiIgZmlsbD0iI2RmY2VjMyIvPjxwYXRoIGQ9Im0yMjkuMjQ1Mjg2IDMyNy4xOTU0NzIgNTUuMTg4NjgtMzkuMzA1OTQ5LTQuMjQ1MjgzIDMzLjk5NDMzNHYxOS4xMjE4MTNsLTM4LjIwNzU0OC03LjQzNjI2eiIgZmlsbD0iI2RmY2VjMyIgdHJhbnNmb3JtPSJtYXRyaXgoLTEgMCAwIDEgNTEzLjY3OTI1MiAwKSIvPjxwYXRoIGQ9Im0xMzIuNjY1MDk2IDIxMi40NjQ1OTMtMTEuNjc0NTI4IDI0LjQzMzQyNyA0MS4zOTE1MS0xMC42MjMyMjl6IiBmaWxsPSIjMzkzOTM5IiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSAyODMuMzcyNjQ2IDApIi8+PHBhdGggZD0ibTIzLjM0OTA1NyAxLjA2MjMyMjk2IDE0NC4zMzk2MjUgMTA5LjQxOTI2NTA0LTI0LjQxMDM3OC01OS40OTAwODU4eiIgZmlsbD0iI2U4OGYzNSIvPjxwYXRoIGQ9Im0yMy4zNDkwNTcgMS4wNjIzMjI5Ni0xOS4xMDM3NzM5MiA1OC40Mjc3NjI5NCAxMC42MTMyMDc3MiA2My43MzkzNzgxLTcuNDI5MjQ1NDEgNC4yNDkyOTIgMTAuNjEzMjA3NzEgOS41NjA5MDYtOC40OTA1NjYxNyA3LjQzNjI2MSAxMS42NzQ1Mjg0NyAxMC42MjMyMjktNy40MjkyNDU0IDYuMzczOTM4IDE2Ljk4MTEzMjMgMjEuMjQ2NDU5IDc5LjU5OTA1NzctMjQuNDMzNDI4YzM4LjkxNTA5Ni0zMS4xNjE0NzMgNTguMDE4ODY5LTQ3LjA5NjMxOCA1Ny4zMTEzMjItNDcuODA0NTMzLS43MDc1NDgtLjcwODIxNS00OC44MjA3NTYtMzcuMTgxMzAzNi0xNDQuMzM5NjI1LTEwOS40MTkyNjUwNHoiIGZpbGw9IiM4ZTVhMzAiLz48ZyB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSAzOTkuMDU2NjExIDApIj48cGF0aCBkPSJtMzAuNzc4MzAyMyAxODEuNjU3MjI2LTI5LjcxNjk4MTUzIDg2LjA0ODE2MSA3NC4yOTI0NTM5My00LjI0OTI5M2g0Ny43NTk0MzQzdi0zNy4xODEzMDNsLTIuMTIyNjQxLTc2LjQ4NzI1My0xMC42MTMyMDggOC40OTg1ODN6IiBmaWxsPSIjZjg5ZDM1Ii8+PHBhdGggZD0ibTg3LjAyODMwMzIgMTkxLjIxODEzNCA4Ny4wMjgzMDI4IDIuMTI0NjQ2LTkuNTUxODg2IDQ0LjYxNzU2My00MS4zOTE1MTEtMTAuNjIzMjI5eiIgZmlsbD0iI2Q4N2MzMCIvPjxwYXRoIGQ9Im04Ny4wMjgzMDMyIDE5Mi4yODA0NTcgMzYuMDg0OTA1OCAzMy45OTQzMzR2MzMuOTk0MzM0eiIgZmlsbD0iI2VhOGQzYSIvPjxwYXRoIGQ9Im0xMjMuMTEzMjA5IDIyNy4zMzcxMTQgNDIuNDUyODMxIDEwLjYyMzIyOSAxMy43OTcxNyA0NS42Nzk4ODgtOS41NTE4ODYgNS4zMTE2MTUtNDYuNjk4MTE1LTI3LjYyMDM5OHoiIGZpbGw9IiNmODlkMzUiLz48cGF0aCBkPSJtMTIzLjExMzIwOSAyNjEuMzMxNDQ4LTguNDkwNTY1IDY1Ljg2NDAyNCA1NS4xODg2OC0zOC4yNDM2MjZ6IiBmaWxsPSIjZWI4ZjM1Ii8+PHBhdGggZD0ibTE3NC4wNTY2MDYgMTkzLjM0Mjc4IDUuMzA2NjA0IDkwLjI5NzQ1MS0xNS45MTk4MTItNDYuMjExMDQ5eiIgZmlsbD0iI2VhOGUzYSIvPjxwYXRoIGQ9Im03NC4yOTI0NTM5IDI2Mi4zOTM3NzEgNDguODIwNzU1MS0xLjA2MjMyMy04LjQ5MDU2NSA2NS44NjQwMjR6IiBmaWxsPSIjZDg3YzMwIi8+PHBhdGggZD0ibTI0LjQxMDM3NzcgMzU1Ljg3ODE5MyA5MC4yMTIyNjYzLTI4LjY4MjcyMS00MC4zMzAxOTAxLTY0LjgwMTcwMS03My4yMzExMzMxMyA1LjMxMTYxNnoiIGZpbGw9IiNlYjhmMzUiLz48cGF0aCBkPSJtMTY3LjY4ODY4MiAxMTAuNDgxNTg4LTQ1LjYzNjc5MyAzOC4yNDM2MjctMzUuMDIzNTg1OCA0Mi40OTI5MTkgODcuMDI4MzAyOCAzLjE4Njk2OXoiIGZpbGw9IiNlODgyMWUiLz48cGF0aCBkPSJtMTMyLjY2NTA5NiAyMTIuNDY0NTkzLTExLjY3NDUyOCAyNC40MzM0MjcgNDEuMzkxNTEtMTAuNjIzMjI5eiIgZmlsbD0iIzM5MzkzOSIgdHJhbnNmb3JtPSJtYXRyaXgoLTEgMCAwIDEgMjgzLjM3MjY0NiAwKSIvPjxwYXRoIGQ9Im0yMy4zNDkwNTcgMS4wNjIzMjI5NiAxNDQuMzM5NjI1IDEwOS40MTkyNjUwNC0yNC40MTAzNzgtNTkuNDkwMDg1OHoiIGZpbGw9IiNlODhmMzUiLz48cGF0aCBkPSJtMjMuMzQ5MDU3IDEuMDYyMzIyOTYtMTkuMTAzNzczOTIgNTguNDI3NzYyOTQgMTAuNjEzMjA3NzIgNjMuNzM5Mzc4MS03LjQyOTI0NTQxIDQuMjQ5MjkyIDEwLjYxMzIwNzcxIDkuNTYwOTA2LTguNDkwNTY2MTcgNy40MzYyNjEgMTEuNjc0NTI4NDcgMTAuNjIzMjI5LTcuNDI5MjQ1NCA2LjM3MzkzOCAxNi45ODExMzIzIDIxLjI0NjQ1OSA3OS41OTkwNTc3LTI0LjQzMzQyOGMzOC45MTUwOTYtMzEuMTYxNDczIDU4LjAxODg2OS00Ny4wOTYzMTggNTcuMzExMzIyLTQ3LjgwNDUzMy0uNzA3NTQ4LS43MDgyMTUtNDguODIwNzU2LTM3LjE4MTMwMzYtMTQ0LjMzOTYyNS0xMDkuNDE5MjY1MDR6IiBmaWxsPSIjOGU1YTMwIi8+PC9nPjwvZz48L3N2Zz4=",desc:"Connect to your MetaMask Wallet"},{id:2,name:"WalletConnect",logo:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyYWRpYWxHcmFkaWVudCBpZD0iYSIgY3g9IjAlIiBjeT0iNTAlIiByPSIxMDAlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1ZDlkZjYiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDZmZmYiLz48L3JhZGlhbEdyYWRpZW50PjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0ibTI1NiAwYzE0MS4zODQ4OTYgMCAyNTYgMTE0LjYxNTEwNCAyNTYgMjU2cy0xMTQuNjE1MTA0IDI1Ni0yNTYgMjU2LTI1Ni0xMTQuNjE1MTA0LTI1Ni0yNTYgMTE0LjYxNTEwNC0yNTYgMjU2LTI1NnoiIGZpbGw9InVybCgjYSkiLz48cGF0aCBkPSJtNjQuNjkxNzU1OCAzNy43MDg4Mjk4YzUxLjUzMjgwNzItNTAuMjc4NDM5NyAxMzUuMDgzOTk0Mi01MC4yNzg0Mzk3IDE4Ni42MTY3OTkyIDBsNi4yMDIwNTcgNi4wNTEwOTA2YzIuNTc2NjQgMi41MTM5MjE4IDIuNTc2NjQgNi41ODk3OTQ4IDAgOS4xMDM3MTc3bC0yMS4yMTU5OTggMjAuNjk5NTc1OWMtMS4yODgzMjEgMS4yNTY5NjE5LTMuMzc3MSAxLjI1Njk2MTktNC42NjU0MjEgMGwtOC41MzQ3NjYtOC4zMjcwMjA1Yy0zNS45NTA1NzMtMzUuMDc1NDk2Mi05NC4yMzc5NjktMzUuMDc1NDk2Mi0xMzAuMTg4NTQ0IDBsLTkuMTQwMDI4MiA4LjkxNzU1MTljLTEuMjg4MzIxNyAxLjI1Njk2MDktMy4zNzcxMDE2IDEuMjU2OTYwOS00LjY2NTQyMDggMGwtMjEuMjE1OTk3My0yMC42OTk1NzU5Yy0yLjU3NjY0MDMtMi41MTM5MjI5LTIuNTc2NjQwMy02LjU4OTc5NTggMC05LjEwMzcxNzd6bTIzMC40OTM0ODUyIDQyLjgwODkxMTcgMTguODgyMjc5IDE4LjQyMjcyNjJjMi41NzY2MjcgMi41MTM5MTAzIDIuNTc2NjQyIDYuNTg5NzU5My4wMDAwMzIgOS4xMDM2ODYzbC04NS4xNDE0OTggODMuMDcwMzU4Yy0yLjU3NjYyMyAyLjUxMzk0MS02Ljc1NDE4MiAyLjUxMzk2OS05LjMzMDg0LjAwMDA2Ni0uMDAwMDEtLjAwMDAxLS4wMDAwMjMtLjAwMDAyMy0uMDAwMDMzLS4wMDAwMzRsLTYwLjQyODI1Ni01OC45NTc0NTFjLS42NDQxNi0uNjI4NDgxLTEuNjg4NTUtLjYyODQ4MS0yLjMzMjcxIDAtLjAwMDAwNC4wMDAwMDQtLjAwMDAwOC4wMDAwMDctLjAwMDAxMi4wMDAwMTFsLTYwLjQyNjk2ODMgNTguOTU3NDA4Yy0yLjU3NjYxNDEgMi41MTM5NDctNi43NTQxNzQ2IDIuNTEzOTktOS4zMzA4NDA4LjAwMDA5Mi0uMDAwMDE1MS0uMDAwMDE0LS4wMDAwMzA5LS4wMDAwMjktLjAwMDA0NjctLjAwMDA0NmwtODUuMTQzODY3NzQtODMuMDcxNDYzYy0yLjU3NjYzOTI4LTIuNTEzOTIxLTIuNTc2NjM5MjgtNi41ODk3OTUgMC05LjEwMzcxNjNsMTguODgyMzEyNjQtMTguNDIyNjk1NWMyLjU3NjYzOTMtMi41MTM5MjIyIDYuNzU0MTk5My0yLjUxMzkyMjIgOS4zMzA4Mzk3IDBsNjAuNDI5MTM0NyA1OC45NTgyNzU4Yy42NDQxNjA4LjYyODQ4IDEuNjg4NTQ5NS42Mjg0OCAyLjMzMjcxMDMgMCAuMDAwMDA5NS0uMDAwMDA5LjAwMDAxODItLjAwMDAxOC4wMDAwMjc3LS4wMDAwMjVsNjAuNDI2MTA2NS01OC45NTgyNTA4YzIuNTc2NTgxLTIuNTEzOTggNi43NTQxNDItMi41MTQwNzQzIDkuMzMwODQtLjAwMDIxMDMuMDAwMDM3LjAwMDAzNTQuMDAwMDcyLjAwMDA3MDkuMDAwMTA3LjAwMDEwNjNsNjAuNDI5MDU2IDU4Ljk1ODM1NDhjLjY0NDE1OS42Mjg0NzkgMS42ODg1NDkuNjI4NDc5IDIuMzMyNzA5IDBsNjAuNDI4MDc5LTU4Ljk1NzE5MjVjMi41NzY2NC0yLjUxMzkyMzEgNi43NTQxOTktMi41MTM5MjMxIDkuMzMwODM5IDB6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDk4IDE2MCkiLz48L2c+PC9zdmc+",desc:"Scan with WalletConnect to connect"},{id:3,name:"NativeWallet",logo:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyYWRpYWxHcmFkaWVudCBpZD0iYSIgY3g9IjAlIiBjeT0iNTAlIiByPSIxMDAlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1ZDlkZjYiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDZmZmYiLz48L3JhZGlhbEdyYWRpZW50PjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0ibTI1NiAwYzE0MS4zODQ4OTYgMCAyNTYgMTE0LjYxNTEwNCAyNTYgMjU2cy0xMTQuNjE1MTA0IDI1Ni0yNTYgMjU2LTI1Ni0xMTQuNjE1MTA0LTI1Ni0yNTYgMTE0LjYxNTEwNC0yNTYgMjU2LTI1NnoiIGZpbGw9InVybCgjYSkiLz48cGF0aCBkPSJtNjQuNjkxNzU1OCAzNy43MDg4Mjk4YzUxLjUzMjgwNzItNTAuMjc4NDM5NyAxMzUuMDgzOTk0Mi01MC4yNzg0Mzk3IDE4Ni42MTY3OTkyIDBsNi4yMDIwNTcgNi4wNTEwOTA2YzIuNTc2NjQgMi41MTM5MjE4IDIuNTc2NjQgNi41ODk3OTQ4IDAgOS4xMDM3MTc3bC0yMS4yMTU5OTggMjAuNjk5NTc1OWMtMS4yODgzMjEgMS4yNTY5NjE5LTMuMzc3MSAxLjI1Njk2MTktNC42NjU0MjEgMGwtOC41MzQ3NjYtOC4zMjcwMjA1Yy0zNS45NTA1NzMtMzUuMDc1NDk2Mi05NC4yMzc5NjktMzUuMDc1NDk2Mi0xMzAuMTg4NTQ0IDBsLTkuMTQwMDI4MiA4LjkxNzU1MTljLTEuMjg4MzIxNyAxLjI1Njk2MDktMy4zNzcxMDE2IDEuMjU2OTYwOS00LjY2NTQyMDggMGwtMjEuMjE1OTk3My0yMC42OTk1NzU5Yy0yLjU3NjY0MDMtMi41MTM5MjI5LTIuNTc2NjQwMy02LjU4OTc5NTggMC05LjEwMzcxNzd6bTIzMC40OTM0ODUyIDQyLjgwODkxMTcgMTguODgyMjc5IDE4LjQyMjcyNjJjMi41NzY2MjcgMi41MTM5MTAzIDIuNTc2NjQyIDYuNTg5NzU5My4wMDAwMzIgOS4xMDM2ODYzbC04NS4xNDE0OTggODMuMDcwMzU4Yy0yLjU3NjYyMyAyLjUxMzk0MS02Ljc1NDE4MiAyLjUxMzk2OS05LjMzMDg0LjAwMDA2Ni0uMDAwMDEtLjAwMDAxLS4wMDAwMjMtLjAwMDAyMy0uMDAwMDMzLS4wMDAwMzRsLTYwLjQyODI1Ni01OC45NTc0NTFjLS42NDQxNi0uNjI4NDgxLTEuNjg4NTUtLjYyODQ4MS0yLjMzMjcxIDAtLjAwMDAwNC4wMDAwMDQtLjAwMDAwOC4wMDAwMDctLjAwMDAxMi4wMDAwMTFsLTYwLjQyNjk2ODMgNTguOTU3NDA4Yy0yLjU3NjYxNDEgMi41MTM5NDctNi43NTQxNzQ2IDIuNTEzOTktOS4zMzA4NDA4LjAwMDA5Mi0uMDAwMDE1MS0uMDAwMDE0LS4wMDAwMzA5LS4wMDAwMjktLjAwMDA0NjctLjAwMDA0NmwtODUuMTQzODY3NzQtODMuMDcxNDYzYy0yLjU3NjYzOTI4LTIuNTEzOTIxLTIuNTc2NjM5MjgtNi41ODk3OTUgMC05LjEwMzcxNjNsMTguODgyMzEyNjQtMTguNDIyNjk1NWMyLjU3NjYzOTMtMi41MTM5MjIyIDYuNzU0MTk5My0yLjUxMzkyMjIgOS4zMzA4Mzk3IDBsNjAuNDI5MTM0NyA1OC45NTgyNzU4Yy42NDQxNjA4LjYyODQ4IDEuNjg4NTQ5NS42Mjg0OCAyLjMzMjcxMDMgMCAuMDAwMDA5NS0uMDAwMDA5LjAwMDAxODItLjAwMDAxOC4wMDAwMjc3LS4wMDAwMjVsNjAuNDI2MTA2NS01OC45NTgyNTA4YzIuNTc2NTgxLTIuNTEzOTggNi43NTQxNDItMi41MTQwNzQzIDkuMzMwODQtLjAwMDIxMDMuMDAwMDM3LjAwMDAzNTQuMDAwMDcyLjAwMDA3MDkuMDAwMTA3LjAwMDEwNjNsNjAuNDI5MDU2IDU4Ljk1ODM1NDhjLjY0NDE1OS42Mjg0NzkgMS42ODg1NDkuNjI4NDc5IDIuMzMyNzA5IDBsNjAuNDI4MDc5LTU4Ljk1NzE5MjVjMi41NzY2NC0yLjUxMzkyMzEgNi43NTQxOTktMi41MTM5MjMxIDkuMzMwODM5IDB6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDk4IDE2MCkiLz48L2c+PC9zdmc+",desc:"Native Wallet"}],t.AVAILABLE_CHAINS=[321],t.OFFICE_ACCOUNT="0x565edA4ef351EB78F03B8AfCb6dCF02E29cAD62e",t.CONTRACT_ADDRESS={322:{cec:"0xdb6D4bB22E2C12686Efff25a79EC78f9f078fe7D",ceg:"0xC5Cd606b3e9B80b758e8274B198c76D929aA094A",eth:"0x67f6a7BbE0da067A747C6b2bEdF8aBBF7D6f60dc",mall:"0x2bD8185e1B175c2b64859235981B700DD643dc4a",mystery:"0x7546b0829BDC04515F734fDD290Cf6bC2bB7058f",mysteryProxy:"0xA171C03Fa71bD66A013e53F64dDb9455C58E6567",nftProxy:"0x244B1F2c13eCbF9Ac918a01F5261972459dCd7c6"},97:{cec:"0xFAA03824c38Ed5102F9F901987FA7cd9d193449B",ceg:"0xA70beE785B92d4F662F870Cf4f3EBE774234d795",eth:"0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd",mall:"0xF278ff771F9E24968083B0bA54Cb42eb4B23C2d7"},321:{cec:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",ceg:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",eth:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",mall:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",mystery:"0x8444404bD78089A5a6d5Cc57f7Df8924f2DdACB4",mysteryProxy:"0xAA9C6e00bBeE2b41128EF46aB669D564d02F75E0",nftProxy:"0x3caD77a9479Aa157e94EFEa7168E202397Ce2ab8"},32:{cec:"0xfeFc3aab779863c1624eE008aba485c53805dCeb",ceg:"0xE388e872e63aadF5a4F1521E4d96C10A28091457",eth:"0xb296bab2ed122a85977423b602ddf3527582a3da",mall:"0xF278ff771F9E24968083B0bA54Cb42eb4B23C2d7"}}},63546:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOCAL_WALLET_KEY=t.ZERO_ADDRESS=t.NATIVE_PK_PREFIX=t.WALLET_INFURAID=void 0,t.WALLET_INFURAID="e7743d46923911fa8850619b7a7f6d9d",t.NATIVE_PK_PREFIX="0x000000000000000000000000",t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000",t.LOCAL_WALLET_KEY="local_wallet_key"},54737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ACTIVATE_PROXY_ABI=t.MYSTERY_PROXY_ABI=t.MYSTERY_BOX_ABI=t.MALL_ABI=t.ERC20ABI=void 0,t.ERC20ABI=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],t.MALL_ABI=[{inputs:[{internalType:"address[]",name:"proposers",type:"address[]"},{internalType:"address[]",name:"executors",type:"address[]"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"boxId",type:"uint256"},{indexed:!0,internalType:"address",name:"buyer",type:"address"},{indexed:!1,internalType:"uint256",name:"boxType",type:"uint256"},{indexed:!1,internalType:"uint256",name:"price",type:"uint256"},{indexed:!1,internalType:"address",name:"paymentToken",type:"address"}],name:"BEBoxPaid",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"index",type:"uint256"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"CallExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"index",type:"uint256"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes32",name:"predecessor",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"delay",type:"uint256"}],name:"CallScheduled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"}],name:"Cancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldDuration",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newDuration",type:"uint256"}],name:"MinDelayChange",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"EXECUTOR_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MIN_DELAY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"PROPOSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TIMELOCK_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"address_initialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"cancel",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"checkSigner",outputs:[],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes32",name:"structHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"checkSigner712",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"datas",type:"bytes[]"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"getTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"hashOperation",outputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"datas",type:"bytes[]"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"hashOperationBatch",outputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperation",outputs:[{internalType:"bool",name:"pending",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperationDone",outputs:[{internalType:"bool",name:"done",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperationPending",outputs:[{internalType:"bool",name:"pending",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"id",type:"bytes32"}],name:"isOperationReady",outputs:[{internalType:"bool",name:"ready",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"paymentReceivedAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256",name:"delay",type:"uint256"}],name:"schedule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"targets",type:"address[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes[]",name:"datas",type:"bytes[]"},{internalType:"bytes32",name:"predecessor",type:"bytes32"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256",name:"delay",type:"uint256"}],name:"scheduleBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"usedSignatures",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"},{inputs:[{internalType:"address",name:"_paymentReceivedAddress",type:"address"}],name:"setPaymentReceivedAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"boxId",type:"uint256"},{internalType:"uint256",name:"_type",type:"uint256"},{internalType:"address",name:"userAddress",type:"address"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"address",name:"paymentErc20",type:"address"},{internalType:"uint256",name:"saltNonce",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"payForBoxWithSignature",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_boxType",type:"uint256"},{internalType:"address",name:"_paymentErc20",type:"address"},{internalType:"uint256",name:"_price",type:"uint256"},{internalType:"uint256",name:"_saltNonce",type:"uint256"}],name:"getMessageHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[],name:"getMinDelay",outputs:[{internalType:"uint256",name:"duration",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"newDelay",type:"uint256"}],name:"updateDelay",outputs:[],stateMutability:"nonpayable",type:"function"}],t.MYSTERY_BOX_ABI=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"BURN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"proxy",type:"address"}],name:"addApprovalWhitelist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"approvalWhitelists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"isLocked",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"lock",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"lockedTokens",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"proxy",type:"address"}],name:"removeApprovalWhitelist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"proxy",type:"address"}],name:"removeBurnProxy",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"factory",type:"address"}],name:"removeMintFactory",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"proxy",type:"address"}],name:"setBurnProxy",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"factory",type:"address"}],name:"setMintFactory",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unlock",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseTokenURI",type:"string"}],name:"updateBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"page",type:"uint256"}],name:"userTokens",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function",constant:!0}],t.MYSTERY_PROXY_ABI=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"boxId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"val",type:"uint256"},{indexed:!1,internalType:"uint256[3]",name:"ids",type:"uint256[3]"},{indexed:!1,internalType:"uint8[3]",name:"types",type:"uint8[3]"}],name:"BoxOpened",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"contractAddress",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"TokenMinted",type:"event"},{inputs:[],name:"TYPE_CHIP",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"TYPE_EQUIP",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"TYPE_HERO",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"TYPE_NONE",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"box",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"checkSigner",outputs:[],stateMutability:"pure",type:"function",constant:!0},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes32",name:"structHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"checkSigner712",outputs:[],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"chip",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"equip",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"executor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"hero",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"usedSignatures",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address[4]",name:"_erc721s",type:"address[4]"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"updateExecutor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mintBoxTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"boxId",type:"uint256"},{internalType:"uint256[3]",name:"ids",type:"uint256[3]"},{internalType:"uint256",name:"saltNonce",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"openBox",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_boxId",type:"uint256"},{internalType:"uint256",name:"_firstToken",type:"uint256"},{internalType:"uint256",name:"_secondToken",type:"uint256"},{internalType:"uint256",name:"_thirdToken",type:"uint256"},{internalType:"uint256",name:"_saltNonce",type:"uint256"}],name:"getMessageHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function",constant:!0}],t.ACTIVATE_PROXY_ABI=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"nftOld",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nftNew",type:"uint256"},{indexed:!1,internalType:"uint256",name:"nftType",type:"uint256"}],name:"LogNFTActivate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[],name:"TYPE_CHIP",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"TYPE_EQUIP",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"TYPE_HERO",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"TYPE_NONE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"checkSigner",outputs:[],stateMutability:"pure",type:"function",constant:!0},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"bytes32",name:"structHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"checkSigner712",outputs:[],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"chip",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"equip",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"executor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"hero",outputs:[{internalType:"contract IMintableERC721",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"usedSignatures",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address[3]",name:"_erc721s",type:"address[3]"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"updateExecutor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"nftOld",type:"uint256"},{internalType:"uint256",name:"nftNew",type:"uint256"},{internalType:"uint256",name:"nftType",type:"uint256"},{internalType:"uint256",name:"saltNonce",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"activateOne",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"uint256",name:"_nftOld",type:"uint256"},{internalType:"uint256",name:"_nftNew",type:"uint256"},{internalType:"uint256",name:"_nftType",type:"uint256"},{internalType:"uint256",name:"_saltNonce",type:"uint256"}],name:"getMessageHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function",constant:!0}]},22002:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.singleton=t.SINGLETON_KEY=void 0,t.SINGLETON_KEY=Symbol(),t.singleton=function(e){return new Proxy(e,{construct:function(e,r,n){return e.prototype!==n.prototype?Reflect.construct(e,r,n):(e[t.SINGLETON_KEY]||(e[t.SINGLETON_KEY]=Reflect.construct(e,r,n)),e[t.SINGLETON_KEY])}})}},991:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var a=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__decorate||function(e,t,r,a){var i,o=arguments.length,c=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,a);else for(var f=e.length-1;f>=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JCChain=void 0;var f=c(r(68947)),d=r(22002),s=r(28995),u=function(){function e(){this.chainManager=new f.default}return e.prototype.login=function(){return this.chainManager.login()},e.prototype.selectWalletAndLogin=function(e){return this.chainManager.bc.walletType=e,this.chainManager.login()},e.prototype.logout=function(){return this.chainManager.logout()},Object.defineProperty(e.prototype,"logined",{get:function(){return!!s.UserModule.token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return s.UserModule.token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"account",{get:function(){return s.UserModule.accountId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chainId",{get:function(){return s.UserModule.chainId},enumerable:!1,configurable:!0}),i([d.singleton],e)}();t.JCChain=u,o(r(44325),t),o(r(62186),t),o(r(93907),t)},28995:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var a=this&&this.__decorate||function(e,t,r,a){var i,o=arguments.length,c=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,a);else for(var f=e.length-1;f>=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WALLET_CSS=void 0,t.WALLET_CSS="\n.chain-modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n margin: 0;\n z-index: 10;\n display: none;\n}\n\n.chain-modal .modal-bg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n margin: 0;\n background-color: #000000a3;\n}\n\n.chain-modal .modal-content {\n width: 500px;\n height: auto;\n position: relative;\n top: 100px;\n right: 0;\n bottom: 0;\n left: 0;\n margin: auto;\n display: flex;\n flex-direction: column;\n}\n\n.chain-modal .modal-content.mobile {\n width: 100vw;\n}\n\n.chain-modal .modal-content .modal-title {\n background-color: white;\n color: black;\n border-radius: 12px 12px 0 0;\n padding: 15px 20px;\n border-bottom: 1px solid rgba(195, 195, 195, 0.14);\n}\n\n.chain-modal .modal-content .chain-modal-card {\n background-color: white;\n transition: background-color 0.2s ease-in-out 0s;\n display: flex;\n flex-direction: column;\n -webkit-box-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n align-items: center;\n padding: 16px 16px;\n text-align: center;\n cursor: pointer;\n}\n\n.chain-modal .modal-content .chain-modal-card:first-child {\n border-radius: 12px 12px 0 0;\n}\n\n.chain-modal .modal-content .chain-modal-card:not(:first-child) {\n border-top: 1px solid rgba(195, 195, 195, 0.14);\n}\n\n.chain-modal .modal-content .chain-modal-card:last-child {\n border-radius: 0 0 12px 12px;\n}\n\n.chain-modal .modal-content .chain-modal-card .icon {\n width: 45px;\n height: 45px;\n display: flex;\n border-radius: 50%;\n overflow: visible;\n box-shadow: none;\n -webkit-box-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n align-items: center;\n}\n\n.chain-modal .modal-content .chain-modal-card .icon img {\n width: 100%;\n height: 100%;\n}\n\n.chain-modal .modal-content .chain-modal-card .icon .icon-svg {\n width: 100%;\n height: 100%;\n fill: currentColor;\n color: unset;\n stroke: none;\n}\n\n.chain-modal .modal-content .chain-modal-card .name {\n width: 100%;\n font-size: 24px;\n font-weight: 700;\n margin-top: 0.5em;\n color: #0c0c0d;\n}\n\n.chain-modal .modal-content .chain-modal-card .desc {\n width: 100%;\n font-size: 18px;\n margin: 0.333em 0px;\n color: #a9a9bc;\n}\n"},37868:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var a=this&&this.__decorate||function(e,t,r,a){var i,o=arguments.length,c=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,a);else for(var f=e.length-1;f>=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletModal=void 0;var f,d=r(82265),s=r(22002),u=r(47347),b=r(72784),h=function(e){var t=document.createElement("div");t.className="chain-modal-card";var r=document.createElement("div");r.className="icon";var n=document.createElement("img");n.src=e.logo,n.alt=e.name,r.appendChild(n),t.appendChild(r);var a=document.createElement("div");a.className="name",a.innerText=e.name,t.appendChild(a);var i=document.createElement("div");return i.className="desc",i.innerText=e.desc,t.appendChild(i),t};!function(e){e[e.WALL_LIST=0]="WALL_LIST",e[e.QR=1]="QR",e[e.CHAIN_LIST=2]="CHAIN_LIST"}(f||(f={}));var l=function(){function e(){}return e.prototype.selectWallet=function(){return i(this,void 0,void 0,(function(){return o(this,(function(e){return this.deferred=new u.Deferred,this.show(f.WALL_LIST),this.appendWalletList(),[2,this.deferred.promise]}))}))},e.prototype.showQr=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this.deferred=new u.Deferred,this.show(f.QR),this.appendQrImg(e),[2,this.deferred.promise]}))}))},e.prototype.show=function(e){this.modal=document.getElementById("wallet_modal"),this.modal||(this.appendStyle(),this.appendContainerHtml(),this.modal=document.getElementById("wallet_modal")),this.modalContent.innerHTML="",this.modal.style.display="block"},e.prototype.cancelSelect=function(){this.deferred.reject("cancel select wallet"),this.hide()},e.prototype.hide=function(){console.log("close modal"),this.modal&&(this.modal.style.display="none")},e.prototype.toWallet=function(e){console.log(e),this.hide(),this.deferred.resolve(e.id)},e.prototype.appendStyle=function(){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.innerHTML=b.WALLET_CSS,e.appendChild(t)},e.prototype.appendContainerHtml=function(){var e=document.createElement("div");e.id="wallet_modal",e.className="chain-modal";var t=document.createElement("div");t.className="modal-bg",t.addEventListener("click",this.cancelSelect.bind(this)),e.appendChild(t);var r=document.createElement("div");r.className="modal-content",e.appendChild(r),document.body.appendChild(e),this.modalContent=r},e.prototype.appendWalletList=function(){var e,t,r=document.createElement("div");r.className="modal-title",r.innerText="You need to connect to supported network",this.modalContent.appendChild(r);try{for(var n=c(d.ALL_PROVIDERS),a=n.next();!a.done;a=n.next()){var i=a.value,o=h(i);o.addEventListener("click",this.toWallet.bind(this,i)),this.modalContent.appendChild(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.appendQrImg=function(e){var t=document.createElement("div");t.className="modal-title",t.innerText="Scan QR with your game client.",this.modalContent.appendChild(t);var r=document.createElement("div");r.innerHTML=e,this.modalContent.appendChild(r)},a([s.singleton],e)}();t.WalletModal=l},93907:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=void 0,t.isMobile=function(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(navigator.userAgent.substr(0,4))&&!function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}())}},62186:(e,t)=>{"use strict";function r(e){return window.ethereum?window.ethereum[e]:window.web3&&window.web3.currentProvider&&window.web3.currentProvider[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.toHexChainId=t.formatPrice=t.parsePrice=t.hasMetamask=t.verifyInjectedProvider=void 0,t.verifyInjectedProvider=r,t.hasMetamask=function(){return!(!window.ethereum&&!window.web3)&&r("isMetaMask")},t.parsePrice=function(e,t){return e+new Array(19-t).join("0")},t.formatPrice=function(e,t,r){if(void 0===r&&(r=2),!t)return e;var n=e+"",a=n.length;if(n=n.padStart(t,"0"),t>=a)n="0."+n;else{var i=a-t;n=n.slice(0,i)+"."+n.slice(i)}return(n=n.slice(0,n.lastIndexOf(".")+r+1)).replace(/0+$/,"").replace(/\.+$/,"")},t.toHexChainId=function(e){return"0x"+e.toString(16)}},97408:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.removeItem=t.setItem=t.getItem=t.removeToken=t.setToken=t.getToken=t.generateDomain=t.setMini=t.getMini=t.setSize=t.getSize=t.setLanguage=t.getLanguage=void 0;var a=n(r(71614)),i="language";t.getLanguage=function(){return a.default.get(i)},t.setLanguage=function(e){return a.default.set(i,e)};var o="size";t.getSize=function(){return a.default.get(o)},t.setSize=function(e){return a.default.set(o,e)};var c="mini";t.getMini=function(){return a.default.get(c)},t.setMini=function(e){return a.default.set(c,e)};var f="vue_typescript_access_token";t.generateDomain=function(){var e=location.host,t=e.split(".");return e.length>1&&(e=t.slice(t.length-2).join(".")),e},t.getToken=function(){return a.default.get(f)},t.setToken=function(e){var r=t.generateDomain();a.default.set(f,e,{domain:r})},t.removeToken=function(){return a.default.remove(f,{domain:t.generateDomain()})},t.getItem=function(e){return a.default.get(e)},t.setItem=function(e,r){var n=t.generateDomain();a.default.set(e,r,{domain:n})},t.removeItem=function(e){return a.default.remove(e,{domain:t.generateDomain()})}},78912:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateId=t.md5Hash=void 0;var a=n(r(7525)),i=r(75789);function o(e){return(new a.default).update(e).digest("hex")}t.md5Hash=o,t.generateId=function(){return o(i.v4())}},44325:function(e,t){"use strict";var r,n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeJWT=t.keyValToObject=t.generateKVStr=t.findUrlScheme=t.RE_URL_SCHEME=void 0,t.RE_URL_SCHEME=/^(.+?):\/\/.+?$/,t.findUrlScheme=function(e){var r=e.match(t.RE_URL_SCHEME);return r?r[1]:""},t.generateKVStr=function(e){var t,n,a=e.data,i=void 0===a?{}:a,o=e.sort,c=void 0!==o&&o,f=e.ignoreNull,d=void 0===f||f,s=e.splitChar,u=void 0===s?"&":s,b=e.equalChar,h=void 0===b?"=":b,l=e.url,p=void 0===l?"":l,x=Object.keys(i);c&&x.sort();var m="",y=0;try{for(var v=r(x),g=v.next();!g.done;g=v.next()){var w=g.value;d&&!i[w]||(y++>0&&(m+=u),m+=""+w+h+i[w])}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}if(p){var M=-1===p.search(/\?/)?"?":"&";m=m?p+M+m:p}return m},t.keyValToObject=function(e,t,n){var a,i;void 0===t&&(t="&"),void 0===n&&(n="=");var o={};if(!e)return o;var c=e.split(t);try{for(var f=r(c),d=f.next();!d.done;d=f.next()){var s=d.value.split(n);o[s[0]]=s[1]}}catch(e){a={error:e}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(a)throw a.error}}return o},t.decodeJWT=function(e){var t=e.split(".");return JSON.parse(decodeURIComponent(encodeURIComponent(window.atob(t[1].replace(/-/g,"+").replace(/_/g,"/")))))}},47347:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=0?(i.UserModule.token&&(r.token=i.UserModule.encodeToken),i.UserModule.accountId&&(r.account=i.UserModule.accountId),i.UserModule.chainId&&(r.net_id=i.UserModule.chainId)):((n=new Headers).append("Content-Type","application/json"),i.UserModule.walletToken&&n.append("Authorization","Bearer "+i.UserModule.walletToken),e.headers=n),Object.assign(r,d),"GET"==f?t=o.generateKVStr({url:t,data:r}):e.body=JSON.stringify(r),[4,fetch(t,e)];case 1:if(200!==(s=a.sent()).status)throw new Error("HTTP error! Status: "+s.status);return[4,s.json()];case 2:if((u=a.sent()).errcode)throw new Error(u.errmsg||"Error");return[2,u]}}))}))}},27683:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var a=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__decorate||function(e,t,r,a){var i,o=arguments.length,c=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,a);else for(var f=e.length-1;f>=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return i(t,e),t},f=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},d=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=0&&(o=n.split("|"),n=o[0],i=parseInt(o[1])),c=x.wdecrypt(this.tmpWallet.mk,this.tmpWallet.key0,this.tmpWallet.key1,this.tmpWallet.key2,n),f={key:c,index:i,token:a},localStorage.setItem(g.LOCAL_WALLET_KEY,JSON.stringify(f)),this.localRemoteWalletInfo(c,i),[2]}}))}))},e.prototype.localRemoteWalletInfo=function(e,t){return f(this,void 0,void 0,(function(){var r,n,a,i,o,c,f;return d(this,(function(d){switch(d.label){case 0:return[4,u.getWalletInfo()];case 1:return r=d.sent().data,n=r.oid+r.is+r.salt,a=b.md5Hash(n),i=r.key,o=0===t?e:void 0,c=1===t?e:void 0,f=x.wget_address(a,i,o,c),this.localWallet={mk:a,key0:i,key1:o,key2:c,address:f},(new m.WalletModal).hide(),console.log("local wallet: ",this.localWallet),this.generateProvider(),[2]}}))}))},e.prototype.generateProvider=function(){var e=this;this.chainId=this.chainId||w.AVAILABLE_CHAINS[0];var t=M.AllChains.find((function(t){return t.id===e.chainId}));if(t){var r=t.rpc,n=new v.HttpRetryProvider([r]);this.deferred.resolve(n)}},e.prototype.registClient=function(){return f(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return[4,u.registBridgeClient({clientId:this.clientId})];case 1:return e=t.sent().data,console.log(e),this.webtoken=e.token,console.log("receive tmp webtoken: ",this.webtoken),[2]}}))}))},e.prototype.loadClientWalletInfo=function(){var e=this;return new Promise((function(t,r){var n=setInterval((function(){return f(this,void 0,void 0,(function(){var a;return d(this,(function(i){switch(i.label){case 0:return[4,u.queryQrStatus({clientId:e.clientId,webtoken:e.webtoken})];case 1:return 0!==(a=i.sent().data).status?(clearInterval(n),1===a.status?(console.log("login success:: token: "+a.token+", key: "+a.key),t&&t({key:a.key,token:a.token})):-1===a.status&&r&&r("login info expired")):console.log(a),[2]}}))}))}),5e3)}))},o([p.singleton],e)}();t.NativeWallet=k},95847:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.chains=t._getInitializedChains=void 0;var i=a(r(87295)),o=a(r(31227)),c=a(r(40439)),f=a(r(37098)),d=a(r(17687)),s=a(r(49422));function u(e){var t,r,a={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli",11155111:"sepolia"},u={mainnet:i.default,ropsten:o.default,rinkeby:c.default,kovan:f.default,goerli:d.default,sepolia:s.default};if(e)try{for(var b=n(e),h=b.next();!h.done;h=b.next()){var l=h.value,p=l.name;a[l.chainId.toString()]=p,u[p]=l}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}return u.names=a,u}t._getInitializedChains=u,t.chains=u()},22074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1153:r(96561),1559:r(77523),2315:r(83339),2537:r(26769),2565:r(17897),2718:r(62170),2929:r(88436),2930:r(96213),3198:r(25491),3529:r(20070),3540:r(52256),3541:r(21871),3554:r(47225),3607:r(3968),3651:r(29496),3670:r(74290),3675:r(98571),3855:r(64551),3860:r(94300),4345:r(74818),4399:r(68372),5133:r(4759)}},44708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",r(60114)],["homestead",r(62800)],["dao",r(7197)],["tangerineWhistle",r(22302)],["spuriousDragon",r(90716)],["byzantium",r(26985)],["constantinople",r(35993)],["petersburg",r(4064)],["istanbul",r(83166)],["muirGlacier",r(42946)],["berlin",r(20015)],["london",r(61250)],["shanghai",r(5553)],["arrowGlacier",r(51971)],["grayGlacier",r(31088)],["mergeForkIdTransition",r(49347)],["merge",r(88648)]]},42721:function(e,t,r){"use strict";var n=r(22236).Buffer;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=this&&this.__assign||function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=t.CustomChain=void 0;var d,s,u,b,h,l=r(54575),p=r(81057),x=r(51295),m=r(95847),y=r(44708),v=r(22074);!function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"}(d=t.CustomChain||(t.CustomChain={})),(h=t.Chain||(t.Chain={}))[h.Mainnet=1]="Mainnet",h[h.Ropsten=3]="Ropsten",h[h.Rinkeby=4]="Rinkeby",h[h.Kovan=42]="Kovan",h[h.Goerli=5]="Goerli",h[h.Sepolia=11155111]="Sepolia",function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai"}(s=t.Hardfork||(t.Hardfork={})),(b=t.ConsensusType||(t.ConsensusType={})).ProofOfStake="pos",b.ProofOfWork="pow",b.ProofOfAuthority="poa",(u=t.ConsensusAlgorithm||(t.ConsensusAlgorithm={})).Ethash="ethash",u.Clique="clique",u.Casper="casper";var g=function(e){function t(t){var r,n,a,i,o=this;(o=e.call(this)||this)._supportedHardforks=[],o._eips=[],o._customChains=null!==(a=t.customChains)&&void 0!==a?a:[],o._chainParams=o.setChain(t.chain),o.DEFAULT_HARDFORK=null!==(i=o._chainParams.defaultHardfork)&&void 0!==i?i:s.Istanbul;try{for(var c=f(o._chainParams.hardforks),d=c.next();!d.done;d=c.next()){var u=d.value;u.forkHash||(u.forkHash=o._calcForkHash(u.name))}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return o._hardfork=o.DEFAULT_HARDFORK,t.supportedHardforks&&(o._supportedHardforks=t.supportedHardforks),t.hardfork&&o.setHardfork(t.hardfork),t.eips&&o.setEIPs(t.eips),o}return o(t,e),t.custom=function(e,r){var n;void 0===r&&(r={});var a=null!==(n=r.baseChain)&&void 0!==n?n:"mainnet",i=c({},t._getChainParams(a));if(i.name="custom-chain","string"!=typeof e)return new t(c({chain:c(c({},i),e)},r));if(e===d.PolygonMainnet)return t.custom({name:d.PolygonMainnet,chainId:137,networkId:137},r);if(e===d.PolygonMumbai)return t.custom({name:d.PolygonMumbai,chainId:80001,networkId:80001},r);if(e===d.ArbitrumRinkebyTestnet)return t.custom({name:d.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},r);if(e===d.xDaiChain)return t.custom({name:d.xDaiChain,chainId:100,networkId:100},r);if(e===d.OptimisticKovan)return t.custom({name:d.OptimisticKovan,chainId:69,networkId:69},c({hardfork:s.Berlin},r));if(e===d.OptimisticEthereum)return t.custom({name:d.OptimisticEthereum,chainId:10,networkId:10},c({hardfork:s.Berlin},r));throw new Error("Custom chain ".concat(e," not supported"))},t.forCustomChain=function(e,r,n,a){var i=t._getChainParams(e);return new t({chain:c(c({},i),r),hardfork:n,supportedHardforks:a})},t.isSupportedChainId=function(e){var t=(0,m._getInitializedChains)();return Boolean(t.names[e.toString()])},t._getChainParams=function(e,t){var r=(0,m._getInitializedChains)(t);if("number"==typeof e||x.BN.isBN(e)){if(e=e.toString(),r.names[e])return r[r.names[e]];throw new Error("Chain with ID ".concat(e," not supported"))}if(r[e])return r[e];throw new Error("Chain with name ".concat(e," not supported"))},t.prototype.setChain=function(e){var r,n;if("number"==typeof e||"string"==typeof e||x.BN.isBN(e)){var i;i=this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0])?this._customChains.map((function(e){return e[0]})):this._customChains,this._chainParams=t._getChainParams(e,i)}else{if("object"!==a(e))throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");try{for(var o=f(["networkId","genesis","hardforks","bootstrapNodes"]),c=o.next();!c.done;c=o.next()){var d=c.value;if(void 0===e[d])throw new Error("Missing required chain parameter: ".concat(d))}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}this._chainParams=e}return this._chainParams},t.prototype.setHardfork=function(e){var t,r;if(!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"));var n=!1;try{for(var a=f(y.hardforks),i=a.next();!i.done;i=a.next())i.value[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),n=!0)}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}if(!n)throw new Error("Hardfork with name ".concat(e," not supported"))},t.prototype.getHardforkByBlockNumber=function(e,t){var r,n;e=(0,x.toType)(e,x.TypeOutput.BN),t=(0,x.toType)(t,x.TypeOutput.BN);var a,i,o,c=s.Chainstart;try{for(var d=f(this.hardforks()),u=d.next();!u.done;u=d.next()){var b=u.value;if(null!==b.block)e.gte(new x.BN(b.block))&&(c=b.name),t&&b.td&&(t.gte(new x.BN(b.td))?a=b.name:i=o),o=b.name;else if(null!=t&&void 0!==b.td&&null!==b.td&&t.gte(new x.BN(b.td)))return b.name}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}if(t){var h="block number: ".concat(e," (-> ").concat(c,"), ");if(a&&!this.hardforkGteHardfork(c,a)){var l="HF determined by block number is lower than the minimum total difficulty HF";throw h+="total difficulty: ".concat(t," (-> ").concat(a,")"),new Error("".concat(l,": ").concat(h))}if(i&&!this.hardforkGteHardfork(i,c))throw l="Maximum HF determined by total difficulty is lower than the block number HF",h+="total difficulty: ".concat(t," (-> ").concat(i,")"),new Error("".concat(l,": ").concat(h))}return c},t.prototype.setHardforkByBlockNumber=function(e,t){var r=this.getHardforkByBlockNumber(e,t);return this.setHardfork(r),r},t.prototype._chooseHardfork=function(e,t){if(void 0===t&&(t=!0),e){if(t&&!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"))}else e=this._hardfork;return e},t.prototype._getHardfork=function(e){var t,r,n=this.hardforks();try{for(var a=f(n),i=a.next();!i.done;i=a.next()){var o=i.value;if(o.name===e)return o}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}throw new Error("Hardfork ".concat(e," not defined for chain ").concat(this.chainName()))},t.prototype._isSupportedHardfork=function(e){var t,r;if(!(this._supportedHardforks.length>0))return!0;try{for(var n=f(this._supportedHardforks),a=n.next();!a.done;a=n.next())if(e===a.value)return!0}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},t.prototype.setEIPs=function(e){var t,r,n=this;void 0===e&&(e=[]);var a=function(t){if(!(t in v.EIPs))throw new Error("".concat(t," not supported"));var r=i.gteHardfork(v.EIPs[t].minimumHardfork);if(!r)throw new Error("".concat(t," cannot be activated on hardfork ").concat(i.hardfork(),", minimumHardfork: ").concat(r));v.EIPs[t].requiredEIPs&&v.EIPs[t].requiredEIPs.forEach((function(r){if(!e.includes(r)&&!n.isActivatedEIP(r))throw new Error("".concat(t," requires EIP ").concat(r,", but is not included in the EIP list"))}))},i=this;try{for(var o=f(e),c=o.next();!c.done;c=o.next())a(c.value)}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this._eips=e},t.prototype.param=function(e,t){var r,n,a=null;try{for(var i=f(this._eips),o=i.next();!o.done;o=i.next()){var c=o.value;if(null!==(a=this.paramByEIP(e,t,c)))return a}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return this.paramByHardfork(e,t,this._hardfork)},t.prototype.paramByHardfork=function(e,t,r){var n,a,i,o;r=this._chooseHardfork(r);var c=null;try{for(var d=f(y.hardforks),s=d.next();!s.done;s=d.next()){var u=s.value;if("eips"in u[1]){var b=u[1].eips;try{for(var h=(i=void 0,f(b)),l=h.next();!l.done;l=h.next()){var p=l.value,x=this.paramByEIP(e,t,p);c=null!==x?x:c}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}else{if(!u[1][e])throw new Error("Topic ".concat(e," not defined"));void 0!==u[1][e][t]&&(c=u[1][e][t].v)}if(u[0]===r)break}}catch(e){n={error:e}}finally{try{s&&!s.done&&(a=d.return)&&a.call(d)}finally{if(n)throw n.error}}return c},t.prototype.paramByEIP=function(e,t,r){if(!(r in v.EIPs))throw new Error("".concat(r," not supported"));var n=v.EIPs[r];if(!(e in n))throw new Error("Topic ".concat(e," not defined"));return void 0===n[e][t]?null:n[e][t].v},t.prototype.paramByBlock=function(e,t,r){var n=this.activeHardforks(r),a=n[n.length-1].name;return this.paramByHardfork(e,t,a)},t.prototype.isActivatedEIP=function(e){var t,r;if(this.eips().includes(e))return!0;try{for(var n=f(y.hardforks),a=n.next();!a.done;a=n.next()){var i=a.value[1];if(this.gteHardfork(i.name)&&"eips"in i&&i.eips.includes(e))return!0}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},t.prototype.hardforkIsActiveOnBlock=function(e,t,r){var n;void 0===r&&(r={}),t=(0,x.toType)(t,x.TypeOutput.BN);var a=null!==(n=r.onlySupported)&&void 0!==n&&n;e=this._chooseHardfork(e,a);var i=this.hardforkBlockBN(e);return!(!i||!t.gte(i))},t.prototype.activeOnBlock=function(e,t){return this.hardforkIsActiveOnBlock(null,e,t)},t.prototype.hardforkGteHardfork=function(e,t,r){var n,a;void 0===r&&(r={});var i,o=void 0!==r.onlyActive&&r.onlyActive;e=this._chooseHardfork(e,r.onlySupported),i=o?this.activeHardforks(null,r):this.hardforks();var c=-1,d=-1,s=0;try{for(var u=f(i),b=u.next();!b.done;b=u.next()){var h=b.value;h.name===e&&(c=s),h.name===t&&(d=s),s+=1}}catch(e){n={error:e}}finally{try{b&&!b.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}return c>=d&&-1!==d},t.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},t.prototype.hardforkIsActiveOnChain=function(e,t){var r,n,a;void 0===t&&(t={});var i=null!==(a=t.onlySupported)&&void 0!==a&&a;e=this._chooseHardfork(e,i);try{for(var o=f(this.hardforks()),c=o.next();!c.done;c=o.next()){var d=c.value;if(d.name===e&&null!==d.block)return!0}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},t.prototype.activeHardforks=function(e,t){var r,n;void 0===t&&(t={});var a=[],i=this.hardforks();try{for(var o=f(i),c=o.next();!c.done;c=o.next()){var d=c.value;if(null!==d.block){if(null!=e&&e0)return r[r.length-1].name;throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return(0,x.toType)(t,x.TypeOutput.Number)},t.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).block;return null==t?null:new x.BN(t)},t.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).td;return null==t?null:new x.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0,x.toType)(e,x.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.hardforkBlockBN(t);return!!r&&r.eq(e)},t.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return(0,x.toType)(t,x.TypeOutput.Number)},t.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);return null===t?null:this.hardforks().reduce((function(e,r){var n=new x.BN(r.block);return n.gt(t)&&null===e?n:e}),null)},t.prototype.isNextHardforkBlock=function(e,t){e=(0,x.toType)(e,x.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.nextHardforkBlockBN(t);return null!==r&&r.eq(e)},t.prototype._calcForkHash=function(e){var t,r,a=n.from(this.genesis().hash.substr(2),"hex"),i=n.alloc(0),o=0;try{for(var c=f(this.hardforks()),d=c.next();!d.done;d=c.next()){var s=d.value,u=s.block;if(0!==u&&null!==u&&u!==o){var b=n.from(u.toString(16).padStart(16,"0"),"hex");i=n.concat([i,b])}if(s.name===e)break;null!==u&&(o=u)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}var h=n.concat([a,i]),l=(0,x.intToBuffer)((0,p.buf)(h)>>>0).toString("hex");return"0x".concat(l)},t.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t.block&&void 0===t.td)throw new Error("No fork hash calculation possible for future hardfork");return void 0!==t.forkHash?t.forkHash:this._calcForkHash(e)},t.prototype.hardforkForForkHash=function(e){var t=this.hardforks().filter((function(t){return t.forkHash===e}));return t.length>=1?t[t.length-1]:null},t.prototype.genesis=function(){return this._chainParams.genesis},t.prototype.genesisState=function(){var e,t;switch(this.chainName()){case"mainnet":return r(31617);case"ropsten":return r(53712);case"rinkeby":return r(3023);case"kovan":return r(28777);case"goerli":return r(15382);case"sepolia":return r(81847)}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var n=f(this._customChains),a=n.next();!a.done;a=n.next()){var i=a.value;if(i[0].name===this.chainName())return i[1]}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return{}},t.prototype.hardforks=function(){return this._chainParams.hardforks},t.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},t.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},t.prototype.hardfork=function(){return this._hardfork},t.prototype.chainId=function(){return(0,x.toType)(this.chainIdBN(),x.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new x.BN(this._chainParams.chainId)},t.prototype.chainName=function(){return this._chainParams.name},t.prototype.networkId=function(){return(0,x.toType)(this.networkIdBN(),x.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new x.BN(this._chainParams.networkId)},t.prototype.eips=function(){return this._eips},t.prototype.consensusType=function(){var e,t,r,n=this.hardfork();try{for(var a=f(y.hardforks),i=a.next();!i.done;i=a.next()){var o=i.value;if("consensus"in o[1]&&(r=o[1].consensus.type),o[0]===n)break}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r||this._chainParams.consensus.type},t.prototype.consensusAlgorithm=function(){var e,t,r,n=this.hardfork();try{for(var a=f(y.hardforks),i=a.next();!i.done;i=a.next()){var o=i.value;if("consensus"in o[1]&&(r=o[1].consensus.algorithm),o[0]===n)break}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r||this._chainParams.consensus.algorithm},t.prototype.consensusConfig=function(){var e,t,r,n=this.hardfork();try{for(var a=f(y.hardforks),i=a.next();!i.done;i=a.next()){var o=i.value;if("consensus"in o[1]&&(r=o[1].consensus[o[1].consensus.algorithm]),o[0]===n)break}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(r)return r;var c=this.consensusAlgorithm();return this._chainParams.consensus[c]},t.prototype.copy=function(){var e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e},t}(l.EventEmitter);t.default=g},12766:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}!function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===n(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(62859).Buffer}catch(e){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===n(e))return this._initArray(e,t,r);"hex"===t&&(t=16),a(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&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)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}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"],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],p=[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 x(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,x=0|o[2],m=8191&x,y=x>>>13,v=0|o[3],g=8191&v,w=v>>>13,M=0|o[4],_=8191&M,k=M>>>13,S=0|o[5],A=8191&S,E=S>>>13,T=0|o[6],O=8191&T,I=T>>>13,P=0|o[7],j=8191&P,L=P>>>13,N=0|o[8],B=8191&N,C=N>>>13,R=0|o[9],U=8191&R,D=R>>>13,z=0|c[0],F=8191&z,H=z>>>13,q=0|c[1],K=8191&q,G=q>>>13,Z=0|c[2],W=8191&Z,V=Z>>>13,Y=0|c[3],J=8191&Y,X=Y>>>13,Q=0|c[4],$=8191&Q,ee=Q>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var xe=(d+(n=Math.imul(u,F))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,F)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(l,F),a=(a=Math.imul(l,H))+Math.imul(p,F)|0,i=Math.imul(p,H);var me=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),a=(a=Math.imul(m,H))+Math.imul(y,F)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,W)|0)|0)+((8191&(a=(a=a+Math.imul(u,V)|0)+Math.imul(b,W)|0))<<13)|0;d=((i=i+Math.imul(b,V)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,F),a=(a=Math.imul(g,H))+Math.imul(w,F)|0,i=Math.imul(w,H),n=n+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,W)|0,a=(a=a+Math.imul(l,V)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,V)|0;var ve=(d+(n=n+Math.imul(u,J)|0)|0)+((8191&(a=(a=a+Math.imul(u,X)|0)+Math.imul(b,J)|0))<<13)|0;d=((i=i+Math.imul(b,X)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,F),a=(a=Math.imul(_,H))+Math.imul(k,F)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,V)|0,n=n+Math.imul(l,J)|0,a=(a=a+Math.imul(l,X)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,X)|0;var ge=(d+(n=n+Math.imul(u,$)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,$)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,F),a=(a=Math.imul(A,H))+Math.imul(E,F)|0,i=Math.imul(E,H),n=n+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,W)|0,a=(a=a+Math.imul(g,V)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,V)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(l,$)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,F),a=(a=Math.imul(O,H))+Math.imul(I,F)|0,i=Math.imul(I,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(_,W)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,V)|0,n=n+Math.imul(g,J)|0,a=(a=a+Math.imul(g,X)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,X)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,F),a=(a=Math.imul(j,H))+Math.imul(L,F)|0,i=Math.imul(L,H),n=n+Math.imul(O,K)|0,a=(a=a+Math.imul(O,G)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,G)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,V)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,V)|0,n=n+Math.imul(_,J)|0,a=(a=a+Math.imul(_,X)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(g,$)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,a=(a=a+Math.imul(m,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var _e=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,F),a=(a=Math.imul(B,H))+Math.imul(C,F)|0,i=Math.imul(C,H),n=n+Math.imul(j,K)|0,a=(a=a+Math.imul(j,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(O,W)|0,a=(a=a+Math.imul(O,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(_,$)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,F),a=(a=Math.imul(U,H))+Math.imul(D,F)|0,i=Math.imul(D,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(j,W)|0,a=(a=a+Math.imul(j,V)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,V)|0,n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(I,J)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(A,$)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(m,fe)|0,a=(a=a+Math.imul(m,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(D,K)|0,i=Math.imul(D,G),n=n+Math.imul(B,W)|0,a=(a=a+Math.imul(B,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,n=n+Math.imul(j,J)|0,a=(a=a+Math.imul(j,X)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,W),a=(a=Math.imul(U,V))+Math.imul(D,W)|0,i=Math.imul(D,V),n=n+Math.imul(B,J)|0,a=(a=a+Math.imul(B,X)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(j,$)|0,a=(a=a+Math.imul(j,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(_,fe)|0,a=(a=a+Math.imul(_,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(m,le)|0)|0)+((8191&(a=(a=a+Math.imul(m,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,J),a=(a=Math.imul(U,X))+Math.imul(D,J)|0,i=Math.imul(D,X),n=n+Math.imul(B,$)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,a=(a=a+Math.imul(j,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Te=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,$),a=(a=Math.imul(U,ee))+Math.imul(D,$)|0,i=Math.imul(D,ee),n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(j,ie)|0,a=(a=a+Math.imul(j,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(O,fe)|0,a=(a=a+Math.imul(O,de)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Oe=(d+(n=n+Math.imul(_,le)|0)|0)+((8191&(a=(a=a+Math.imul(_,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,n=n+Math.imul(j,fe)|0,a=(a=a+Math.imul(j,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(O,ue)|0,a=(a=a+Math.imul(O,be)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0;var Ie=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(D,ie)|0,i=Math.imul(D,oe),n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,de)|0,n=n+Math.imul(j,ue)|0,a=(a=a+Math.imul(j,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Pe=(d+(n=n+Math.imul(O,le)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(I,le)|0))<<13)|0;d=((i=i+Math.imul(I,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(D,fe)|0,i=Math.imul(D,de),n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,be)|0;var je=(d+(n=n+Math.imul(j,le)|0)|0)+((8191&(a=(a=a+Math.imul(j,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(D,ue)|0,i=Math.imul(D,be);var Le=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(C,le)|0))<<13)|0;d=((i=i+Math.imul(C,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ne=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(D,le)|0))<<13)|0;return d=((i=Math.imul(D,pe))+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,f[0]=xe,f[1]=me,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=Me,f[7]=_e,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Te,f[13]=Oe,f[14]=Ie,f[15]=Pe,f[16]=je,f[17]=Le,f[18]=Ne,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(m=x),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?x(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!=(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){E.call(this,e),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)}M.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(_,M),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,x=0;0!==p.cmp(c);x++)p=p.redSqr();a(x=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4==++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,E),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},4958:function(e,t,r){"use strict";var n=r(22236).Buffer,a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var o=i(r(62899)),c=r(65151),f=r(53897),d=r(75150),s=r(34197),u=r(1686),b=r(64119),h=r(15787),l=r(55063),p=function(){function e(e,t,r,n){void 0===e&&(e=new c.BN(0)),void 0===t&&(t=new c.BN(0)),void 0===r&&(r=s.KECCAK256_RLP),void 0===n&&(n=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,a=t.stateRoot,i=t.codeHash;return new e(r?new c.BN((0,u.toBuffer)(r)):void 0,n?new c.BN((0,u.toBuffer)(n)):void 0,a?(0,u.toBuffer)(a):void 0,i?(0,u.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=c.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=a(t,4),n=r[0],i=r[1],o=r[2],f=r[3];return new e(new c.BN(n),new c.BN(i),o,f)},e.prototype._validate=function(){if(this.nonce.lt(new c.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new c.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return c.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(s.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(s.KECCAK256_NULL)},e}();t.Account=p,t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e);var r=(0,d.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,l.toType)(t,l.TypeOutput.BN).toString()+"0x");for(var a=(0,b.keccakFromString)(n+r).toString("hex"),i="0x",o=0;o=8?i+=r[o].toUpperCase():i+=r[o];return i},t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e},t.generateAddress=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new c.BN(t);return r.isZero()?(0,b.rlphash)([e,null]).slice(-20):(0,b.rlphash)([e,n.from(r.toArray())]).slice(-20)},t.generateAddress2=function(e,t,r){return(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,o.default)(20===e.length),(0,o.default)(32===t.length),(0,b.keccak256)(n.concat([n.from("ff","hex"),e,t,(0,b.keccak256)(r)])).slice(-20)},t.isValidPrivate=function(e){return(0,f.privateKeyVerify)(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,f.publicKeyVerify)(n.concat([n.from([4]),e])):!!t&&(0,f.publicKeyVerify)(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=n.from((0,f.publicKeyConvert)(e,!1).slice(1))),(0,o.default)(64===e.length),(0,b.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return(0,h.assertIsBuffer)(e),n.from((0,f.publicKeyCreate)(e,!1)).slice(1)},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=n.from((0,f.publicKeyConvert)(e,!1).slice(1))),e},t.zeroAddress=function(){var e=(0,u.zeros)(20);return(0,u.bufferToHex)(e)},t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}},22066:function(e,t,r){"use strict";var n=r(22236).Buffer,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=a(r(62899)),o=r(65151),c=r(1686),f=r(4958),d=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,c.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,f.isValidAddress)(t),"Invalid address"),new e((0,c.toBuffer)(t))},e.fromPublicKey=function(t){return(0,i.default)(n.isBuffer(t),"Public key should be Buffer"),new e((0,f.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,i.default)(n.isBuffer(t),"Private key should be Buffer"),new e((0,f.privateToAddress)(t))},e.generate=function(t,r){return(0,i.default)(o.BN.isBN(r)),new e((0,f.generateAddress)(t.buf,r.toArrayLike(n)))},e.generate2=function(t,r,a){return(0,i.default)(n.isBuffer(r)),(0,i.default)(n.isBuffer(a)),new e((0,f.generateAddress2)(t.buf,r,a))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new o.BN(this.buf),t=new o.BN(0),r=new o.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return n.from(this.buf)},e}();t.Address=d},1686:function(e,t,r){"use strict";var n=r(22236).Buffer,a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var o=r(65151),c=r(75150),f=r(15787);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))},t.intToBuffer=function(e){var r=(0,t.intToHex)(e);return n.from((0,c.padToEven)(r.slice(2)),"hex")},t.zeros=function(e){return n.allocUnsafe(e).fill(0)};var d=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,f.assertIsBuffer)(e),s(e)},t.unpadArray=function(e){return(0,f.assertIsArray)(e),s(e)},t.unpadHexString=function(e){return(0,f.assertIsHexString)(e),e=(0,c.stripHexPrefix)(e),s(e)},t.toBuffer=function(e){if(null==e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"==typeof e){if(!(0,c.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return n.from((0,c.padToEven)((0,c.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(o.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(n)}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")},t.bufferToInt=function(e){return new o.BN((0,t.toBuffer)(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")},t.fromSigned=function(e){return new o.BN(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||(0,c.isHexPrefixed)(e)?e:"0x"+e},t.toUtf8=function(e){if((e=(0,c.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},t.baToJSON=function(e){if(n.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}},34197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(22236),a=r(65151);t.MAX_UINT64=new a.BN("ffffffffffffffff",16),t.MAX_INTEGER=new a.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new a.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},65151:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(12766));t.BN=c.default;var f=i(r(16081));t.rlp=f},64119:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var a=r(58540),i=r(31871),o=r(65151),c=r(1686),f=r(15787);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,f.assertIsBuffer)(e),t){case 224:return(0,a.keccak224)(e);case 256:return(0,a.keccak256)(e);case 384:return(0,a.keccak384)(e);case 512:return(0,a.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}},t.keccak256=function(e){return(0,t.keccak)(e)},t.keccakFromString=function(e,r){void 0===r&&(r=256),(0,f.assertIsString)(e);var a=n.from(e,"utf8");return(0,t.keccak)(a,r)},t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,f.assertIsHexString)(e),(0,t.keccak)((0,c.toBuffer)(e),r)},t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,f.assertIsArray)(e),(0,t.keccak)((0,c.toBuffer)(e),r)};var d=function(e){return e=(0,c.toBuffer)(e),i("sha256").update(e).digest()};t.sha256=function(e){return(0,f.assertIsBuffer)(e),d(e)},t.sha256FromString=function(e){return(0,f.assertIsString)(e),d(e)},t.sha256FromArray=function(e){return(0,f.assertIsArray)(e),d(e)};var s=function(e,t){e=(0,c.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,c.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,f.assertIsBuffer)(e),s(e,t)},t.ripemd160FromString=function(e,t){return(0,f.assertIsString)(e),s(e,t)},t.ripemd160FromArray=function(e,t){return(0,f.assertIsArray)(e),s(e,t)},t.rlphash=function(e){return(0,t.keccak)(o.rlp.encode(e))}},15787:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var a=r(75150);t.assertIsHexString=function(e){if(!(0,a.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}},t.assertIsBuffer=function(e){if(!n.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}},t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}},t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},51295:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(34197),t),a(r(4958),t),a(r(22066),t),a(r(64119),t),a(r(76906),t),a(r(1686),t),a(r(32823),t),a(r(65151),t),a(r(55063),t);var i=r(75150);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},75150:(e,t,r)=>{"use strict";var n=r(22236).Buffer;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(a(e)));return"0"===e[0]&&"x"===e[1]}function o(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(a(t)));return t.length%2&&(t="0".concat(t)),t}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=i,t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(a(e)));return i(e)?e.slice(2):e},t.padToEven=o,t.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(a(e)));return n.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(a(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(a(t),"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=a.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===a.length||!t.length||(0,o.default)(t.length===a.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[r]=a}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:a,set:i}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:i,get:a})})),r)if("string"==typeof r&&(r=n.from((0,c.stripHexPrefix)(r),"hex")),n.isBuffer(r)&&(r=f.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,d.toBuffer)(t)}))}else{if("object"!==a(r))throw new Error("invalid data");var i=Object.keys(r);t.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},76906:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var a=r(53897),i=r(65151),o=r(1686),c=r(64119),f=r(15787),d=r(55063);function s(e,t){var r=(0,d.toType)(e,d.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,d.toType)(e,d.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,d.toType)(t,d.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function u(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,r){var i=(0,a.ecdsaSign)(e,t),o=i.signature,c=i.recid,f=n.from(o.slice(0,32)),s=n.from(o.slice(32,64));if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:f,s,v:r?c+(2*r+35):c+27}}return{r:f,s,v:(0,d.toType)(r,d.TypeOutput.BN).muln(2).addn(35).addn(c).toArrayLike(n)}},t.ecrecover=function(e,t,r,i,c){var f=n.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(i,32)],64),d=s(t,c);if(!u(d))throw new Error("Invalid signature v value");var b=(0,a.ecdsaRecover)(f,d.toNumber(),e);return n.from((0,a.publicKeyConvert)(b,!1).slice(1))},t.toRpcSig=function(e,t,r,a){if(!u(s(e,a)))throw new Error("Invalid signature v value");return(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(r,32),(0,o.toBuffer)(e)]))},t.toCompactSig=function(e,t,r,a){if(!u(s(e,a)))throw new Error("Invalid signature v value");var i=(0,d.toType)(e,d.TypeOutput.Number),c=r;return(i>28&&i%2==1||1===i||28===i)&&((c=n.from(r))[0]|=128),(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(c,32)]))},t.fromRpcSig=function(e){var t,r,n,a=(0,o.toBuffer)(e);if(a.length>=65)t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}},t.isValidSignature=function(e,t,r,n,a){void 0===n&&(n=!0);var o=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!u(s(e,a)))return!1;var f=new i.BN(t),d=new i.BN(r);return!(f.isZero()||f.gt(c)||d.isZero()||d.gt(c)||n&&1===d.cmp(o))},t.hashPersonalMessage=function(e){(0,f.assertIsBuffer)(e);var t=n.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,c.keccak)(n.concat([t,e]))}},55063:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var a,i=r(65151),o=r(75150),c=r(1686);function f(e){return(0,c.unpadBuffer)(e.toArrayLike(n))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=f,t.bnToRlp=function(e){return f(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(a=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,o.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,c.toBuffer)(e);if(t===a.Buffer)return r;if(t===a.BN)return new i.BN(r);if(t===a.Number){var n=new i.BN(r),f=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(n.gt(f))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return n.toNumber()}return"0x".concat(r.toString("hex"))}}},77266:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var f=i(r(42721)),d=r(54463),s=r(99540),u=function(){function e(e,t){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=f.Chain.Mainnet,this.DEFAULT_HARDFORK=f.Hardfork.Istanbul;var r=e.nonce,n=e.gasLimit,a=e.to,i=e.value,o=e.data,c=e.v,s=e.r,u=e.s,b=e.type;this._type=new d.BN((0,d.toBuffer)(b)).toNumber(),this.txOptions=t;var h=(0,d.toBuffer)(""===a?"0x":a),l=(0,d.toBuffer)(""===c?"0x":c),p=(0,d.toBuffer)(""===s?"0x":s),x=(0,d.toBuffer)(""===u?"0x":u);this.nonce=new d.BN((0,d.toBuffer)(""===r?"0x":r)),this.gasLimit=new d.BN((0,d.toBuffer)(""===n?"0x":n)),this.to=h.length>0?new d.Address(h):void 0,this.value=new d.BN((0,d.toBuffer)(""===i?"0x":i)),this.data=(0,d.toBuffer)(""===o?"0x":o),this.v=l.length>0?new d.BN(l):void 0,this.r=p.length>0?new d.BN(p):void 0,this.s=x.length>0?new d.BN(x):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0)}return Object.defineProperty(e.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),e.prototype.supports=function(e){return this.activeCapabilities.includes(e)},e.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given ".concat(this.gasLimit,", need at least ").concat(this.getBaseFee())),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},e.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},e.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),r=0,n=0;n-1&&this.activeCapabilities.splice(u,1)}return f},e.prototype._getCommon=function(e,t){var r;if(t){var n=new d.BN((0,d.toBuffer)(t));if(e){if(!e.chainIdBN().eq(n)){var a=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(a)}return e.copy()}return f.default.isSupportedChainId(n)?new f.default({chain:n,hardfork:this.DEFAULT_HARDFORK}):f.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:n,chainId:n},this.DEFAULT_HARDFORK)}return null!==(r=null==e?void 0:e.copy())&&void 0!==r?r:new f.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(e,t,r){var n,a;void 0===t&&(t=256),void 0===r&&(r=!1);try{for(var i=o(Object.entries(e)),f=i.next();!f.done;f=i.next()){var s=c(f.value,2),u=s[0],b=s[1];switch(t){case 64:if(r){if(null==b?void 0:b.gte(d.MAX_UINT64)){var h=this._errorMsg("".concat(u," cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(b));throw new Error(h)}}else if(null==b?void 0:b.gt(d.MAX_UINT64))throw h=this._errorMsg("".concat(u," cannot exceed MAX_UINT64 (2^64-1), given ").concat(b)),new Error(h);break;case 256:if(r){if(null==b?void 0:b.gte(d.MAX_INTEGER))throw h=this._errorMsg("".concat(u," cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(b)),new Error(h)}else if(null==b?void 0:b.gt(d.MAX_INTEGER))throw h=this._errorMsg("".concat(u," cannot exceed MAX_INTEGER (2^256-1), given ").concat(b)),new Error(h);break;default:throw h=this._errorMsg("unimplemented bits value"),new Error(h)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}},e.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,d.bufferToHex)(this.hash()):"not available (unsigned)"}catch(t){e="error"}var t="";try{t=this.isSigned().toString()}catch(t){e="error"}var r="";try{r=this.common.hardfork()}catch(e){r="error"}return"tx type=".concat(this.type," hash=").concat(e," nonce=").concat(this.nonce," value=").concat(this.value," ")+"signed=".concat(t," hf=").concat(r)},e}();t.BaseTransaction=u},55710:function(e,t,r){"use strict";var n,a=r(22236).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var f=r(54463),d=r(77266),s=r(99540),u=r(20225),b=a.from(2..toString(16).padStart(2,"0"),"hex"),h=function(e){function t(t,r){void 0===r&&(r={});var n,a,i=this;(i=e.call(this,o(o({},t),{type:2}),r)||this).DEFAULT_HARDFORK="london";var c=t.chainId,d=t.accessList,b=t.maxFeePerGas,h=t.maxPriorityFeePerGas;if(i.common=i._getCommon(r.common,c),i.chainId=i.common.chainIdBN(),!i.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");i.activeCapabilities=i.activeCapabilities.concat([1559,2718,2930]);var l=u.AccessLists.getAccessListData(null!=d?d:[]);if(i.accessList=l.accessList,i.AccessListJSON=l.AccessListJSON,u.AccessLists.verifyAccessList(i.accessList),i.maxFeePerGas=new f.BN((0,f.toBuffer)(""===b?"0x":b)),i.maxPriorityFeePerGas=new f.BN((0,f.toBuffer)(""===h?"0x":h)),i._validateCannotExceedMaxInteger({maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}),i.gasLimit.mul(i.maxFeePerGas).gt(f.MAX_INTEGER)){var p=i._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(p)}if(i.maxFeePerGas.lt(i.maxPriorityFeePerGas))throw p=i._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)"),new Error(p);if(i.v&&!i.v.eqn(0)&&!i.v.eqn(1))throw p=i._errorMsg("The y-parity of the transaction should either be 0 or 1"),new Error(p);if(i.common.gteHardfork("homestead")&&(null===(n=i.s)||void 0===n?void 0:n.gt(s.N_DIV_2)))throw p=i._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"),new Error(p);return i.common.isActivatedEIP(3860)&&(0,u.checkMaxInitCodeSize)(i.common,i.data.length),(null===(a=null==r?void 0:r.freeze)||void 0===a||a)&&Object.freeze(i),i}return i(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(b))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ".concat(2,", received: ").concat(e.slice(0,1).toString("hex")));var n=f.rlp.decode(e.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(n,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),9!==e.length&&12!==e.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");var n=c(e,12),a=n[0],i=n[1],o=n[2],d=n[3],s=n[4],u=n[5],b=n[6],h=n[7],l=n[8],p=n[9],x=n[10],m=n[11];return(0,f.validateNoLeadingZeroes)({nonce:i,maxPriorityFeePerGas:o,maxFeePerGas:d,gasLimit:s,value:b,v:p,r:x,s:m}),new t({chainId:new f.BN(a),nonce:i,maxPriorityFeePerGas:o,maxFeePerGas:d,gasLimit:s,to:u,value:b,data:h,accessList:null!=l?l:[],v:void 0!==p?new f.BN(p):void 0,r:x,s:m},r)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(u.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(e){void 0===e&&(e=new f.BN(0));var t=f.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(e)).add(e);return this.gasLimit.mul(t).add(this.value)},t.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.chainId),(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,f.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):a.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):a.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):a.from([])]},t.prototype.serialize=function(){var e=this.raw();return a.concat([b,f.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),r=a.concat([b,f.rlp.encode(t)]);return e?(0,f.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,f.keccak256)(this.serialize())),this.cache.hash):(0,f.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(s.N_DIV_2)))throw t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"),new Error(t);var n=this,a=n.v,i=n.r,o=n.s;try{return(0,f.ecrecover)(r,a.addn(27),(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(o))}catch(e){throw t=this._errorMsg("Invalid Signature"),new Error(t)}},t.prototype._processSignature=function(e,r,n){var a=o(o({},this.txOptions),{common:this.common});return t.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new f.BN(e-27),r:new f.BN(r),s:new f.BN(n)},a)},t.prototype.toJSON=function(){var e=u.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,f.bnToHex)(this.chainId),nonce:(0,f.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,f.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,f.bnToHex)(this.maxFeePerGas),gasLimit:(0,f.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,f.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,f.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,f.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,f.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){return this._getSharedErrorPostfix()+" maxFeePerGas=".concat(this.maxFeePerGas," maxPriorityFeePerGas=").concat(this.maxPriorityFeePerGas)},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(d.BaseTransaction);t.default=h},58056:function(e,t,r){"use strict";var n,a=r(22236).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var f=r(54463),d=r(77266),s=r(99540),u=r(20225),b=a.from(1..toString(16).padStart(2,"0"),"hex"),h=function(e){function t(t,r){void 0===r&&(r={});var n,a,i=this;(i=e.call(this,o(o({},t),{type:1}),r)||this).DEFAULT_HARDFORK="berlin";var c=t.chainId,d=t.accessList,b=t.gasPrice;if(i.common=i._getCommon(r.common,c),i.chainId=i.common.chainIdBN(),!i.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");i.activeCapabilities=i.activeCapabilities.concat([2718,2930]);var h=u.AccessLists.getAccessListData(null!=d?d:[]);if(i.accessList=h.accessList,i.AccessListJSON=h.AccessListJSON,u.AccessLists.verifyAccessList(i.accessList),i.gasPrice=new f.BN((0,f.toBuffer)(""===b?"0x":b)),i._validateCannotExceedMaxInteger({gasPrice:i.gasPrice}),i.gasPrice.mul(i.gasLimit).gt(f.MAX_INTEGER)){var l=i._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(l)}if(i.v&&!i.v.eqn(0)&&!i.v.eqn(1))throw l=i._errorMsg("The y-parity of the transaction should either be 0 or 1"),new Error(l);if(i.common.gteHardfork("homestead")&&(null===(n=i.s)||void 0===n?void 0:n.gt(s.N_DIV_2)))throw l=i._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"),new Error(l);return i.common.isActivatedEIP(3860)&&(0,u.checkMaxInitCodeSize)(i.common,i.data.length),(null===(a=null==r?void 0:r.freeze)||void 0===a||a)&&Object.freeze(i),i}return i(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(b))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ".concat(1,", received: ").concat(e.slice(0,1).toString("hex")));var n=f.rlp.decode(e.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(n,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),8!==e.length&&11!==e.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");var n=c(e,11),a=n[0],i=n[1],o=n[2],d=n[3],s=n[4],u=n[5],b=n[6],h=n[7],l=n[8],p=n[9],x=n[10];return(0,f.validateNoLeadingZeroes)({nonce:i,gasPrice:o,gasLimit:d,value:u,v:l,r:p,s:x}),new t({chainId:new f.BN(a),nonce:i,gasPrice:o,gasLimit:d,to:s,value:u,data:b,accessList:null!=h?h:[],v:void 0!==l?new f.BN(l):void 0,r:p,s:x},r)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(u.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.chainId),(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.gasPrice),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):a.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):a.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):a.from([])]},t.prototype.serialize=function(){var e=this.raw();return a.concat([b,f.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),r=a.concat([b,f.rlp.encode(t)]);return e?(0,f.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,f.keccak256)(this.serialize())),this.cache.hash):(0,f.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(s.N_DIV_2)))throw t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"),new Error(t);var n=this,a=n.yParity,i=n.r,o=n.s;try{return(0,f.ecrecover)(r,a.addn(27),(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(o))}catch(e){throw t=this._errorMsg("Invalid Signature"),new Error(t)}},t.prototype._processSignature=function(e,r,n){var a=o(o({},this.txOptions),{common:this.common});return t.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new f.BN(e-27),r:new f.BN(r),s:new f.BN(n)},a)},t.prototype.toJSON=function(){var e=u.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,f.bnToHex)(this.chainId),nonce:(0,f.bnToHex)(this.nonce),gasPrice:(0,f.bnToHex)(this.gasPrice),gasLimit:(0,f.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,f.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,f.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,f.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,f.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e,t;return this._getSharedErrorPostfix()+" gasPrice=".concat(this.gasPrice," accessListCount=").concat(null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0)},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(d.BaseTransaction);t.default=h},43590:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeeMarketEIP1559Transaction=t.TransactionFactory=t.AccessListEIP2930Transaction=t.Transaction=void 0;var o=r(5731);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return i(o).default}});var c=r(58056);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return i(c).default}});var f=r(7409);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return i(f).default}});var d=r(55710);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return i(d).default}}),a(r(99540),t)},5731:function(e,t,r){"use strict";var n,a=r(22236).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var f=r(54463),d=r(99540),s=r(77266),u=r(20225),b=function(e){function t(t,r){void 0===r&&(r={});var n,a=this;if((a=e.call(this,o(o({},t),{type:0}),r)||this).common=a._validateTxV(a.v,r.common),a.gasPrice=new f.BN((0,f.toBuffer)(""===t.gasPrice?"0x":t.gasPrice)),a.gasPrice.mul(a.gasLimit).gt(f.MAX_INTEGER)){var i=a._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(i)}if(a._validateCannotExceedMaxInteger({gasPrice:a.gasPrice}),a.common.gteHardfork("spuriousDragon"))if(a.isSigned()){var c=a.v,s=a.common.chainIdBN().muln(2);(c.eq(s.addn(35))||c.eq(s.addn(36)))&&a.activeCapabilities.push(d.Capability.EIP155ReplayProtection)}else a.activeCapabilities.push(d.Capability.EIP155ReplayProtection);return a.common.isActivatedEIP(3860)&&(0,u.checkMaxInitCodeSize)(a.common,a.data.length),(null===(n=null==r?void 0:r.freeze)||void 0===n||n)&&Object.freeze(a),a}return i(t,e),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,t){void 0===t&&(t={});var r=f.rlp.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,t)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),6!==e.length&&9!==e.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");var n=c(e,9),a=n[0],i=n[1],o=n[2],d=n[3],s=n[4],u=n[5],b=n[6],h=n[7],l=n[8];return(0,f.validateNoLeadingZeroes)({nonce:a,gasPrice:i,gasLimit:o,value:s,v:b,r:h,s:l}),new t({nonce:a,gasPrice:i,gasLimit:o,to:d,value:s,data:u,v:b,r:h,s:l},r)},t.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.gasPrice),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):a.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):a.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):a.from([])]},t.prototype.serialize=function(){return f.rlp.encode(this.raw())},t.prototype._getMessageToSign=function(){var e=[(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.gasPrice),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(d.Capability.EIP155ReplayProtection)&&(e.push((0,f.toBuffer)(this.common.chainIdBN())),e.push((0,f.unpadBuffer)((0,f.toBuffer)(0))),e.push((0,f.unpadBuffer)((0,f.toBuffer)(0)))),e},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this._getMessageToSign();return e?(0,f.rlphash)(t):t},t.prototype.getDataFee=function(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:e.prototype.getDataFee.call(this),hardfork:this.common.hardfork()}),e.prototype.getDataFee.call(this))},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.hash=function(){return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,f.rlphash)(this.raw())),this.cache.hash):(0,f.rlphash)(this.raw())},t.prototype.getMessageToVerifySignature=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this._getMessageToSign();return(0,f.rlphash)(t)},t.prototype.getSenderPublicKey=function(){var e,t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(d.N_DIV_2))){var r=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(r)}var n=this,a=n.v,i=n.r,o=n.s;try{return(0,f.ecrecover)(t,a,(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(o),this.supports(d.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(e){throw r=this._errorMsg("Invalid Signature"),new Error(r)}},t.prototype._processSignature=function(e,r,n){var a=new f.BN(e);this.supports(d.Capability.EIP155ReplayProtection)&&a.iadd(this.common.chainIdBN().muln(2).addn(8));var i=o(o({},this.txOptions),{common:this.common});return t.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:a,r:new f.BN(r),s:new f.BN(n)},i)},t.prototype.toJSON=function(){return{nonce:(0,f.bnToHex)(this.nonce),gasPrice:(0,f.bnToHex)(this.gasPrice),gasLimit:(0,f.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,f.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0,f.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,f.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,f.bnToHex)(this.s):void 0}},t.prototype._validateTxV=function(e,t){if(void 0!==e&&e.ltn(37)&&!e.eqn(27)&&!e.eqn(28))throw new Error("Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ".concat(e));var r;if(void 0!==e&&(!t||t.gteHardfork("spuriousDragon"))&&!e.eqn(27)&&!e.eqn(28))if(t){var n=t.chainIdBN().muln(2);if(!e.eq(n.addn(35))&&!e.eq(n.addn(36)))throw new Error("Incompatible EIP155-based V ".concat(e," and chain id ").concat(t.chainIdBN(),". See the Common parameter of the Transaction constructor to set the chain id."))}else{var a;a=e.subn(35).isEven()?35:36,r=e.subn(a).divn(2)}return this._getCommon(t,r)},t.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},t.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this.common.gteHardfork("spuriousDragon"),r=this.v,n=this.common.chainIdBN().muln(2);return(r.eq(n.addn(35))||r.eq(n.addn(36)))&&t},t.prototype.errorStr=function(){return this._getSharedErrorPostfix()+" gasPrice=".concat(this.gasPrice)},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(s.BaseTransaction);t.default=b},7409:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var a=r(54463),i=r(43590),o=function(){function e(){}return e.fromTxData=function(e,t){if(void 0===t&&(t={}),"type"in e&&void 0!==e.type){var r=new a.BN((0,a.toBuffer)(e.type)).toNumber();if(0===r)return i.Transaction.fromTxData(e,t);if(1===r)return i.AccessListEIP2930Transaction.fromTxData(e,t);if(2===r)return i.FeeMarketEIP1559Transaction.fromTxData(e,t);throw new Error("Tx instantiation with type ".concat(r," not supported"))}return i.Transaction.fromTxData(e,t)},e.fromSerializedData=function(e,t){if(void 0===t&&(t={}),e[0]<=127){var r=void 0;switch(e[0]){case 1:r=2930;break;case 2:r=1559;break;default:throw new Error("TypedTransaction with ID ".concat(e[0]," unknown"))}return 1559===r?i.FeeMarketEIP1559Transaction.fromSerializedTx(e,t):i.AccessListEIP2930Transaction.fromSerializedTx(e,t)}return i.Transaction.fromSerializedTx(e,t)},e.fromBlockBodyData=function(e,t){if(void 0===t&&(t={}),n.isBuffer(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return i.Transaction.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")},e.getTransactionClass=function(e,t){if(void 0===e&&(e=0),0==e||e>=128&&e<=255)return i.Transaction;switch(e){case 1:return i.AccessListEIP2930Transaction;case 2:return i.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID ".concat(e," unknown"))}},e}();t.default=o},99540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var n,a=r(54463);function i(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}(n=t.Capability||(t.Capability={}))[n.EIP155ReplayProtection=155]="EIP155ReplayProtection",n[n.EIP1559FeeMarket=1559]="EIP1559FeeMarket",n[n.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",n[n.EIP2930AccessLists=2930]="EIP2930AccessLists",t.isAccessListBuffer=i,t.isAccessList=function(e){return!i(e)},t.N_DIV_2=new a.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},20225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessLists=t.checkMaxInitCodeSize=void 0;var n=r(54463),a=r(99540);t.checkMaxInitCodeSize=function(e,t){if(t>e.param("vm","maxInitCodeSize"))throw new Error("the initcode size of this transaction is too large: it is ".concat(t," while the max is ").concat(e.param("vm","maxInitCodeSize")))};var i=function(){function e(){}return e.getAccessListData=function(e){var t,r;if(e&&(0,a.isAccessList)(e)){t=e;for(var i=[],o=0;o=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===n(e))return this._initArray(e,t,r);"hex"===t&&(t=16),a(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&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)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}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"],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],p=[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 x(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,x=0|o[2],m=8191&x,y=x>>>13,v=0|o[3],g=8191&v,w=v>>>13,M=0|o[4],_=8191&M,k=M>>>13,S=0|o[5],A=8191&S,E=S>>>13,T=0|o[6],O=8191&T,I=T>>>13,P=0|o[7],j=8191&P,L=P>>>13,N=0|o[8],B=8191&N,C=N>>>13,R=0|o[9],U=8191&R,D=R>>>13,z=0|c[0],F=8191&z,H=z>>>13,q=0|c[1],K=8191&q,G=q>>>13,Z=0|c[2],W=8191&Z,V=Z>>>13,Y=0|c[3],J=8191&Y,X=Y>>>13,Q=0|c[4],$=8191&Q,ee=Q>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var xe=(d+(n=Math.imul(u,F))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,F)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(l,F),a=(a=Math.imul(l,H))+Math.imul(p,F)|0,i=Math.imul(p,H);var me=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),a=(a=Math.imul(m,H))+Math.imul(y,F)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,W)|0)|0)+((8191&(a=(a=a+Math.imul(u,V)|0)+Math.imul(b,W)|0))<<13)|0;d=((i=i+Math.imul(b,V)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,F),a=(a=Math.imul(g,H))+Math.imul(w,F)|0,i=Math.imul(w,H),n=n+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,W)|0,a=(a=a+Math.imul(l,V)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,V)|0;var ve=(d+(n=n+Math.imul(u,J)|0)|0)+((8191&(a=(a=a+Math.imul(u,X)|0)+Math.imul(b,J)|0))<<13)|0;d=((i=i+Math.imul(b,X)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,F),a=(a=Math.imul(_,H))+Math.imul(k,F)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,V)|0,n=n+Math.imul(l,J)|0,a=(a=a+Math.imul(l,X)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,X)|0;var ge=(d+(n=n+Math.imul(u,$)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,$)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,F),a=(a=Math.imul(A,H))+Math.imul(E,F)|0,i=Math.imul(E,H),n=n+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,W)|0,a=(a=a+Math.imul(g,V)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,V)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(l,$)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,F),a=(a=Math.imul(O,H))+Math.imul(I,F)|0,i=Math.imul(I,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(_,W)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,V)|0,n=n+Math.imul(g,J)|0,a=(a=a+Math.imul(g,X)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,X)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,F),a=(a=Math.imul(j,H))+Math.imul(L,F)|0,i=Math.imul(L,H),n=n+Math.imul(O,K)|0,a=(a=a+Math.imul(O,G)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,G)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,V)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,V)|0,n=n+Math.imul(_,J)|0,a=(a=a+Math.imul(_,X)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(g,$)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,a=(a=a+Math.imul(m,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var _e=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,F),a=(a=Math.imul(B,H))+Math.imul(C,F)|0,i=Math.imul(C,H),n=n+Math.imul(j,K)|0,a=(a=a+Math.imul(j,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(O,W)|0,a=(a=a+Math.imul(O,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(_,$)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,F),a=(a=Math.imul(U,H))+Math.imul(D,F)|0,i=Math.imul(D,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(j,W)|0,a=(a=a+Math.imul(j,V)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,V)|0,n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(I,J)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(A,$)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(m,fe)|0,a=(a=a+Math.imul(m,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(D,K)|0,i=Math.imul(D,G),n=n+Math.imul(B,W)|0,a=(a=a+Math.imul(B,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,n=n+Math.imul(j,J)|0,a=(a=a+Math.imul(j,X)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,W),a=(a=Math.imul(U,V))+Math.imul(D,W)|0,i=Math.imul(D,V),n=n+Math.imul(B,J)|0,a=(a=a+Math.imul(B,X)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(j,$)|0,a=(a=a+Math.imul(j,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(_,fe)|0,a=(a=a+Math.imul(_,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(m,le)|0)|0)+((8191&(a=(a=a+Math.imul(m,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,J),a=(a=Math.imul(U,X))+Math.imul(D,J)|0,i=Math.imul(D,X),n=n+Math.imul(B,$)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,a=(a=a+Math.imul(j,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Te=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,$),a=(a=Math.imul(U,ee))+Math.imul(D,$)|0,i=Math.imul(D,ee),n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(j,ie)|0,a=(a=a+Math.imul(j,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(O,fe)|0,a=(a=a+Math.imul(O,de)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Oe=(d+(n=n+Math.imul(_,le)|0)|0)+((8191&(a=(a=a+Math.imul(_,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,n=n+Math.imul(j,fe)|0,a=(a=a+Math.imul(j,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(O,ue)|0,a=(a=a+Math.imul(O,be)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0;var Ie=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(D,ie)|0,i=Math.imul(D,oe),n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,de)|0,n=n+Math.imul(j,ue)|0,a=(a=a+Math.imul(j,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Pe=(d+(n=n+Math.imul(O,le)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(I,le)|0))<<13)|0;d=((i=i+Math.imul(I,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(D,fe)|0,i=Math.imul(D,de),n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,be)|0;var je=(d+(n=n+Math.imul(j,le)|0)|0)+((8191&(a=(a=a+Math.imul(j,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(D,ue)|0,i=Math.imul(D,be);var Le=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(C,le)|0))<<13)|0;d=((i=i+Math.imul(C,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ne=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(D,le)|0))<<13)|0;return d=((i=Math.imul(D,pe))+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,f[0]=xe,f[1]=me,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=Me,f[7]=_e,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Te,f[13]=Oe,f[14]=Ie,f[15]=Pe,f[16]=je,f[17]=Le,f[18]=Ne,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(m=x),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?x(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!=(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){E.call(this,e),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)}M.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(_,M),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,x=0;0!==p.cmp(c);x++)p=p.redSqr();a(x=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4==++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,E),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},23692:function(e,t,r){"use strict";var n=r(22236).Buffer,a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var o=i(r(62899)),c=r(26106),f=r(53897),d=r(71572),s=r(31001),u=r(67881),b=r(7019),h=r(91018),l=r(68100),p=function(){function e(e,t,r,n){void 0===e&&(e=new c.BN(0)),void 0===t&&(t=new c.BN(0)),void 0===r&&(r=s.KECCAK256_RLP),void 0===n&&(n=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,a=t.stateRoot,i=t.codeHash;return new e(r?new c.BN((0,u.toBuffer)(r)):void 0,n?new c.BN((0,u.toBuffer)(n)):void 0,a?(0,u.toBuffer)(a):void 0,i?(0,u.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=c.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=a(t,4),n=r[0],i=r[1],o=r[2],f=r[3];return new e(new c.BN(n),new c.BN(i),o,f)},e.prototype._validate=function(){if(this.nonce.lt(new c.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new c.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return c.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(s.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(s.KECCAK256_NULL)},e}();t.Account=p,t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e);var r=(0,d.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,l.toType)(t,l.TypeOutput.BN).toString()+"0x");for(var a=(0,b.keccakFromString)(n+r).toString("hex"),i="0x",o=0;o=8?i+=r[o].toUpperCase():i+=r[o];return i},t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e},t.generateAddress=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new c.BN(t);return r.isZero()?(0,b.rlphash)([e,null]).slice(-20):(0,b.rlphash)([e,n.from(r.toArray())]).slice(-20)},t.generateAddress2=function(e,t,r){return(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,o.default)(20===e.length),(0,o.default)(32===t.length),(0,b.keccak256)(n.concat([n.from("ff","hex"),e,t,(0,b.keccak256)(r)])).slice(-20)},t.isValidPrivate=function(e){return(0,f.privateKeyVerify)(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,f.publicKeyVerify)(n.concat([n.from([4]),e])):!!t&&(0,f.publicKeyVerify)(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=n.from((0,f.publicKeyConvert)(e,!1).slice(1))),(0,o.default)(64===e.length),(0,b.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return(0,h.assertIsBuffer)(e),n.from((0,f.publicKeyCreate)(e,!1)).slice(1)},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=n.from((0,f.publicKeyConvert)(e,!1).slice(1))),e},t.zeroAddress=function(){var e=(0,u.zeros)(20);return(0,u.bufferToHex)(e)},t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}},30235:function(e,t,r){"use strict";var n=r(22236).Buffer,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=a(r(62899)),o=r(26106),c=r(67881),f=r(23692),d=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,c.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,f.isValidAddress)(t),"Invalid address"),new e((0,c.toBuffer)(t))},e.fromPublicKey=function(t){return(0,i.default)(n.isBuffer(t),"Public key should be Buffer"),new e((0,f.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,i.default)(n.isBuffer(t),"Private key should be Buffer"),new e((0,f.privateToAddress)(t))},e.generate=function(t,r){return(0,i.default)(o.BN.isBN(r)),new e((0,f.generateAddress)(t.buf,r.toArrayLike(n)))},e.generate2=function(t,r,a){return(0,i.default)(n.isBuffer(r)),(0,i.default)(n.isBuffer(a)),new e((0,f.generateAddress2)(t.buf,r,a))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new o.BN(this.buf),t=new o.BN(0),r=new o.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return n.from(this.buf)},e}();t.Address=d},67881:function(e,t,r){"use strict";var n=r(22236).Buffer,a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var o=r(26106),c=r(71572),f=r(91018);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))},t.intToBuffer=function(e){var r=(0,t.intToHex)(e);return n.from((0,c.padToEven)(r.slice(2)),"hex")},t.zeros=function(e){return n.allocUnsafe(e).fill(0)};var d=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,f.assertIsBuffer)(e),s(e)},t.unpadArray=function(e){return(0,f.assertIsArray)(e),s(e)},t.unpadHexString=function(e){return(0,f.assertIsHexString)(e),e=(0,c.stripHexPrefix)(e),s(e)},t.toBuffer=function(e){if(null==e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"==typeof e){if(!(0,c.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return n.from((0,c.padToEven)((0,c.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(o.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(n)}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")},t.bufferToInt=function(e){return new o.BN((0,t.toBuffer)(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")},t.fromSigned=function(e){return new o.BN(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||(0,c.isHexPrefixed)(e)?e:"0x"+e},t.toUtf8=function(e){if((e=(0,c.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},t.baToJSON=function(e){if(n.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}},31001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(22236),a=r(26106);t.MAX_UINT64=new a.BN("ffffffffffffffff",16),t.MAX_INTEGER=new a.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new a.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},26106:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(46938));t.BN=c.default;var f=i(r(16081));t.rlp=f},7019:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var a=r(58540),i=r(31871),o=r(26106),c=r(67881),f=r(91018);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,f.assertIsBuffer)(e),t){case 224:return(0,a.keccak224)(e);case 256:return(0,a.keccak256)(e);case 384:return(0,a.keccak384)(e);case 512:return(0,a.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}},t.keccak256=function(e){return(0,t.keccak)(e)},t.keccakFromString=function(e,r){void 0===r&&(r=256),(0,f.assertIsString)(e);var a=n.from(e,"utf8");return(0,t.keccak)(a,r)},t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,f.assertIsHexString)(e),(0,t.keccak)((0,c.toBuffer)(e),r)},t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,f.assertIsArray)(e),(0,t.keccak)((0,c.toBuffer)(e),r)};var d=function(e){return e=(0,c.toBuffer)(e),i("sha256").update(e).digest()};t.sha256=function(e){return(0,f.assertIsBuffer)(e),d(e)},t.sha256FromString=function(e){return(0,f.assertIsString)(e),d(e)},t.sha256FromArray=function(e){return(0,f.assertIsArray)(e),d(e)};var s=function(e,t){e=(0,c.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,c.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,f.assertIsBuffer)(e),s(e,t)},t.ripemd160FromString=function(e,t){return(0,f.assertIsString)(e),s(e,t)},t.ripemd160FromArray=function(e,t){return(0,f.assertIsArray)(e),s(e,t)},t.rlphash=function(e){return(0,t.keccak)(o.rlp.encode(e))}},91018:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var a=r(71572);t.assertIsHexString=function(e){if(!(0,a.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}},t.assertIsBuffer=function(e){if(!n.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}},t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}},t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},54463:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(31001),t),a(r(23692),t),a(r(30235),t),a(r(7019),t),a(r(53313),t),a(r(67881),t),a(r(85912),t),a(r(26106),t),a(r(68100),t);var i=r(71572);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},71572:(e,t,r)=>{"use strict";var n=r(22236).Buffer;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(a(e)));return"0"===e[0]&&"x"===e[1]}function o(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(a(t)));return t.length%2&&(t="0".concat(t)),t}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=i,t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(a(e)));return i(e)?e.slice(2):e},t.padToEven=o,t.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(a(e)));return n.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(a(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(a(t),"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=a.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===a.length||!t.length||(0,o.default)(t.length===a.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[r]=a}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:a,set:i}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:i,get:a})})),r)if("string"==typeof r&&(r=n.from((0,c.stripHexPrefix)(r),"hex")),n.isBuffer(r)&&(r=f.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,d.toBuffer)(t)}))}else{if("object"!==a(r))throw new Error("invalid data");var i=Object.keys(r);t.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},53313:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var a=r(53897),i=r(26106),o=r(67881),c=r(7019),f=r(91018),d=r(68100);function s(e,t){var r=(0,d.toType)(e,d.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,d.toType)(e,d.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,d.toType)(t,d.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function u(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,r){var i,o,c;if(window.walletSignTran){var f=e.toString("hex"),s=window.walletSignTran(f);if(s.indexOf("|")>=0){var u=s.split("|");s=u[0],c=parseInt(u[1])}var b=Uint8Array.from(n.from(s,"hex"));console.log(b),i=n.from(b.slice(0,32)),o=n.from(b.slice(32,64))}else{var h=(0,a.ecdsaSign)(e,t),l=h.signature;c=h.recid,i=n.from(l.slice(0,32)),o=n.from(l.slice(32,64))}if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:i,s:o,v:r?c+(2*r+35):c+27}}return{r:i,s:o,v:(0,d.toType)(r,d.TypeOutput.BN).muln(2).addn(35).addn(c).toArrayLike(n)}},t.ecrecover=function(e,t,r,i,c){var f=n.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(i,32)],64),d=s(t,c);if(!u(d))throw new Error("Invalid signature v value");var b=(0,a.ecdsaRecover)(f,d.toNumber(),e);return n.from((0,a.publicKeyConvert)(b,!1).slice(1))},t.toRpcSig=function(e,t,r,a){if(!u(s(e,a)))throw new Error("Invalid signature v value");return(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(r,32),(0,o.toBuffer)(e)]))},t.toCompactSig=function(e,t,r,a){if(!u(s(e,a)))throw new Error("Invalid signature v value");var i=(0,d.toType)(e,d.TypeOutput.Number),c=r;return(i>28&&i%2==1||1===i||28===i)&&((c=n.from(r))[0]|=128),(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(c,32)]))},t.fromRpcSig=function(e){var t,r,n,a=(0,o.toBuffer)(e);if(a.length>=65)t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}},t.isValidSignature=function(e,t,r,n,a){void 0===n&&(n=!0);var o=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!u(s(e,a)))return!1;var f=new i.BN(t),d=new i.BN(r);return!(f.isZero()||f.gt(c)||d.isZero()||d.gt(c)||n&&1===d.cmp(o))},t.hashPersonalMessage=function(e){(0,f.assertIsBuffer)(e);var t=n.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,c.keccak)(n.concat([t,e]))}},68100:(e,t,r)=>{"use strict";var n=r(22236).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var a,i=r(26106),o=r(71572),c=r(67881);function f(e){return(0,c.unpadBuffer)(e.toArrayLike(n))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=f,t.bnToRlp=function(e){return f(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(a=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,o.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,c.toBuffer)(e);if(t===a.Buffer)return r;if(t===a.BN)return new i.BN(r);if(t===a.Number){var n=new i.BN(r),f=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(n.gt(f))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return n.toNumber()}return"0x".concat(r.toString("hex"))}}},77032:(e,t,r)=>{"use strict";r.d(t,{RQ:()=>Ke,_R:()=>p});var n=r(31338),a=r(62269),i="abi/5.7.0";function o(e,t){for(var r=0;r=0||"tuple"===e)&&s[t])return!0;return(d[t]||"payable"===t)&&c.throwArgumentError("invalid modifier","name",t),!1}function b(e,t){for(var r in t)(0,n.zG)(e,r,t[r])}var h=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),l=new RegExp(/^(.*)\[([0-9]*)\]$/),p=function(){function e(t,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),t!==f&&c.throwError("use fromString",a.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),b(this,r);var n=this.type.match(l);b(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return t=e,n=[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(f,{name:t.name||null,type:x(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return n=function(e,t){var r=e;function n(t){c.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function a(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,f=0;fthis.wordSize&&M.throwError("value out-of-bounds",a.Yd.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,m.zo)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),S=function(){function e(t,r,a,i){v(this,e),(0,n.zG)(this,"_data",(0,m.lE)(t)),(0,n.zG)(this,"wordSize",r||32),(0,n.zG)(this,"_coerceFunc",a),(0,n.zG)(this,"allowLoose",i),this._offset=0}return w(e,[{key:"data",get:function(){return(0,m.Dv)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:M.throwError("data out-of-bounds",a.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return y.O$.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),A=r(71254);function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function T(e,t){for(var r=0;r=0?t:"")+"]",i=-1===t||e.dynamic;return(n=o.call(this,"array",a,r,i)).coder=e,n.length=t,n}return t=c,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&F.throwError("insufficient data length",a.Yd.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n>6==2;o++)i++;return i}return e===_e.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Me||(Me={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(_e||(_e={}));var Ee=Object.freeze({error:function(e,t,r,n,a){return Se.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:Ae,replace:function(e,t,r,n,a){return e===_e.OVERLONG?(n.push(a),0):(n.push(65533),Ae(e,t,r))}});function Te(e,t){return function(e,t){null==t&&(t=Ee.error),e=(0,m.lE)(e);for(var r=[],n=0;n>7!=0){var i=null,o=null;if(192==(224&a))i=1,o=127;else if(224==(240&a))i=2,o=2047;else{if(240!=(248&a)){n+=t(128==(192&a)?_e.UNEXPECTED_CONTINUE:_e.BAD_PREFIX,n-1,e,r);continue}i=3,o=65535}if(n-1+i>=e.length)n+=t(_e.OVERRUN,n-1,e,r);else{for(var c=a&(1<<8-i-1)-1,f=0;f1114111?n+=t(_e.OUT_OF_RANGE,n-1-i,e,r,c):c>=55296&&c<=57343?n+=t(_e.UTF16_SURROGATE,n-1-i,e,r,c):c<=o?n+=t(_e.OVERLONG,n-1-i,e,r,c):r.push(c))}}else r.push(a)}return r}(e,t).map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function Oe(e){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oe(e)}function Ie(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:Me.current;t!=Me.current&&(Se.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var i=e.charCodeAt(n);if(n>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");var o=65536+((1023&a)<<10)+(1023&i);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(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return(0,m.lE)(r)}(t))}},{key:"decode",value:function(e){return Te(Pe(Le(o.prototype),"decode",this).call(this,e))}}])&&Ie(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),o}(ie);function Be(e){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(e)}function Ce(e,t){for(var r=0;r256||n%8!=0)&&Fe.throwArgumentError("invalid "+r[1]+" bit length","param",e),new ke(n/8,"int"===r[1],e.name)}if(r=e.type.match(He)){var a=parseInt(r[1]);return(0===a||a>32)&&Fe.throwArgumentError("invalid bytes length","param",e),new ue(a,e.name)}return Fe.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new S(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new k(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(p.from(e))}));return new De(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&Fe.throwError("types/values length mismatch",a.Yd.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(p.from(e))})),i=new De(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,a=e.map((function(e){return n._getCoder(p.from(e))}));return new De(a,"_").decode(this._getReader((0,m.lE)(t),r))}}])&&ze(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();new Ke},71254:(e,t,r)=>{"use strict";r.d(t,{Kn:()=>h});var n=r(33271),a=r(31944),i=r(13666),o=new(r(62269).Yd)("address/5.7.0");function c(e){(0,n.A7)(e,20)||o.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),a=0;a<40;a++)r[a]=t[a].charCodeAt(0);for(var c=(0,n.lE)((0,i.w)(r)),f=0;f<40;f+=2)c[f>>1]>>4>=8&&(t[f]=t[f].toUpperCase()),(15&c[f>>1])>=8&&(t[f+1]=t[f+1].toUpperCase());return"0x"+t.join("")}for(var f={},d=0;d<10;d++)f[String(d)]=String(d);for(var s=0;s<26;s++)f[String.fromCharCode(65+s)]=String(10+s);var u,b=Math.floor((u=9007199254740991,Math.log10?Math.log10(u):Math.log(u)/Math.LN10));function h(e){var t=null;if("string"!=typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return f[e]})).join("");t.length>=b;){var r=t.substring(0,b);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}(e)&&o.throwArgumentError("bad icap checksum","address",e),t=(0,a.g$)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}},31944:(e,t,r)=>{"use strict";r.d(t,{O$:()=>h,g$:()=>y});var n=r(77303),a=r.n(n),i=r(33271),o=r(62269);function c(e,t){for(var r=0;r0&&(10===arguments[0]?b||(b=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.Yd.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",o.Yd.errors.UNEXPECTED_ARGUMENT,{})),x(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],n=[{key:"from",value:function(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(s,l(t)):t.match(/^-?[0-9]+$/)?new e(s,l(new f(t))):d.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&m("underflow","BigNumber.from",t),(t>=u||t<=-u)&&m("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if((0,i._t)(r))return e.from((0,i.Dv)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var a=r._hex;if(null==a&&"BigNumber"===r.type&&(a=r.hex),"string"==typeof a&&((0,i.A7)(a)||"-"===a[0]&&(0,i.A7)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],r&&c(t.prototype,r),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function l(e){if("string"!=typeof e)return l(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=l(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function p(e){return h.from(l(e))}function x(e){var t=h.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16)}function m(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,o.Yd.errors.NUMERIC_FAULT,n)}function y(e){return new f(e,36).toString(16)}},77303:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}!function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===n(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(88677).Buffer}catch(e){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===n(e))return this._initArray(e,t,r);"hex"===t&&(t=16),a(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&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)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}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"],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],p=[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 x(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,x=0|o[2],m=8191&x,y=x>>>13,v=0|o[3],g=8191&v,w=v>>>13,M=0|o[4],_=8191&M,k=M>>>13,S=0|o[5],A=8191&S,E=S>>>13,T=0|o[6],O=8191&T,I=T>>>13,P=0|o[7],j=8191&P,L=P>>>13,N=0|o[8],B=8191&N,C=N>>>13,R=0|o[9],U=8191&R,D=R>>>13,z=0|c[0],F=8191&z,H=z>>>13,q=0|c[1],K=8191&q,G=q>>>13,Z=0|c[2],W=8191&Z,V=Z>>>13,Y=0|c[3],J=8191&Y,X=Y>>>13,Q=0|c[4],$=8191&Q,ee=Q>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var xe=(d+(n=Math.imul(u,F))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,F)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(l,F),a=(a=Math.imul(l,H))+Math.imul(p,F)|0,i=Math.imul(p,H);var me=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),a=(a=Math.imul(m,H))+Math.imul(y,F)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,W)|0)|0)+((8191&(a=(a=a+Math.imul(u,V)|0)+Math.imul(b,W)|0))<<13)|0;d=((i=i+Math.imul(b,V)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,F),a=(a=Math.imul(g,H))+Math.imul(w,F)|0,i=Math.imul(w,H),n=n+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,W)|0,a=(a=a+Math.imul(l,V)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,V)|0;var ve=(d+(n=n+Math.imul(u,J)|0)|0)+((8191&(a=(a=a+Math.imul(u,X)|0)+Math.imul(b,J)|0))<<13)|0;d=((i=i+Math.imul(b,X)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,F),a=(a=Math.imul(_,H))+Math.imul(k,F)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,V)|0,n=n+Math.imul(l,J)|0,a=(a=a+Math.imul(l,X)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,X)|0;var ge=(d+(n=n+Math.imul(u,$)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,$)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,F),a=(a=Math.imul(A,H))+Math.imul(E,F)|0,i=Math.imul(E,H),n=n+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,W)|0,a=(a=a+Math.imul(g,V)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,V)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(l,$)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,F),a=(a=Math.imul(O,H))+Math.imul(I,F)|0,i=Math.imul(I,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(_,W)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,V)|0,n=n+Math.imul(g,J)|0,a=(a=a+Math.imul(g,X)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,X)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,F),a=(a=Math.imul(j,H))+Math.imul(L,F)|0,i=Math.imul(L,H),n=n+Math.imul(O,K)|0,a=(a=a+Math.imul(O,G)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,G)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,V)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,V)|0,n=n+Math.imul(_,J)|0,a=(a=a+Math.imul(_,X)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(g,$)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,a=(a=a+Math.imul(m,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var _e=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,F),a=(a=Math.imul(B,H))+Math.imul(C,F)|0,i=Math.imul(C,H),n=n+Math.imul(j,K)|0,a=(a=a+Math.imul(j,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(O,W)|0,a=(a=a+Math.imul(O,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(_,$)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,F),a=(a=Math.imul(U,H))+Math.imul(D,F)|0,i=Math.imul(D,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(j,W)|0,a=(a=a+Math.imul(j,V)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,V)|0,n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(I,J)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(A,$)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(m,fe)|0,a=(a=a+Math.imul(m,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(D,K)|0,i=Math.imul(D,G),n=n+Math.imul(B,W)|0,a=(a=a+Math.imul(B,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,n=n+Math.imul(j,J)|0,a=(a=a+Math.imul(j,X)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,W),a=(a=Math.imul(U,V))+Math.imul(D,W)|0,i=Math.imul(D,V),n=n+Math.imul(B,J)|0,a=(a=a+Math.imul(B,X)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(j,$)|0,a=(a=a+Math.imul(j,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(_,fe)|0,a=(a=a+Math.imul(_,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(m,le)|0)|0)+((8191&(a=(a=a+Math.imul(m,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,J),a=(a=Math.imul(U,X))+Math.imul(D,J)|0,i=Math.imul(D,X),n=n+Math.imul(B,$)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,a=(a=a+Math.imul(j,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Te=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,$),a=(a=Math.imul(U,ee))+Math.imul(D,$)|0,i=Math.imul(D,ee),n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(j,ie)|0,a=(a=a+Math.imul(j,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(O,fe)|0,a=(a=a+Math.imul(O,de)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Oe=(d+(n=n+Math.imul(_,le)|0)|0)+((8191&(a=(a=a+Math.imul(_,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,n=n+Math.imul(j,fe)|0,a=(a=a+Math.imul(j,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(O,ue)|0,a=(a=a+Math.imul(O,be)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0;var Ie=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(D,ie)|0,i=Math.imul(D,oe),n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,de)|0,n=n+Math.imul(j,ue)|0,a=(a=a+Math.imul(j,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Pe=(d+(n=n+Math.imul(O,le)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(I,le)|0))<<13)|0;d=((i=i+Math.imul(I,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(D,fe)|0,i=Math.imul(D,de),n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,be)|0;var je=(d+(n=n+Math.imul(j,le)|0)|0)+((8191&(a=(a=a+Math.imul(j,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(D,ue)|0,i=Math.imul(D,be);var Le=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(C,le)|0))<<13)|0;d=((i=i+Math.imul(C,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ne=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(D,le)|0))<<13)|0;return d=((i=Math.imul(D,pe))+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,f[0]=xe,f[1]=me,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=Me,f[7]=_e,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Te,f[13]=Oe,f[14]=Ie,f[15]=Pe,f[16]=je,f[17]=Le,f[18]=Ne,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(m=x),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?x(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!=(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){E.call(this,e),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)}M.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(_,M),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,x=0;0!==p.cmp(c);x++)p=p.redSqr();a(x=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4==++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,E),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},33271:(e,t,r)=>{"use strict";r.d(t,{lE:()=>d,zo:()=>s,xs:()=>m,E1:()=>p,p3:()=>x,$m:()=>y,Dv:()=>l,_t:()=>f,Zq:()=>o,A7:()=>b,N:()=>v,G1:()=>u});var n=new(r(62269).Yd)("bytes/5.7.0");function a(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function o(e){return b(e)&&!(e.length%2)||f(e)}function c(e){return"number"==typeof e&&e==e&&e%1==0}function f(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!c(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function d(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),i(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e)&&(e=e.toHexString()),b(e)){var o=e.substring(2);o.length%2&&("left"===t.hexPad?o="0"+o:"right"===t.hexPad?o+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var c=[],d=0;d>4]+h[15&c]}return i}return n.throwArgumentError("invalid hexlify value","value",e)}function p(e){if("string"!=typeof e)e=l(e);else if(!b(e)||e.length%2)return null;return(e.length-2)/2}function x(e,t,r){return"string"!=typeof e?e=l(e):(!b(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function m(e){var t="0x";return e.forEach((function(e){t+=l(e).substring(2)})),t}function y(e,t){for("string"!=typeof e?e=l(e):b(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function v(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(o(e)){var r=d(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=l(r.slice(0,32)),t.s=l(r.slice(32,64))):65===r.length?(t.r=l(r.slice(0,32)),t.s=l(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=l(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var a=function(e,t){(e=d(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),i(r)}(d(t._vs),32);t._vs=l(a);var c=a[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=c:t.recoveryParam!==c&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),a[0]&=127;var f=l(a);null==t.s?t.s=f:t.s!==f&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var s=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==s&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&b(t.r)?t.r=y(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&b(t.s)?t.s=y(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);var u=d(t.s);u[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(u[0]|=128);var h=l(u);t._vs&&(b(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=y(t._vs,32)),null==t._vs?t._vs=h:t._vs!==h&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}},65854:(e,t,r)=>{"use strict";r.d(t,{Bz:()=>c,_Y:()=>i,fh:()=>o,tL:()=>a});var n=r(31944),a=n.O$.from(-1),i=n.O$.from(0),o=n.O$.from(1),c=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},13666:(e,t,r)=>{"use strict";r.d(t,{w:()=>o});var n=r(56806),a=r.n(n),i=r(33271);function o(e){return"0x"+a().keccak_256((0,i.lE)(e))}},62269:(e,t,r)=>{"use strict";function n(e,t){for(var r=0;rh});var a,i,o=!1,c=!1,f={debug:1,default:2,info:2,warning:3,error:4,off:5},d=f.default,s=null,u=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(a||(a={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(i||(i={}));var b="0123456789abcdef",h=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}var t,r,a;return t=e,r=[{key:"_log",value:function(e,t){var r=e.toLowerCase();null==f[r]&&this.throwArgumentError("invalid log level name","logLevel",e),d>f[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n>4],r+=b[15&t[i]];a.push(e+"=Uint8Array(0x"+r+")")}else a.push(e+"="+JSON.stringify(t))}catch(t){a.push(e+"="+JSON.stringify(n[e].toString()))}})),a.push("code=".concat(r)),a.push("version=".concat(this.version));var o=t,f="";switch(r){case i.NUMERIC_FAULT:f="NUMERIC_FAULT";var d=t;switch(d){case"overflow":case"underflow":case"division-by-zero":f+="-"+d;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result"}break;case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:f=r}f&&(t+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),a.length&&(t+=" ("+a.join(", ")+")");var s=new Error(t);return s.reason=o,s.code=r,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),u&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}},{key:"checkSafeUint53",value:function(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",tr&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}],a=[{key:"globalLogger",value:function(){return s||(s=new e("logger/5.7.0")),s}},{key:"setCensorship",value:function(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}c=!!t,o=!!r}},{key:"setLogLevel",value:function(t){var r=f[t.toLowerCase()];null!=r?d=r:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}],r&&n(t.prototype,r),a&&n(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();h.errors=i,h.levels=a},31338:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{uj:()=>o,zG:()=>i});var a=new(r(62269).Yd)("properties/5.7.0");function i(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function o(e,t){e&&"object"===n(e)||a.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||a.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}},51143:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}!function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===n(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(62808).Buffer}catch(e){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===n(e))return this._initArray(e,t,r);"hex"===t&&(t=16),a(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&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)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}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"],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],p=[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 x(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,x=0|o[2],m=8191&x,y=x>>>13,v=0|o[3],g=8191&v,w=v>>>13,M=0|o[4],_=8191&M,k=M>>>13,S=0|o[5],A=8191&S,E=S>>>13,T=0|o[6],O=8191&T,I=T>>>13,P=0|o[7],j=8191&P,L=P>>>13,N=0|o[8],B=8191&N,C=N>>>13,R=0|o[9],U=8191&R,D=R>>>13,z=0|c[0],F=8191&z,H=z>>>13,q=0|c[1],K=8191&q,G=q>>>13,Z=0|c[2],W=8191&Z,V=Z>>>13,Y=0|c[3],J=8191&Y,X=Y>>>13,Q=0|c[4],$=8191&Q,ee=Q>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var xe=(d+(n=Math.imul(u,F))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,F)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(l,F),a=(a=Math.imul(l,H))+Math.imul(p,F)|0,i=Math.imul(p,H);var me=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),a=(a=Math.imul(m,H))+Math.imul(y,F)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,W)|0)|0)+((8191&(a=(a=a+Math.imul(u,V)|0)+Math.imul(b,W)|0))<<13)|0;d=((i=i+Math.imul(b,V)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,F),a=(a=Math.imul(g,H))+Math.imul(w,F)|0,i=Math.imul(w,H),n=n+Math.imul(m,K)|0,a=(a=a+Math.imul(m,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,W)|0,a=(a=a+Math.imul(l,V)|0)+Math.imul(p,W)|0,i=i+Math.imul(p,V)|0;var ve=(d+(n=n+Math.imul(u,J)|0)|0)+((8191&(a=(a=a+Math.imul(u,X)|0)+Math.imul(b,J)|0))<<13)|0;d=((i=i+Math.imul(b,X)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,F),a=(a=Math.imul(_,H))+Math.imul(k,F)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,V)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,V)|0,n=n+Math.imul(l,J)|0,a=(a=a+Math.imul(l,X)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,X)|0;var ge=(d+(n=n+Math.imul(u,$)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,$)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,F),a=(a=Math.imul(A,H))+Math.imul(E,F)|0,i=Math.imul(E,H),n=n+Math.imul(_,K)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,W)|0,a=(a=a+Math.imul(g,V)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,V)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,X)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,X)|0,n=n+Math.imul(l,$)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,F),a=(a=Math.imul(O,H))+Math.imul(I,F)|0,i=Math.imul(I,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(_,W)|0,a=(a=a+Math.imul(_,V)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,V)|0,n=n+Math.imul(g,J)|0,a=(a=a+Math.imul(g,X)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,X)|0,n=n+Math.imul(m,$)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,F),a=(a=Math.imul(j,H))+Math.imul(L,F)|0,i=Math.imul(L,H),n=n+Math.imul(O,K)|0,a=(a=a+Math.imul(O,G)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,G)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,V)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,V)|0,n=n+Math.imul(_,J)|0,a=(a=a+Math.imul(_,X)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(g,$)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,a=(a=a+Math.imul(m,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var _e=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,F),a=(a=Math.imul(B,H))+Math.imul(C,F)|0,i=Math.imul(C,H),n=n+Math.imul(j,K)|0,a=(a=a+Math.imul(j,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(O,W)|0,a=(a=a+Math.imul(O,V)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,V)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,X)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(_,$)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(m,ie)|0,a=(a=a+Math.imul(m,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,F),a=(a=Math.imul(U,H))+Math.imul(D,F)|0,i=Math.imul(D,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(j,W)|0,a=(a=a+Math.imul(j,V)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,V)|0,n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,X)|0)+Math.imul(I,J)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(A,$)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(m,fe)|0,a=(a=a+Math.imul(m,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(D,K)|0,i=Math.imul(D,G),n=n+Math.imul(B,W)|0,a=(a=a+Math.imul(B,V)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,V)|0,n=n+Math.imul(j,J)|0,a=(a=a+Math.imul(j,X)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(m,ue)|0,a=(a=a+Math.imul(m,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,W),a=(a=Math.imul(U,V))+Math.imul(D,W)|0,i=Math.imul(D,V),n=n+Math.imul(B,J)|0,a=(a=a+Math.imul(B,X)|0)+Math.imul(C,J)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(j,$)|0,a=(a=a+Math.imul(j,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(_,fe)|0,a=(a=a+Math.imul(_,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(m,le)|0)|0)+((8191&(a=(a=a+Math.imul(m,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,J),a=(a=Math.imul(U,X))+Math.imul(D,J)|0,i=Math.imul(D,X),n=n+Math.imul(B,$)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,a=(a=a+Math.imul(j,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Te=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,$),a=(a=Math.imul(U,ee))+Math.imul(D,$)|0,i=Math.imul(D,ee),n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(j,ie)|0,a=(a=a+Math.imul(j,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(O,fe)|0,a=(a=a+Math.imul(O,de)|0)+Math.imul(I,fe)|0,i=i+Math.imul(I,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Oe=(d+(n=n+Math.imul(_,le)|0)|0)+((8191&(a=(a=a+Math.imul(_,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(D,re)|0,i=Math.imul(D,ne),n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,oe)|0,n=n+Math.imul(j,fe)|0,a=(a=a+Math.imul(j,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(O,ue)|0,a=(a=a+Math.imul(O,be)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0;var Ie=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(D,ie)|0,i=Math.imul(D,oe),n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(C,fe)|0,i=i+Math.imul(C,de)|0,n=n+Math.imul(j,ue)|0,a=(a=a+Math.imul(j,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Pe=(d+(n=n+Math.imul(O,le)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(I,le)|0))<<13)|0;d=((i=i+Math.imul(I,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(D,fe)|0,i=Math.imul(D,de),n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,be)|0;var je=(d+(n=n+Math.imul(j,le)|0)|0)+((8191&(a=(a=a+Math.imul(j,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(D,ue)|0,i=Math.imul(D,be);var Le=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(C,le)|0))<<13)|0;d=((i=i+Math.imul(C,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ne=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(D,le)|0))<<13)|0;return d=((i=Math.imul(D,pe))+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,f[0]=xe,f[1]=me,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=Me,f[7]=_e,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Te,f[13]=Oe,f[14]=Ie,f[15]=Pe,f[16]=je,f[17]=Le,f[18]=Ne,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(m=x),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?x(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!=(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){E.call(this,e),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)}M.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(_,M),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,x=0;0!==p.cmp(c);x++)p=p.redSqr();a(x=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4==++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,E),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},67005:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TransactionTypes:()=>ue,accessListify:()=>we,computeAddress:()=>me,parse:()=>Ee,recoverAddress:()=>ye,serialize:()=>Se});var n=r(71254),a=r(31944),i=r(33271),o=r(65854),c=r(13666),f=r(31338),d=r(62269),s=new d.Yd("rlp/5.7.0");function u(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function b(e,t,r){for(var n=0,a=0;at+1+n&&s.throwError("child data too short",d.Yd.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function x(e,t){if(0===e.length&&s.throwError("data too short",d.Yd.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&s.throwError("data short segment too short",d.Yd.errors.BUFFER_OVERRUN,{});var n=b(e,t+1,r);return t+1+r+n>e.length&&s.throwError("data long segment too short",d.Yd.errors.BUFFER_OVERRUN,{}),p(e,t,t+1+r,r+n)}if(e[t]>=192){var a=e[t]-192;return t+1+a>e.length&&s.throwError("data array too short",d.Yd.errors.BUFFER_OVERRUN,{}),p(e,t,t+1,a)}if(e[t]>=184){var o=e[t]-183;t+1+o>e.length&&s.throwError("data array too short",d.Yd.errors.BUFFER_OVERRUN,{});var c=b(e,t+1,o);return t+1+o+c>e.length&&s.throwError("data array too short",d.Yd.errors.BUFFER_OVERRUN,{}),{consumed:1+o+c,result:(0,i.Dv)(e.slice(t+1+o,t+1+o+c))}}if(e[t]>=128){var f=e[t]-128;return t+1+f>e.length&&s.throwError("data too short",d.Yd.errors.BUFFER_OVERRUN,{}),{consumed:1+f,result:(0,i.Dv)(e.slice(t+1,t+1+f))}}return{consumed:1,result:(0,i.Dv)(e[t])}}function m(e){var t=(0,i.lE)(e),r=x(t,0);return r.consumed!==t.length&&s.throwArgumentError("invalid rlp data","data",e),r.result}var y=r(51143),v=r.n(y),g=r(71285),w=r.n(g);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function _(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var k=S;function S(e,t){if(!e)throw new Error(t||"Assertion failed")}S.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var A=_((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>8,o=255&a;i?r.push(i,o):r.push(o)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}})),E=_((function(e,t){var r=t;r.assert=k,r.toArray=A.toArray,r.zero2=A.zero2,r.toHex=A.toHex,r.encode=A.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!=(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(v())(e,"hex","le")}})),T=E.getNAF,O=E.getJSF,I=E.assert;function P(e,t){this.type=e,this.p=new(v())(t.p,16),this.red=t.prime?v().red(t.prime):v().mont(this.p),this.zero=new(v())(0).toRed(this.red),this.one=new(v())(1).toRed(this.red),this.two=new(v())(2).toRed(this.red),this.n=t.n&&new(v())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var j=P;function L(e,t){this.curve=e,this.type=t,this.precomputed=null}P.prototype.point=function(){throw new Error("Not implemented")},P.prototype.validate=function(){throw new Error("Not implemented")},P.prototype._fixedNafMul=function(e,t){I(e.precomputed);var r=e._getDoubles(),n=T(t,1,this._bitLength),a=(1<=i;f--)o=(o<<1)+n[f];c.push(o)}for(var d=this.jpoint(null,null,null),s=this.jpoint(null,null,null),u=a;u>0;u--){for(i=0;i=0;c--){for(var f=0;c>=0&&0===i[c];c--)f++;if(c>=0&&f++,o=o.dblp(f),c<0)break;var d=i[c];I(0!==d),o="affine"===e.type?d>0?o.mixedAdd(a[d-1>>1]):o.mixedAdd(a[-d-1>>1].neg()):d>0?o.add(a[d-1>>1]):o.add(a[-d-1>>1].neg())}return"affine"===e.type?o.toP():o},P.prototype._wnafMulAdd=function(e,t,r,n,a){var i,o,c,f=this._wnafT1,d=this._wnafT2,s=this._wnafT3,u=0;for(i=0;i=1;i-=2){var h=i-1,l=i;if(1===f[h]&&1===f[l]){var p=[t[h],null,null,t[l]];0===t[h].y.cmp(t[l].y)?(p[1]=t[h].add(t[l]),p[2]=t[h].toJ().mixedAdd(t[l].neg())):0===t[h].y.cmp(t[l].y.redNeg())?(p[1]=t[h].toJ().mixedAdd(t[l]),p[2]=t[h].add(t[l].neg())):(p[1]=t[h].toJ().mixedAdd(t[l]),p[2]=t[h].toJ().mixedAdd(t[l].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],m=O(r[h],r[l]);for(u=Math.max(m[0].length,u),s[h]=new Array(u),s[l]=new Array(u),o=0;o=0;i--){for(var M=0;i>=0;){var _=!0;for(o=0;o=0&&M++,g=g.dblp(M),i<0)break;for(o=0;o0?c=d[o][k-1>>1]:k<0&&(c=d[o][-k-1>>1].neg()),g="affine"===c.type?g.mixedAdd(c):g.add(c))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},L.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a