@depay/widgets 11.1.1 → 11.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function t(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function e(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t){var e={exports:{}};return t(e,e.exports),e.exports}var a=o((function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),s=o((function(t){var e=a.default;function n(){t.exports=n=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:A(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=d;var p={};function m(){}function g(){}function y(){}var v={};h(v,u,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(I([])));w&&w!==i&&o.call(w,u)&&(v=w);var M=y.prototype=m.prototype=Object.create(v);function k(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,n){function r(i,a,s,u){var c=f(t[i],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,i){r(t,e,n,i)}))}return i=i?i.then(o,o):o()}})}function A(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function x(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=f(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return g.prototype=y,a(M,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=h(y,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,h(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},r.awrap=function(t){return{__await:t}},k(L.prototype),h(L.prototype,c,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new L(d(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(M),h(M,l,"Generator"),h(M,u,(function(){return this})),h(M,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},r.values=I,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),u=s(),c=u;try{regeneratorRuntime=u}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=u:Function("r","regeneratorRuntime = r")(u)}const l="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxOTIgMTkyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxOTIgMTkyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGZpbGw9IiNGMEI5MEIiIGQ9Ik01NCw0MS4xbDQyLTI0LjJsNDIsMjQuMmwtMTUuNCw4LjlMOTYsMzQuOUw2OS40LDUwTDU0LDQxLjF6IE0xMzgsNzEuN2wtMTUuNC04LjlMOTYsNzhMNjkuNCw2Mi43bC0xNS40LDl2MTgKCUw4MC42LDEwNXYzMC41bDE1LjQsOWwxNS40LTlWMTA1TDEzOCw4OS43VjcxLjd6IE0xMzgsMTIwLjN2LTE4bC0xNS40LDguOXYxOEMxMjIuNiwxMjkuMSwxMzgsMTIwLjMsMTM4LDEyMC4zeiBNMTQ4LjksMTI2LjQKCWwtMjYuNiwxNS4zdjE4bDQyLTI0LjJWODdsLTE1LjQsOUMxNDguOSw5NiwxNDguOSwxMjYuNCwxNDguOSwxMjYuNHogTTEzMy41LDU2LjRsMTUuNCw5djE4bDE1LjQtOXYtMThsLTE1LjQtOUwxMzMuNSw1Ni40CglMMTMzLjUsNTYuNHogTTgwLjYsMTQ4LjN2MThsMTUuNCw5bDE1LjQtOXYtMThMOTYsMTU3LjFMODAuNiwxNDguM3ogTTU0LDEyMC4zbDE1LjQsOXYtMTguMUw1NCwxMDIuM0w1NCwxMjAuM0w1NCwxMjAuM3oKCSBNODAuNiw1Ni40bDE1LjQsOWwxNS40LTlMOTYsNDcuNUM5Niw0Ny40LDgwLjYsNTYuNCw4MC42LDU2LjRMODAuNiw1Ni40eiBNNDMuMSw2NS40bDE1LjQtOWwtMTUuNC05bC0xNS40LDl2MThsMTUuNCw5TDQzLjEsNjUuNAoJTDQzLjEsNjUuNHogTTQzLjEsOTUuOUwyNy43LDg3djQ4LjVsNDIsMjQuMnYtMThsLTI2LjYtMTUuM1Y5NS45TDQzLjEsOTUuOXoiLz4KPC9zdmc+Cg==";var h={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:l,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955","0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://bscscan.com/tx/${t.id||t}`:e?`https://bscscan.com/token/${e}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:l,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",symbol:"BUSD",name:"BUSD Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://integrate.depay.com/tokens/bsc/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb/image",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const d="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiCgkgaW1hZ2UtcmVuZGVyaW5nPSJvcHRpbWl6ZVF1YWxpdHkiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIgoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjgzLjUgMjgzLjUiCgkgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjgzLjUgMjgzLjU7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBmaWxsPSIjMzQzNDM0IiBkPSJNMTQxLjcsMjUuOWwtMS41LDUuMnYxNTMuM2wxLjUsMS41bDcxLjItNDIuMUwxNDEuNywyNS45eiIvPgoJCTxwYXRoIGZpbGw9IiM4QzhDOEMiIGQ9Ik0xNDEuNywyNS45TDcwLjYsMTQzLjhsNzEuMSw0Mi4xdi03NC40VjI1Ljl6Ii8+CgkJPHBhdGggZmlsbD0iIzNDM0MzQiIgZD0iTTE0MS43LDE5OS40bC0wLjgsMS4xdjU0LjZsMC44LDIuNWw3MS4yLTEwMC4zTDE0MS43LDE5OS40eiIvPgoJCTxwYXRoIGZpbGw9IiM4QzhDOEMiIGQ9Ik0xNDEuNywyNTcuNnYtNTguMmwtNzEuMS00Mi4xTDE0MS43LDI1Ny42eiIvPgoJCTxwYXRoIGZpbGw9IiMxNDE0MTQiIGQ9Ik0xNDEuNywxODUuOWw3MS4yLTQyLjFsLTcxLjItMzIuM1YxODUuOXoiLz4KCQk8cGF0aCBmaWxsPSIjMzkzOTM5IiBkPSJNNzAuNiwxNDMuOGw3MS4xLDQyLjF2LTc0LjRMNzAuNiwxNDMuOHoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K";var f={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",label:"Ethereum",fullName:"Ethereum Mainnet",logo:d,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7","0x6B175474E89094C44Da98b954EedeAC495271d0F"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://etherscan.io/tx/${t.id||t}`:e?`https://etherscan.io/token/${e}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:d,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x8E870D67F660D95d5be530380D0eC0bd388289E1",symbol:"USDP",name:"Pax Dollar",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x8E870D67F660D95d5be530380D0eC0bd388289E1/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://integrate.depay.com/tokens/ethereum/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb/image",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const p="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTkyIDE5MiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTkyIDE5MjsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8ZyBpZD0iY2lyY2xlIj4KCTxnIGlkPSJGYW50b20tY2lyY2xlIj4KCQk8Y2lyY2xlIGlkPSJPdmFsIiBmaWxsUnVsZT0iZXZlbm9kZCIgY2xpcFJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiMxOTY5RkYiIGNsYXNzPSJzdDAiIGN4PSI5NiIgY3k9Ijk2IiByPSI4MC40Ii8+CgkJPHBhdGggaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBkPSJNOTEuMSw0MS4yYzIuNy0xLjQsNi44LTEuNCw5LjUsMGwyNy42LDE0LjZjMS42LDAuOSwyLjUsMi4xLDIuNywzLjVoMHY3My4zCgkJCWMwLDEuNC0wLjksMi45LTIuNywzLjhsLTI3LjYsMTQuNmMtMi43LDEuNC02LjgsMS40LTkuNSwwbC0yNy42LTE0LjZjLTEuOC0wLjktMi42LTIuNC0yLjctMy44YzAtMC4xLDAtMC4zLDAtMC40bDAtNzIuNAoJCQljMC0wLjEsMC0wLjIsMC0wLjNsMC0wLjJoMGMwLjEtMS4zLDEtMi42LDIuNi0zLjVMOTEuMSw0MS4yeiBNMTI2LjYsOTkuOWwtMjYsMTMuN2MtMi43LDEuNC02LjgsMS40LTkuNSwwTDY1LjIsMTAwdjMyLjMKCQkJbDI1LjksMTMuNmMxLjUsMC44LDMuMSwxLjYsNC43LDEuN2wwLjEsMGMxLjUsMCwzLTAuOCw0LjYtMS41bDI2LjItMTMuOVY5OS45eiBNNTYuNSwxMzAuOWMwLDIuOCwwLjMsNC43LDEsNgoJCQljMC41LDEuMSwxLjMsMS45LDIuOCwyLjlsMC4xLDAuMWMwLjMsMC4yLDAuNywwLjQsMS4xLDAuN2wwLjUsMC4zbDEuNiwwLjlsLTIuMiwzLjdsLTEuNy0xLjFsLTAuMy0wLjJjLTAuNS0wLjMtMC45LTAuNi0xLjMtMC44CgkJCWMtNC4yLTIuOC01LjctNS45LTUuNy0xMi4zbDAtMC4ySDU2LjV6IE05My44LDgwLjVjLTAuMiwwLjEtMC40LDAuMS0wLjYsMC4yTDY1LjYsOTUuM2MwLDAtMC4xLDAtMC4xLDBsMCwwbDAsMGwwLjEsMGwyNy42LDE0LjYKCQkJYzAuMiwwLjEsMC40LDAuMiwwLjYsMC4yVjgwLjV6IE05OC4yLDgwLjV2MjkuOGMwLjItMC4xLDAuNC0wLjEsMC42LTAuMmwyNy42LTE0LjZjMCwwLDAuMSwwLDAuMSwwbDAsMGwwLDBsLTAuMSwwTDk4LjgsODAuNwoJCQlDOTguNiw4MC42LDk4LjQsODAuNSw5OC4yLDgwLjV6IE0xMjYuNiw2NC40bC0yNC44LDEzbDI0LjgsMTNWNjQuNHogTTY1LjIsNjQuNHYyNi4xbDI0LjgtMTNMNjUuMiw2NC40eiBNOTguNyw0NS4xCgkJCWMtMS40LTAuOC00LTAuOC01LjUsMEw2NS42LDU5LjdjMCwwLTAuMSwwLTAuMSwwbDAsMGwwLDBsMC4xLDBsMjcuNiwxNC42YzEuNCwwLjgsNCwwLjgsNS41LDBsMjcuNi0xNC42YzAsMCwwLjEsMCwwLjEsMGwwLDBsMCwwCgkJCWwtMC4xLDBMOTguNyw0NS4xeiBNMTMwLjcsNDYuNWwxLjcsMS4xbDAuMywwLjJjMC41LDAuMywwLjksMC42LDEuMywwLjhjNC4yLDIuOCw1LjcsNS45LDUuNywxMi4zbDAsMC4yaC00LjNjMC0yLjgtMC4zLTQuNy0xLTYKCQkJYy0wLjUtMS4xLTEuMy0xLjktMi44LTIuOWwtMC4xLTAuMWMtMC4zLTAuMi0wLjctMC40LTEuMS0wLjdsLTAuNS0wLjNsLTEuNi0wLjlMMTMwLjcsNDYuNXoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K";var m={name:"fantom",id:"0xFA",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:p,currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83"},stables:{usd:["0x04068DA6C83AFCFA0e13ba15A6696662335D5B75","0x049d68029688eAbF473097a2fC38ef61633A3C7A","0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://ftmscan.com/tx/${t.id||t}`:e?`https://ftmscan.com/token/${e}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:p,type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:p,type:"20"},{address:"0x04068DA6C83AFCFA0e13ba15A6696662335D5B75",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://assets.spooky.fi/tokens/DAI.png",type:"20"},{address:"0x049d68029688eAbF473097a2fC38ef61633A3C7A",symbol:"fUSDT",name:"Frapped USDT",decimals:6,logo:"https://assets.spooky.fi/tokens/fUSDT.png",type:"20"},{address:"0x74b23882a30290451A17c44f4F05243b6b58C76d",symbol:"ETH",name:"Ethereum",decimals:18,logo:"https://assets.spooky.fi/tokens/wETH.png",type:"20"},{address:"0x321162Cd933E2Be498Cd2267a90534A804051b11",symbol:"BTC",name:"Bitcoin",decimals:8,logo:"https://assets.spooky.fi/tokens/wBTC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const g="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA0NS40IDQ1LjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ1LjQgNDUuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjODI0N0U1IiBkPSJNMzEuOSwxNi42Yy0wLjctMC40LTEuNi0wLjQtMi4yLDBsLTUuMywzLjFsLTMuNSwybC01LjEsMy4xYy0wLjcsMC40LTEuNiwwLjQtMi4yLDBsLTQtMi40CgljLTAuNi0wLjQtMS4xLTEuMS0xLjEtMnYtNC42YzAtMC45LDAuNS0xLjYsMS4xLTJsNC0yLjNjMC43LTAuNCwxLjUtMC40LDIuMiwwbDQsMi40YzAuNywwLjQsMS4xLDEuMSwxLjEsMnYzLjFsMy41LTIuMXYtMy4yCgljMC0wLjktMC40LTEuNi0xLjEtMmwtNy41LTQuNGMtMC43LTAuNC0xLjUtMC40LTIuMiwwTDYsMTEuN2MtMC43LDAuNC0xLjEsMS4xLTEuMSwxLjh2OC43YzAsMC45LDAuNCwxLjYsMS4xLDJsNy42LDQuNAoJYzAuNywwLjQsMS41LDAuNCwyLjIsMGw1LjEtMi45bDMuNS0yLjFsNS4xLTIuOWMwLjctMC40LDEuNi0wLjQsMi4yLDBsNCwyLjNjMC43LDAuNCwxLjEsMS4xLDEuMSwydjQuNmMwLDAuOS0wLjQsMS42LTEuMSwyCglsLTMuOSwyLjNjLTAuNywwLjQtMS41LDAuNC0yLjIsMGwtNC0yLjNjLTAuNy0wLjQtMS4xLTEuMS0xLjEtMnYtMi45TDIxLDI4Ljd2My4xYzAsMC45LDAuNCwxLjYsMS4xLDJsNy41LDQuNAoJYzAuNywwLjQsMS41LDAuNCwyLjIsMGw3LjUtNC40YzAuNy0wLjQsMS4xLTEuMSwxLjEtMlYyM2MwLTAuOS0wLjQtMS42LTEuMS0yQzM5LjIsMjEsMzEuOSwxNi42LDMxLjksMTYuNnoiLz4KPC9zdmc+Cg==";var y={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon",fullName:"Polygon Mainnet",logo:g,currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"},stables:{usd:["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174","0xc2132D05D31c914a87C6611C10748AEb04B58e8F","0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://polygonscan.com/tx/${t.id||t}`:e?`https://polygonscan.com/token/${e}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://poly-rpc.gateway.pokt.network","https://polygon.llamarpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:g,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xa3Fa99A148fA48D14Ed51d610c367C61876997F1",symbol:"miMATIC",name:"miMATIC",decimals:18,logo:"https://raw.githubusercontent.com/0xlaozi/qidao/main/images/mimatic-red.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const v="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA0NS40IDQ1LjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ1LjQgNDUuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9IlNPTEFOQV9TVkdJRF8xIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjM1LjU5NzQiIHkxPSI3NzIuOTI3NyIgeDI9IjE4LjE0MjIiIHkyPSI4MDYuMzYxNiIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgLTc2NS43NjUpIj4KCTxzdG9wICBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiMwMEZGQTMiLz4KCTxzdG9wICBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOiNEQzFGRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPHBhdGggZmlsbD0idXJsKCNTT0xBTkFfU1ZHSURfMSkiIGQ9Ik0xMiwyOS4xYzAuMi0wLjIsMC41LTAuMywwLjctMC4zSDM4YzAuNSwwLDAuNywwLjYsMC40LDAuOWwtNSw1Yy0wLjIsMC4yLTAuNSwwLjMtMC43LDAuM0g3LjQKCUM2LjksMzUsNi43LDM0LjQsNywzNEwxMiwyOS4xeiIvPgo8bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzAwMDAwMTYwODY5NzIyMjI5NDY0Mzk5NzMwMDAwMDA5NDA3MDIxNTc4MjQ4MDg3NzExXyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIyNy45NTk1IiB5MT0iNzY5LjEyNDQiIHgyPSIxMC41MDQzIiB5Mj0iODAyLjU1ODIiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIC03NjUuNzY1KSI+Cgk8c3RvcCAgb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjojMDBGRkEzIi8+Cgk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojREMxRkZGIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxwYXRoIHN0eWxlPSJmaWxsOnVybCgjU1ZHSURfMDAwMDAxNjA4Njk3MjIyMjk0NjQzOTk3MzAwMDAwMDk0MDcwMjE1NzgyNDgwODc3MTFfKTsiIGQ9Ik0xMiwxMC42YzAuMi0wLjIsMC41LTAuMywwLjctMC4zSDM4CgljMC41LDAsMC43LDAuNiwwLjQsMC45bC01LDVjLTAuMiwwLjItMC41LDAuMy0wLjcsMC4zSDcuNGMtMC41LDAtMC43LTAuNi0wLjQtMC45TDEyLDEwLjZ6Ii8+CjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMDAwMDAxMzkyODMyMTczNzg2NTYwOTQ4NjAwMDAwMDM2OTQ4OTUzNzkwNzgxMTY3ODJfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjMxLjc0MDYiIHkxPSI3NzEuMDk4NSIgeDI9IjE0LjI4NTUiIHkyPSI4MDQuNTMyMyIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgLTc2NS43NjUpIj4KCTxzdG9wICBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiMwMEZGQTMiLz4KCTxzdG9wICBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOiNEQzFGRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPHBhdGggc3R5bGU9ImZpbGw6dXJsKCNTVkdJRF8wMDAwMDEzOTI4MzIxNzM3ODY1NjA5NDg2MDAwMDAwMzY5NDg5NTM3OTA3ODExNjc4Ml8pOyIgZD0iTTMzLjQsMTkuOGMtMC4yLTAuMi0wLjUtMC4zLTAuNy0wLjNINy40CgljLTAuNSwwLTAuNywwLjYtMC40LDAuOWw1LDVjMC4yLDAuMiwwLjUsMC4zLDAuNywwLjNIMzhjMC41LDAsMC43LTAuNiwwLjQtMC45TDMzLjQsMTkuOHoiLz4KPC9zdmc+Cg==";var b={name:"solana",networkId:"mainnetBeta",namespace:"solana",label:"Solana",fullName:"Solana",logo:v,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111"},wrapped:{address:"So11111111111111111111111111111111111111112"},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://solscan.io/tx/${t.id||t}`:e?`https://solscan.io/token/${e}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://solana-mainnet.rpc.extrnode.com"],rpc:"https://api.mainnet-beta.solana.com",tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:v,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E",symbol:"wBTC",name:"Wrapped Bitcoin (Sollet)",decimals:6,logo:"https://img.raydium.io/icon/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const w="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiCgkgdGV4dC1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iIGltYWdlLXJlbmRlcmluZz0ib3B0aW1pemVRdWFsaXR5IgoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDUuNCA0NS40IgoJIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ1LjQgNDUuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgo8L3N0eWxlPgo8cGF0aCBmaWxsPSIjMDAzN0MxIiBkPSJNMjguOCwyMi44bC02LjEsMTAuNmwtNi4xLTEwLjdMMjguOCwyMi44TDI4LjgsMjIuOHogTTM0LjksMTkuMkgxMC41bDEyLjIsMjEuNEwzNC45LDE5LjJ6IE02LjUsMTIuMWwyLDMuNgoJaDI4LjNsMi4xLTMuNkg2LjV6Ii8+Cjwvc3ZnPgo=";var M={name:"velas",id:"0x6a",networkId:"106",namespace:"eip155",label:"VELAS",fullName:"Velas EVM Mainnet",logo:w,currency:{name:"Velas",symbol:"VLX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126"},stables:{usd:["0xc111c29A988AE0C0087D97b33C6E6766808A3BD3","0x01445C31581c354b7338AC35693AB2001B50b9aE"]},explorer:"https://evmexplorer.velas.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://evmexplorer.velas.com/tx/${t.id||t}`:e?`https://evmexplorer.velas.com/token/${e}`:n?`https://evmexplorer.velas.com/address/${n}`:void 0,endpoints:["https://mainnet.velas.com/rpc","https://evmexplorer.velas.com/rpc","https://explorer.velas.com/rpc"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"VLX",name:"Velas",decimals:18,logo:w,type:"NATIVE"},{address:"0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126",symbol:"WVLX",name:"Wrapped Velas",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0xc579d1f3cf86749e05cd06f7ade17856c2ce3126/logo.png?raw=true",type:"20"},{address:"0xc111c29A988AE0C0087D97b33C6E6766808A3BD3",symbol:"BUSD",name:"Multichain BUSD",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0xc111c29a988ae0c0087d97b33c6e6766808a3bd3/logo.png?raw=true",type:"20"},{address:"0x01445C31581c354b7338AC35693AB2001B50b9aE",symbol:"USDT",name:"Multichain USDT",decimals:6,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0x01445c31581c354b7338ac35693ab2001b50b9ae/logo.png?raw=true",type:"20"},{address:"0x85219708c49aa701871Ad330A94EA0f41dFf24Ca",symbol:"ETH",name:"ETH",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0x85219708c49aa701871ad330a94ea0f41dff24ca/logo.png?raw=true",type:"20"},{address:"0xaBf26902Fd7B624e0db40D31171eA9ddDf078351",symbol:"WAG",name:"WagyuSwap",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0xabf26902fd7b624e0db40d31171ea9dddf078351/logo.png?raw=true",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const k=[f,h,y,b,m,M];for(var L={ethereum:f,bsc:h,polygon:y,solana:b,fantom:m,velas:M,all:k,findById:function(t){let e=t;e.match("0x0")&&(e=e.replace(/0x0+/,"0x"));let n=k.find((t=>t.id&&t.id.toLowerCase()==e.toLowerCase()));return n},findByNetworkId:function(t){t=t.toString();let e=k.find((e=>e.networkId==t));return e},findByName:function(t){return k.find((e=>e.name==t))}},A=function(t){var e=C(t),n=e[0],r=e[1];return 3*(n+r)/4-r},x=function(t){var e,n,r=C(t),i=r[0],o=r[1],a=new I(function(t,e,n){return 3*(e+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n<u;n+=4)e=S[t.charCodeAt(n)]<<18|S[t.charCodeAt(n+1)]<<12|S[t.charCodeAt(n+2)]<<6|S[t.charCodeAt(n+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;2===o&&(e=S[t.charCodeAt(n)]<<2|S[t.charCodeAt(n+1)]>>4,a[s++]=255&e);1===o&&(e=S[t.charCodeAt(n)]<<10|S[t.charCodeAt(n+1)]<<4|S[t.charCodeAt(n+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e);return a},E=function(t){for(var e,n=t.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(D(t,a,a+o>s?s:a+o));1===r?(e=t[n-1],i.push(N[e>>2]+N[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],i.push(N[e>>10]+N[e>>4&63]+N[e<<2&63]+"="));return i.join("")},N=[],S=[],I="undefined"!=typeof Uint8Array?Uint8Array:Array,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=0;j<64;++j)N[j]=T[j],S[T.charCodeAt(j)]=j;function C(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function D(t,e,n){for(var r,i,o=[],a=e;a<n;a+=3)r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(N[(i=r)>>18&63]+N[i>>12&63]+N[i>>6&63]+N[63&i]);return o.join("")}S["-".charCodeAt(0)]=62,S["_".charCodeAt(0)]=63;var O={byteLength:A,toByteArray:x,fromByteArray:E},_=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},z=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+f]=255&a,f+=p,a/=256,c-=8);t[n+f-p]|=128*m},P=o((function(t,e){const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(t){+t!=t&&(t=0);return o.alloc(+t)},e.INSPECT_MAX_BYTES=50;const r=2147483647;function i(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return a(t,e,n)}function a(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|d(t,e);let r=i(n);const a=r.write(t,e);a!==n&&(r=r.slice(0,a));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return l(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return l(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return o.from(r,e,n);const a=function(t){if(o.isBuffer(t)){const e=0|h(t.length),n=i(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||q(t.length)?i(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return s(t),i(t<0?0:0|h(t))}function c(t){const e=t.length<0?0:0|h(t.length),n=i(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function l(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,o.prototype),r}function h(t){if(t>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(t).length;default:if(i)return r?-1:G(t).length;e=(""+e).toLowerCase(),i=!0}}function f(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return L(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function p(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){let o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let r=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(c(t,o+r)!==c(e,r)){n=!1;break}if(n)return o}return-1}function y(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=e.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(e.substr(2*a,2),16);if(q(r))return a;t[n+a]=r}return a}function v(t,e,n,r){return V(G(e,t.length-n),t,n,r)}function b(t,e,n,r){return V(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return V(Z(e),t,n,r)}function M(t,e,n,r){return V(function(t,e){let n,r,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?O.fromByteArray(t):O.fromByteArray(t.slice(e,n))}function L(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:n=t[i+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(o=u));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(u=(15&e)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=t[i+1],r=t[i+2],s=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=A));return n}(r)}e.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,n){return a(t,e,n)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,n){return function(t,e,n){return s(t),t<=0?i(t):void 0!==e?"string"==typeof n?i(t).fill(e,n):i(t).fill(e):i(t)}(t,e,n)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(J(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=o.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(J(e,Uint8Array))i+e.length>r.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},o.byteLength=d,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)p(this,e,e+1);return this},o.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},o.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},o.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?L(this,0,t):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,n,r,i){if(J(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0);const u=Math.min(a,s),c=this.slice(r,i),l=t.slice(e,n);for(let t=0;t<u;++t)if(c[t]!==l[t]){a=c[t],s=l[t];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},o.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},o.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},o.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":case"latin1":case"binary":return b(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function x(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function E(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function N(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=e;r<n;++r)i+=X[t[r]];return i}function S(t,e,n){const r=t.slice(e,n);let i="";for(let t=0;t<r.length-1;t+=2)i+=String.fromCharCode(r[t]+256*r[t+1]);return i}function I(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,n,r,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function j(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function C(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,4),z(t,e,n,r,23,4),n+4}function B(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,8),z(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),o.prototype.readBigInt64BE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),_(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),_(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),_(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),_(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){T(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){T(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=K((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=K((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);T(this,t,e,n,r-1,-r)}let i=0,o=1,a=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);T(this,t,e,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=K((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=K((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},o.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const a=o.isBuffer(t)?t:o.from(t,r),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=a[i%s]}return this};const R={};function U(t,e,n){R[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function Q(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function W(t,e,n,r,i,o){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new R.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){F(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||Y(e,t.length-(n+1))}(r,i,o)}function F(t,e){if("number"!=typeof t)throw new R.ERR_INVALID_ARG_TYPE(e,"number",t)}function Y(t,e,n){if(Math.floor(t)!==t)throw F(t,n),new R.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new R.ERR_BUFFER_OUT_OF_BOUNDS;throw new R.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=Q(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=Q(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(t){return O.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?$:t}function $(){throw new Error("BigInt not supported")}})),B=o((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:P.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var c=t.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(t,l,l+r,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var h=1;for(c=u(t,l,t.length,e),l=0;l<a;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){c(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(a=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,c=0,l=0|a[0],h=8191&l,d=l>>>13,f=0|a[1],p=8191&f,m=f>>>13,g=0|a[2],y=8191&g,v=g>>>13,b=0|a[3],w=8191&b,M=b>>>13,k=0|a[4],L=8191&k,A=k>>>13,x=0|a[5],E=8191&x,N=x>>>13,S=0|a[6],I=8191&S,T=S>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],_=8191&O,z=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],Q=8191&U,W=U>>>13,F=0|s[1],Y=8191&F,H=F>>>13,G=0|s[2],Z=8191&G,V=G>>>13,J=0|s[3],q=8191&J,X=J>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,lt=0|s[8],ht=8191<,dt=lt>>>13,ft=0|s[9],pt=8191&ft,mt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(c+(r=Math.imul(h,Q))|0)+((8191&(i=(i=Math.imul(h,W))+Math.imul(d,Q)|0))<<13)|0;c=((o=Math.imul(d,W))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,Q),i=(i=Math.imul(p,W))+Math.imul(m,Q)|0,o=Math.imul(m,W);var yt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,Q),i=(i=Math.imul(y,W))+Math.imul(v,Q)|0,o=Math.imul(v,W),r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,H)|0;var vt=(c+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,Q),i=(i=Math.imul(w,W))+Math.imul(M,Q)|0,o=Math.imul(M,W),r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,H)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,V)|0;var bt=(c+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,W))+Math.imul(A,Q)|0,o=Math.imul(A,W),r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,H)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,X)|0;var wt=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(E,Q),i=(i=Math.imul(E,W))+Math.imul(N,Q)|0,o=Math.imul(N,W),r=r+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,H)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,H)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,W))+Math.imul(T,Q)|0,o=Math.imul(T,W),r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,H)|0,r=r+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var kt=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(C,Q),i=(i=Math.imul(C,W))+Math.imul(D,Q)|0,o=Math.imul(D,W),r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(L,q)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Lt=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(_,Q),i=(i=Math.imul(_,W))+Math.imul(z,Q)|0,o=Math.imul(z,W),r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,H)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var At=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,Q),i=(i=Math.imul(B,W))+Math.imul(R,Q)|0,o=Math.imul(R,W),r=r+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,H)|0,r=r+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var xt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,H))+Math.imul(R,Y)|0,o=Math.imul(R,H),r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(z,Z)|0,o=o+Math.imul(z,V)|0,r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,V))+Math.imul(R,Z)|0,o=Math.imul(R,V),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(z,q)|0,o=o+Math.imul(z,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var Nt=(c+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,X))+Math.imul(R,q)|0,o=Math.imul(R,X),r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(z,$)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(C,nt)|0,i=(i=i+Math.imul(C,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var St=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(R,$)|0,o=Math.imul(R,tt),r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(z,nt)|0,o=o+Math.imul(z,rt)|0,r=r+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var It=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(R,nt)|0,o=Math.imul(R,rt),r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,at)|0,r=r+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,dt)|0;var Tt=(c+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,at))+Math.imul(R,ot)|0,o=Math.imul(R,at),r=r+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,dt)|0;var jt=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(R,ut)|0,o=Math.imul(R,ct),r=r+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(z,ht)|0,o=o+Math.imul(z,dt)|0;var Ct=(c+(r=r+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(R,ht)|0,o=Math.imul(R,dt);var Dt=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(z,pt)|0))<<13)|0;c=((o=o+Math.imul(z,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(R,pt)|0))<<13)|0;return c=((o=Math.imul(R,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=kt,u[7]=Lt,u[8]=At,u[9]=xt,u[10]=Et,u[11]=Nt,u[12]=St,u[13]=It,u[14]=Tt,u[15]=jt,u[16]=Ct,u[17]=Dt,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;s=67108863&(d=d+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(o,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=d)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new A(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function L(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(M,b),r(k,b),r(L,b),L.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new L}return v[t]=e,e},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),d=this.pow(t,o.addn(1).iushrn(1)),f=this.pow(t,o),p=a;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var y=this.pow(h,new i(1).iushln(p-g-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=g}return d},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new x(t)},r(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,r)}));
|
|
1
|
+
function t(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function e(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t){var e={exports:{}};return t(e,e.exports),e.exports}var a=o((function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),s=o((function(t){var e=a.default;function n(){t.exports=n=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:A(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=d;var p={};function m(){}function g(){}function y(){}var v={};h(v,u,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(I([])));w&&w!==i&&o.call(w,u)&&(v=w);var M=y.prototype=m.prototype=Object.create(v);function k(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,n){function r(i,a,s,u){var c=f(t[i],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,i){r(t,e,n,i)}))}return i=i?i.then(o,o):o()}})}function A(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function x(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=f(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return g.prototype=y,a(M,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=h(y,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,h(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},r.awrap=function(t){return{__await:t}},k(L.prototype),h(L.prototype,c,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new L(d(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(M),h(M,l,"Generator"),h(M,u,(function(){return this})),h(M,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},r.values=I,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),u=s(),c=u;try{regeneratorRuntime=u}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=u:Function("r","regeneratorRuntime = r")(u)}const l="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxOTIgMTkyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxOTIgMTkyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGZpbGw9IiNGMEI5MEIiIGQ9Ik01NCw0MS4xbDQyLTI0LjJsNDIsMjQuMmwtMTUuNCw4LjlMOTYsMzQuOUw2OS40LDUwTDU0LDQxLjF6IE0xMzgsNzEuN2wtMTUuNC04LjlMOTYsNzhMNjkuNCw2Mi43bC0xNS40LDl2MTgKCUw4MC42LDEwNXYzMC41bDE1LjQsOWwxNS40LTlWMTA1TDEzOCw4OS43VjcxLjd6IE0xMzgsMTIwLjN2LTE4bC0xNS40LDguOXYxOEMxMjIuNiwxMjkuMSwxMzgsMTIwLjMsMTM4LDEyMC4zeiBNMTQ4LjksMTI2LjQKCWwtMjYuNiwxNS4zdjE4bDQyLTI0LjJWODdsLTE1LjQsOUMxNDguOSw5NiwxNDguOSwxMjYuNCwxNDguOSwxMjYuNHogTTEzMy41LDU2LjRsMTUuNCw5djE4bDE1LjQtOXYtMThsLTE1LjQtOUwxMzMuNSw1Ni40CglMMTMzLjUsNTYuNHogTTgwLjYsMTQ4LjN2MThsMTUuNCw5bDE1LjQtOXYtMThMOTYsMTU3LjFMODAuNiwxNDguM3ogTTU0LDEyMC4zbDE1LjQsOXYtMTguMUw1NCwxMDIuM0w1NCwxMjAuM0w1NCwxMjAuM3oKCSBNODAuNiw1Ni40bDE1LjQsOWwxNS40LTlMOTYsNDcuNUM5Niw0Ny40LDgwLjYsNTYuNCw4MC42LDU2LjRMODAuNiw1Ni40eiBNNDMuMSw2NS40bDE1LjQtOWwtMTUuNC05bC0xNS40LDl2MThsMTUuNCw5TDQzLjEsNjUuNAoJTDQzLjEsNjUuNHogTTQzLjEsOTUuOUwyNy43LDg3djQ4LjVsNDIsMjQuMnYtMThsLTI2LjYtMTUuM1Y5NS45TDQzLjEsOTUuOXoiLz4KPC9zdmc+Cg==";var h={name:"bsc",id:"0x38",networkId:"56",namespace:"eip155",label:"BNB Smart Chain",fullName:"BNB Smart Chain Mainnet",logo:l,currency:{name:"BNB",symbol:"BNB",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"},stables:{usd:["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","0x55d398326f99059fF775485246999027B3197955","0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56"]},explorer:"https://bscscan.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://bscscan.com/tx/${t.id||t}`:e?`https://bscscan.com/token/${e}`:n?`https://bscscan.com/address/${n}`:void 0,endpoints:["https://bsc-dataseed.binance.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed3.defibit.io"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",name:"Binance Coin",decimals:18,logo:l,type:"NATIVE"},{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",name:"Wrapped BNB",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",type:"20"},{address:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",symbol:"BUSD",name:"BUSD Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56/logo.png",type:"20"},{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",name:"Tether USD",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",type:"20"},{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",name:"USD Coin",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d/logo.png",type:"20"},{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:"ETH",name:"Ethereum Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",type:"20"},{address:"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",symbol:"Cake",name:"PancakeSwap Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",type:"20"},{address:"0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",symbol:"BTCB",name:"BTCB Token",decimals:18,logo:"https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://integrate.depay.com/tokens/bsc/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb/image",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const d="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiCgkgaW1hZ2UtcmVuZGVyaW5nPSJvcHRpbWl6ZVF1YWxpdHkiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIgoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjgzLjUgMjgzLjUiCgkgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjgzLjUgMjgzLjU7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBmaWxsPSIjMzQzNDM0IiBkPSJNMTQxLjcsMjUuOWwtMS41LDUuMnYxNTMuM2wxLjUsMS41bDcxLjItNDIuMUwxNDEuNywyNS45eiIvPgoJCTxwYXRoIGZpbGw9IiM4QzhDOEMiIGQ9Ik0xNDEuNywyNS45TDcwLjYsMTQzLjhsNzEuMSw0Mi4xdi03NC40VjI1Ljl6Ii8+CgkJPHBhdGggZmlsbD0iIzNDM0MzQiIgZD0iTTE0MS43LDE5OS40bC0wLjgsMS4xdjU0LjZsMC44LDIuNWw3MS4yLTEwMC4zTDE0MS43LDE5OS40eiIvPgoJCTxwYXRoIGZpbGw9IiM4QzhDOEMiIGQ9Ik0xNDEuNywyNTcuNnYtNTguMmwtNzEuMS00Mi4xTDE0MS43LDI1Ny42eiIvPgoJCTxwYXRoIGZpbGw9IiMxNDE0MTQiIGQ9Ik0xNDEuNywxODUuOWw3MS4yLTQyLjFsLTcxLjItMzIuM1YxODUuOXoiLz4KCQk8cGF0aCBmaWxsPSIjMzkzOTM5IiBkPSJNNzAuNiwxNDMuOGw3MS4xLDQyLjF2LTc0LjRMNzAuNiwxNDMuOHoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K";var f={name:"ethereum",id:"0x1",networkId:"1",namespace:"eip155",label:"Ethereum",fullName:"Ethereum Mainnet",logo:d,currency:{name:"Ether",symbol:"ETH",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"},stables:{usd:["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7","0x6B175474E89094C44Da98b954EedeAC495271d0F"]},explorer:"https://etherscan.io",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://etherscan.io/tx/${t.id||t}`:e?`https://etherscan.io/token/${e}`:n?`https://etherscan.io/address/${n}`:void 0,endpoints:["https://rpc.ankr.com/eth","https://eth.llamarpc.com","https://ethereum.publicnode.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",name:"Ether",decimals:18,logo:d,type:"NATIVE"},{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x853d955aCEf822Db058eb8505911ED77F175b99e",symbol:"FRAX",name:"Frax",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x853d955aCEf822Db058eb8505911ED77F175b99e/logo.png",type:"20"},{address:"0x8E870D67F660D95d5be530380D0eC0bd388289E1",symbol:"USDP",name:"Pax Dollar",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x8E870D67F660D95d5be530380D0eC0bd388289E1/logo.png",type:"20"},{address:"0x956F47F50A910163D8BF957Cf5846D573E7f87CA",symbol:"FEI",name:"Fei USD",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x956F47F50A910163D8BF957Cf5846D573E7f87CA/logo.png",type:"20"},{address:"0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb",symbol:"DEPAY",name:"DePay",decimals:18,logo:"https://integrate.depay.com/tokens/ethereum/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb/image",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const p="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTkyIDE5MiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTkyIDE5MjsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8ZyBpZD0iY2lyY2xlIj4KCTxnIGlkPSJGYW50b20tY2lyY2xlIj4KCQk8Y2lyY2xlIGlkPSJPdmFsIiBmaWxsUnVsZT0iZXZlbm9kZCIgY2xpcFJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiMxOTY5RkYiIGNsYXNzPSJzdDAiIGN4PSI5NiIgY3k9Ijk2IiByPSI4MC40Ii8+CgkJPHBhdGggaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBkPSJNOTEuMSw0MS4yYzIuNy0xLjQsNi44LTEuNCw5LjUsMGwyNy42LDE0LjZjMS42LDAuOSwyLjUsMi4xLDIuNywzLjVoMHY3My4zCgkJCWMwLDEuNC0wLjksMi45LTIuNywzLjhsLTI3LjYsMTQuNmMtMi43LDEuNC02LjgsMS40LTkuNSwwbC0yNy42LTE0LjZjLTEuOC0wLjktMi42LTIuNC0yLjctMy44YzAtMC4xLDAtMC4zLDAtMC40bDAtNzIuNAoJCQljMC0wLjEsMC0wLjIsMC0wLjNsMC0wLjJoMGMwLjEtMS4zLDEtMi42LDIuNi0zLjVMOTEuMSw0MS4yeiBNMTI2LjYsOTkuOWwtMjYsMTMuN2MtMi43LDEuNC02LjgsMS40LTkuNSwwTDY1LjIsMTAwdjMyLjMKCQkJbDI1LjksMTMuNmMxLjUsMC44LDMuMSwxLjYsNC43LDEuN2wwLjEsMGMxLjUsMCwzLTAuOCw0LjYtMS41bDI2LjItMTMuOVY5OS45eiBNNTYuNSwxMzAuOWMwLDIuOCwwLjMsNC43LDEsNgoJCQljMC41LDEuMSwxLjMsMS45LDIuOCwyLjlsMC4xLDAuMWMwLjMsMC4yLDAuNywwLjQsMS4xLDAuN2wwLjUsMC4zbDEuNiwwLjlsLTIuMiwzLjdsLTEuNy0xLjFsLTAuMy0wLjJjLTAuNS0wLjMtMC45LTAuNi0xLjMtMC44CgkJCWMtNC4yLTIuOC01LjctNS45LTUuNy0xMi4zbDAtMC4ySDU2LjV6IE05My44LDgwLjVjLTAuMiwwLjEtMC40LDAuMS0wLjYsMC4yTDY1LjYsOTUuM2MwLDAtMC4xLDAtMC4xLDBsMCwwbDAsMGwwLjEsMGwyNy42LDE0LjYKCQkJYzAuMiwwLjEsMC40LDAuMiwwLjYsMC4yVjgwLjV6IE05OC4yLDgwLjV2MjkuOGMwLjItMC4xLDAuNC0wLjEsMC42LTAuMmwyNy42LTE0LjZjMCwwLDAuMSwwLDAuMSwwbDAsMGwwLDBsLTAuMSwwTDk4LjgsODAuNwoJCQlDOTguNiw4MC42LDk4LjQsODAuNSw5OC4yLDgwLjV6IE0xMjYuNiw2NC40bC0yNC44LDEzbDI0LjgsMTNWNjQuNHogTTY1LjIsNjQuNHYyNi4xbDI0LjgtMTNMNjUuMiw2NC40eiBNOTguNyw0NS4xCgkJCWMtMS40LTAuOC00LTAuOC01LjUsMEw2NS42LDU5LjdjMCwwLTAuMSwwLTAuMSwwbDAsMGwwLDBsMC4xLDBsMjcuNiwxNC42YzEuNCwwLjgsNCwwLjgsNS41LDBsMjcuNi0xNC42YzAsMCwwLjEsMCwwLjEsMGwwLDBsMCwwCgkJCWwtMC4xLDBMOTguNyw0NS4xeiBNMTMwLjcsNDYuNWwxLjcsMS4xbDAuMywwLjJjMC41LDAuMywwLjksMC42LDEuMywwLjhjNC4yLDIuOCw1LjcsNS45LDUuNywxMi4zbDAsMC4yaC00LjNjMC0yLjgtMC4zLTQuNy0xLTYKCQkJYy0wLjUtMS4xLTEuMy0xLjktMi44LTIuOWwtMC4xLTAuMWMtMC4zLTAuMi0wLjctMC40LTEuMS0wLjdsLTAuNS0wLjNsLTEuNi0wLjlMMTMwLjcsNDYuNXoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4K";var m={name:"fantom",id:"0xFA",networkId:"250",namespace:"eip155",label:"Fantom",fullName:"Fantom Opera",logo:p,currency:{name:"Fantom",symbol:"FTM",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83"},stables:{usd:["0x04068DA6C83AFCFA0e13ba15A6696662335D5B75","0x049d68029688eAbF473097a2fC38ef61633A3C7A","0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E"]},explorer:"https://ftmscan.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://ftmscan.com/tx/${t.id||t}`:e?`https://ftmscan.com/token/${e}`:n?`https://ftmscan.com/address/${n}`:void 0,endpoints:["https://rpc.ftm.tools","https://fantom.publicnode.com","https://rpc2.fantom.network"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"FTM",name:"Fantom",decimals:18,logo:p,type:"NATIVE"},{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",symbol:"WFTM",name:"Wrapped Fantom",decimals:18,logo:p,type:"20"},{address:"0x04068DA6C83AFCFA0e13ba15A6696662335D5B75",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://assets.spooky.fi/tokens/USDC.png",type:"20"},{address:"0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://assets.spooky.fi/tokens/DAI.png",type:"20"},{address:"0x049d68029688eAbF473097a2fC38ef61633A3C7A",symbol:"fUSDT",name:"Frapped USDT",decimals:6,logo:"https://assets.spooky.fi/tokens/fUSDT.png",type:"20"},{address:"0x74b23882a30290451A17c44f4F05243b6b58C76d",symbol:"ETH",name:"Ethereum",decimals:18,logo:"https://assets.spooky.fi/tokens/wETH.png",type:"20"},{address:"0x321162Cd933E2Be498Cd2267a90534A804051b11",symbol:"BTC",name:"Bitcoin",decimals:8,logo:"https://assets.spooky.fi/tokens/wBTC.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const g="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA0NS40IDQ1LjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ1LjQgNDUuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjODI0N0U1IiBkPSJNMzEuOSwxNi42Yy0wLjctMC40LTEuNi0wLjQtMi4yLDBsLTUuMywzLjFsLTMuNSwybC01LjEsMy4xYy0wLjcsMC40LTEuNiwwLjQtMi4yLDBsLTQtMi40CgljLTAuNi0wLjQtMS4xLTEuMS0xLjEtMnYtNC42YzAtMC45LDAuNS0xLjYsMS4xLTJsNC0yLjNjMC43LTAuNCwxLjUtMC40LDIuMiwwbDQsMi40YzAuNywwLjQsMS4xLDEuMSwxLjEsMnYzLjFsMy41LTIuMXYtMy4yCgljMC0wLjktMC40LTEuNi0xLjEtMmwtNy41LTQuNGMtMC43LTAuNC0xLjUtMC40LTIuMiwwTDYsMTEuN2MtMC43LDAuNC0xLjEsMS4xLTEuMSwxLjh2OC43YzAsMC45LDAuNCwxLjYsMS4xLDJsNy42LDQuNAoJYzAuNywwLjQsMS41LDAuNCwyLjIsMGw1LjEtMi45bDMuNS0yLjFsNS4xLTIuOWMwLjctMC40LDEuNi0wLjQsMi4yLDBsNCwyLjNjMC43LDAuNCwxLjEsMS4xLDEuMSwydjQuNmMwLDAuOS0wLjQsMS42LTEuMSwyCglsLTMuOSwyLjNjLTAuNywwLjQtMS41LDAuNC0yLjIsMGwtNC0yLjNjLTAuNy0wLjQtMS4xLTEuMS0xLjEtMnYtMi45TDIxLDI4Ljd2My4xYzAsMC45LDAuNCwxLjYsMS4xLDJsNy41LDQuNAoJYzAuNywwLjQsMS41LDAuNCwyLjIsMGw3LjUtNC40YzAuNy0wLjQsMS4xLTEuMSwxLjEtMlYyM2MwLTAuOS0wLjQtMS42LTEuMS0yQzM5LjIsMjEsMzEuOSwxNi42LDMxLjksMTYuNnoiLz4KPC9zdmc+Cg==";var y={name:"polygon",id:"0x89",networkId:"137",namespace:"eip155",label:"Polygon",fullName:"Polygon Mainnet",logo:g,currency:{name:"Polygon",symbol:"MATIC",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"},stables:{usd:["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174","0xc2132D05D31c914a87C6611C10748AEb04B58e8F","0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063"]},explorer:"https://polygonscan.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://polygonscan.com/tx/${t.id||t}`:e?`https://polygonscan.com/token/${e}`:n?`https://polygonscan.com/address/${n}`:void 0,endpoints:["https://polygon-rpc.com","https://poly-rpc.gateway.pokt.network","https://polygon.llamarpc.com"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",name:"Polygon",decimals:18,logo:g,type:"NATIVE"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",symbol:"WMATIC",name:"Wrapped Matic",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0/logo.png",type:"20"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:"WETH",name:"Wrapped Ether",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",type:"20"},{address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",type:"20"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",name:"Tether USD",decimals:6,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",type:"20"},{address:"0xa3Fa99A148fA48D14Ed51d610c367C61876997F1",symbol:"miMATIC",name:"miMATIC",decimals:18,logo:"https://raw.githubusercontent.com/0xlaozi/qidao/main/images/mimatic-red.png",type:"20"},{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:"DAI",name:"Dai Stablecoin",decimals:18,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",type:"20"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",symbol:"WBTC",name:"Wrapped BTC",decimals:8,logo:"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const v="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA0NS40IDQ1LjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ1LjQgNDUuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9IlNPTEFOQV9TVkdJRF8xIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjM1LjU5NzQiIHkxPSI3NzIuOTI3NyIgeDI9IjE4LjE0MjIiIHkyPSI4MDYuMzYxNiIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgLTc2NS43NjUpIj4KCTxzdG9wICBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiMwMEZGQTMiLz4KCTxzdG9wICBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOiNEQzFGRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPHBhdGggZmlsbD0idXJsKCNTT0xBTkFfU1ZHSURfMSkiIGQ9Ik0xMiwyOS4xYzAuMi0wLjIsMC41LTAuMywwLjctMC4zSDM4YzAuNSwwLDAuNywwLjYsMC40LDAuOWwtNSw1Yy0wLjIsMC4yLTAuNSwwLjMtMC43LDAuM0g3LjQKCUM2LjksMzUsNi43LDM0LjQsNywzNEwxMiwyOS4xeiIvPgo8bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzAwMDAwMTYwODY5NzIyMjI5NDY0Mzk5NzMwMDAwMDA5NDA3MDIxNTc4MjQ4MDg3NzExXyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIyNy45NTk1IiB5MT0iNzY5LjEyNDQiIHgyPSIxMC41MDQzIiB5Mj0iODAyLjU1ODIiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIC03NjUuNzY1KSI+Cgk8c3RvcCAgb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjojMDBGRkEzIi8+Cgk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojREMxRkZGIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxwYXRoIHN0eWxlPSJmaWxsOnVybCgjU1ZHSURfMDAwMDAxNjA4Njk3MjIyMjk0NjQzOTk3MzAwMDAwMDk0MDcwMjE1NzgyNDgwODc3MTFfKTsiIGQ9Ik0xMiwxMC42YzAuMi0wLjIsMC41LTAuMywwLjctMC4zSDM4CgljMC41LDAsMC43LDAuNiwwLjQsMC45bC01LDVjLTAuMiwwLjItMC41LDAuMy0wLjcsMC4zSDcuNGMtMC41LDAtMC43LTAuNi0wLjQtMC45TDEyLDEwLjZ6Ii8+CjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMDAwMDAxMzkyODMyMTczNzg2NTYwOTQ4NjAwMDAwMDM2OTQ4OTUzNzkwNzgxMTY3ODJfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjMxLjc0MDYiIHkxPSI3NzEuMDk4NSIgeDI9IjE0LjI4NTUiIHkyPSI4MDQuNTMyMyIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgLTc2NS43NjUpIj4KCTxzdG9wICBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiMwMEZGQTMiLz4KCTxzdG9wICBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOiNEQzFGRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPHBhdGggc3R5bGU9ImZpbGw6dXJsKCNTVkdJRF8wMDAwMDEzOTI4MzIxNzM3ODY1NjA5NDg2MDAwMDAwMzY5NDg5NTM3OTA3ODExNjc4Ml8pOyIgZD0iTTMzLjQsMTkuOGMtMC4yLTAuMi0wLjUtMC4zLTAuNy0wLjNINy40CgljLTAuNSwwLTAuNywwLjYtMC40LDAuOWw1LDVjMC4yLDAuMiwwLjUsMC4zLDAuNywwLjNIMzhjMC41LDAsMC43LTAuNiwwLjQtMC45TDMzLjQsMTkuOHoiLz4KPC9zdmc+Cg==";var b={name:"solana",networkId:"mainnetBeta",namespace:"solana",label:"Solana",fullName:"Solana",logo:v,currency:{name:"Solana",symbol:"SOL",decimals:9,address:"11111111111111111111111111111111"},wrapped:{address:"So11111111111111111111111111111111111111112"},stables:{usd:["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]},explorer:"https://solscan.io",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://solscan.io/tx/${t.id||t}`:e?`https://solscan.io/token/${e}`:n?`https://solscan.io/address/${n}`:void 0,endpoints:["https://solana-mainnet.phantom.app/YBPpkkN4g91xDiAnTE9r0RcMkjg0sKUIWvAfoFVJ","https://mainnet-beta.solflare.network","https://solana-mainnet.rpc.extrnode.com"],rpc:"https://api.mainnet-beta.solana.com",tokens:[{address:"11111111111111111111111111111111",symbol:"SOL",name:"Solana",decimals:9,logo:v,type:"NATIVE"},{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",name:"USD Coin",decimals:6,logo:"https://img.raydium.io/icon/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",type:"SPL"},{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",name:"USDT",decimals:6,logo:"https://img.raydium.io/icon/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB.png",type:"SPL"},{address:"7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj",symbol:"stSOL",name:"Lido Staked SOL",decimals:9,logo:"https://img.raydium.io/icon/7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj.png",type:"SPL"},{address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",symbol:"BONK",name:"BONK",decimals:5,logo:"https://img.raydium.io/icon/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263.png",type:"SPL"},{address:"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",symbol:"SAMO",name:"Samoyed Coin",decimals:9,logo:"https://img.raydium.io/icon/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU.png",type:"SPL"}],zero:"0",maxInt:"340282366920938463463374607431768211455"};const w="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiCgkgdGV4dC1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iIGltYWdlLXJlbmRlcmluZz0ib3B0aW1pemVRdWFsaXR5IgoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDUuNCA0NS40IgoJIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ1LjQgNDUuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgo8L3N0eWxlPgo8cGF0aCBmaWxsPSIjMDAzN0MxIiBkPSJNMjguOCwyMi44bC02LjEsMTAuNmwtNi4xLTEwLjdMMjguOCwyMi44TDI4LjgsMjIuOHogTTM0LjksMTkuMkgxMC41bDEyLjIsMjEuNEwzNC45LDE5LjJ6IE02LjUsMTIuMWwyLDMuNgoJaDI4LjNsMi4xLTMuNkg2LjV6Ii8+Cjwvc3ZnPgo=";var M={name:"velas",id:"0x6a",networkId:"106",namespace:"eip155",label:"VELAS",fullName:"Velas EVM Mainnet",logo:w,currency:{name:"Velas",symbol:"VLX",decimals:18,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"},wrapped:{address:"0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126"},stables:{usd:["0xc111c29A988AE0C0087D97b33C6E6766808A3BD3","0x01445C31581c354b7338AC35693AB2001B50b9aE"]},explorer:"https://evmexplorer.velas.com",explorerUrlFor:({transaction:t,token:e,address:n})=>t?`https://evmexplorer.velas.com/tx/${t.id||t}`:e?`https://evmexplorer.velas.com/token/${e}`:n?`https://evmexplorer.velas.com/address/${n}`:void 0,endpoints:["https://mainnet.velas.com/rpc","https://evmexplorer.velas.com/rpc","https://explorer.velas.com/rpc"],tokens:[{address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"VLX",name:"Velas",decimals:18,logo:w,type:"NATIVE"},{address:"0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126",symbol:"WVLX",name:"Wrapped Velas",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0xc579d1f3cf86749e05cd06f7ade17856c2ce3126/logo.png?raw=true",type:"20"},{address:"0xc111c29A988AE0C0087D97b33C6E6766808A3BD3",symbol:"BUSD",name:"Multichain BUSD",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0xc111c29a988ae0c0087d97b33c6e6766808a3bd3/logo.png?raw=true",type:"20"},{address:"0x01445C31581c354b7338AC35693AB2001B50b9aE",symbol:"USDT",name:"Multichain USDT",decimals:6,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0x01445c31581c354b7338ac35693ab2001b50b9ae/logo.png?raw=true",type:"20"},{address:"0x85219708c49aa701871Ad330A94EA0f41dFf24Ca",symbol:"ETH",name:"ETH",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0x85219708c49aa701871ad330a94ea0f41dff24ca/logo.png?raw=true",type:"20"},{address:"0xaBf26902Fd7B624e0db40D31171eA9ddDf078351",symbol:"WAG",name:"WagyuSwap",decimals:18,logo:"https://github.com/wagyuswapapp/assets/blob/master/blockchains/velas/assets/0xabf26902fd7b624e0db40d31171ea9dddf078351/logo.png?raw=true",type:"20"}],zero:"0x0000000000000000000000000000000000000000",maxInt:"115792089237316195423570985008687907853269984665640564039457584007913129639935"};const k=[f,h,y,b,m,M];for(var L={ethereum:f,bsc:h,polygon:y,solana:b,fantom:m,velas:M,all:k,findById:function(t){let e=t;e.match("0x0")&&(e=e.replace(/0x0+/,"0x"));let n=k.find((t=>t.id&&t.id.toLowerCase()==e.toLowerCase()));return n},findByNetworkId:function(t){t=t.toString();let e=k.find((e=>e.networkId==t));return e},findByName:function(t){return k.find((e=>e.name==t))}},A=function(t){var e=C(t),n=e[0],r=e[1];return 3*(n+r)/4-r},x=function(t){var e,n,r=C(t),i=r[0],o=r[1],a=new I(function(t,e,n){return 3*(e+n)/4-n}(0,i,o)),s=0,u=o>0?i-4:i;for(n=0;n<u;n+=4)e=S[t.charCodeAt(n)]<<18|S[t.charCodeAt(n+1)]<<12|S[t.charCodeAt(n+2)]<<6|S[t.charCodeAt(n+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;2===o&&(e=S[t.charCodeAt(n)]<<2|S[t.charCodeAt(n+1)]>>4,a[s++]=255&e);1===o&&(e=S[t.charCodeAt(n)]<<10|S[t.charCodeAt(n+1)]<<4|S[t.charCodeAt(n+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e);return a},E=function(t){for(var e,n=t.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(D(t,a,a+o>s?s:a+o));1===r?(e=t[n-1],i.push(N[e>>2]+N[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],i.push(N[e>>10]+N[e>>4&63]+N[e<<2&63]+"="));return i.join("")},N=[],S=[],I="undefined"!=typeof Uint8Array?Uint8Array:Array,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=0;j<64;++j)N[j]=T[j],S[T.charCodeAt(j)]=j;function C(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function D(t,e,n){for(var r,i,o=[],a=e;a<n;a+=3)r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(N[(i=r)>>18&63]+N[i>>12&63]+N[i>>6&63]+N[63&i]);return o.join("")}S["-".charCodeAt(0)]=62,S["_".charCodeAt(0)]=63;var O={byteLength:A,toByteArray:x,fromByteArray:E},_=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},z=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+f]=255&a,f+=p,a/=256,c-=8);t[n+f-p]|=128*m},P=o((function(t,e){const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(t){+t!=t&&(t=0);return o.alloc(+t)},e.INSPECT_MAX_BYTES=50;const r=2147483647;function i(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return a(t,e,n)}function a(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|d(t,e);let r=i(n);const a=r.write(t,e);a!==n&&(r=r.slice(0,a));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return l(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return l(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return o.from(r,e,n);const a=function(t){if(o.isBuffer(t)){const e=0|h(t.length),n=i(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||q(t.length)?i(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return s(t),i(t<0?0:0|h(t))}function c(t){const e=t.length<0?0:0|h(t.length),n=i(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function l(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,o.prototype),r}function h(t){if(t>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(t).length;default:if(i)return r?-1:G(t).length;e=(""+e).toLowerCase(),i=!0}}function f(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,n);case"utf8":case"utf-8":return L(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return E(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function p(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){let o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let r=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(c(t,o+r)!==c(e,r)){n=!1;break}if(n)return o}return-1}function y(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=e.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(e.substr(2*a,2),16);if(q(r))return a;t[n+a]=r}return a}function v(t,e,n,r){return V(G(e,t.length-n),t,n,r)}function b(t,e,n,r){return V(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return V(Z(e),t,n,r)}function M(t,e,n,r){return V(function(t,e){let n,r,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?O.fromByteArray(t):O.fromByteArray(t.slice(e,n))}function L(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:n=t[i+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(o=u));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(u=(15&e)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=t[i+1],r=t[i+2],s=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=A));return n}(r)}e.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,n){return a(t,e,n)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,n){return function(t,e,n){return s(t),t<=0?i(t):void 0!==e?"string"==typeof n?i(t).fill(e,n):i(t).fill(e):i(t)}(t,e,n)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(J(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=o.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(J(e,Uint8Array))i+e.length>r.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},o.byteLength=d,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)p(this,e,e+1);return this},o.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},o.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},o.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?L(this,0,t):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,n,r,i){if(J(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0);const u=Math.min(a,s),c=this.slice(r,i),l=t.slice(e,n);for(let t=0;t<u;++t)if(c[t]!==l[t]){a=c[t],s=l[t];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},o.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},o.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},o.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":case"latin1":case"binary":return b(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function x(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function E(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function N(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=e;r<n;++r)i+=X[t[r]];return i}function S(t,e,n){const r=t.slice(e,n);let i="";for(let t=0;t<r.length-1;t+=2)i+=String.fromCharCode(r[t]+256*r[t+1]);return i}function I(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,n,r,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function j(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function C(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,4),z(t,e,n,r,23,4),n+4}function B(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,8),z(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),o.prototype.readBigInt64BE=K((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Y(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),_(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),_(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),_(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),_(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){T(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){T(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=K((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=K((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);T(this,t,e,n,r-1,-r)}let i=0,o=1,a=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);T(this,t,e,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=K((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=K((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},o.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const a=o.isBuffer(t)?t:o.from(t,r),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=a[i%s]}return this};const R={};function U(t,e,n){R[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function Q(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function W(t,e,n,r,i,o){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new R.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){F(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||Y(e,t.length-(n+1))}(r,i,o)}function F(t,e){if("number"!=typeof t)throw new R.ERR_INVALID_ARG_TYPE(e,"number",t)}function Y(t,e,n){if(Math.floor(t)!==t)throw F(t,n),new R.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new R.ERR_BUFFER_OUT_OF_BOUNDS;throw new R.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=Q(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=Q(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(t){return O.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?$:t}function $(){throw new Error("BigInt not supported")}})),B=o((function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:P.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var c=t.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(t,l,l+r,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var h=1;for(c=u(t,l,t.length,e),l=0;l<a;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){c(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(a=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,c=0,l=0|a[0],h=8191&l,d=l>>>13,f=0|a[1],p=8191&f,m=f>>>13,g=0|a[2],y=8191&g,v=g>>>13,b=0|a[3],w=8191&b,M=b>>>13,k=0|a[4],L=8191&k,A=k>>>13,x=0|a[5],E=8191&x,N=x>>>13,S=0|a[6],I=8191&S,T=S>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],_=8191&O,z=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],Q=8191&U,W=U>>>13,F=0|s[1],Y=8191&F,H=F>>>13,G=0|s[2],Z=8191&G,V=G>>>13,J=0|s[3],q=8191&J,X=J>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,lt=0|s[8],ht=8191<,dt=lt>>>13,ft=0|s[9],pt=8191&ft,mt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(c+(r=Math.imul(h,Q))|0)+((8191&(i=(i=Math.imul(h,W))+Math.imul(d,Q)|0))<<13)|0;c=((o=Math.imul(d,W))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,Q),i=(i=Math.imul(p,W))+Math.imul(m,Q)|0,o=Math.imul(m,W);var yt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,Q),i=(i=Math.imul(y,W))+Math.imul(v,Q)|0,o=Math.imul(v,W),r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,H)|0;var vt=(c+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,Q),i=(i=Math.imul(w,W))+Math.imul(M,Q)|0,o=Math.imul(M,W),r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,H)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,V)|0;var bt=(c+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,W))+Math.imul(A,Q)|0,o=Math.imul(A,W),r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,H)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,X)|0;var wt=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(E,Q),i=(i=Math.imul(E,W))+Math.imul(N,Q)|0,o=Math.imul(N,W),r=r+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,H)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,H)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,W))+Math.imul(T,Q)|0,o=Math.imul(T,W),r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,H)|0,r=r+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var kt=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(C,Q),i=(i=Math.imul(C,W))+Math.imul(D,Q)|0,o=Math.imul(D,W),r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(L,q)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Lt=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(_,Q),i=(i=Math.imul(_,W))+Math.imul(z,Q)|0,o=Math.imul(z,W),r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,H)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var At=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,Q),i=(i=Math.imul(B,W))+Math.imul(R,Q)|0,o=Math.imul(R,W),r=r+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,H)|0,r=r+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var xt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,H))+Math.imul(R,Y)|0,o=Math.imul(R,H),r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(z,Z)|0,o=o+Math.imul(z,V)|0,r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,V))+Math.imul(R,Z)|0,o=Math.imul(R,V),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(z,q)|0,o=o+Math.imul(z,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var Nt=(c+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,X))+Math.imul(R,q)|0,o=Math.imul(R,X),r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(z,$)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(C,nt)|0,i=(i=i+Math.imul(C,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var St=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(R,$)|0,o=Math.imul(R,tt),r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(z,nt)|0,o=o+Math.imul(z,rt)|0,r=r+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var It=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(R,nt)|0,o=Math.imul(R,rt),r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,at)|0,r=r+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,dt)|0;var Tt=(c+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,at))+Math.imul(R,ot)|0,o=Math.imul(R,at),r=r+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,dt)|0;var jt=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(R,ut)|0,o=Math.imul(R,ct),r=r+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(z,ht)|0,o=o+Math.imul(z,dt)|0;var Ct=(c+(r=r+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(R,ht)|0,o=Math.imul(R,dt);var Dt=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(z,pt)|0))<<13)|0;c=((o=o+Math.imul(z,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(R,pt)|0))<<13)|0;return c=((o=Math.imul(R,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=kt,u[7]=Lt,u[8]=At,u[9]=xt,u[10]=Et,u[11]=Nt,u[12]=St,u[13]=It,u[14]=Tt,u[15]=jt,u[16]=Ct,u[17]=Dt,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;s=67108863&(d=d+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(o,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=d)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new A(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function L(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(M,b),r(k,b),r(L,b),L.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new L}return v[t]=e,e},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),d=this.pow(t,o.addn(1).iushrn(1)),f=this.pow(t,o),p=a;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var y=this.pow(h,new i(1).iushln(p-g-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=g}return d},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new x(t)},r(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,r)}));
|
|
2
2
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */let R=!1,U=!1;const Q={debug:1,default:2,info:2,warning:3,error:4,off:5};let W=Q.default,F=null;const Y=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(n){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var H,G;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(H||(H={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(G||(G={}));const Z="0123456789abcdef";class V{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();null==Q[n]&&this.throwArgumentError("invalid log level name","logLevel",t),W>Q[n]||console.log.apply(console,e)}debug(...t){this._log(V.levels.DEBUG,t)}info(...t){this._log(V.levels.INFO,t)}warn(...t){this._log(V.levels.WARNING,t)}makeError(t,e,n){if(U)return this.makeError("censored error",e,{});e||(e=V.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((t=>{const e=n[t];try{if(e instanceof Uint8Array){let n="";for(let t=0;t<e.length;t++)n+=Z[e[t]>>4],n+=Z[15&e[t]];r.push(t+"=Uint8Array(0x"+n+")")}else r.push(t+"="+JSON.stringify(e))}catch(e){r.push(t+"="+JSON.stringify(n[t].toString()))}})),r.push(`code=${e}`),r.push(`version=${this.version}`);const i=t;let o="";switch(e){case G.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case G.CALL_EXCEPTION:case G.INSUFFICIENT_FUNDS:case G.MISSING_NEW:case G.NONCE_EXPIRED:case G.REPLACEMENT_UNDERPRICED:case G.TRANSACTION_REPLACED:case G.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),r.length&&(t+=" ("+r.join(", ")+")");const a=new Error(t);return a.reason=i,a.code=e,Object.keys(n).forEach((function(t){a[t]=n[t]})),a}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,V.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,r){t||this.throwError(e,n,r)}assertArgument(t,e,n,r){t||this.throwArgumentError(e,n,r)}checkNormalize(t){Y&&this.throwError("platform missing String.prototype.normalize",V.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Y})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,V.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,V.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n=n?": "+n:"",t<e&&this.throwError("missing argument"+n,V.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,V.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",V.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",V.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",V.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return F||(F=new V("logger/5.7.0")),F}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",V.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),R){if(!t)return;this.globalLogger().throwError("error censorship permanent",V.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}U=!!t,R=!!e}static setLogLevel(t){const e=Q[t.toLowerCase()];null!=e?W=e:V.globalLogger().warn("invalid log level - "+t)}static from(t){return new V(t)}}V.errors=G,V.levels=H;const J=new V("bytes/5.7.0");function q(t){return!!t.toHexString}function X(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return X(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function K(t){return it(t)&&!(t.length%2)||tt(t)}function $(t){return"number"==typeof t&&t==t&&t%1==0}function tt(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!$(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const n=t[e];if(!$(n)||n<0||n>=256)return!1}return!0}function et(t,e){if(e||(e={}),"number"==typeof t){J.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),X(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),q(t)&&(t=t.toHexString()),it(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":J.throwArgumentError("hex data is odd-length","value",t));const r=[];for(let t=0;t<n.length;t+=2)r.push(parseInt(n.substring(t,t+2),16));return X(new Uint8Array(r))}return tt(t)?X(new Uint8Array(t)):J.throwArgumentError("invalid arrayify value","value",t)}function nt(t){const e=t.map((t=>et(t))),n=e.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(n);return e.reduce(((t,e)=>(r.set(e,t),t+e.length)),0),X(r)}function rt(t){let e=et(t);if(0===e.length)return e;let n=0;for(;n<e.length&&0===e[n];)n++;return n&&(e=e.slice(n)),e}function it(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}const ot="0123456789abcdef";function at(t,e){if(e||(e={}),"number"==typeof t){J.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=ot[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),q(t))return t.toHexString();if(it(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":J.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(tt(t)){let e="0x";for(let n=0;n<t.length;n++){let r=t[n];e+=ot[(240&r)>>4]+ot[15&r]}return e}return J.throwArgumentError("invalid hexlify value","value",t)}function st(t){if("string"!=typeof t)t=at(t);else if(!it(t)||t.length%2)return null;return(t.length-2)/2}function ut(t,e,n){return"string"!=typeof t?t=at(t):(!it(t)||t.length%2)&&J.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=n?"0x"+t.substring(e,2+2*n):"0x"+t.substring(e)}function ct(t){let e="0x";return t.forEach((t=>{e+=at(t).substring(2)})),e}function lt(t){const e=function(t){"string"!=typeof t&&(t=at(t));it(t)||J.throwArgumentError("invalid hex string","value",t);t=t.substring(2);let e=0;for(;e<t.length&&"0"===t[e];)e++;return"0x"+t.substring(e)}(at(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function ht(t,e){for("string"!=typeof t?t=at(t):it(t)||J.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&J.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function dt(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(K(t)){let n=et(t);64===n.length?(e.v=27+(n[32]>>7),n[32]&=127,e.r=at(n.slice(0,32)),e.s=at(n.slice(32,64))):65===n.length?(e.r=at(n.slice(0,32)),e.s=at(n.slice(32,64)),e.v=n[64]):J.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:J.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(n[32]|=128),e._vs=at(n.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const n=function(t,e){(t=et(t)).length>e&&J.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(e);return n.set(t,e-t.length),X(n)}(et(e._vs),32);e._vs=at(n);const r=n[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=r:e.recoveryParam!==r&&J.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;const i=at(n);null==e.s?e.s=i:e.s!==i&&J.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?J.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const n=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==n&&J.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&it(e.r)?e.r=ht(e.r,32):J.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&it(e.s)?e.s=ht(e.s,32):J.throwArgumentError("signature missing or invalid s","signature",t);const n=et(e.s);n[0]>=128&&J.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(n[0]|=128);const r=at(n);e._vs&&(it(e._vs)||J.throwArgumentError("signature invalid _vs","signature",t),e._vs=ht(e._vs,32)),null==e._vs?e._vs=r:e._vs!==r&&J.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const ft="bignumber/5.7.0";var pt=B.BN;const mt=new V(ft),gt={},yt=9007199254740991;let vt=!1;class bt{constructor(t,e){t!==gt&&mt.throwError("cannot call constructor directly; use BigNumber.from",V.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Mt(kt(this).fromTwos(t))}toTwos(t){return Mt(kt(this).toTwos(t))}abs(){return"-"===this._hex[0]?bt.from(this._hex.substring(1)):this}add(t){return Mt(kt(this).add(kt(t)))}sub(t){return Mt(kt(this).sub(kt(t)))}div(t){return bt.from(t).isZero()&&Lt("division-by-zero","div"),Mt(kt(this).div(kt(t)))}mul(t){return Mt(kt(this).mul(kt(t)))}mod(t){const e=kt(t);return e.isNeg()&&Lt("division-by-zero","mod"),Mt(kt(this).umod(e))}pow(t){const e=kt(t);return e.isNeg()&&Lt("negative-power","pow"),Mt(kt(this).pow(e))}and(t){const e=kt(t);return(this.isNegative()||e.isNeg())&&Lt("unbound-bitwise-result","and"),Mt(kt(this).and(e))}or(t){const e=kt(t);return(this.isNegative()||e.isNeg())&&Lt("unbound-bitwise-result","or"),Mt(kt(this).or(e))}xor(t){const e=kt(t);return(this.isNegative()||e.isNeg())&&Lt("unbound-bitwise-result","xor"),Mt(kt(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&Lt("negative-width","mask"),Mt(kt(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Lt("negative-width","shl"),Mt(kt(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Lt("negative-width","shr"),Mt(kt(this).shrn(t))}eq(t){return kt(this).eq(kt(t))}lt(t){return kt(this).lt(kt(t))}lte(t){return kt(this).lte(kt(t))}gt(t){return kt(this).gt(kt(t))}gte(t){return kt(this).gte(kt(t))}isNegative(){return"-"===this._hex[0]}isZero(){return kt(this).isZero()}toNumber(){try{return kt(this).toNumber()}catch(t){Lt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return mt.throwError("this platform does not support BigInt",V.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?vt||(vt=!0,mt.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?mt.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",V.errors.UNEXPECTED_ARGUMENT,{}):mt.throwError("BigNumber.toString does not accept parameters",V.errors.UNEXPECTED_ARGUMENT,{})),kt(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof bt)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new bt(gt,wt(t)):t.match(/^-?[0-9]+$/)?new bt(gt,wt(new pt(t))):mt.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&Lt("underflow","BigNumber.from",t),(t>=yt||t<=-yt)&&Lt("overflow","BigNumber.from",t),bt.from(String(t));const e=t;if("bigint"==typeof e)return bt.from(e.toString());if(tt(e))return bt.from(at(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return bt.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(it(t)||"-"===t[0]&&it(t.substring(1))))return bt.from(t)}return mt.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function wt(t){if("string"!=typeof t)return wt(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&mt.throwArgumentError("invalid hex","value",t),"0x00"===(t=wt(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function Mt(t){return bt.from(wt(t))}function kt(t){const e=bt.from(t).toHexString();return"-"===e[0]?new pt("-"+e.substring(3),16):new pt(e.substring(2),16)}function Lt(t,e,n){const r={fault:t,operation:e};return null!=n&&(r.value=n),mt.throwError(t,V.errors.NUMERIC_FAULT,r)}const At=new V(ft),xt={},Et=bt.from(0),Nt=bt.from(-1);function St(t,e,n,r){const i={fault:e,operation:n};return void 0!==r&&(i.value=r),At.throwError(t,V.errors.NUMERIC_FAULT,i)}let It="0";for(;It.length<256;)It+=It;function Tt(t){if("number"!=typeof t)try{t=bt.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+It.substring(0,t):At.throwArgumentError("invalid decimal size","decimals",t)}function jt(t,e){null==e&&(e=0);const n=Tt(e),r=(t=bt.from(t)).lt(Et);r&&(t=t.mul(Nt));let i=t.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(n).toString();return t=1===n.length?o:o+"."+i,r&&(t="-"+t),t}function Ct(t,e){null==e&&(e=0);const n=Tt(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||At.throwArgumentError("invalid decimal value","value",t);const r="-"===t.substring(0,1);r&&(t=t.substring(1)),"."===t&&At.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&At.throwArgumentError("too many decimal points","value",t);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&St("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<n.length-1;)a+="0";const s=bt.from(o),u=bt.from(a);let c=s.mul(n).add(u);return r&&(c=c.mul(Nt)),c}class Dt{constructor(t,e,n,r){t!==xt&&At.throwError("cannot use FixedFormat constructor; use FixedFormat.from",V.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=n,this.decimals=r,this.name=(e?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=Tt(r),Object.freeze(this)}static from(t){if(t instanceof Dt)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,n=128,r=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)e=!1;else{const i=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||At.throwArgumentError("invalid fixed format","format",t),e="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(t){const i=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&At.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&At.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&At.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new Dt(xt,e,n,r)}}class Ot{constructor(t,e,n,r){t!==xt&&At.throwError("cannot use FixedNumber constructor; use FixedNumber.from",V.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=e,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&At.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=Ct(this._value,this.format.decimals),n=Ct(t._value,t.format.decimals);return Ot.fromValue(e.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=Ct(this._value,this.format.decimals),n=Ct(t._value,t.format.decimals);return Ot.fromValue(e.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=Ct(this._value,this.format.decimals),n=Ct(t._value,t.format.decimals);return Ot.fromValue(e.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=Ct(this._value,this.format.decimals),n=Ct(t._value,t.format.decimals);return Ot.fromValue(e.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Ot.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(e=e.subUnsafe(_t.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Ot.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(e=e.addUnsafe(_t.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&At.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const n=Ot.from("1"+It.substring(0,t),this.format),r=zt.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&At.throwArgumentError("invalid byte width","width",t);return ht(bt.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Ot.fromString(this._value,t)}static fromValue(t,e,n){return null!=n||null==e||function(t){return null!=t&&(bt.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||it(t)||"bigint"==typeof t||tt(t))}(e)||(n=e,e=null),null==e&&(e=0),null==n&&(n="fixed"),Ot.fromString(jt(t,e),Dt.from(n))}static fromString(t,e){null==e&&(e="fixed");const n=Dt.from(e),r=Ct(t,n.decimals);!n.signed&&r.lt(Et)&&St("unsigned value cannot be negative","overflow","value",t);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=ht(i,n.width/8));const o=jt(r,n.decimals);return new Ot(xt,i,o,n)}static fromBytes(t,e){null==e&&(e="fixed");const n=Dt.from(e);if(et(t).length>n.width/8)throw new Error("overflow");let r=bt.from(t);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),o=jt(r,n.decimals);return new Ot(xt,i,o,n)}static from(t,e){if("string"==typeof t)return Ot.fromString(t,e);if(tt(t))return Ot.fromBytes(t,e);try{return Ot.fromValue(t,0,e)}catch(t){if(t.code!==V.errors.INVALID_ARGUMENT)throw t}return At.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const _t=Ot.from(1),zt=Ot.from("0.5");var Pt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const Bt=new V("properties/5.7.0");function Rt(t,e,n){Object.defineProperty(t,e,{enumerable:!0,value:n,writable:!1})}function Ut(t,e){for(let n=0;n<32;n++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Qt(t){return Pt(this,void 0,void 0,(function*(){const e=Object.keys(t).map((e=>{const n=t[e];return Promise.resolve(n).then((t=>({key:e,value:t})))}));return(yield Promise.all(e)).reduce(((t,e)=>(t[e.key]=e.value,t)),{})}))}function Wt(t){const e={};for(const n in t)e[n]=t[n];return e}const Ft={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Yt(t){if(null==t||Ft[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let n=0;n<e.length;n++){let r=null;try{r=t[e[n]]}catch(t){continue}if(!Yt(r))return!1}return!0}return Bt.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function Ht(t){if(Yt(t))return t;if(Array.isArray(t))return Object.freeze(t.map((t=>Gt(t))));if("object"==typeof t){const e={};for(const n in t){const r=t[n];void 0!==r&&Rt(e,n,Gt(r))}return e}return Bt.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function Gt(t){return Ht(t)}class Zt{constructor(t){for(const e in t)this[e]=Gt(t[e])}}const Vt="abi/5.7.0",Jt=new V(Vt),qt={};let Xt={calldata:!0,memory:!0,storage:!0},Kt={calldata:!0,memory:!0};function $t(t,e){if("bytes"===t||"string"===t){if(Xt[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&Kt[e])return!0;return(Xt[e]||"payable"===e)&&Jt.throwArgumentError("invalid modifier","name",e),!1}function te(t,e){for(let n in e)Rt(t,n,e[n])}const ee=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ne=new RegExp(/^(.*)\[([0-9]*)\]$/);class re{constructor(t,e){t!==qt&&Jt.throwError("use fromString",V.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),te(this,e);let n=this.type.match(ne);te(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:re.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)}format(t){if(t||(t=ee.sighash),ee[t]||Jt.throwArgumentError("invalid format type","format",t),t===ee.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==ee.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===ee.full?", ":",")+")"):e+=this.type,t!==ee.sighash&&(!0===this.indexed&&(e+=" indexed"),t===ee.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?re.fromString(t,e):re.fromObject(t)}static fromObject(t){return re.isParamType(t)?t:new re(qt,{name:t.name||null,type:pe(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(re.fromObject):null})}static fromString(t,e){return n=function(t,e){let n=t;function r(e){Jt.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let n={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(n.indexed=!1),n}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let n=0;n<t.length;n++){let o=t[n];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||r(n),a.state.allowType=!1,a.type=pe(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(e||r(n),a.indexed=!0,a.name=""),$t(a.type,a.name)&&(a.name=""),a.type=pe(a.type);let t=a;a=a.parent,a||r(n),delete t.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(e||r(n),a.indexed=!0,a.name=""),$t(a.type,a.name)&&(a.name=""),a.type=pe(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=pe(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(e||r(n),a.indexed&&r(n),a.indexed=!0,a.name=""):$t(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||r(n),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||r(n),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:r(n)}}return a.parent&&Jt.throwArgumentError("unexpected eof","param",t),delete o.state,"indexed"===a.name?(e||r(n.length-7),a.indexed&&r(n.length-7),a.indexed=!0,a.name=""):$t(a.type,a.name)&&(a.name=""),o.type=pe(o.type),o}(t,!!e),re.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(t){return!(null==t||!t._isParamType)}}function ie(t,e){return function(t){t=t.trim();let e=[],n="",r=0;for(let i=0;i<t.length;i++){let o=t[i];","===o&&0===r?(e.push(n),n=""):(n+=o,"("===o?r++:")"===o&&(r--,-1===r&&Jt.throwArgumentError("unbalanced parenthesis","value",t)))}n&&e.push(n);return e}(t).map((t=>re.fromString(t,e)))}class oe{constructor(t,e){t!==qt&&Jt.throwError("use a static from method",V.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),te(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return oe.isFragment(t)?t:"string"==typeof t?oe.fromString(t):oe.fromObject(t)}static fromObject(t){if(oe.isFragment(t))return t;switch(t.type){case"function":return he.fromObject(t);case"event":return ae.fromObject(t);case"constructor":return le.fromObject(t);case"error":return fe.fromObject(t);case"fallback":case"receive":return null}return Jt.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?ae.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?he.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?le.fromString(t.trim()):"error"===t.split(" ")[0]?fe.fromString(t.substring(5).trim()):Jt.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class ae extends oe{format(t){if(t||(t=ee.sighash),ee[t]||Jt.throwArgumentError("invalid format type","format",t),t===ee.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==ee.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===ee.full?", ":",")+") ",t!==ee.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?ae.fromString(t):ae.fromObject(t)}static fromObject(t){if(ae.isEventFragment(t))return t;"event"!==t.type&&Jt.throwArgumentError("invalid event object","value",t);const e={name:ge(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(re.fromObject):[],type:"event"};return new ae(qt,e)}static fromString(t){let e=t.match(ye);e||Jt.throwArgumentError("invalid event string","value",t);let n=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":n=!0;break;case"":break;default:Jt.warn("unknown modifier: "+t)}})),ae.fromObject({name:e[1].trim(),anonymous:n,inputs:ie(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function se(t,e){e.gas=null;let n=t.split("@");return 1!==n.length?(n.length>2&&Jt.throwArgumentError("invalid human-readable ABI signature","value",t),n[1].match(/^[0-9]+$/)||Jt.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=bt.from(n[1]),n[0]):t}function ue(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function ce(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&Jt.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&Jt.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||Jt.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Jt.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&Jt.throwArgumentError("unable to determine stateMutability","value",t),e}class le extends oe{format(t){if(t||(t=ee.sighash),ee[t]||Jt.throwArgumentError("invalid format type","format",t),t===ee.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});t===ee.sighash&&Jt.throwError("cannot format a constructor for sighash",V.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===ee.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?le.fromString(t):le.fromObject(t)}static fromObject(t){if(le.isConstructorFragment(t))return t;"constructor"!==t.type&&Jt.throwArgumentError("invalid constructor object","value",t);let e=ce(t);e.constant&&Jt.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(re.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?bt.from(t.gas):null};return new le(qt,n)}static fromString(t){let e={type:"constructor"},n=(t=se(t,e)).match(ye);return n&&"constructor"===n[1].trim()||Jt.throwArgumentError("invalid constructor string","value",t),e.inputs=ie(n[2].trim(),!1),ue(n[3].trim(),e),le.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class he extends le{format(t){if(t||(t=ee.sighash),ee[t]||Jt.throwArgumentError("invalid format type","format",t),t===ee.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==ee.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===ee.full?", ":",")+") ",t!==ee.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?he.fromString(t):he.fromObject(t)}static fromObject(t){if(he.isFunctionFragment(t))return t;"function"!==t.type&&Jt.throwArgumentError("invalid function object","value",t);let e=ce(t);const n={type:t.type,name:ge(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(re.fromObject):[],outputs:t.outputs?t.outputs.map(re.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?bt.from(t.gas):null};return new he(qt,n)}static fromString(t){let e={type:"function"},n=(t=se(t,e)).split(" returns ");n.length>2&&Jt.throwArgumentError("invalid function string","value",t);let r=n[0].match(ye);if(r||Jt.throwArgumentError("invalid function signature","value",t),e.name=r[1].trim(),e.name&&ge(e.name),e.inputs=ie(r[2],!1),ue(r[3].trim(),e),n.length>1){let r=n[1].match(ye);""==r[1].trim()&&""==r[3].trim()||Jt.throwArgumentError("unexpected tokens","value",t),e.outputs=ie(r[2],!1)}else e.outputs=[];return he.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function de(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||Jt.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class fe extends oe{format(t){if(t||(t=ee.sighash),ee[t]||Jt.throwArgumentError("invalid format type","format",t),t===ee.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==ee.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===ee.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?fe.fromString(t):fe.fromObject(t)}static fromObject(t){if(fe.isErrorFragment(t))return t;"error"!==t.type&&Jt.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:ge(t.name),inputs:t.inputs?t.inputs.map(re.fromObject):[]};return de(new fe(qt,e))}static fromString(t){let e={type:"error"},n=t.match(ye);return n||Jt.throwArgumentError("invalid error signature","value",t),e.name=n[1].trim(),e.name&&ge(e.name),e.inputs=ie(n[2],!1),de(fe.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function pe(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const me=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function ge(t){return t&&t.match(me)||Jt.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const ye=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const ve=new V(Vt);class be{constructor(t,e,n,r){this.name=t,this.type=e,this.localName=n,this.dynamic=r}_throwError(t,e){ve.throwArgumentError(t,this.localName,e)}}class we{constructor(t){Rt(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return ct(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(nt(t._data))}writeBytes(t){let e=et(t);const n=e.length%this.wordSize;return n&&(e=nt([e,this._padding.slice(n)])),this._writeData(e)}_getValue(t){let e=et(bt.from(t));return e.length>this.wordSize&&ve.throwError("value out-of-bounds",V.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=nt([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class Me{constructor(t,e,n,r){Rt(this,"_data",et(t)),Rt(this,"wordSize",e||32),Rt(this,"_coerceFunc",n),Rt(this,"allowLoose",r),this._offset=0}get data(){return at(this._data)}get consumed(){return this._offset}static coerce(t,e){let n=t.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):Me.coerce(t,e)}_peekBytes(t,e,n){let r=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&n&&this._offset+e<=this._data.length?r=e:ve.throwError("data out-of-bounds",V.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(t){return new Me(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let n=this._peekBytes(0,t,!!e);return this._offset+=n.length,n.slice(0,t)}readValue(){return bt.from(this.readBytes(this.wordSize))}}var ke=void 0!==ke?ke:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Le(){throw new Error("setTimeout has not been defined")}function Ae(){throw new Error("clearTimeout has not been defined")}var xe=Le,Ee=Ae;function Ne(t){if(xe===setTimeout)return setTimeout(t,0);if((xe===Le||!xe)&&setTimeout)return xe=setTimeout,setTimeout(t,0);try{return xe(t,0)}catch(e){try{return xe.call(null,t,0)}catch(e){return xe.call(this,t,0)}}}"function"==typeof ke.setTimeout&&(xe=setTimeout),"function"==typeof ke.clearTimeout&&(Ee=clearTimeout);var Se,Ie=[],Te=!1,je=-1;function Ce(){Te&&Se&&(Te=!1,Se.length?Ie=Se.concat(Ie):je=-1,Ie.length&&De())}function De(){if(!Te){var t=Ne(Ce);Te=!0;for(var e=Ie.length;e;){for(Se=Ie,Ie=[];++je<e;)Se&&Se[je].run();je=-1,e=Ie.length}Se=null,Te=!1,function(t){if(Ee===clearTimeout)return clearTimeout(t);if((Ee===Ae||!Ee)&&clearTimeout)return Ee=clearTimeout,clearTimeout(t);try{return Ee(t)}catch(e){try{return Ee.call(null,t)}catch(e){return Ee.call(this,t)}}}(t)}}function Oe(t,e){this.fun=t,this.array=e}Oe.prototype.run=function(){this.fun.apply(null,this.array)};function _e(){}var ze=_e,Pe=_e,Be=_e,Re=_e,Ue=_e,Qe=_e,We=_e;var Fe=ke.performance||{},Ye=Fe.now||Fe.mozNow||Fe.msNow||Fe.oNow||Fe.webkitNow||function(){return(new Date).getTime()};var He=new Date;var Ge={nextTick:function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Ie.push(new Oe(t,e)),1!==Ie.length||Te||Ne(De)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ze,addListener:Pe,once:Be,off:Re,removeListener:Ue,removeAllListeners:Qe,emit:We,binding:function(t){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*Ye.call(Fe),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&&(n-=t[0],(r-=t[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-He)/1e3}},Ze=Ge,Ve=o((function(t){!function(){var e="input is invalid type",n="object"==typeof window,i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self;!i.JS_SHA3_NO_NODE_JS&&"object"==typeof Ze&&Ze.versions&&Ze.versions.node?i=r:o&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&t.exports,s=!i.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),c=[4,1024,262144,67108864],l=[0,8,16,24],h=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],d=[224,256,384,512],f=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!i.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!s||!i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var g=function(t,e,n){return function(r){return new j(t,e,t).update(r)[n]()}},y=function(t,e,n){return function(r,i){return new j(t,e,i).update(r)[n]()}},v=function(t,e,n){return function(e,r,i,o){return L["cshake"+t].update(e,r,i,o)[n]()}},b=function(t,e,n){return function(e,r,i,o){return L["kmac"+t].update(e,r,i,o)[n]()}},w=function(t,e,n,r){for(var i=0;i<p.length;++i){var o=p[i];t[o]=e(n,r,o)}return t},M=function(t,e){var n=g(t,e,"hex");return n.create=function(){return new j(t,e,t)},n.update=function(t){return n.create().update(t)},w(n,g,t,e)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:M},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:M},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(t,e){var n=y(t,e,"hex");return n.create=function(n){return new j(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},w(n,y,t,e)}},{name:"cshake",padding:c,bits:f,createMethod:function(t,e){var n=m[t],r=v(t,0,"hex");return r.create=function(r,i,o){return i||o?new j(t,e,r).bytepad([i,o],n):L["shake"+t].create(r)},r.update=function(t,e,n,i){return r.create(e,n,i).update(t)},w(r,v,t,e)}},{name:"kmac",padding:c,bits:f,createMethod:function(t,e){var n=m[t],r=b(t,0,"hex");return r.create=function(r,i,o){return new C(t,e,i).bytepad(["KMAC",o],n).bytepad([r],n)},r.update=function(t,e,n,i){return r.create(t,n,i).update(e)},w(r,b,t,e)}}],L={},A=[],x=0;x<k.length;++x)for(var E=k[x],N=E.bits,S=0;S<N.length;++S){var I=E.name+"_"+N[S];if(A.push(I),L[I]=E.createMethod(N[S],E.padding),"sha3"!==E.name){var T=E.name+N[S];A.push(T),L[T]=L[I]}}function j(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function C(t,e,n){j.call(this,t,e,n)}j.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,a=this.blocks,u=this.byteCount,c=t.length,h=this.blockCount,d=0,f=this.s;d<c;){if(this.reset)for(this.reset=!1,a[0]=this.block,i=1;i<h+1;++i)a[i]=0;if(n)for(i=this.start;d<c&&i<u;++d)a[i>>2]|=t[d]<<l[3&i++];else for(i=this.start;d<c&&i<u;++d)(o=t.charCodeAt(d))<128?a[i>>2]|=o<<l[3&i++]:o<2048?(a[i>>2]|=(192|o>>6)<<l[3&i++],a[i>>2]|=(128|63&o)<<l[3&i++]):o<55296||o>=57344?(a[i>>2]|=(224|o>>12)<<l[3&i++],a[i>>2]|=(128|o>>6&63)<<l[3&i++],a[i>>2]|=(128|63&o)<<l[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++d)),a[i>>2]|=(240|o>>18)<<l[3&i++],a[i>>2]|=(128|o>>12&63)<<l[3&i++],a[i>>2]|=(128|o>>6&63)<<l[3&i++],a[i>>2]|=(128|63&o)<<l[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=a[h],i=0;i<h;++i)f[i]^=a[i];D(f),this.reset=!0}else this.start=i}return this},j.prototype.encode=function(t,e){var n=255&t,r=1,i=[n];for(n=255&(t>>=8);n>0;)i.unshift(n),n=255&(t>>=8),++r;return e?i.push(r):i.unshift(r),this.update(i),i.length},j.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var a=0;a<t.length;++a){var u=t.charCodeAt(a);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(t),i},j.prototype.bytepad=function(t,e){for(var n=this.encode(e),r=0;r<t.length;++r)n+=this.encodeString(t[r]);var i=e-n%e,o=[];return o.length=i,this.update(o),this},j.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];D(r)}},j.prototype.toString=j.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<r;){for(o=0;o<e&&a<r;++o,++a)t=n[o],s+=u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];a%e==0&&(D(n),o=0)}return i&&(t=n[o],s+=u[t>>4&15]+u[15&t],i>1&&(s+=u[t>>12&15]+u[t>>8&15]),i>2&&(s+=u[t>>20&15]+u[t>>16&15])),s},j.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a<r;){for(o=0;o<e&&a<r;++o,++a)u[a]=n[o];a%e==0&&D(n)}return i&&(u[o]=n[o],t=t.slice(0,s)),t},j.prototype.buffer=j.prototype.arrayBuffer,j.prototype.digest=j.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<n&&s<i;++a,++s)t=s<<2,e=r[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%n==0&&D(r)}return o&&(t=s<<2,e=r[a],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},C.prototype=new j,C.prototype.finalize=function(){return this.encode(this.outputBits,!0),j.prototype.finalize.call(this)};var D=function(t){var e,n,r,i,o,a,s,u,c,l,d,f,p,m,g,y,v,b,w,M,k,L,A,x,E,N,S,I,T,j,C,D,O,_,z,P,B,R,U,Q,W,F,Y,H,G,Z,V,J,q,X,K,$,tt,et,nt,rt,it,ot,at,st,ut,ct,lt;for(r=0;r<48;r+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),n=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(u<<1|c>>>31),n=o^(c<<1|u>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=a^(l<<1|d>>>31),n=s^(d<<1|l>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=u^(f<<1|p>>>31),n=c^(p<<1|f>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=l^(i<<1|o>>>31),n=d^(o<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,m=t[0],g=t[1],Z=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,Y=t[41]<<18|t[40]>>>14,_=t[2]<<1|t[3]>>>31,z=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,j=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,P=t[14]<<6|t[15]>>>26,B=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,K=t[35]<<15|t[34]>>>17,D=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,R=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,k=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,H=t[8]<<27|t[9]>>>5,G=t[9]<<27|t[8]>>>5,N=t[18]<<20|t[19]>>>12,S=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,Q=t[38]<<8|t[39]>>>24,W=t[39]<<8|t[38]>>>24,L=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&b,t[1]=g^~v&w,t[10]=x^~N&I,t[11]=E^~S&T,t[20]=_^~P&R,t[21]=z^~B&U,t[30]=H^~Z&J,t[31]=G^~V&q,t[40]=et^~rt&ot,t[41]=nt^~it&at,t[2]=y^~b&M,t[3]=v^~w&k,t[12]=N^~I&j,t[13]=S^~T&C,t[22]=P^~R&Q,t[23]=B^~U&W,t[32]=Z^~J&X,t[33]=V^~q&K,t[42]=rt^~ot&st,t[43]=it^~at&ut,t[4]=b^~M&L,t[5]=w^~k&A,t[14]=I^~j&D,t[15]=T^~C&O,t[24]=R^~Q&F,t[25]=U^~W&Y,t[34]=J^~X&$,t[35]=q^~K&tt,t[44]=ot^~st&ct,t[45]=at^~ut<,t[6]=M^~L&m,t[7]=k^~A&g,t[16]=j^~D&x,t[17]=C^~O&E,t[26]=Q^~F&_,t[27]=W^~Y&z,t[36]=X^~$&H,t[37]=K^~tt&G,t[46]=st^~ct&et,t[47]=ut^~lt&nt,t[8]=L^~m&y,t[9]=A^~g&v,t[18]=D^~x&N,t[19]=O^~E&S,t[28]=F^~_&P,t[29]=Y^~z&B,t[38]=$^~H&Z,t[39]=tt^~G&V,t[48]=ct^~et&rt,t[49]=lt^~nt&it,t[0]^=h[r],t[1]^=h[r+1]};if(a)t.exports=L;else for(x=0;x<A.length;++x)i[A[x]]=L[A[x]]}()})),Je=Ve;function qe(t){return"0x"+Je.keccak_256(et(t))}const Xe=new V("rlp/5.7.0");function Ke(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function $e(t,e,n){let r=0;for(let i=0;i<n;i++)r=256*r+t[e+i];return r}function tn(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(tn(t))})),e.length<=55)return e.unshift(192+e.length),e;const n=Ke(e.length);return n.unshift(247+n.length),n.concat(e)}K(t)||Xe.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(et(t));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Ke(e.length);return n.unshift(183+n.length),n.concat(e)}function en(t){return at(tn(t))}function nn(t,e,n,r){const i=[];for(;n<e+1+r;){const o=rn(t,n);i.push(o.result),(n+=o.consumed)>e+1+r&&Xe.throwError("child data too short",V.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function rn(t,e){if(0===t.length&&Xe.throwError("data too short",V.errors.BUFFER_OVERRUN,{}),t[e]>=248){const n=t[e]-247;e+1+n>t.length&&Xe.throwError("data short segment too short",V.errors.BUFFER_OVERRUN,{});const r=$e(t,e+1,n);return e+1+n+r>t.length&&Xe.throwError("data long segment too short",V.errors.BUFFER_OVERRUN,{}),nn(t,e,e+1+n,n+r)}if(t[e]>=192){const n=t[e]-192;return e+1+n>t.length&&Xe.throwError("data array too short",V.errors.BUFFER_OVERRUN,{}),nn(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;e+1+n>t.length&&Xe.throwError("data array too short",V.errors.BUFFER_OVERRUN,{});const r=$e(t,e+1,n);e+1+n+r>t.length&&Xe.throwError("data array too short",V.errors.BUFFER_OVERRUN,{});return{consumed:1+n+r,result:at(t.slice(e+1+n,e+1+n+r))}}if(t[e]>=128){const n=t[e]-128;e+1+n>t.length&&Xe.throwError("data too short",V.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:at(t.slice(e+1,e+1+n))}}return{consumed:1,result:at(t[e])}}function on(t){const e=et(t),n=rn(e,0);return n.consumed!==e.length&&Xe.throwArgumentError("invalid rlp data","data",t),n.result}const an=new V("address/5.7.0");function sn(t){it(t,20)||an.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=et(qe(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const un={};for(let t=0;t<10;t++)un[String(t)]=String(t);for(let t=0;t<26;t++)un[String.fromCharCode(65+t)]=String(10+t);const cn=Math.floor(function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}(9007199254740991));function ln(t){let e=null;if("string"!=typeof t&&an.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=sn(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&an.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>un[t])).join("");for(;e.length>=cn;){let t=e.substring(0,cn);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t)&&an.throwArgumentError("bad icap checksum","address",t),n=t.substring(4),e=new pt(n,36).toString(16);e.length<40;)e="0"+e;e=sn("0x"+e)}else an.throwArgumentError("invalid address","address",t);var n;return e}function hn(t){let e=null;try{e=ln(t.from)}catch(e){an.throwArgumentError("missing from address","transaction",t)}return ln(ut(qe(en([e,rt(et(bt.from(t.nonce).toHexString()))])),12))}class dn extends be{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=ln(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return ln(ht(t.readValue().toHexString(),20))}}class fn extends be{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const pn=new V(Vt);function mn(t,e,n){let r=null;if(Array.isArray(n))r=n;else if(n&&"object"==typeof n){let t={};r=e.map((e=>{const r=e.localName;return r||pn.throwError("cannot encode object for signature with missing names",V.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]&&pn.throwError("cannot encode object for signature with duplicate names",V.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:n}),t[r]=!0,n[r]}))}else pn.throwArgumentError("invalid tuple value","tuple",n);e.length!==r.length&&pn.throwArgumentError("types/value length mismatch","tuple",n);let i=new we(t.wordSize),o=new we(t.wordSize),a=[];e.forEach(((t,e)=>{let n=r[e];if(t.dynamic){let e=o.length;t.encode(o,n);let r=i.writeUpdatableValue();a.push((t=>{r(t+e)}))}else t.encode(i,n)})),a.forEach((t=>{t(i.length)}));let s=t.appendWriter(i);return s+=t.appendWriter(o),s}function gn(t,e){let n=[],r=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let n=t.readValue(),o=r.subReader(n.toNumber());try{i=e.decode(o)}catch(t){if(t.code===V.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===V.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&n.push(i)}));const i=e.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});e.forEach(((t,e)=>{let r=t.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=n[r])return;const o=n[e];o instanceof Error?Object.defineProperty(n,r,{enumerable:!0,get:()=>{throw o}}):n[r]=o}));for(let t=0;t<n.length;t++){const e=n[t];e instanceof Error&&Object.defineProperty(n,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(n)}class yn extends be{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let n=this.length;-1===n&&(n=e.length,t.writeValue(e.length)),pn.checkArgumentCount(e.length,n,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let t=0;t<e.length;t++)r.push(this.coder);return mn(t,r,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&pn.throwError("insufficient data length",V.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let t=0;t<e;t++)n.push(new fn(this.coder));return t.coerce(this.name,gn(t,n))}}class vn extends be{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class bn extends be{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=et(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class wn extends bn{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,at(super.decode(t)))}}class Mn extends be{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=et(e);return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return t.coerce(this.name,at(t.readBytes(this.size)))}}class kn extends be{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const Ln=bt.from(-1),An=bt.from(0),xn=bt.from(1),En=bt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Nn extends be{constructor(t,e,n){const r=(e?"int":"uint")+8*t;super(r,r,n,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let n=bt.from(e),r=En.mask(8*t.wordSize);if(this.signed){let t=r.mask(8*this.size-1);(n.gt(t)||n.lt(t.add(xn).mul(Ln)))&&this._throwError("value out-of-bounds",e)}else(n.lt(An)||n.gt(r.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}const Sn=new V("strings/5.7.0");var In,Tn;function jn(t,e,n,r,i){if(t===Tn.BAD_PREFIX||t===Tn.UNEXPECTED_CONTINUE){let t=0;for(let r=e+1;r<n.length&&n[r]>>6==2;r++)t++;return t}return t===Tn.OVERRUN?n.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(In||(In={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Tn||(Tn={}));const Cn=Object.freeze({error:function(t,e,n,r,i){return Sn.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",n)},ignore:jn,replace:function(t,e,n,r,i){return t===Tn.OVERLONG?(r.push(i),0):(r.push(65533),jn(t,e,n))}});function Dn(t,e){null==e&&(e=Cn.error),t=et(t);const n=[];let r=0;for(;r<t.length;){const i=t[r++];if(i>>7==0){n.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){r+=e(128==(192&i)?Tn.UNEXPECTED_CONTINUE:Tn.BAD_PREFIX,r-1,t,n);continue}o=3,a=65535}if(r-1+o>=t.length){r+=e(Tn.OVERRUN,r-1,t,n);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=t[r];if(128!=(192&i)){r+=e(Tn.MISSING_CONTINUE,r,t,n),s=null;break}s=s<<6|63&i,r++}null!==s&&(s>1114111?r+=e(Tn.OUT_OF_RANGE,r-1-o,t,n,s):s>=55296&&s<=57343?r+=e(Tn.UTF16_SURROGATE,r-1-o,t,n,s):s<=a?r+=e(Tn.OVERLONG,r-1-o,t,n,s):n.push(s))}return n}function On(t,e=In.current){e!=In.current&&(Sn.checkNormalize(),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return et(n)}function _n(t,e){return Dn(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}class zn extends bn{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,On(e))}decode(t){return _n(super.decode(t))}}class Pn extends be{constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)}));super("tuple","tuple("+r.join(",")+")",e,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[r]))})),Object.freeze(t)}encode(t,e){return mn(t,this.coders,e)}decode(t){return t.coerce(this.name,gn(t,this.coders))}}const Bn=new V(Vt),Rn=new RegExp(/^bytes([0-9]*)$/),Un=new RegExp(/^(u?int)([0-9]*)$/);const Qn=new class{constructor(t){Rt(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new dn(t.name);case"bool":return new vn(t.name);case"string":return new zn(t.name);case"bytes":return new wn(t.name);case"array":return new yn(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new Pn((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new kn(t.name)}let e=t.type.match(Un);if(e){let n=parseInt(e[2]||"256");return(0===n||n>256||n%8!=0)&&Bn.throwArgumentError("invalid "+e[1]+" bit length","param",t),new Nn(n/8,"int"===e[1],t.name)}if(e=t.type.match(Rn),e){let n=parseInt(e[1]);return(0===n||n>32)&&Bn.throwArgumentError("invalid bytes length","param",t),new Mn(n,t.name)}return Bn.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new Me(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new we(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(re.from(t))));return new Pn(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&Bn.throwError("types/values length mismatch",V.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map((t=>this._getCoder(re.from(t)))),r=new Pn(n,"_"),i=this._getWriter();return r.encode(i,e),i.data}decode(t,e,n){const r=t.map((t=>this._getCoder(re.from(t))));return new Pn(r,"_").decode(this._getReader(et(e),n))}};function Wn(t){return qe(On(t))}const Fn="hash/5.7.0";function Yn(t){t=atob(t);const e=[];for(let n=0;n<t.length;n++)e.push(t.charCodeAt(n));return et(e)}function Hn(t){t=et(t);let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Gn(t,e){null==e&&(e=1);const n=[],r=n.forEach,i=function(t,e){r.call(t,(function(t){e>0&&Array.isArray(t)?i(t,e-1):n.push(t)}))};return i(t,e),n}function Zn(t){return function(t){let e=0;return()=>t[e++]}(function(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,o=[0,1];for(let t=1;t<r;t++)o.push(i+=n());let a=n(),s=e;e+=a;let u=0,c=0;function l(){return 0==u&&(c=c<<8|t[e++],u=8),c>>--u&1}const h=Math.pow(2,31),d=h>>>1,f=d>>1,p=h-1;let m=0;for(let t=0;t<31;t++)m=m<<1|l();let g=[],y=0,v=h;for(;;){let t=Math.floor(((m-y+1)*i-1)/v),e=0,n=r;for(;n-e>1;){let r=e+n>>>1;t<o[r]?n=r:e=r}if(0==e)break;g.push(e);let a=y+Math.floor(v*o[e]/i),s=y+Math.floor(v*o[e+1]/i)-1;for(;0==((a^s)&d);)m=m<<1&p|l(),a=a<<1&p,s=s<<1&p|1;for(;a&~s&f;)m=m&d|m<<1&p>>>1|l(),a=a<<1^d,s=(s^d)<<1|d|1;y=a,v=1+s-a}let b=r-4;return g.map((e=>{switch(e-b){case 3:return b+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return b+256+(t[s++]<<8|t[s++]);case 1:return b+t[s++];default:return e-1}}))}(t))}function Vn(t){return 1&t?~t>>1:t>>1}function Jn(t,e){let n=Array(t);for(let r=0,i=-1;r<t;r++)n[r]=i+=1+e();return n}function qn(t,e){let n=Array(t);for(let r=0,i=0;r<t;r++)n[r]=i+=Vn(e());return n}function Xn(t,e){let n=Jn(t(),t),r=t(),i=Jn(r,t),o=function(t,e){let n=Array(t);for(let r=0;r<t;r++)n[r]=1+e();return n}(r,t);for(let t=0;t<r;t++)for(let e=0;e<o[t];e++)n.push(i[t]+e);return e?n.map((t=>e[t])):n}function Kn(t,e,n){let r=Array(t).fill(void 0).map((()=>[]));for(let i=0;i<e;i++)qn(t,n).forEach(((t,e)=>r[e].push(t)));return r}function $n(t,e){let n=1+e(),r=e(),i=function(t){let e=[];for(;;){let n=t();if(0==n)break;e.push(n)}return e}(e);return Gn(Kn(i.length,1+t,e).map(((t,e)=>{const o=t[0],a=t.slice(1);return Array(i[e]).fill(void 0).map(((t,e)=>{let i=e*r;return[o+e*n,a.map((t=>t+i))]}))})))}function tr(t,e){return Kn(1+e(),1+t,e).map((t=>[t[0],t.slice(1)]))}const er=Zn(Yn("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),nr=new Set(Xn(er)),rr=new Set(Xn(er)),ir=function(t){let e=[];for(;;){let n=t();if(0==n)break;e.push($n(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(tr(n,t))}return function(t){const e={};for(let n=0;n<t.length;n++){const r=t[n];e[r[0]]=r[1]}return e}(Gn(e))}(er),or=function(t){let e=Xn(t).sort(((t,e)=>t-e));return function n(){let r=[];for(;;){let i=Xn(t,e);if(0==i.length)break;r.push({set:new Set(i),node:n()})}r.sort(((t,e)=>e.set.size-t.set.size));let i=t(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:r,valid:o,fe0f:a,save:1==i,check:2==i}}()}(er),ar=45,sr=95;function ur(t){return function(t,e=In.current){return Dn(On(t,e))}(t)}function cr(t){return t.filter((t=>65039!=t))}function lr(t){for(let e of t.split(".")){let t=ur(e);try{for(let e=t.lastIndexOf(sr)-1;e>=0;e--)if(t[e]!==sr)throw new Error("underscore only allowed at start");if(t.length>=4&&t.every((t=>t<128))&&t[2]===ar&&t[3]===ar)throw new Error("invalid label extension")}catch(t){throw new Error(`Invalid label "${e}": ${t.message}`)}}return t}function hr(t){return lr(function(t,e){let n=ur(t).reverse(),r=[];for(;n.length;){let t=dr(n);if(t){r.push(...e(t));continue}let i=n.pop();if(nr.has(i)){r.push(i);continue}if(rr.has(i))continue;let o=ir[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);r.push(...o)}return lr(function(t){return t.normalize("NFC")}(String.fromCodePoint(...r)))}(t,cr))}function dr(t,e){var n;let r,i,o=or,a=[],s=t.length;for(e&&(e.length=0);s;){let u=t[--s];if(o=null===(n=o.branches.find((t=>t.set.has(u))))||void 0===n?void 0:n.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==t[s-1]&&s--),o.valid&&(r=a.slice(),2==o.valid&&r.splice(1,1),e&&e.push(...t.slice(s).reverse()),t.length=s)}return r}const fr=new V(Fn),pr=new Uint8Array(32);function mr(t){if(0===t.length)throw new Error("invalid ENS name; empty component");return t}function gr(t){const e=On(hr(t)),n=[];if(0===t.length)return n;let r=0;for(let t=0;t<e.length;t++){46===e[t]&&(n.push(mr(e.slice(r,t))),r=t+1)}if(r>=e.length)throw new Error("invalid ENS name; empty component");return n.push(mr(e.slice(r))),n}function yr(t){"string"!=typeof t&&fr.throwArgumentError("invalid ENS name; not a string","name",t);let e=pr;const n=gr(t);for(;n.length;)e=qe(nt([e,qe(n.pop())]));return at(e)}pr.fill(0);var vr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const br=new V(Fn),wr=new Uint8Array(32);wr.fill(0);const Mr=bt.from(-1),kr=bt.from(0),Lr=bt.from(1),Ar=bt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const xr=ht(Lr.toHexString(),32),Er=ht(kr.toHexString(),32),Nr={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Sr=["name","version","chainId","verifyingContract","salt"];function Ir(t){return function(e){return"string"!=typeof e&&br.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Tr={name:Ir("name"),version:Ir("version"),chainId:function(t){try{return bt.from(t).toString()}catch(t){}return br.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return ln(t).toLowerCase()}catch(t){}return br.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=et(t);if(32!==e.length)throw new Error("bad length");return at(e)}catch(t){}return br.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function jr(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=""===e[1],r=parseInt(e[2]||"256");(r%8!=0||r>256||e[2]&&e[2]!==String(r))&&br.throwArgumentError("invalid numeric width","type",t);const i=Ar.mask(n?r-1:r),o=n?i.add(Lr).mul(Mr):kr;return function(e){const n=bt.from(e);return(n.lt(o)||n.gt(i))&&br.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),ht(n.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return(0===n||n>32||e[1]!==String(n))&&br.throwArgumentError("invalid bytes width","type",t),function(e){return et(e).length!==n&&br.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=et(t),n=e.length%32;return n?ct([e,wr.slice(n)]):at(e)}(e)}}}switch(t){case"address":return function(t){return ht(ln(t),32)};case"bool":return function(t){return t?xr:Er};case"bytes":return function(t){return qe(t)};case"string":return function(t){return Wn(t)}}return null}function Cr(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Dr{constructor(t){Rt(this,"types",Object.freeze(Gt(t))),Rt(this,"_encoderCache",{}),Rt(this,"_types",{});const e={},n={},r={};Object.keys(t).forEach((t=>{e[t]={},n[t]=[],r[t]={}}));for(const r in t){const i={};t[r].forEach((o=>{i[o.name]&&br.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(r)}`,"types",t),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===r&&br.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",t);jr(a)||(n[a]||br.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",t),n[a].push(r),e[r][a]=!0)}))}const i=Object.keys(n).filter((t=>0===n[t].length));0===i.length?br.throwArgumentError("missing primary type","types",t):i.length>1&&br.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),Rt(this,"primaryType",i[0]),function i(o,a){a[o]&&br.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),a[o]=!0,Object.keys(e[o]).forEach((t=>{n[t]&&(i(t,a),Object.keys(a).forEach((e=>{r[e][t]=!0})))})),delete a[o]}(this.primaryType,{});for(const e in r){const n=Object.keys(r[e]);n.sort(),this._types[e]=Cr(e,t[e])+n.map((e=>Cr(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=jr(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],n=this.getEncoder(t),r=parseInt(e[3]);return e=>{r>=0&&e.length!==r&&br.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(n);return this._types[t]&&(i=i.map(qe)),qe(ct(i))}}const n=this.types[t];if(n){const e=Wn(this._types[t]);return t=>{const r=n.map((({name:e,type:n})=>{const r=this.getEncoder(n)(t[e]);return this._types[n]?qe(r):r}));return r.unshift(e),ct(r)}}return br.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||br.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return qe(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(jr(t))return n(t,e);const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],i=parseInt(r[3]);return i>=0&&e.length!==i&&br.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,n)))}const i=this.types[t];return i?i.reduce(((t,{name:r,type:i})=>(t[r]=this._visit(i,e[r],n),t)),{}):br.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Dr(t)}static getPrimaryType(t){return Dr.from(t).primaryType}static hashStruct(t,e,n){return Dr.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const r=Nr[n];r||br.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:r})}return e.sort(((t,e)=>Sr.indexOf(t.name)-Sr.indexOf(e.name))),Dr.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return ct(["0x1901",Dr.hashDomain(t),Dr.from(e).hash(n)])}static hash(t,e,n){return qe(Dr.encode(t,e,n))}static resolveNames(t,e,n,r){return vr(this,void 0,void 0,(function*(){t=Wt(t);const i={};t.verifyingContract&&!it(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Dr.from(e);o.visit(n,((t,e)=>("address"!==t||it(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield r(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=o.visit(n,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:n}}))}static getPayload(t,e,n){Dr.hashDomain(t);const r={},i=[];Sr.forEach((e=>{const n=t[e];null!=n&&(r[e]=Tr[e](n),i.push({name:e,type:Nr[e]}))}));const o=Dr.from(e),a=Wt(e);return a.EIP712Domain?br.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):a.EIP712Domain=i,o.encode(n),{types:a,domain:r,primaryType:o.primaryType,message:o.visit(n,((t,e)=>{if(t.match(/^bytes(\d*)/))return at(et(e));if(t.match(/^u?int/))return bt.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&br.throwArgumentError("invalid string","value",e),e}return br.throwArgumentError("unsupported type","type",t)}))}}}const Or=new V(Vt);class _r extends Zt{}class zr extends Zt{}class Pr extends Zt{}class Br extends Zt{static isIndexed(t){return!(!t||!t._isIndexed)}}const Rr={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Ur(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return n.error=e,n}class Qr{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,Rt(this,"fragments",e.map((t=>oe.from(t))).filter((t=>null!=t))),Rt(this,"_abiCoder",Ut(new.target,"getAbiCoder")()),Rt(this,"functions",{}),Rt(this,"errors",{}),Rt(this,"events",{}),Rt(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void Or.warn("duplicate definition - constructor"):void Rt(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let n=t.format();e[n]?Or.warn("duplicate definition - "+n):e[n]=t})),this.deploy||Rt(this,"deploy",le.from({payable:!1,type:"constructor"})),Rt(this,"_isInterface",!0)}format(t){t||(t=ee.full),t===ee.sighash&&Or.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===ee.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return Qn}static getAddress(t){return ln(t)}static getSighash(t){return ut(Wn(t.format()),0,4)}static getEventTopic(t){return Wn(t.format())}getFunction(t){if(it(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];Or.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===n.length?Or.throwArgumentError("no matching function","name",e):n.length>1&&Or.throwArgumentError("multiple matching functions","name",e),this.functions[n[0]]}const e=this.functions[he.fromString(t).format()];return e||Or.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(it(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];Or.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===n.length?Or.throwArgumentError("no matching event","name",e):n.length>1&&Or.throwArgumentError("multiple matching events","name",e),this.events[n[0]]}const e=this.events[ae.fromString(t).format()];return e||Or.throwArgumentError("no matching event","signature",t),e}getError(t){if(it(t)){const e=Ut(this.constructor,"getSighash");for(const n in this.errors){if(t===e(this.errors[n]))return this.errors[n]}Or.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),n=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===n.length?Or.throwArgumentError("no matching error","name",e):n.length>1&&Or.throwArgumentError("multiple matching errors","name",e),this.errors[n[0]]}const e=this.errors[he.fromString(t).format()];return e||Or.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return Ut(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),Ut(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const n=et(e);return at(n.slice(0,4))!==this.getSighash(t)&&Or.throwArgumentError(`data signature does not match error ${t.name}.`,"data",at(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),at(nt([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const n=et(e);return at(n.slice(0,4))!==this.getSighash(t)&&Or.throwArgumentError(`data signature does not match function ${t.name}.`,"data",at(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),at(nt([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let n=et(e),r=null,i="",o=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch(t){}break;case 4:{const t=at(n.slice(0,4)),e=Rr[t];if(e)o=this._abiCoder.decode(e.inputs,n.slice(4)),a=e.name,s=e.signature,e.reason&&(r=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const e=this.getError(t);o=this._abiCoder.decode(e.inputs,n.slice(4)),a=e.name,s=e.format()}catch(t){}break}}return Or.throwError("call revert exception"+i,V.errors.CALL_EXCEPTION,{method:t.format(),data:at(e),errorArgs:o,errorName:a,errorSignature:s,reason:r})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),at(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&Or.throwError("too many arguments for "+t.format(),V.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const r=(t,e)=>"string"===t.type?Wn(e):"bytes"===t.type?qe(at(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=bt.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),ht(at(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Or.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((t=>r(o,t)))):n.push(r(o,e)):null!=e&&Or.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const n=[],r=[],i=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&Or.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const a=e[o];if(t.indexed)if("string"===t.type)n.push(Wn(a));else if("bytes"===t.type)n.push(qe(a));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([t.type],[a]))}else r.push(t),i.push(a)})),{data:this._abiCoder.encode(r,i),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);it(n[0],32)&&n[0].toLowerCase()===e||Or.throwError("fragment/topic mismatch",V.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let r=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(re.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(r.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let a=null!=n?this._abiCoder.decode(r,nt(n)):null,s=this._abiCoder.decode(i,e,!0),u=[],c=0,l=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==a)u[e]=new Br({_isIndexed:!0,hash:null});else if(o[e])u[e]=new Br({_isIndexed:!0,hash:a[l++]});else try{u[e]=a[l++]}catch(t){u[e]=t}else try{u[e]=s[c++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const n=u[e];n instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw Ur(`property ${JSON.stringify(t.name)}`,n)}}):u[t.name]=n}}));for(let t=0;t<u.length;t++){const e=u[t];e instanceof Error&&Object.defineProperty(u,t,{enumerable:!0,get:()=>{throw Ur(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new zr({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:bt.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new _r({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=at(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new Pr({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!(!t||!t._isInterface)}}var Wr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const Fr=new V("abstract-provider/5.7.0");class Yr extends Zt{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class Hr{constructor(){Fr.checkAbstract(new.target,Hr),Rt(this,"_isProvider",!0)}getFeeData(){return Wr(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield Qt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let n=null,r=null,i=null;return t&&t.baseFeePerGas&&(n=t.baseFeePerGas,i=bt.from("1500000000"),r=t.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:n,maxFeePerGas:r,maxPriorityFeePerGas:i,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}var Gr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const Zr=new V("abstract-signer/5.7.0"),Vr=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Jr=[V.errors.INSUFFICIENT_FUNDS,V.errors.NONCE_EXPIRED,V.errors.REPLACEMENT_UNDERPRICED];class qr{constructor(){Zr.checkAbstract(new.target,qr),Rt(this,"_isSigner",!0)}getBalance(t){return Gr(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return Gr(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return Gr(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield Qt(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return Gr(this,void 0,void 0,(function*(){this._checkProvider("call");const n=yield Qt(this.checkTransaction(t));return yield this.provider.call(n,e)}))}sendTransaction(t){return Gr(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)}))}getChainId(){return Gr(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Gr(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Gr(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return Gr(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===Vr.indexOf(e)&&Zr.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=Wt(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&Zr.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return Gr(this,void 0,void 0,(function*(){const e=yield Qt(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>Gr(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&Zr.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const n=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!n?0!==e.type&&1!==e.type||!n||Zr.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):Zr.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(n&&Zr.throwError("network does not support EIP-1559",V.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):Zr.throwError("failed to get consistent fee data",V.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(Jr.indexOf(t.code)>=0)throw t;return Zr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",V.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&Zr.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield Qt(e)}))}_checkProvider(t){this.provider||Zr.throwError("missing provider",V.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class Xr extends qr{constructor(t,e){super(),Rt(this,"address",t),Rt(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{Zr.throwError(t,V.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new Xr(this.address,t)}}var Kr=$r;function $r(t,e){if(!t)throw new Error(e||"Assertion failed")}$r.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var ti=[],ei=[],ni="undefined"!=typeof Uint8Array?Uint8Array:Array,ri=!1;function ii(){ri=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)ti[e]=t[e],ei[t.charCodeAt(e)]=e;ei["-".charCodeAt(0)]=62,ei["_".charCodeAt(0)]=63}function oi(t,e,n){for(var r,i,o=[],a=e;a<n;a+=3)r=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(ti[(i=r)>>18&63]+ti[i>>12&63]+ti[i>>6&63]+ti[63&i]);return o.join("")}function ai(t){var e;ri||ii();for(var n=t.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;s<u;s+=a)o.push(oi(t,s,s+a>u?u:s+a));return 1===r?(e=t[n-1],i+=ti[e>>2],i+=ti[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=ti[e>>10],i+=ti[e>>4&63],i+=ti[e<<2&63],i+="="),o.push(i),o.join("")}function si(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function ui(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+f]=255&a,f+=p,a/=256,c-=8);t[n+f-p]|=128*m}var ci={}.toString,li=Array.isArray||function(t){return"[object Array]"==ci.call(t)};function hi(){return fi.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function di(t,e){if(hi()<e)throw new RangeError("Invalid typed array length");return fi.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=fi.prototype:(null===t&&(t=new fi(e)),t.length=e),t}function fi(t,e,n){if(!(fi.TYPED_ARRAY_SUPPORT||this instanceof fi))return new fi(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return gi(this,t)}return pi(this,t,e,n)}function pi(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);fi.TYPED_ARRAY_SUPPORT?(t=e).__proto__=fi.prototype:t=yi(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!fi.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|wi(e,n);t=di(t,r);var i=t.write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(bi(e)){var n=0|vi(e.length);return 0===(t=di(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?di(t,0):yi(t,e);if("Buffer"===e.type&&li(e.data))return yi(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function mi(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function gi(t,e){if(mi(e),t=di(t,e<0?0:0|vi(e)),!fi.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function yi(t,e){var n=e.length<0?0:0|vi(e.length);t=di(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function vi(t){if(t>=hi())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+hi().toString(16)+" bytes");return 0|t}function bi(t){return!(null==t||!t._isBuffer)}function wi(t,e){if(bi(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Zi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Vi(t).length;default:if(r)return Zi(t).length;e=(""+e).toLowerCase(),r=!0}}function Mi(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return zi(this,e,n);case"utf8":case"utf-8":return Ci(this,e,n);case"ascii":return Oi(this,e,n);case"latin1":case"binary":return _i(this,e,n);case"base64":return ji(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pi(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function ki(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Li(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=fi.from(e,r)),bi(e))return 0===e.length?-1:Ai(t,e,n,r,i);if("number"==typeof e)return e&=255,fi.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):Ai(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Ai(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(c(t,o+d)!==c(e,d)){h=!1;break}if(h)return o}return-1}function xi(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function Ei(t,e,n,r){return Ji(Zi(e,t.length-n),t,n,r)}function Ni(t,e,n,r){return Ji(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function Si(t,e,n,r){return Ni(t,e,n,r)}function Ii(t,e,n,r){return Ji(Vi(e),t,n,r)}function Ti(t,e,n,r){return Ji(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function ji(t,e,n){return 0===e&&n===t.length?ai(t):ai(t.slice(e,n))}function Ci(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=Di)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Di));return n}(r)}fi.TYPED_ARRAY_SUPPORT=void 0===ke.TYPED_ARRAY_SUPPORT||ke.TYPED_ARRAY_SUPPORT,hi(),fi.poolSize=8192,fi._augment=function(t){return t.__proto__=fi.prototype,t},fi.from=function(t,e,n){return pi(null,t,e,n)},fi.TYPED_ARRAY_SUPPORT&&(fi.prototype.__proto__=Uint8Array.prototype,fi.__proto__=Uint8Array),fi.alloc=function(t,e,n){return function(t,e,n,r){return mi(e),e<=0?di(t,e):void 0!==n?"string"==typeof r?di(t,e).fill(n,r):di(t,e).fill(n):di(t,e)}(null,t,e,n)},fi.allocUnsafe=function(t){return gi(null,t)},fi.allocUnsafeSlow=function(t){return gi(null,t)},fi.isBuffer=function(t){return null!=t&&(!!t._isBuffer||qi(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&qi(t.slice(0,0))}(t))},fi.compare=function(t,e){if(!bi(t)||!bi(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},fi.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},fi.concat=function(t,e){if(!li(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return fi.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=fi.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!bi(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},fi.byteLength=wi,fi.prototype._isBuffer=!0,fi.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)ki(this,e,e+1);return this},fi.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)ki(this,e,e+3),ki(this,e+1,e+2);return this},fi.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)ki(this,e,e+7),ki(this,e+1,e+6),ki(this,e+2,e+5),ki(this,e+3,e+4);return this},fi.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Ci(this,0,t):Mi.apply(this,arguments)},fi.prototype.equals=function(t){if(!bi(t))throw new TypeError("Argument must be a Buffer");return this===t||0===fi.compare(this,t)},fi.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},fi.prototype.compare=function(t,e,n,r,i){if(!bi(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},fi.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},fi.prototype.indexOf=function(t,e,n){return Li(this,t,e,n,!0)},fi.prototype.lastIndexOf=function(t,e,n){return Li(this,t,e,n,!1)},fi.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return xi(this,t,e,n);case"utf8":case"utf-8":return Ei(this,t,e,n);case"ascii":return Ni(this,t,e,n);case"latin1":case"binary":return Si(this,t,e,n);case"base64":return Ii(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ti(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},fi.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Di=4096;function Oi(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function _i(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function zi(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=Gi(t[o]);return i}function Pi(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Bi(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function Ri(t,e,n,r,i,o){if(!bi(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function Ui(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Qi(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function Wi(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Fi(t,e,n,r,i){return i||Wi(t,0,n,4),ui(t,e,n,r,23,4),n+4}function Yi(t,e,n,r,i){return i||Wi(t,0,n,8),ui(t,e,n,r,52,8),n+8}fi.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),fi.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=fi.prototype;else{var i=e-t;n=new fi(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},fi.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Bi(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},fi.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Bi(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},fi.prototype.readUInt8=function(t,e){return e||Bi(t,1,this.length),this[t]},fi.prototype.readUInt16LE=function(t,e){return e||Bi(t,2,this.length),this[t]|this[t+1]<<8},fi.prototype.readUInt16BE=function(t,e){return e||Bi(t,2,this.length),this[t]<<8|this[t+1]},fi.prototype.readUInt32LE=function(t,e){return e||Bi(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},fi.prototype.readUInt32BE=function(t,e){return e||Bi(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},fi.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Bi(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},fi.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Bi(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},fi.prototype.readInt8=function(t,e){return e||Bi(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},fi.prototype.readInt16LE=function(t,e){e||Bi(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},fi.prototype.readInt16BE=function(t,e){e||Bi(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},fi.prototype.readInt32LE=function(t,e){return e||Bi(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},fi.prototype.readInt32BE=function(t,e){return e||Bi(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},fi.prototype.readFloatLE=function(t,e){return e||Bi(t,4,this.length),si(this,t,!0,23,4)},fi.prototype.readFloatBE=function(t,e){return e||Bi(t,4,this.length),si(this,t,!1,23,4)},fi.prototype.readDoubleLE=function(t,e){return e||Bi(t,8,this.length),si(this,t,!0,52,8)},fi.prototype.readDoubleBE=function(t,e){return e||Bi(t,8,this.length),si(this,t,!1,52,8)},fi.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Ri(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},fi.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Ri(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},fi.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,1,255,0),fi.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},fi.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,2,65535,0),fi.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ui(this,t,e,!0),e+2},fi.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,2,65535,0),fi.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ui(this,t,e,!1),e+2},fi.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,4,4294967295,0),fi.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Qi(this,t,e,!0),e+4},fi.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,4,4294967295,0),fi.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Qi(this,t,e,!1),e+4},fi.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Ri(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},fi.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Ri(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},fi.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,1,127,-128),fi.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},fi.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,2,32767,-32768),fi.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ui(this,t,e,!0),e+2},fi.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,2,32767,-32768),fi.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ui(this,t,e,!1),e+2},fi.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,4,2147483647,-2147483648),fi.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Qi(this,t,e,!0),e+4},fi.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||Ri(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),fi.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Qi(this,t,e,!1),e+4},fi.prototype.writeFloatLE=function(t,e,n){return Fi(this,t,e,!0,n)},fi.prototype.writeFloatBE=function(t,e,n){return Fi(this,t,e,!1,n)},fi.prototype.writeDoubleLE=function(t,e,n){return Yi(this,t,e,!0,n)},fi.prototype.writeDoubleBE=function(t,e,n){return Yi(this,t,e,!1,n)},fi.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!fi.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},fi.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!fi.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=bi(t)?t:Zi(new fi(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var Hi=/[^+\/0-9A-Za-z-_]/g;function Gi(t){return t<16?"0"+t.toString(16):t.toString(16)}function Zi(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Vi(t){return function(t){var e,n,r,i,o,a;ri||ii();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new ni(3*s/4-o),r=o>0?s-4:s;var u=0;for(e=0,n=0;e<r;e+=4,n+=3)i=ei[t.charCodeAt(e)]<<18|ei[t.charCodeAt(e+1)]<<12|ei[t.charCodeAt(e+2)]<<6|ei[t.charCodeAt(e+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=ei[t.charCodeAt(e)]<<2|ei[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=ei[t.charCodeAt(e)]<<10|ei[t.charCodeAt(e+1)]<<4|ei[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Hi,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Ji(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function qi(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Xi=function(t){return t instanceof fi},Ki=o((function(t,e){var n=/%[sdj%]/g;e.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var i=arguments,o=i.length,s=String(t).replace(n,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}})),u=i[r];r<o;u=i[++r])p(u)||!b(u)?s+=" "+u:s+=" "+a(u);return s},e.deprecate=function(t,n){if(y(r.process))return function(){return e.deprecate(t,n).apply(this,arguments)};if(!0===Ze.noDeprecation)return t;var i=!1;return function(){if(!i){if(Ze.throwDeprecation)throw new Error(n);Ze.traceDeprecation?console.trace(n):console.error(n),i=!0}return t.apply(this,arguments)}};var i,o={};function a(t,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(n)?r.showHidden=n:n&&e._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),c(r,t,r.depth)}function s(t,e){var n=a.styles[e];return n?"["+a.colors[n][0]+"m"+t+"["+a.colors[n][1]+"m":t}function u(t,e){return t}function c(t,n,r){if(t.customInspect&&n&&k(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return g(i)||(i=c(t,i,r)),i}var o=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(m(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(p(e))return t.stylize("null","null")}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),0===a.length){if(k(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(v(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return t.stylize(Date.prototype.toString.call(n),"date");if(M(n))return l(n)}var b,L="",A=!1,x=["{","}"];(d(n)&&(A=!0,x=["[","]"]),k(n))&&(L=" [Function"+(n.name?": "+n.name:"")+"]");return v(n)&&(L=" "+RegExp.prototype.toString.call(n)),w(n)&&(L=" "+Date.prototype.toUTCString.call(n)),M(n)&&(L=" "+l(n)),0!==a.length||A&&0!=n.length?r<0?v(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),b=A?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)E(e,String(a))?o.push(h(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(t,e,n,r,i,!0))})),o}(t,n,r,s,a):a.map((function(e){return h(t,n,r,s,e,A)})),t.seen.pop(),function(t,e,n){var r=t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(b,L,x)):x[0]+L+x[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),E(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=p(n)?c(t,u.value,null):c(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function p(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return b(t)&&"[object RegExp]"===L(t)}function b(t){return"object"==typeof t&&null!==t}function w(t){return b(t)&&"[object Date]"===L(t)}function M(t){return b(t)&&("[object Error]"===L(t)||t instanceof Error)}function k(t){return"function"==typeof t}function L(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(y(i)&&(i=Ze.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var n=Ze.pid;o[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else o[t]=function(){};return o[t]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=f,e.isNull=p,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=y,e.isRegExp=v,e.isObject=b,e.isDate=w,e.isError=M,e.isFunction=k,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=Xi;var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,n;console.log("%s - %s",(t=new Date,n=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),x[t.getMonth()],n].join(" ")),e.format.apply(e,arguments))},e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e._extend=function(t,e){if(!e||!b(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}})),$i=o((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),to=o((function(t){try{var e=Ki;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=$i}}));function eo(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}var no=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)n.push(parseInt(t[i]+t[i+1],16))}else for(var r=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):eo(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<t.length;i++)n[i]=0|t[i];return n};var ro=function(t){for(var e="",n=0;n<t.length;n++)e+=ao(t[n].toString(16));return e};function io(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}var oo=function(t,e){for(var n="",r=0;r<t.length;r++){var i=t[r];"little"===e&&(i=io(i)),n+=so(i.toString(16))}return n};function ao(t){return 1===t.length?"0"+t:t}function so(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}var uo=function(t,e,n,r){var i=n-e;Kr(i%4==0);for(var o=new Array(i/4),a=0,s=e;a<o.length;a++,s+=4){var u;u="big"===r?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],o[a]=u>>>0}return o};var co=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r<t.length;r++,i+=4){var o=t[r];"big"===e?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n};var lo=function(t,e){return t>>>e|t<<32-e};var ho=function(t,e){return t<<e|t>>>32-e};var fo=function(t,e){return t+e>>>0};var po=function(t,e,n){return t+e+n>>>0};var mo=function(t,e,n,r){return t+e+n+r>>>0};var go=function(t,e,n,r,i){return t+e+n+r+i>>>0};var yo=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,a=(o<r?1:0)+n+i;t[e]=a>>>0,t[e+1]=o};var vo=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0};var bo=function(t,e,n,r){return e+r>>>0};var wo=function(t,e,n,r,i,o,a,s){var u=0,c=e;return u+=(c=c+r>>>0)<e?1:0,u+=(c=c+o>>>0)<o?1:0,t+n+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0};var Mo=function(t,e,n,r,i,o,a,s){return e+r+o+s>>>0};var ko=function(t,e,n,r,i,o,a,s,u,c){var l=0,h=e;return l+=(h=h+r>>>0)<e?1:0,l+=(h=h+o>>>0)<o?1:0,l+=(h=h+s>>>0)<s?1:0,t+n+i+a+u+(l+=(h=h+c>>>0)<c?1:0)>>>0};var Lo=function(t,e,n,r,i,o,a,s,u,c){return e+r+o+s+c>>>0};var Ao=function(t,e,n){return(e<<32-n|t>>>n)>>>0};var xo=function(t,e,n){return(t<<32-n|e>>>n)>>>0};var Eo=function(t,e,n){return t>>>n};var No=function(t,e,n){return(t<<32-n|e>>>n)>>>0},So={inherits:to,toArray:no,toHex:ro,htonl:io,toHex32:oo,zero2:ao,zero8:so,join32:uo,split32:co,rotr32:lo,rotl32:ho,sum32:fo,sum32_3:po,sum32_4:mo,sum32_5:go,sum64:yo,sum64_hi:vo,sum64_lo:bo,sum64_4_hi:wo,sum64_4_lo:Mo,sum64_5_hi:ko,sum64_5_lo:Lo,rotr64_hi:Ao,rotr64_lo:xo,shr64_hi:Eo,shr64_lo:No};function Io(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var To=Io;Io.prototype.update=function(t,e){if(t=So.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=So.join32(t,0,t.length-n,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},Io.prototype.digest=function(t){return this.update(this._pad()),Kr(null===this.pending),this._digest(t)},Io.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=t>>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r};var jo={BlockHash:To},Co=So.rotr32;var Do=function(t,e,n,r){return 0===t?Oo(e,n,r):1===t||3===t?zo(e,n,r):2===t?_o(e,n,r):void 0};function Oo(t,e,n){return t&e^~t&n}function _o(t,e,n){return t&e^t&n^e&n}function zo(t,e,n){return t^e^n}var Po=function(t){return Co(t,2)^Co(t,13)^Co(t,22)};var Bo=function(t){return Co(t,6)^Co(t,11)^Co(t,25)};var Ro=function(t){return Co(t,7)^Co(t,18)^t>>>3};var Uo=function(t){return Co(t,17)^Co(t,19)^t>>>10},Qo={ft_1:Do,ch32:Oo,maj32:_o,p32:zo,s0_256:Po,s1_256:Bo,g0_256:Ro,g1_256:Uo},Wo=So.rotl32,Fo=So.sum32,Yo=So.sum32_5,Ho=Qo.ft_1,Go=jo.BlockHash,Zo=[1518500249,1859775393,2400959708,3395469782];function Vo(){if(!(this instanceof Vo))return new Vo;Go.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}So.inherits(Vo,Go);var Jo=Vo;Vo.blockSize=512,Vo.outSize=160,Vo.hmacStrength=80,Vo.padLength=64,Vo.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=Wo(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(r=0;r<n.length;r++){var c=~~(r/20),l=Yo(Wo(i,5),Ho(c,o,a,s),u,n[r],Zo[c]);u=s,s=a,a=Wo(o,30),o=i,i=l}this.h[0]=Fo(this.h[0],i),this.h[1]=Fo(this.h[1],o),this.h[2]=Fo(this.h[2],a),this.h[3]=Fo(this.h[3],s),this.h[4]=Fo(this.h[4],u)},Vo.prototype._digest=function(t){return"hex"===t?So.toHex32(this.h,"big"):So.split32(this.h,"big")};var qo=So.sum32,Xo=So.sum32_4,Ko=So.sum32_5,$o=Qo.ch32,ta=Qo.maj32,ea=Qo.s0_256,na=Qo.s1_256,ra=Qo.g0_256,ia=Qo.g1_256,oa=jo.BlockHash,aa=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function sa(){if(!(this instanceof sa))return new sa;oa.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=aa,this.W=new Array(64)}So.inherits(sa,oa);var ua=sa;function ca(){if(!(this instanceof ca))return new ca;ua.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sa.blockSize=512,sa.outSize=256,sa.hmacStrength=192,sa.padLength=64,sa.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=Xo(ia(n[r-2]),n[r-7],ra(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],h=this.h[7];for(Kr(this.k.length===n.length),r=0;r<n.length;r++){var d=Ko(h,na(u),$o(u,c,l),this.k[r],n[r]),f=qo(ea(i),ta(i,o,a));h=l,l=c,c=u,u=qo(s,d),s=a,a=o,o=i,i=qo(d,f)}this.h[0]=qo(this.h[0],i),this.h[1]=qo(this.h[1],o),this.h[2]=qo(this.h[2],a),this.h[3]=qo(this.h[3],s),this.h[4]=qo(this.h[4],u),this.h[5]=qo(this.h[5],c),this.h[6]=qo(this.h[6],l),this.h[7]=qo(this.h[7],h)},sa.prototype._digest=function(t){return"hex"===t?So.toHex32(this.h,"big"):So.split32(this.h,"big")},So.inherits(ca,ua);var la=ca;ca.blockSize=512,ca.outSize=224,ca.hmacStrength=192,ca.padLength=64,ca.prototype._digest=function(t){return"hex"===t?So.toHex32(this.h.slice(0,7),"big"):So.split32(this.h.slice(0,7),"big")};var ha=So.rotr64_hi,da=So.rotr64_lo,fa=So.shr64_hi,pa=So.shr64_lo,ma=So.sum64,ga=So.sum64_hi,ya=So.sum64_lo,va=So.sum64_4_hi,ba=So.sum64_4_lo,wa=So.sum64_5_hi,Ma=So.sum64_5_lo,ka=jo.BlockHash,La=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Aa(){if(!(this instanceof Aa))return new Aa;ka.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=La,this.W=new Array(160)}So.inherits(Aa,ka);var xa=Aa;function Ea(t,e,n,r,i){var o=t&n^~t&i;return o<0&&(o+=4294967296),o}function Na(t,e,n,r,i,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function Sa(t,e,n,r,i){var o=t&n^t&i^n&i;return o<0&&(o+=4294967296),o}function Ia(t,e,n,r,i,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function Ta(t,e){var n=ha(t,e,28)^ha(e,t,2)^ha(e,t,7);return n<0&&(n+=4294967296),n}function ja(t,e){var n=da(t,e,28)^da(e,t,2)^da(e,t,7);return n<0&&(n+=4294967296),n}function Ca(t,e){var n=ha(t,e,14)^ha(t,e,18)^ha(e,t,9);return n<0&&(n+=4294967296),n}function Da(t,e){var n=da(t,e,14)^da(t,e,18)^da(e,t,9);return n<0&&(n+=4294967296),n}function Oa(t,e){var n=ha(t,e,1)^ha(t,e,8)^fa(t,e,7);return n<0&&(n+=4294967296),n}function _a(t,e){var n=da(t,e,1)^da(t,e,8)^pa(t,e,7);return n<0&&(n+=4294967296),n}function za(t,e){var n=ha(t,e,19)^ha(e,t,29)^fa(t,e,6);return n<0&&(n+=4294967296),n}function Pa(t,e){var n=da(t,e,19)^da(e,t,29)^pa(t,e,6);return n<0&&(n+=4294967296),n}function Ba(){if(!(this instanceof Ba))return new Ba;xa.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Aa.blockSize=1024,Aa.outSize=512,Aa.hmacStrength=192,Aa.padLength=128,Aa.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var i=za(n[r-4],n[r-3]),o=Pa(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=Oa(n[r-30],n[r-29]),c=_a(n[r-30],n[r-29]),l=n[r-32],h=n[r-31];n[r]=va(i,o,a,s,u,c,l,h),n[r+1]=ba(i,o,a,s,u,c,l,h)}},Aa.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],h=this.h[8],d=this.h[9],f=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],y=this.h[14],v=this.h[15];Kr(this.k.length===n.length);for(var b=0;b<n.length;b+=2){var w=y,M=v,k=Ca(h,d),L=Da(h,d),A=Ea(h,d,f,p,m),x=Na(h,d,f,p,m,g),E=this.k[b],N=this.k[b+1],S=n[b],I=n[b+1],T=wa(w,M,k,L,A,x,E,N,S,I),j=Ma(w,M,k,L,A,x,E,N,S,I);w=Ta(r,i),M=ja(r,i),k=Sa(r,i,o,a,s),L=Ia(r,i,o,a,s,u);var C=ga(w,M,k,L),D=ya(w,M,k,L);y=m,v=g,m=f,g=p,f=h,p=d,h=ga(c,l,T,j),d=ya(l,l,T,j),c=s,l=u,s=o,u=a,o=r,a=i,r=ga(T,j,C,D),i=ya(T,j,C,D)}ma(this.h,0,r,i),ma(this.h,2,o,a),ma(this.h,4,s,u),ma(this.h,6,c,l),ma(this.h,8,h,d),ma(this.h,10,f,p),ma(this.h,12,m,g),ma(this.h,14,y,v)},Aa.prototype._digest=function(t){return"hex"===t?So.toHex32(this.h,"big"):So.split32(this.h,"big")},So.inherits(Ba,xa);var Ra=Ba;Ba.blockSize=1024,Ba.outSize=384,Ba.hmacStrength=192,Ba.padLength=128,Ba.prototype._digest=function(t){return"hex"===t?So.toHex32(this.h.slice(0,12),"big"):So.split32(this.h.slice(0,12),"big")};var Ua={sha1:Jo,sha224:la,sha256:ua,sha384:Ra,sha512:xa},Qa=So.rotl32,Wa=So.sum32,Fa=So.sum32_3,Ya=So.sum32_4,Ha=jo.BlockHash;function Ga(){if(!(this instanceof Ga))return new Ga;Ha.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}So.inherits(Ga,Ha);var Za=Ga;function Va(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}function Ja(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function qa(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Ga.blockSize=512,Ga.outSize=160,Ga.hmacStrength=192,Ga.padLength=64,Ga.prototype._update=function(t,e){for(var n=this.h[0],r=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=n,u=r,c=i,l=o,h=a,d=0;d<80;d++){var f=Wa(Qa(Ya(n,Va(d,r,i,o),t[Xa[d]+e],Ja(d)),$a[d]),a);n=a,a=o,o=Qa(i,10),i=r,r=f,f=Wa(Qa(Ya(s,Va(79-d,u,c,l),t[Ka[d]+e],qa(d)),ts[d]),h),s=h,h=l,l=Qa(c,10),c=u,u=f}f=Fa(this.h[1],i,l),this.h[1]=Fa(this.h[2],o,h),this.h[2]=Fa(this.h[3],a,s),this.h[3]=Fa(this.h[4],n,u),this.h[4]=Fa(this.h[0],r,c),this.h[0]=f},Ga.prototype._digest=function(t){return"hex"===t?So.toHex32(this.h,"little"):So.split32(this.h,"little")};var Xa=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ka=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],$a=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],ts=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],es={ripemd160:Za};function ns(t,e,n){if(!(this instanceof ns))return new ns(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(So.toArray(e,n))}var rs=ns;ns.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Kr(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},ns.prototype.update=function(t,e){return this.inner.update(t,e),this},ns.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};var is=o((function(t,e){var n=e;n.utils=So,n.common=jo,n.sha=Ua,n.ripemd=es,n.hmac=rs,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),os=is;function as(t,e,n){return n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},t(n,n.exports),n.exports}var ss=us;function us(t,e){if(!t)throw new Error(e||"Assertion failed")}us.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var cs=as((function(t,e){var n=e;function r(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(r=0;r<t.length;r++){var i=t.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(t,e){return"hex"===e?i(t):t}})),ls=as((function(t,e){var n=e;n.assert=ss,n.toArray=cs.toArray,n.zero2=cs.zero2,n.toHex=cs.toHex,n.encode=cs.encode,n.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<r.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,u=t.andln(3)+i&3,c=e.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0==(1&c)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},n.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new B(t,"hex","le")}})),hs=ls.getNAF,ds=ls.getJSF,fs=ls.assert;function ps(t,e){this.type=t,this.p=new B(e.p,16),this.red=e.prime?B.red(e.prime):B.mont(this.p),this.zero=new B(0).toRed(this.red),this.one=new B(1).toRed(this.red),this.two=new B(2).toRed(this.red),this.n=e.n&&new B(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ms=ps;function gs(t,e){this.curve=t,this.type=e,this.precomputed=null}ps.prototype.point=function(){throw new Error("Not implemented")},ps.prototype.validate=function(){throw new Error("Not implemented")},ps.prototype._fixedNafMul=function(t,e){fs(t.precomputed);var n=t._getDoubles(),r=hs(e,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<r.length;o+=n.step){a=0;for(var u=o+n.step-1;u>=o;u--)a=(a<<1)+r[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<s.length;o++)(a=s[o])===h?l=l.mixedAdd(n.points[o]):a===-h&&(l=l.mixedAdd(n.points[o].neg()));c=c.add(l)}return c.toP()},ps.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=hs(e,n,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];fs(0!==c),a="affine"===t.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===t.type?a.toP():a},ps.prototype._wnafMulAdd=function(t,e,n,r,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,h=0;for(o=0;o<r;o++){var d=(s=e[o])._getNAFPoints(t);u[o]=d.wnd,c[o]=d.points}for(o=r-1;o>=1;o-=2){var f=o-1,p=o;if(1===u[f]&&1===u[p]){var m=[e[f],null,null,e[p]];0===e[f].y.cmp(e[p].y)?(m[1]=e[f].add(e[p]),m[2]=e[f].toJ().mixedAdd(e[p].neg())):0===e[f].y.cmp(e[p].y.redNeg())?(m[1]=e[f].toJ().mixedAdd(e[p]),m[2]=e[f].add(e[p].neg())):(m[1]=e[f].toJ().mixedAdd(e[p]),m[2]=e[f].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=ds(n[f],n[p]);for(h=Math.max(y[0].length,h),l[f]=new Array(h),l[p]=new Array(h),a=0;a<h;a++){var v=0|y[0][a],b=0|y[1][a];l[f][a]=g[3*(v+1)+(b+1)],l[p][a]=0,c[f]=m}}else l[f]=hs(n[f],u[f],this._bitLength),l[p]=hs(n[p],u[p],this._bitLength),h=Math.max(l[f].length,h),h=Math.max(l[p].length,h)}var w=this.jpoint(null,null,null),M=this._wnafT4;for(o=h;o>=0;o--){for(var k=0;o>=0;){var L=!0;for(a=0;a<r;a++)M[a]=0|l[a][o],0!==M[a]&&(L=!1);if(!L)break;k++,o--}if(o>=0&&k++,w=w.dblp(k),o<0)break;for(a=0;a<r;a++){var A=M[a];0!==A&&(A>0?s=c[a][A-1>>1]:A<0&&(s=c[a][-A-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<r;o++)c[o]=null;return i?w:w.toP()},ps.BasePoint=gs,gs.prototype.eq=function(){throw new Error("Not implemented")},gs.prototype.validate=function(){return this.curve.validate(this)},ps.prototype.decodePoint=function(t,e){t=ls.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?fs(t[t.length-1]%2==0):7===t[0]&&fs(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},gs.prototype.encodeCompressed=function(t){return this.encode(t,!0)},gs.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},gs.prototype.encode=function(t,e){return ls.encode(this._encode(e),t)},gs.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},gs.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},gs.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)r=r.dbl();n.push(r)}return{step:t,points:n}},gs.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)e[i]=e[i-1].add(r);return{wnd:t,points:e}},gs.prototype._getBeta=function(){return null},gs.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var ys=as((function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}})),vs=ls.assert;function bs(t){ms.call(this,"short",t),this.a=new B(t.a,16).toRed(this.red),this.b=new B(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ys(bs,ms);var ws=bs;function Ms(t,e,n,r){ms.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new B(e,16),this.y=new B(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function ks(t,e,n,r){ms.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new B(0)):(this.x=new B(e,16),this.y=new B(n,16),this.z=new B(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}bs.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,n,r;if(t.beta)e=new B(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)n=new B(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?n=o[0]:(n=o[1],vs(0===this.g.mul(n).x.cmp(this.g.x.redMul(e))))}return r=t.basis?t.basis.map((function(t){return{a:new B(t.a,16),b:new B(t.b,16)}})):this._getEndoBasis(n),{beta:e,lambda:n,basis:r}}},bs.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:B.mont(t),n=new B(2).toRed(e).redInvm(),r=n.redNeg(),i=new B(3).toRed(e).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},bs.prototype._getEndoBasis=function(t){for(var e,n,r,i,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),f=new B(1),p=new B(0),m=new B(0),g=new B(1),y=0;0!==h.cmpn(0);){var v=d.div(h);u=d.sub(v.mul(h)),c=m.sub(v.mul(f));var b=g.sub(v.mul(p));if(!r&&u.cmp(l)<0)e=s.neg(),n=f,r=u.neg(),i=c;else if(r&&2==++y)break;s=u,d=h,h=u,m=f,f=c,g=p,p=b}o=u.neg(),a=c;var w=r.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=e,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},bs.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],i=r.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:t.sub(a).sub(s),k2:u.add(c).neg()}},bs.prototype.pointFromX=function(t,e){(t=new B(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},bs.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},bs.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,r,i,2*o,n),l=0;l<2*o;l++)r[l]=null,i[l]=null;return c},ys(Ms,ms.BasePoint),bs.prototype.point=function(t,e,n){return new Ms(this,t,e,n)},bs.prototype.pointFromJSON=function(t,e){return Ms.fromJSON(this,t,e)},Ms.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,r=function(t){return n.point(t.x.redMul(n.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},Ms.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Ms.fromJSON=function(t,e,n){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],n);if(!e[2])return r;function i(e){return t.point(e[0],e[1],n)}var o=e[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},Ms.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Ms.prototype.isInfinity=function(){return this.inf},Ms.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},Ms.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ms.prototype.getX=function(){return this.x.fromRed()},Ms.prototype.getY=function(){return this.y.fromRed()},Ms.prototype.mul=function(t){return t=new B(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Ms.prototype.mulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},Ms.prototype.jmulAdd=function(t,e,n){var r=[this,e],i=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},Ms.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},Ms.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return e},Ms.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ys(ks,ms.BasePoint),bs.prototype.jpoint=function(t,e,n){return new ks(this,t,e,n)},ks.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},ks.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ks.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),i=t.x.redMul(n),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),h=r.redMul(c),d=u.redSqr().redIAdd(l).redISub(h).redISub(h),f=u.redMul(h.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,f,p)},ks.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),h=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(h)).redISub(i.redMul(c)),f=this.z.redMul(a);return this.curve.jpoint(h,d,f)},ks.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(e=0;e<t;e++){var l=o.redSqr(),h=c.redSqr(),d=h.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(u)),p=o.redMul(h),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(d);var v=c.redMul(s);e+1<t&&(u=u.redMul(d)),o=m,s=v,c=y}return this.curve.jpoint(o,c.redMul(i),s)},ks.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ks.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=u,e=s.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),f=this.x.redAdd(h).redSqr().redISub(l).redISub(d);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(f).redISub(f),e=p.redMul(f.redISub(t)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(t,e,n)},ks.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);t=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=s.redMul(a.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);t=f.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(h).redISub(l);var g=h.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=f.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,n)},ks.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=e.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),h=c.redISub(l),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=s.redMul(h).redISub(d),p=n.redAdd(n).redMul(r);return this.curve.jpoint(l,f,p)},ks.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),r=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=e.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.x.redMul(s).redISub(l);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(h,d,f)},ks.prototype.mul=function(t,e){return t=new B(t,e),this.curve._wnafMul(this,t)},ks.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),i=n.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(r)).cmpn(0)},ks.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},ks.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},ks.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Ls=as((function(t,e){var n=e;n.base=ms,n.short=ws,n.mont=null,n.edwards=null})),As=as((function(t,e){var n,r=e,i=ls.assert;function o(t){"short"===t.type?this.curve=new Ls.short(t):"edwards"===t.type?this.curve=new Ls.edwards(t):this.curve=new Ls.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new o(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:os.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:os.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:os.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:os.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:os.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:os.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:os.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(t){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:os.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function xs(t){if(!(this instanceof xs))return new xs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=cs.toArray(t.entropy,t.entropyEnc||"hex"),n=cs.toArray(t.nonce,t.nonceEnc||"hex"),r=cs.toArray(t.pers,t.persEnc||"hex");ss(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}var Es=xs;xs.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},xs.prototype._hmac=function(){return new os.hmac(this.hash,this.K)},xs.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},xs.prototype.reseed=function(t,e,n,r){"string"!=typeof e&&(r=n,n=e,e=null),t=cs.toArray(t,e),n=cs.toArray(n,r),ss(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},xs.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=cs.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(n),this._reseed++,cs.encode(o,e)};var Ns=ls.assert;function Ss(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Is=Ss;Ss.fromPublic=function(t,e,n){return e instanceof Ss?e:new Ss(t,{pub:e,pubEnc:n})},Ss.fromPrivate=function(t,e,n){return e instanceof Ss?e:new Ss(t,{priv:e,privEnc:n})},Ss.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Ss.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Ss.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},Ss.prototype._importPrivate=function(t,e){this.priv=new B(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Ss.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?Ns(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Ns(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},Ss.prototype.derive=function(t){return t.validate()||Ns(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Ss.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},Ss.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Ss.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Ts=ls.assert;function js(t,e){if(t instanceof js)return t;this._importDER(t,e)||(Ts(t.r&&t.s,"Signature without r or s"),this.r=new B(t.r,16),this.s=new B(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Cs=js;function Ds(){this.place=0}function Os(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=e.place;o<r;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function _s(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function zs(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}js.prototype._importDER=function(t,e){t=ls.toArray(t,e);var n=new Ds;if(48!==t[n.place++])return!1;var r=Os(t,n);if(!1===r)return!1;if(r+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var i=Os(t,n);if(!1===i)return!1;var o=t.slice(n.place,i+n.place);if(n.place+=i,2!==t[n.place++])return!1;var a=Os(t,n);if(!1===a)return!1;if(t.length!==a+n.place)return!1;var s=t.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new B(o),this.s=new B(s),this.recoveryParam=null,!0},js.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=_s(e),n=_s(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];zs(r,e.length),(r=r.concat(e)).push(2),zs(r,n.length);var i=r.concat(n),o=[48];return zs(o,i.length),o=o.concat(i),ls.encode(o,t)};var Ps=function(){throw new Error("unsupported")},Bs=ls.assert;function Rs(t){if(!(this instanceof Rs))return new Rs(t);"string"==typeof t&&(Bs(Object.prototype.hasOwnProperty.call(As,t),"Unknown curve "+t),t=As[t]),t instanceof As.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Us=Rs;Rs.prototype.keyPair=function(t){return new Is(this,t)},Rs.prototype.keyFromPrivate=function(t,e){return Is.fromPrivate(this,t,e)},Rs.prototype.keyFromPublic=function(t,e){return Is.fromPublic(this,t,e)},Rs.prototype.genKeyPair=function(t){t||(t={});for(var e=new Es({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Ps(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new B(2));;){var i=new B(e.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Rs.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Rs.prototype.sign=function(t,e,n,r){"object"==typeof n&&(r=n,n=null),r||(r={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new B(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),a=t.toArray("be",i),s=new Es({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new B(1)),c=0;;c++){var l=r.k?r.k(c):new B(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var d=h.getX(),f=d.umod(this.n);if(0!==f.cmpn(0)){var p=l.invm(this.n).mul(f.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==d.cmp(f)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Cs({r:f,s:p,recoveryParam:m})}}}}}},Rs.prototype.verify=function(t,e,n,r){t=this._truncateToN(new B(t,16)),n=this.keyFromPublic(n,r);var i=(e=new Cs(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(t).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Rs.prototype.recoverPubKey=function(t,e,n,r){Bs((3&n)===n,"The recovery param is more than two bits"),e=new Cs(e,r);var i=this.n,o=new B(t),a=e.r,s=e.s,u=1&n,c=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=e.r.invm(i),h=i.sub(o).mul(l).umod(i),d=s.mul(l).umod(i);return this.g.mulAdd(h,a,d)},Rs.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new Cs(e,r)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var Qs=as((function(t,e){var n=e;n.version="6.5.4",n.utils=ls,n.rand=function(){throw new Error("unsupported")},n.curve=Ls,n.curves=As,n.ec=Us,n.eddsa=null})).ec;const Ws=new V("signing-key/5.7.0");let Fs=null;function Ys(){return Fs||(Fs=new Qs("secp256k1")),Fs}class Hs{constructor(t){Rt(this,"curve","secp256k1"),Rt(this,"privateKey",at(t)),32!==st(this.privateKey)&&Ws.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=Ys().keyFromPrivate(et(this.privateKey));Rt(this,"publicKey","0x"+e.getPublic(!1,"hex")),Rt(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),Rt(this,"_isSigningKey",!0)}_addPoint(t){const e=Ys().keyFromPublic(et(this.publicKey)),n=Ys().keyFromPublic(et(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const e=Ys().keyFromPrivate(et(this.privateKey)),n=et(t);32!==n.length&&Ws.throwArgumentError("bad digest length","digest",t);const r=e.sign(n,{canonical:!0});return dt({recoveryParam:r.recoveryParam,r:ht("0x"+r.r.toString(16),32),s:ht("0x"+r.s.toString(16),32)})}computeSharedSecret(t){const e=Ys().keyFromPrivate(et(this.privateKey)),n=Ys().keyFromPublic(et(Gs(t)));return ht("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function Gs(t,e){const n=et(t);if(32===n.length){const t=new Hs(n);return e?"0x"+Ys().keyFromPrivate(n).getPublic(!0,"hex"):t.publicKey}return 33===n.length?e?at(n):"0x"+Ys().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+Ys().keyFromPublic(n).getPublic(!0,"hex"):at(n):Ws.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Zs=new V("transactions/5.7.0");var Vs;function Js(t){return"0x"===t?null:ln(t)}function qs(t){return"0x"===t?An:bt.from(t)}function Xs(t,e){return function(t){return ln(ut(qe(ut(Gs(t),1)),12))}(function(t,e){const n=dt(e),r={r:et(n.r),s:et(n.s)};return"0x"+Ys().recoverPubKey(et(t),r,n.recoveryParam).encode("hex",!1)}(et(t),e))}function Ks(t,e){const n=rt(bt.from(t).toHexString());return n.length>32&&Zs.throwArgumentError("invalid length for "+e,"transaction:"+e,t),n}function $s(t,e){return{address:ln(t),storageKeys:(e||[]).map(((e,n)=>(32!==st(e)&&Zs.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,e),e.toLowerCase())))}}function tu(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&Zs.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),$s(t[0],t[1])):$s(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const n=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return $s(e,Object.keys(n).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function eu(t){return tu(t).map((t=>[t.address,t.storageKeys]))}function nu(t,e){if(null!=t.gasPrice){const e=bt.from(t.gasPrice),n=bt.from(t.maxFeePerGas||0);e.eq(n)||Zs.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:n})}const n=[Ks(t.chainId||0,"chainId"),Ks(t.nonce||0,"nonce"),Ks(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ks(t.maxFeePerGas||0,"maxFeePerGas"),Ks(t.gasLimit||0,"gasLimit"),null!=t.to?ln(t.to):"0x",Ks(t.value||0,"value"),t.data||"0x",eu(t.accessList||[])];if(e){const t=dt(e);n.push(Ks(t.recoveryParam,"recoveryParam")),n.push(rt(t.r)),n.push(rt(t.s))}return ct(["0x02",en(n)])}function ru(t,e){const n=[Ks(t.chainId||0,"chainId"),Ks(t.nonce||0,"nonce"),Ks(t.gasPrice||0,"gasPrice"),Ks(t.gasLimit||0,"gasLimit"),null!=t.to?ln(t.to):"0x",Ks(t.value||0,"value"),t.data||"0x",eu(t.accessList||[])];if(e){const t=dt(e);n.push(Ks(t.recoveryParam,"recoveryParam")),n.push(rt(t.r)),n.push(rt(t.s))}return ct(["0x01",en(n)])}function iu(t,e,n){try{const n=qs(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){Zs.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=ht(e[1],32),t.s=ht(e[2],32);try{const e=qe(n(t));t.from=Xs(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function ou(t){const e=et(t);if(e[0]>127)return function(t){const e=on(t);9!==e.length&&6!==e.length&&Zs.throwArgumentError("invalid raw transaction","rawTransaction",t);const n={nonce:qs(e[0]).toNumber(),gasPrice:qs(e[1]),gasLimit:qs(e[2]),to:Js(e[3]),value:qs(e[4]),data:e[5],chainId:0};if(6===e.length)return n;try{n.v=bt.from(e[6]).toNumber()}catch(t){return n}if(n.r=ht(e[7],32),n.s=ht(e[8],32),bt.from(n.r).isZero()&&bt.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);let r=n.v-27;const i=e.slice(0,6);0!==n.chainId&&(i.push(at(n.chainId)),i.push("0x"),i.push("0x"),r-=2*n.chainId+8);const o=qe(en(i));try{n.from=Xs(o,{r:at(n.r),s:at(n.s),recoveryParam:r})}catch(t){}n.hash=qe(t)}return n.type=null,n}(e);switch(e[0]){case 1:return function(t){const e=on(t.slice(1));8!==e.length&&11!==e.length&&Zs.throwArgumentError("invalid component count for transaction type: 1","payload",at(t));const n={type:1,chainId:qs(e[0]).toNumber(),nonce:qs(e[1]).toNumber(),gasPrice:qs(e[2]),gasLimit:qs(e[3]),to:Js(e[4]),value:qs(e[5]),data:e[6],accessList:tu(e[7])};return 8===e.length||(n.hash=qe(t),iu(n,e.slice(8),ru)),n}(e);case 2:return function(t){const e=on(t.slice(1));9!==e.length&&12!==e.length&&Zs.throwArgumentError("invalid component count for transaction type: 2","payload",at(t));const n=qs(e[2]),r=qs(e[3]),i={type:2,chainId:qs(e[0]).toNumber(),nonce:qs(e[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:qs(e[4]),to:Js(e[5]),value:qs(e[6]),data:e[7],accessList:tu(e[8])};return 9===e.length||(i.hash=qe(t),iu(i,e.slice(9),nu)),i}(e)}return Zs.throwError(`unsupported transaction type: ${e[0]}`,V.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(Vs||(Vs={}));var au=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const su=new V("contracts/5.7.0");function uu(t,e){return au(this,void 0,void 0,(function*(){const n=yield e;"string"!=typeof n&&su.throwArgumentError("invalid address or ENS name","name",n);try{return ln(n)}catch(t){}t||su.throwError("a provider or signer is needed to resolve ENS names",V.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const r=yield t.resolveName(n);return null==r&&su.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r}))}function cu(t,e,n){return au(this,void 0,void 0,(function*(){return Array.isArray(n)?yield Promise.all(n.map(((n,r)=>cu(t,Array.isArray(e)?e[r]:e[n.name],n)))):"address"===n.type?yield uu(t,e):"tuple"===n.type?yield cu(t,e,n.components):"array"===n.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>cu(t,e,n.arrayChildren)))):Promise.reject(su.makeError("invalid value for array",V.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function lu(t,e,n){return au(this,void 0,void 0,(function*(){let r={};n.length===e.inputs.length+1&&"object"==typeof n[n.length-1]&&(r=Wt(n.pop())),su.checkArgumentCount(n.length,e.inputs.length,"passed to contract"),t.signer?r.from?r.from=Qt({override:uu(t.signer,r.from),signer:t.signer.getAddress()}).then((t=>au(this,void 0,void 0,(function*(){return ln(t.signer)!==t.override&&su.throwError("Contract with a Signer cannot override from",V.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):r.from=t.signer.getAddress():r.from&&(r.from=uu(t.provider,r.from));const i=yield Qt({args:cu(t.signer||t.provider,n,e.inputs),address:t.resolvedAddress,overrides:Qt(r)||{}}),o=t.interface.encodeFunctionData(e,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=bt.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=bt.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=bt.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=bt.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=bt.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=tu(s.accessList)),null==a.gasLimit&&null!=e.gas){let t=21e3;const n=et(o);for(let e=0;e<n.length;e++)t+=4,n[e]&&(t+=64);a.gasLimit=bt.from(e.gas).add(t)}if(s.value){const t=bt.from(s.value);t.isZero()||e.payable||su.throwError("non-payable method cannot override value",V.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),a.value=t}s.customData&&(a.customData=Wt(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.ccipReadEnabled),delete r.nonce,delete r.gasLimit,delete r.gasPrice,delete r.from,delete r.value,delete r.type,delete r.accessList,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.customData,delete r.ccipReadEnabled;const u=Object.keys(r).filter((t=>null!=r[t]));return u.length&&su.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,V.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function hu(t,e,n){const r=t.signer||t.provider;return function(...i){return au(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=Wt(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const a=yield lu(t,e,i),s=yield r.call(a,o);try{let r=t.interface.decodeFunctionResult(e,s);return n&&1===e.outputs.length&&(r=r[0]),r}catch(e){throw e.code===V.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=a),e}}))}}function du(t,e){return function(...n){return au(this,void 0,void 0,(function*(){t.signer||su.throwError("sending a transaction requires a signer",V.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const r=yield lu(t,e,n),i=yield t.signer.sendTransaction(r);return function(t,e){const n=e.wait.bind(e);e.wait=e=>n(e).then((e=>(e.events=e.logs.map((n=>{let r=Gt(n),i=null;try{i=t.interface.parseLog(n)}catch(t){}return i&&(r.args=i.args,r.decode=(e,n)=>t.interface.decodeEventLog(i.eventFragment,e,n),r.event=i.name,r.eventSignature=i.signature),r.removeListener=()=>t.provider,r.getBlock=()=>t.provider.getBlock(e.blockHash),r.getTransaction=()=>t.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>Promise.resolve(e),r})),e)))}(t,i),i}))}}function fu(t,e,n){return e.constant?hu(t,e,n):du(t,e)}function pu(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class mu{constructor(t,e){Rt(this,"tag",t),Rt(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((n=>!(!e&&n.listener===t)||(e=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const n=t.slice();return setTimeout((()=>{e.listener.apply(this,n)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class gu extends mu{constructor(){super("error",null)}}class yu extends mu{constructor(t,e,n,r){const i={address:t};let o=e.getEventTopic(n);r?(o!==r[0]&&su.throwArgumentError("topic mismatch","topics",r),i.topics=r.slice()):i.topics=[o],super(pu(i),i),Rt(this,"address",t),Rt(this,"interface",e),Rt(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=function(t){const e=[],n=function(t,r){if(Array.isArray(r))for(let i in r){const o=t.slice();o.push(i);try{n(o,r[i])}catch(t){e.push({path:o,error:t})}}};return n([],t),e}(t.args);if(e.length)throw e[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class vu extends mu{constructor(t,e){super("*",{address:t}),Rt(this,"address",t),Rt(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,n)=>this.interface.decodeEventLog(e.eventFragment,t,n),t.args=e.args}catch(t){}}}class bu{constructor(t,e,n){Rt(this,"interface",Ut(new.target,"getInterface")(e)),null==n?(Rt(this,"provider",null),Rt(this,"signer",null)):qr.isSigner(n)?(Rt(this,"provider",n.provider||null),Rt(this,"signer",n)):Hr.isProvider(n)?(Rt(this,"provider",n),Rt(this,"signer",null)):su.throwArgumentError("invalid signer or provider","signerOrProvider",n),Rt(this,"callStatic",{}),Rt(this,"estimateGas",{}),Rt(this,"functions",{}),Rt(this,"populateTransaction",{}),Rt(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const n=this.interface.events[e];Rt(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(n,t)}))),t[n.name]||(t[n.name]=[]),t[n.name].push(e)})),Object.keys(t).forEach((e=>{const n=t[e];1===n.length?Rt(this.filters,e,this.filters[n[0]]):su.warn(`Duplicate definition of ${e} (${n.join(", ")})`)}))}if(Rt(this,"_runningEvents",{}),Rt(this,"_wrappedEmits",{}),null==t&&su.throwArgumentError("invalid contract address or ENS name","addressOrName",t),Rt(this,"address",t),this.provider)Rt(this,"resolvedAddress",uu(this.provider,t));else try{Rt(this,"resolvedAddress",Promise.resolve(ln(t)))}catch(t){su.throwError("provider is required to use ENS name as contract address",V.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const r={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])su.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const n=e.name;r[`%${n}`]||(r[`%${n}`]=[]),r[`%${n}`].push(t)}null==this[t]&&Rt(this,t,fu(this,e,!0)),null==this.functions[t]&&Rt(this.functions,t,fu(this,e,!1)),null==this.callStatic[t]&&Rt(this.callStatic,t,hu(this,e,!0)),null==this.populateTransaction[t]&&Rt(this.populateTransaction,t,function(t,e){return function(...n){return lu(t,e,n)}}(this,e)),null==this.estimateGas[t]&&Rt(this.estimateGas,t,function(t,e){const n=t.signer||t.provider;return function(...r){return au(this,void 0,void 0,(function*(){n||su.throwError("estimate require a provider or signer",V.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield lu(t,e,r);return yield n.estimateGas(i)}))}}(this,e))}})),Object.keys(r).forEach((t=>{const e=r[t];if(e.length>1)return;t=t.substring(1);const n=e[0];try{null==this[t]&&Rt(this,t,this[n])}catch(t){}null==this.functions[t]&&Rt(this.functions,t,this.functions[n]),null==this.callStatic[t]&&Rt(this.callStatic,t,this.callStatic[n]),null==this.populateTransaction[t]&&Rt(this.populateTransaction,t,this.populateTransaction[n]),null==this.estimateGas[t]&&Rt(this.estimateGas,t,this.estimateGas[n])}))}static getContractAddress(t){return hn(t)}static getInterface(t){return Qr.isInterface(t)?t:new Qr(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&su.throwError("contract not deployed",V.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||su.throwError("sending a transactions require a signer",V.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=Wt(t||{});return["from","to"].forEach((function(t){null!=e[t]&&su.throwError("cannot override "+t,V.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new Xr(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&Rt(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return Br.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new gu);if("event"===t)return this._normalizeRunningEvent(new mu("event",null));if("*"===t)return this._normalizeRunningEvent(new vu(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new yu(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const n=this.interface.getEvent(e);return this._normalizeRunningEvent(new yu(this.address,this.interface,n,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new mu(pu(e),e))}return this._normalizeRunningEvent(new vu(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,n){const r=Gt(e);return r.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},r.getBlock=()=>this.provider.getBlock(e.blockHash),r.getTransaction=()=>this.provider.getTransaction(e.transactionHash),r.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(r),r}_addEventListener(t,e,n){if(this.provider||su.throwError("events require a provider or a signer with a provider",V.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const n=n=>{let r=this._wrapEvent(t,n,e);if(null==r.decodeError)try{const e=t.getEmit(r);this.emit(t.filter,...e)}catch(t){r.decodeError=t.error}null!=t.filter&&this.emit("event",r),null!=r.decodeError&&this.emit("error",r.decodeError,r)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,n){const r=this._getRunningEvent(t),i=Wt(r.filter);return"string"==typeof e&&it(e,32)?(null!=n&&su.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=n?n:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(r,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const n=this._getRunningEvent(t),r=n.run(e)>0;return this._checkRunningEvents(n),r}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(e),this._checkRunningEvents(n),this}removeListener(t,e){return this.off(t,e)}}class wu extends bu{}class Mu{constructor(t){Rt(this,"alphabet",t),Rt(this,"base",t.length),Rt(this,"_alphabetMap",{}),Rt(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=et(t);if(0===e.length)return"";let n=[0];for(let t=0;t<e.length;++t){let r=e[t];for(let t=0;t<n.length;++t)r+=n[t]<<8,n[t]=r%this.base,r=r/this.base|0;for(;r>0;)n.push(r%this.base),r=r/this.base|0}let r="";for(let t=0;0===e[t]&&t<e.length-1;++t)r+=this._leader;for(let t=n.length-1;t>=0;--t)r+=this.alphabet[n[t]];return r}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let r=this._alphabetMap[t[n]];if(void 0===r)throw new Error("Non-base"+this.base+" character");let i=r;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return et(new Uint8Array(e.reverse()))}}new Mu("abcdefghijklmnopqrstuvwxyz234567");const ku=new Mu("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function Lu(t){return"0x"+os.sha256().update(et(t)).digest("hex")}new V("sha2/5.7.0");const Au=new V("networks/5.7.1");function xu(t){const e=function(e,n){null==n&&(n={});const r=[];if(e.InfuraProvider&&"-"!==n.infura)try{r.push(new e.InfuraProvider(t,n.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==n.etherscan)try{r.push(new e.EtherscanProvider(t,n.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==n.alchemy)try{r.push(new e.AlchemyProvider(t,n.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==n.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new e.PocketProvider(t,n.pocket);o.network&&-1===i.indexOf(o.network.name)&&r.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==n.cloudflare)try{r.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==n.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,n.ankr);o.network&&-1===i.indexOf(o.network.name)&&r.push(o)}catch(t){}if(0===r.length)return null;if(e.FallbackProvider){let i=1;return null!=n.quorum?i=n.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(r,i)}return r[0]};return e.renetwork=function(t){return xu(t)},e}function Eu(t,e){const n=function(n,r){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return n.renetwork=function(e){return Eu(t,e)},n}const Nu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:xu("homestead")},Su={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:xu("ropsten")},Iu={chainId:63,name:"classicMordor",_defaultProvider:Eu("https://www.ethercluster.com/mordor","classicMordor")},Tu={unspecified:{chainId:0,name:"unspecified"},homestead:Nu,mainnet:Nu,morden:{chainId:2,name:"morden"},ropsten:Su,testnet:Su,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:xu("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:xu("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:xu("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:xu("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Eu("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Iu,classicTestnet:Iu,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Eu("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:xu("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:xu("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var ju=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};function Cu(t,e){return ju(this,void 0,void 0,(function*(){null==e&&(e={});const n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=e.fetchOptions){const t=e.fetchOptions;t.mode&&(n.mode=t.mode),t.cache&&(n.cache=t.cache),t.credentials&&(n.credentials=t.credentials),t.redirect&&(n.redirect=t.redirect),t.referrer&&(n.referrer=t.referrer)}const r=yield fetch(t,n),i=yield r.arrayBuffer(),o={};return r.headers.forEach?r.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):r.headers.keys().forEach((t=>{o[t.toLowerCase()]=r.headers.get(t)})),{headers:o,statusCode:r.status,statusMessage:r.statusText,body:et(new Uint8Array(i))}}))}var Du=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const Ou=new V("web/5.7.1");function _u(t){return new Promise((e=>{setTimeout(e,t)}))}function zu(t,e){if(null==t)return null;if("string"==typeof t)return t;if(K(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return _n(t)}catch(t){}return at(t)}return t}function Pu(t,e,n){let r=null;if(null!=e){r=On(e);const n="string"==typeof t?{url:t}:Wt(t);if(n.headers){0!==Object.keys(n.headers).filter((t=>"content-type"===t.toLowerCase())).length||(n.headers=Wt(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};t=n}return function(t,e,n){const r="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;Ou.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;Ou.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof t&&!!t.errorPassThrough,s={};let u=null;const c={method:"GET"};let l=!1,h=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||Ou.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(h=t.timeout),t.headers)for(const e in t.headers)s[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&Ou.throwError("basic authentication requires a secure https url",V.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;s.authorization={key:"Authorization",value:"Basic "+Hn(On(e))}}null!=t.skipFetchSetup&&(c.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(c.fetchOptions=Wt(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=u?u.match(d):null;if(f)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]||"text/plain"},body:f[2]?Yn(f[3]):(p=f[3],On(p.replace(/%([0-9a-f][0-9a-f])/gi,((t,e)=>String.fromCharCode(parseInt(e,16))))))};let e=t.body;return n&&(e=n(t.body,t)),Promise.resolve(e)}catch(t){Ou.throwError("processing response error",V.errors.SERVER_ERROR,{body:zu(f[1],f[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}var p;e&&(c.method="POST",c.body=e,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(s).forEach((t=>{const e=s[t];m[e.key]=e.value})),c.headers=m;const g=function(){let t=null;return{promise:new Promise((function(e,n){h&&(t=setTimeout((()=>{null!=t&&(t=null,n(Ou.makeError("timeout",V.errors.TIMEOUT,{requestBody:zu(c.body,m["content-type"]),requestMethod:c.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),y=function(){return Du(this,void 0,void 0,(function*(){for(let t=0;t<r;t++){let e=null;try{if(e=yield Cu(u,c),t<r)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===c.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let n=!0;if(i&&(n=yield i(t,u)),n){let n=0;const r=e.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):o*parseInt(String(Math.random()*Math.pow(2,t))),yield _u(n);continue}}}catch(t){e=t.response,null==e&&(g.cancel(),Ou.throwError("missing response",V.errors.SERVER_ERROR,{requestBody:zu(c.body,m["content-type"]),requestMethod:c.method,serverError:t,url:u}))}let s=e.body;if(l&&304===e.statusCode?s=null:!a&&(e.statusCode<200||e.statusCode>=300)&&(g.cancel(),Ou.throwError("bad response",V.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:zu(s,e.headers?e.headers["content-type"]:null),requestBody:zu(c.body,m["content-type"]),requestMethod:c.method,url:u})),n)try{const t=yield n(s,e);return g.cancel(),t}catch(n){if(n.throttleRetry&&t<r){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield _u(e);continue}}g.cancel(),Ou.throwError("processing response error",V.errors.SERVER_ERROR,{body:zu(s,e.headers?e.headers["content-type"]:null),error:n,requestBody:zu(c.body,m["content-type"]),requestMethod:c.method,url:u})}return g.cancel(),s}return Ou.throwError("failed response",V.errors.SERVER_ERROR,{requestBody:zu(c.body,m["content-type"]),requestMethod:c.method,url:u})}))}();return Promise.race([g.promise,y])}(t,r,((t,e)=>{let r=null;if(null!=t)try{r=JSON.parse(_n(t))}catch(e){Ou.throwError("invalid JSON",V.errors.SERVER_ERROR,{body:t,error:e})}return n&&(r=n(r,e)),r}))}function Bu(t,e){return e||(e={}),null==(e=Wt(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{a()&&r(new Error("timeout"))}),e.timeout));const s=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)a()&&n(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&r(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){a()&&r(t)}))}()}))}for(var Ru="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Uu={},Qu=0;Qu<32;Qu++){var Wu=Ru.charAt(Qu);if(void 0!==Uu[Wu])throw new TypeError(Wu+" is ambiguous");Uu[Wu]=Qu}function Fu(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function Yu(t){for(var e=1,n=0;n<t.length;++n){var r=t.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+t+")";e=Fu(e)^r>>5}for(e=Fu(e),n=0;n<t.length;++n){var i=t.charCodeAt(n);e=Fu(e)^31&i}return e}function Hu(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var n=t.toLowerCase(),r=t.toUpperCase();if(t!==n&&t!==r)return"Mixed-case string "+t;var i=(t=n).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),a=t.slice(i+1);if(a.length<6)return"Data too short";var s=Yu(o);if("string"==typeof s)return s;for(var u=[],c=0;c<a.length;++c){var l=a.charAt(c),h=Uu[l];if(void 0===h)return"Unknown character "+l;s=Fu(s)^h,c+6>=a.length||u.push(h)}return 1!==s?"Invalid checksum for "+t:{prefix:o,words:u}}function Gu(t,e,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=e)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}var Zu={decodeUnsafe:function(){var t=Hu.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=Hu.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,e,n){if(n=n||90,t.length+7+e.length>n)throw new TypeError("Exceeds length limit");var r=Yu(t=t.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=t+"1",o=0;o<e.length;++o){var a=e[o];if(a>>5!=0)throw new Error("Non 5-bit word");r=Fu(r)^a,i+=Ru.charAt(a)}for(o=0;o<6;++o)r=Fu(r);for(r^=1,o=0;o<6;++o){i+=Ru.charAt(r>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=Gu(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=Gu(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=Gu(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=Gu(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const Vu="providers/5.7.2",Ju=new V(Vu);class qu{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),r=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:qu.allowNull(this.accessList.bind(this),null),blockHash:qu.allowNull(o,null),blockNumber:qu.allowNull(s,null),transactionIndex:qu.allowNull(s,null),confirmations:qu.allowNull(s,null),from:e,gasPrice:qu.allowNull(n),maxPriorityFeePerGas:qu.allowNull(n),maxFeePerGas:qu.allowNull(n),gasLimit:n,to:qu.allowNull(e,null),value:n,nonce:s,data:i,r:qu.allowNull(this.uint256),s:qu.allowNull(this.uint256),v:qu.allowNull(s),creates:qu.allowNull(e,null),raw:qu.allowNull(i)},t.transactionRequest={from:qu.allowNull(e),nonce:qu.allowNull(s),gasLimit:qu.allowNull(n),gasPrice:qu.allowNull(n),maxPriorityFeePerGas:qu.allowNull(n),maxFeePerGas:qu.allowNull(n),to:qu.allowNull(e),value:qu.allowNull(n),data:qu.allowNull((t=>this.data(t,!0))),type:qu.allowNull(s),accessList:qu.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:e,topics:qu.arrayOf(o),data:i,logIndex:s,blockHash:o},t.receipt={to:qu.allowNull(this.address,null),from:qu.allowNull(this.address,null),contractAddress:qu.allowNull(e,null),transactionIndex:s,root:qu.allowNull(a),gasUsed:n,logsBloom:qu.allowNull(i),blockHash:o,transactionHash:o,logs:qu.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:qu.allowNull(s,null),cumulativeGasUsed:n,effectiveGasPrice:qu.allowNull(n),status:qu.allowNull(s),type:u},t.block={hash:qu.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:qu.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:qu.allowNull(e),extraData:i,transactions:qu.allowNull(qu.arrayOf(o)),baseFeePerGas:qu.allowNull(n)},t.blockWithTransactions=Wt(t.block),t.blockWithTransactions.transactions=qu.allowNull(qu.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:qu.allowNull(r,void 0),toBlock:qu.allowNull(r,void 0),blockHash:qu.allowNull(o,void 0),address:qu.allowNull(e,void 0),topics:qu.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:qu.allowNull(s),blockHash:qu.allowNull(o),transactionIndex:s,removed:qu.allowNull(this.boolean.bind(this)),address:e,data:qu.allowFalsish(i,"0x"),topics:qu.arrayOf(o),transactionHash:o,logIndex:s},t}accessList(t){return tu(t||[])}number(t){return"0x"===t?0:bt.from(t).toNumber()}type(t){return"0x"===t||null==t?0:bt.from(t).toNumber()}bigNumber(t){return bt.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),it(t))?t.toLowerCase():Ju.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!=0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return ln(t)}callAddress(t){if(!it(t,32))return null;const e=ln(ut(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return hn(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||it(t))return lt(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return 32!==st(n)?Ju.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(null==t)return null;const e=bt.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!it(t))throw new Error("invalid uint256");return ht(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const n=null!=t._difficulty?t._difficulty:t.difficulty,r=qu.check(e,t);return r._difficulty=null==n?null:bt.from(n),r}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return qu.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&bt.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=qu.check(this.formats.transaction,t);if(null!=t.chainId){let n=t.chainId;it(n)&&(n=bt.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),it(n)&&(n=bt.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return ou(t)}receiptLog(t){return qu.check(this.formats.receiptLog,t)}receipt(t){const e=qu.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=bt.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&Ju.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):Ju.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&Ju.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return qu.check(this.formats.filter,t)}filterLog(t){return qu.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const r in t)try{const i=t[r](e[r]);void 0!==i&&(n[r]=i)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}static allowNull(t,e){return function(n){return null==n?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach((function(e){n.push(t(e))})),n}}}var Xu=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const Ku=new V(Vu);function $u(t){return null==t?"null":(32!==st(t)&&Ku.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function tc(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[$u(t)]=!0}));const n=Object.keys(e);return n.sort(),n.join("|")}return $u(t)})).join("&")}function ec(t){if("string"==typeof t){if(32===st(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+tc(t);if(Yr.isForkEvent(t))throw Ku.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+tc(t.topics||[])}throw new Error("invalid event - "+t)}function nc(){return(new Date).getTime()}function rc(t){return new Promise((e=>{setTimeout(e,t)}))}const ic=["block","network","pending","poll"];class oc{constructor(t,e,n){Rt(this,"tag",t),Rt(this,"listener",e),Rt(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],n=""===(r=t[2])?[]:r.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var r;const i={};return n.length>0&&(i.topics=n),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||ic.indexOf(this.tag)>=0}}const ac={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function sc(t){return ht(bt.from(t).toHexString(),32)}function uc(t){return ku.encode(nt([t,ut(Lu(Lu(t)),0,4)]))}const cc=new RegExp("^(ipfs)://(.*)$","i"),lc=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),cc,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function hc(t,e){try{return _n(dc(t,e))}catch(t){}return null}function dc(t,e){if("0x"===t)return null;const n=bt.from(ut(t,e,e+32)).toNumber(),r=bt.from(ut(t,n,n+32)).toNumber();return ut(t,n+32,n+32+r)}function fc(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ku.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function pc(t){const e=et(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function mc(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function gc(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(null),n+=32;for(let r=0;r<t.length;r++){const i=et(t[r]);e[r]=pc(n),e.push(pc(i.length)),e.push(mc(i)),n+=32+32*Math.ceil(i.length/32)}return ct(e)}class yc{constructor(t,e,n,r){Rt(this,"provider",t),Rt(this,"name",n),Rt(this,"address",t.formatter.address(e)),Rt(this,"_resolvedAddress",r)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>bt.from(t).eq(1))).catch((t=>{if(t.code===V.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return Xu(this,void 0,void 0,(function*(){const n={to:this.address,ccipReadEnabled:!0,data:ct([t,yr(this.name),e||"0x"])};let r=!1;var i;(yield this.supportsWildcard())&&(r=!0,n.data=ct(["0x9061b923",gc([(i=this.name,at(nt(gr(i).map((t=>{if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e}))))+"00"),n.data])]));try{let t=yield this.provider.call(n);return et(t).length%32==4&&Ku.throwError("resolver threw error",V.errors.CALL_EXCEPTION,{transaction:n,data:t}),r&&(t=dc(t,0)),t}catch(t){if(t.code===V.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return Xu(this,void 0,void 0,(function*(){const n=yield this._fetch(t,e);return null!=n?dc(n,0):null}))}_getAddress(t,e){const n=ac[String(t)];if(null==n&&Ku.throwError(`unsupported coin type: ${t}`,V.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===n.ilk)return this.provider.formatter.address(e);const r=et(e);if(null!=n.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return uc(nt([[n.p2pkh],"0x"+t[2]]))}}if(null!=n.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return uc(nt([[n.p2sh],"0x"+t[2]]))}}if(null!=n.prefix){const t=r[1];let e=r[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&r.length===2+t&&t>=1&&t<=75){const t=Zu.toWords(r.slice(2));return t.unshift(e),Zu.encode(n.prefix,t)}}return null}getAddress(t){return Xu(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===V.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",sc(t));if(null==e||"0x"===e)return null;const n=this._getAddress(t,e);return null==n&&Ku.throwError("invalid or unsupported coin data",V.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n}))}getAvatar(){return Xu(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let n=0;n<lc.length;n++){const r=e.match(lc[n]);if(null==r)continue;const i=r[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:fc(e)};case"erc721":case"erc1155":{const n="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),a=(r[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),u=ht(bt.from(a[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:ct(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=bt.from(yield this.provider.call({to:s,data:ct(["0x00fdd58e",ht(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const c={to:this.provider.formatter.address(a[0]),data:ct([n,u])};let l=hc(yield this.provider.call(c),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=fc(l)),t.push({type:"metadata-url",content:l});const h=yield Pu(l);if(!h)return null;t.push({type:"metadata",content:JSON.stringify(h)});let d=h.image;if("string"!=typeof d)return null;if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(cc))return null;t.push({type:"url-ipfs",content:d}),d=fc(d)}return t.push({type:"url",content:d}),{linkage:t,url:d}}}}}catch(t){}return null}))}getContentHash(){return Xu(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+ku.encode("0x"+e[1])}const n=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const t=parseInt(n[3],16);if(n[4].length===2*t)return"ipns://"+ku.encode("0x"+n[1])}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return"bzz://"+r[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"};return"sia://"+Hn("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return Ku.throwError("invalid or unsupported content hash data",V.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return Xu(this,void 0,void 0,(function*(){let e=On(t);e=nt([sc(64),sc(e.length),e]),e.length%32!=0&&(e=nt([e,ht("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",at(e));return null==n||"0x"===n?null:_n(n)}))}}let vc=null,bc=1;class wc extends Hr{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Rt(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=Ut(new.target,"getNetwork")(t);e?(Rt(this,"_network",e),this.emit("network",e,null)):Ku.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Xu(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||Ku.throwError("no network detected",V.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:Rt(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return Bu((()=>this._ready().then((t=>t),(t=>{if(t.code!==V.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==vc&&(vc=new qu),vc}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in Tu){const n=Tu[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=Tu[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=Tu[t.name];if(!e)return"number"!=typeof t.chainId&&Au.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&Au.throwArgumentError("network chainId mismatch","network",t);let n=t._defaultProvider||null;var r;return null==n&&e._defaultProvider&&(n=(r=e._defaultProvider)&&"function"==typeof r.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:n}}(null==t?"homestead":t)}ccipReadFetch(t,e,n){return Xu(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===n.length)return null;const r=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<n.length;t++){const e=n[t],a=e.replace("{sender}",r).replace("{data}",i),s=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:r}),u=yield Pu({url:a,errorPassThrough:!0},s,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return Ku.throwError(`response not found during CCIP fetch: ${c}`,V.errors.SERVER_ERROR,{url:e,errorMessage:c});o.push(c)}return Ku.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,V.errors.SERVER_ERROR,{urls:n,errorMessages:o})}))}_getInternalBlockNumber(t){return Xu(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const n=yield e;if(nc()-n.respTime<=t)return n.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=nc(),n=Qt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:r})=>{if(r)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),r;const i=nc();return(t=bt.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=n,n.catch((t=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)})),(yield n).blockNumber}))}poll(){return Xu(this,void 0,void 0,(function*(){const t=bc++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Ku.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Ku.makeError("network block skew detected",V.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let t=this._emitted.block+1;t<=n;t++)this.emit("block",t);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&n-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((t=>{switch(t.type){case"tx":{const n=t.hash;let r=this.getTransactionReceipt(n).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(r);break}case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=n-1);const r=t.filter;r.fromBlock=t._lastBlockNumber+1,r.toBlock=n;const i=r.toBlock-this._maxFilterBlockRange;i>r.fromBlock&&(r.fromBlock=i),r.fromBlock<0&&(r.fromBlock=0);const o=this.getLogs(r).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(r,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(o)}}})),this._lastBlockNumber=n,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Xu(this,void 0,void 0,(function*(){return Ku.throwError("provider does not support network detection",V.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Xu(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield rc(0),this._network;const n=Ku.makeError("underlying network changed",V.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=nc();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=nc(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return Xu(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,n||0,null)}))}_waitForTransaction(t,e,n,r){return Xu(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((t=>{t()})),!1)},c=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,c),a.push((()=>{this.removeListener(t,c)})),r){let n=r.startBlock,i=null;const c=a=>Xu(this,void 0,void 0,(function*(){s||(yield rc(1e3),this.getTransactionCount(r.from).then((l=>Xu(this,void 0,void 0,(function*(){if(!s){if(l<=r.nonce)n=a;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=n-3,i<r.startBlock&&(i=r.startBlock));i<=a;){if(s)return;const n=yield this.getBlockWithTransactions(i);for(let i=0;i<n.transactions.length;i++){const a=n.transactions[i];if(a.hash===t)return;if(a.from===r.from&&a.nonce===r.nonce){if(s)return;const n=yield this.waitForTransaction(a.hash,e);if(u())return;let i="replaced";return a.data===r.data&&a.to===r.to&&a.value.eq(r.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(Ku.makeError("transaction was replaced",V.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:t,receipt:n}))}}i++}}s||this.once("block",c)}}))),(t=>{s||this.once("block",c)})))}));if(s)return;this.once("block",c),a.push((()=>{this.removeListener("block",c)}))}if("number"==typeof n&&n>0){const t=setTimeout((()=>{u()||o(Ku.makeError("timeout exceeded",V.errors.TIMEOUT,{timeout:n}))}),n);t.unref&&t.unref(),a.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return Xu(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return bt.from(t)}catch(e){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Qt({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getBalance",n);try{return bt.from(r)}catch(t){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"getBalance",params:n,result:r,error:t})}}))}getTransactionCount(t,e){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Qt({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getTransactionCount",n);try{return bt.from(r).toNumber()}catch(t){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:r,error:t})}}))}getCode(t,e){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Qt({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),r=yield this.perform("getCode",n);try{return at(r)}catch(t){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"getCode",params:n,result:r,error:t})}}))}getStorageAt(t,e,n){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Qt({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then((t=>lt(t)))}),i=yield this.perform("getStorageAt",r);try{return at(i)}catch(t){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"getStorageAt",params:r,result:i,error:t})}}))}_wrapTransaction(t,e,n){if(null!=e&&32!==st(e))throw new Error("invalid response - sendTransaction");const r=t;return null!=e&&t.hash!==e&&Ku.throwError("Transaction hash mismatch from Provider.sendTransaction.",V.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=(e,r)=>Xu(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==r&&(r=0),0!==e&&null!=n&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const o=yield this._waitForTransaction(t.hash,e,r,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&Ku.throwError("transaction failed",V.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),r}sendTransaction(t){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>at(t))),n=this.formatter.transaction(t);null==n.confirmations&&(n.confirmations=0);const r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,t,r)}catch(t){throw t.transaction=n,t.transactionHash=n.hash,t}}))}_getTransactionRequest(t){return Xu(this,void 0,void 0,(function*(){const e=yield t,n={};return["from","to"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?bt.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(n[t]=Promise.resolve(e[t]).then((t=>t?at(t):null)))})),this.formatter.transactionRequest(yield Qt(n))}))}_getFilter(t){return Xu(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((n=>{null!=t[n]&&(e[n]=t[n])})),["fromBlock","toBlock"].forEach((n=>{null!=t[n]&&(e[n]=this._getBlockTag(t[n]))})),this.formatter.filter(yield Qt(e))}))}_call(t,e,n){return Xu(this,void 0,void 0,(function*(){n>=10&&Ku.throwError("CCIP read exceeded maximum redirections",V.errors.SERVER_ERROR,{redirects:n,transaction:t});const r=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(n>=0&&"latest"===e&&null!=r&&"0x556f1830"===i.substring(0,10)&&st(i)%32==4)try{const o=ut(i,4),a=ut(o,0,32);bt.from(a).eq(r)||Ku.throwError("CCIP Read sender did not match",V.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const s=[],u=bt.from(ut(o,32,64)).toNumber(),c=bt.from(ut(o,u,u+32)).toNumber(),l=ut(o,u+32);for(let e=0;e<c;e++){const n=hc(l,32*e);null==n&&Ku.throwError("CCIP Read contained corrupt URL string",V.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),s.push(n)}const h=dc(o,64);bt.from(ut(o,100,128)).isZero()||Ku.throwError("CCIP Read callback selector included junk",V.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const d=ut(o,96,100),f=dc(o,128),p=yield this.ccipReadFetch(t,h,s);null==p&&Ku.throwError("CCIP Read disabled or provided no URLs",V.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const m={to:r,data:ct([d,gc([p,f])])};return this._call(m,e,n+1)}catch(t){if(t.code===V.errors.SERVER_ERROR)throw t}try{return at(i)}catch(n){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:n})}}))}call(t,e){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Qt({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)}))}estimateGas(t){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Qt({transaction:this._getTransactionRequest(t)}),n=yield this.perform("estimateGas",e);try{return bt.from(n)}catch(t){return Ku.throwError("bad result from backend",V.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:n,error:t})}}))}_getAddress(t){return Xu(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&Ku.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&Ku.throwError("ENS name not configured",V.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let n=-128;const r={includeTransactions:!!e};if(it(t,32))r.blockHash=t;else try{r.blockTag=yield this._getBlockTag(t),it(r.blockTag)&&(n=parseInt(r.blockTag.substring(2),16))}catch(e){Ku.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return Bu((()=>Xu(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",r);if(null==t)return null!=r.blockHash&&null==this._emitted["b:"+r.blockHash]||null!=r.blockTag&&n>this._emitted.block?null:void 0;if(e){let e=null;for(let n=0;n<t.transactions.length;n++){const r=t.transactions[n];if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}}const n=this.formatter.blockWithTransactions(t);return n.transactions=n.transactions.map((t=>this._wrapTransaction(t))),n}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return Bu((()=>Xu(this,void 0,void 0,(function*(){const n=yield this.perform("getTransaction",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;const r=this.formatter.transactionResponse(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return this._wrapTransaction(r)}))),{oncePoll:this})}))}getTransactionReceipt(t){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return Bu((()=>Xu(this,void 0,void 0,(function*(){const n=yield this.perform("getTransactionReceipt",e);if(null==n)return null==this._emitted["t:"+t]?null:void 0;if(null==n.blockHash)return;const r=this.formatter.receipt(n);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-r.blockNumber+1;t<=0&&(t=1),r.confirmations=t}return r}))),{oncePoll:this})}))}getLogs(t){return Xu(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Qt({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);return n.forEach((t=>{null==t.removed&&(t.removed=!1)})),qu.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)}))}getEtherPrice(){return Xu(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return Xu(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&Ku.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return Xu(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const n=yield this._getResolver(e,"getResolver");if(null!=n){const r=new yc(this,n,t);return e===t||(yield r.supportsWildcard())?r:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return Xu(this,void 0,void 0,(function*(){null==e&&(e="ENS");const n=yield this.getNetwork();n.ensAddress||Ku.throwError("network does not support ENS",V.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name});try{const e=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+yr(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return Xu(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(it(t))throw e}"string"!=typeof t&&Ku.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return Xu(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e,"lookupAddress");if(null==n)return null;const r=hc(yield this.call({to:n,data:"0x691f3431"+yr(e).substring(2)}),0);return(yield this.resolveName(r))!=t?null:r}))}getAvatar(t){return Xu(this,void 0,void 0,(function*(){let e=null;if(it(t)){const n=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(n,"getAvatar");if(!r)return null;e=new yc(this,r,n);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==V.errors.CALL_EXCEPTION)throw t}try{const t=hc(yield this.call({to:r,data:"0x691f3431"+yr(n).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==V.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const n=yield e.getAvatar();return null==n?null:n.url}))}perform(t,e){return Ku.throwError(t+" not implemented",V.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,n){const r=new oc(ec(t),e,n);return this._events.push(r),this._startEvent(r),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,r=[],i=ec(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),n=!0,!t.once||(r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),n}listenerCount(t){if(!t)return this._events.length;let e=ec(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=ec(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const n=[];let r=!1,i=ec(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!r||(r=!0,n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const n=ec(t);this._events=this._events.filter((t=>t.tag!==n||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var Mc=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};const kc=new V(Vu),Lc=["call","estimateGas"];function Ac(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const n=it(t.data)?t.data:null;if(!e||n)return{message:t.message,data:n}}if("object"==typeof t){for(const n in t){const r=Ac(t[n],e);if(r)return r}return null}if("string"==typeof t)try{return Ac(JSON.parse(t),e)}catch(t){}return null}function xc(t,e,n){const r=n.transaction||n.signedTransaction;if("call"===t){const t=Ac(e,!0);if(t)return t.data;kc.throwError("missing revert data in call exception; Transaction reverted without a reason string",V.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:e})}if("estimateGas"===t){let n=Ac(e.body,!1);null==n&&(n=Ac(e,!1)),n&&kc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",V.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:t,transaction:r,error:e})}let i=e.message;throw e.code===V.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&kc.throwError("insufficient funds for intrinsic transaction cost",V.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/nonce (is )?too low/i)&&kc.throwError("nonce has already been used",V.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&kc.throwError("replacement fee too low",V.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/only replay-protected/i)&&kc.throwError("legacy pre-eip-155 transactions not supported",V.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:r}),Lc.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&kc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",V.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}function Ec(t){return new Promise((function(e){setTimeout(e,t)}))}function Nc(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Sc(t){return t?t.toLowerCase():t}const Ic={};class Tc extends qr{constructor(t,e,n){if(super(),t!==Ic)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Rt(this,"provider",e),null==n&&(n=0),"string"==typeof n?(Rt(this,"_address",this.provider.formatter.address(n)),Rt(this,"_index",null)):"number"==typeof n?(Rt(this,"_index",n),Rt(this,"_address",null)):kc.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return kc.throwError("cannot alter JSON-RPC Signer connection",V.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new jc(Ic,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&kc.throwError("unknown account #"+this._index,V.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=Wt(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const n=Wt(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>Mc(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&kc.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),Qt({tx:Qt(t),sender:e}).then((({tx:e,sender:n})=>{null!=e.from?e.from.toLowerCase()!==n&&kc.throwArgumentError("from address mismatch","transaction",t):e.from=n;const r=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[r]).then((t=>t),(t=>("string"==typeof t.message&&t.message.match(/user denied/i)&&kc.throwError("user rejected transaction",V.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:e}),xc("sendTransaction",t,r))))}))}signTransaction(t){return kc.throwError("signing transactions is unsupported",V.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Mc(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield Bu((()=>Mc(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(n);if(null!==t)return this.provider._wrapTransaction(t,n,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=n,t}}))}signMessage(t){return Mc(this,void 0,void 0,(function*(){const e="string"==typeof t?On(t):t,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[at(e),n.toLowerCase()])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&kc.throwError("user rejected signing",V.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),e}}))}_legacySignMessage(t){return Mc(this,void 0,void 0,(function*(){const e="string"==typeof t?On(t):t,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),at(e)])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&kc.throwError("user rejected signing",V.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),e}}))}_signTypedData(t,e,n){return Mc(this,void 0,void 0,(function*(){const r=yield Dr.resolveNames(t,e,n,(t=>this.provider.resolveName(t))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Dr.getPayload(r.domain,e,r.value))])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&kc.throwError("user rejected signing",V.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:r.domain,types:e,value:r.value}}),t}}))}unlock(t){return Mc(this,void 0,void 0,(function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))}}class jc extends Tc{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const Cc={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Dc extends wc{constructor(t,e){let n=e;null==n&&(n=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(n),t||(t=Ut(this.constructor,"defaultUrl")()),Rt(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(Wt(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Mc(this,void 0,void 0,(function*(){yield Ec(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=Ut(this.constructor,"getNetwork");try{return e(bt.from(t).toNumber())}catch(e){return kc.throwError("could not detect network",V.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return kc.throwError("could not detect network",V.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Tc(Ic,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Gt(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(r&&this._cache[t])return this._cache[t];const i=Pu(this.connection,JSON.stringify(n),Nc).then((t=>(this.emit("debug",{action:"response",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:n,provider:this}),t}));return r&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Sc(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Sc(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Sc(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Sc(e.address),ht(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[Ut(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[Ut(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Sc(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Mc(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&bt.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=Wt(e)).transaction=Wt(t),delete e.transaction.type)}}const n=this.prepareRequest(t,e);null==n&&kc.throwError(t+" not implemented",V.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(n){return xc(t,n,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;let r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return Ec(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){r()}),0),null;t.send("eth_uninstallFilter",[n])})).catch((t=>{}))}(),n})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=Wt(Cc);if(e)for(const t in e)e[t]&&(n[t]=!0);var r,i;i=n,(r=t)&&"object"==typeof r||Bt.throwArgumentError("invalid object","object",r),Object.keys(r).forEach((t=>{i[t]||Bt.throwArgumentError("invalid object key - "+t,"transaction:"+t,r)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const n=lt(bt.from(t[e]));"gasLimit"===e&&(e="gas"),o[e]=n})),["from","to","data"].forEach((function(e){null!=t[e]&&(o[e]=at(t[e]))})),t.accessList&&(o.accessList=tu(t.accessList)),o}}const Oc=new V(Vu);let _c=1;function zc(t,e){const n="Web3LegacyFetcher";return function(t,r){const i={method:t,params:r,id:_c++,jsonrpc:"2.0"};return new Promise(((t,r)=>{this.emit("debug",{action:"request",fetcher:n,request:Gt(i),provider:this}),e(i,((e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:n,error:e,request:i,provider:this}),r(e);if(this.emit("debug",{action:"response",fetcher:n,request:i,response:o,provider:this}),o.error){const t=new Error(o.error.message);return t.code=o.error.code,t.data=o.error.data,r(t)}t(o.result)}))}))}}class Pc extends Dc{constructor(t,e){null==t&&Oc.throwArgumentError("missing provider","provider",t);let n=null,r=null,i=null;"function"==typeof t?(n="unknown:",r=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),i=t,t.request?(""===n&&(n="eip-1193:"),r=function(t){return function(e,n){null==n&&(n=[]);const r={method:e,params:n};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Gt(r),provider:this}),t.request(r).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:t,provider:this}),t}))}}(t)):t.sendAsync?r=zc(0,t.sendAsync.bind(t)):t.send?r=zc(0,t.send.bind(t)):Oc.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,e),Rt(this,"jsonRpcFetchFunc",r),Rt(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const Bc=new V("units/5.7.0"),Rc=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Uc(t,e){if("string"==typeof e){const t=Rc.indexOf(e);-1!==t&&(e=3*t)}return jt(t,null!=e?e:18)}function Qc(t,e){if("string"!=typeof t&&Bc.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=Rc.indexOf(e);-1!==t&&(e=3*t)}return Ct(t,null!=e?e:18)}var Wc=void 0!==ke?ke:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};if(null==Wc.XMLHttpRequest&&(Wc.XMLHttpRequest=class{open(){}}),null==Wc.location&&(Wc.location={}),null==Wc.crypto&&(Wc.crypto={}),null==Wc.crypto.getRandomValues&&(Wc.crypto.getRandomValues=function(t){for(var e=t.length;e--;)t[e]=parseInt(Math.random().toString().replace("0.",""),10);return t}),null==Wc.crypto.randomBytes&&(Wc.crypto.randomBytes=function(t){let e=new Uint8Array(t);return Wc.crypto.getRandomValues(e),e}),null==Wc.fetch)throw"Please polyfill .fetch | See: https://github.com/DePayFi/solana-web3.js#polyfill-fetch";var Fc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==ke?ke:"undefined"!=typeof self?self:{};function Yc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Hc(t){var e=t.default;if("function"==typeof e){var n=function(){return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var Gc=void 0!==ke?ke:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Zc=[],Vc=[],Jc="undefined"!=typeof Uint8Array?Uint8Array:Array,qc=!1;function Xc(){qc=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)Zc[e]=t[e],Vc[t.charCodeAt(e)]=e;Vc["-".charCodeAt(0)]=62,Vc["_".charCodeAt(0)]=63}function Kc(t,e,n){for(var r,i,o=[],a=e;a<n;a+=3)r=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Zc[(i=r)>>18&63]+Zc[i>>12&63]+Zc[i>>6&63]+Zc[63&i]);return o.join("")}function $c(t){var e;qc||Xc();for(var n=t.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;s<u;s+=a)o.push(Kc(t,s,s+a>u?u:s+a));return 1===r?(e=t[n-1],i+=Zc[e>>2],i+=Zc[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=Zc[e>>10],i+=Zc[e>>4&63],i+=Zc[e<<2&63],i+="="),o.push(i),o.join("")}function tl(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function el(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+f]=255&a,f+=p,a/=256,c-=8);t[n+f-p]|=128*m}var nl={}.toString,rl=Array.isArray||function(t){return"[object Array]"==nl.call(t)};sl.TYPED_ARRAY_SUPPORT=void 0===Gc.TYPED_ARRAY_SUPPORT||Gc.TYPED_ARRAY_SUPPORT;var il=ol();function ol(){return sl.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function al(t,e){if(ol()<e)throw new RangeError("Invalid typed array length");return sl.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=sl.prototype:(null===t&&(t=new sl(e)),t.length=e),t}function sl(t,e,n){if(!(sl.TYPED_ARRAY_SUPPORT||this instanceof sl))return new sl(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return ll(this,t)}return ul(this,t,e,n)}function ul(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);sl.TYPED_ARRAY_SUPPORT?(t=e).__proto__=sl.prototype:t=hl(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!sl.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|pl(e,n);t=al(t,r);var i=t.write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(fl(e)){var n=0|dl(e.length);return 0===(t=al(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?al(t,0):hl(t,e);if("Buffer"===e.type&&rl(e.data))return hl(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function cl(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ll(t,e){if(cl(e),t=al(t,e<0?0:0|dl(e)),!sl.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function hl(t,e){var n=e.length<0?0:0|dl(e.length);t=al(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function dl(t){if(t>=ol())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ol().toString(16)+" bytes");return 0|t}function fl(t){return!(null==t||!t._isBuffer)}function pl(t,e){if(fl(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Ql(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Wl(t).length;default:if(r)return Ql(t).length;e=(""+e).toLowerCase(),r=!0}}function ml(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Tl(this,e,n);case"utf8":case"utf-8":return El(this,e,n);case"ascii":return Sl(this,e,n);case"latin1":case"binary":return Il(this,e,n);case"base64":return xl(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jl(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function gl(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function yl(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=sl.from(e,r)),fl(e))return 0===e.length?-1:vl(t,e,n,r,i);if("number"==typeof e)return e&=255,sl.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):vl(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function vl(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(c(t,o+d)!==c(e,d)){h=!1;break}if(h)return o}return-1}function bl(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function wl(t,e,n,r){return Fl(Ql(e,t.length-n),t,n,r)}function Ml(t,e,n,r){return Fl(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function kl(t,e,n,r){return Ml(t,e,n,r)}function Ll(t,e,n,r){return Fl(Wl(e),t,n,r)}function Al(t,e,n,r){return Fl(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function xl(t,e,n){return 0===e&&n===t.length?$c(t):$c(t.slice(e,n))}function El(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=Nl)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Nl));return n}(r)}sl.poolSize=8192,sl._augment=function(t){return t.__proto__=sl.prototype,t},sl.from=function(t,e,n){return ul(null,t,e,n)},sl.TYPED_ARRAY_SUPPORT&&(sl.prototype.__proto__=Uint8Array.prototype,sl.__proto__=Uint8Array),sl.alloc=function(t,e,n){return function(t,e,n,r){return cl(e),e<=0?al(t,e):void 0!==n?"string"==typeof r?al(t,e).fill(n,r):al(t,e).fill(n):al(t,e)}(null,t,e,n)},sl.allocUnsafe=function(t){return ll(null,t)},sl.allocUnsafeSlow=function(t){return ll(null,t)},sl.isBuffer=Yl,sl.compare=function(t,e){if(!fl(t)||!fl(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},sl.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},sl.concat=function(t,e){if(!rl(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return sl.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=sl.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!fl(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},sl.byteLength=pl,sl.prototype._isBuffer=!0,sl.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)gl(this,e,e+1);return this},sl.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)gl(this,e,e+3),gl(this,e+1,e+2);return this},sl.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)gl(this,e,e+7),gl(this,e+1,e+6),gl(this,e+2,e+5),gl(this,e+3,e+4);return this},sl.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?El(this,0,t):ml.apply(this,arguments)},sl.prototype.equals=function(t){if(!fl(t))throw new TypeError("Argument must be a Buffer");return this===t||0===sl.compare(this,t)},sl.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},sl.prototype.compare=function(t,e,n,r,i){if(!fl(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},sl.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},sl.prototype.indexOf=function(t,e,n){return yl(this,t,e,n,!0)},sl.prototype.lastIndexOf=function(t,e,n){return yl(this,t,e,n,!1)},sl.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return bl(this,t,e,n);case"utf8":case"utf-8":return wl(this,t,e,n);case"ascii":return Ml(this,t,e,n);case"latin1":case"binary":return kl(this,t,e,n);case"base64":return Ll(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Al(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},sl.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Nl=4096;function Sl(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function Il(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function Tl(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=Ul(t[o]);return i}function jl(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Cl(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function Dl(t,e,n,r,i,o){if(!fl(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function Ol(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function _l(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function zl(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Pl(t,e,n,r,i){return i||zl(t,0,n,4),el(t,e,n,r,23,4),n+4}function Bl(t,e,n,r,i){return i||zl(t,0,n,8),el(t,e,n,r,52,8),n+8}sl.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),sl.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=sl.prototype;else{var i=e-t;n=new sl(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},sl.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Cl(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},sl.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Cl(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},sl.prototype.readUInt8=function(t,e){return e||Cl(t,1,this.length),this[t]},sl.prototype.readUInt16LE=function(t,e){return e||Cl(t,2,this.length),this[t]|this[t+1]<<8},sl.prototype.readUInt16BE=function(t,e){return e||Cl(t,2,this.length),this[t]<<8|this[t+1]},sl.prototype.readUInt32LE=function(t,e){return e||Cl(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},sl.prototype.readUInt32BE=function(t,e){return e||Cl(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},sl.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Cl(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},sl.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Cl(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},sl.prototype.readInt8=function(t,e){return e||Cl(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},sl.prototype.readInt16LE=function(t,e){e||Cl(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},sl.prototype.readInt16BE=function(t,e){e||Cl(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},sl.prototype.readInt32LE=function(t,e){return e||Cl(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},sl.prototype.readInt32BE=function(t,e){return e||Cl(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},sl.prototype.readFloatLE=function(t,e){return e||Cl(t,4,this.length),tl(this,t,!0,23,4)},sl.prototype.readFloatBE=function(t,e){return e||Cl(t,4,this.length),tl(this,t,!1,23,4)},sl.prototype.readDoubleLE=function(t,e){return e||Cl(t,8,this.length),tl(this,t,!0,52,8)},sl.prototype.readDoubleBE=function(t,e){return e||Cl(t,8,this.length),tl(this,t,!1,52,8)},sl.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Dl(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},sl.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Dl(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},sl.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,1,255,0),sl.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},sl.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,2,65535,0),sl.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ol(this,t,e,!0),e+2},sl.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,2,65535,0),sl.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ol(this,t,e,!1),e+2},sl.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,4,4294967295,0),sl.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):_l(this,t,e,!0),e+4},sl.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,4,4294967295,0),sl.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):_l(this,t,e,!1),e+4},sl.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Dl(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},sl.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Dl(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},sl.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,1,127,-128),sl.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},sl.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,2,32767,-32768),sl.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ol(this,t,e,!0),e+2},sl.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,2,32767,-32768),sl.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ol(this,t,e,!1),e+2},sl.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,4,2147483647,-2147483648),sl.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):_l(this,t,e,!0),e+4},sl.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||Dl(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),sl.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):_l(this,t,e,!1),e+4},sl.prototype.writeFloatLE=function(t,e,n){return Pl(this,t,e,!0,n)},sl.prototype.writeFloatBE=function(t,e,n){return Pl(this,t,e,!1,n)},sl.prototype.writeDoubleLE=function(t,e,n){return Bl(this,t,e,!0,n)},sl.prototype.writeDoubleBE=function(t,e,n){return Bl(this,t,e,!1,n)},sl.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!sl.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},sl.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!sl.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=fl(t)?t:Ql(new sl(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var Rl=/[^+\/0-9A-Za-z-_]/g;function Ul(t){return t<16?"0"+t.toString(16):t.toString(16)}function Ql(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Wl(t){return function(t){var e,n,r,i,o,a;qc||Xc();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new Jc(3*s/4-o),r=o>0?s-4:s;var u=0;for(e=0,n=0;e<r;e+=4,n+=3)i=Vc[t.charCodeAt(e)]<<18|Vc[t.charCodeAt(e+1)]<<12|Vc[t.charCodeAt(e+2)]<<6|Vc[t.charCodeAt(e+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=Vc[t.charCodeAt(e)]<<2|Vc[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=Vc[t.charCodeAt(e)]<<10|Vc[t.charCodeAt(e+1)]<<4|Vc[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Rl,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Fl(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Yl(t){return null!=t&&(!!t._isBuffer||Hl(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Hl(t.slice(0,0))}(t))}function Hl(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Gl=Object.freeze({__proto__:null,Buffer:sl,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),sl.alloc(+t)},isBuffer:Yl,kMaxLength:il}),Zl=Hc(Gl);function Vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vl(Object(n),!0).forEach((function(e){rh(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ql(){
|
|
3
3
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
4
4
|
ql=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new L(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function d(){}function f(){}var p={};s(p,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(A([])));g&&g!==e&&n.call(g,i)&&(p=g);var y=f.prototype=h.prototype=Object.create(p);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function A(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=f,s(y,"constructor",f),s(f,"constructor",d),d.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},v(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},v(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function Xl(t){return Xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xl(t)}function Kl(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function $l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Kl(o,r,i,a,s,"next",t)}function s(t){Kl(o,r,i,a,s,"throw",t)}a(void 0)}))}}function th(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function nh(t,e,n){return e&&eh(t.prototype,e),n&&eh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ih(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ah(t,e)}function oh(t){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oh(t)}function ah(t,e){return ah=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ah(t,e)}function sh(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function uh(t,e,n){return uh=sh()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&ah(i,n.prototype),i},uh.apply(null,arguments)}function ch(t){var e="function"==typeof Map?new Map:void 0;return ch=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return uh(t,arguments,oh(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ah(r,t)},ch(t)}function lh(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function hh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dh(t){var e=sh();return function(){var n,r=oh(t);if(e){var i=oh(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return hh(t)}(this,n)}}function fh(){return fh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oh(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},fh.apply(this,arguments)}function ph(t,e){return gh(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||vh(t,e)||wh()}function mh(t){return function(t){if(Array.isArray(t))return bh(t)}(t)||yh(t)||vh(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gh(t){if(Array.isArray(t))return t}function yh(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function vh(t,e){if(t){if("string"==typeof t)return bh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bh(t,e):void 0}}function bh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wh(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Mh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=vh(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var kh={exports:{}};!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"===Xl(t)?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Zl.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function s(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u<s;u++){var c=t.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"===Xl(t)&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===Xl(t))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=s(t,e,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l<s;l+=r)c=u(t,l,l+r,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var h=1;for(c=u(t,l,t.length,e),l=0;l<a;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){c(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(a=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n++]=255&a,n<t.length&&(t[n++]=a>>8&255),n<t.length&&(t[n++]=a>>16&255),6===o?(n<t.length&&(t[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;t[n--]=255&a,n>=0&&(t[n--]=a>>8&255),n>=0&&(t[n--]=a>>16&255),6===o?(n>=0&&(t[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)o=(e=(0|n.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,n){var r,i,o,a=t.words,s=e.words,u=n.words,c=0,l=0|a[0],h=8191&l,d=l>>>13,f=0|a[1],p=8191&f,m=f>>>13,g=0|a[2],y=8191&g,v=g>>>13,b=0|a[3],w=8191&b,M=b>>>13,k=0|a[4],L=8191&k,A=k>>>13,x=0|a[5],E=8191&x,N=x>>>13,S=0|a[6],I=8191&S,T=S>>>13,j=0|a[7],C=8191&j,D=j>>>13,O=0|a[8],_=8191&O,z=O>>>13,P=0|a[9],B=8191&P,R=P>>>13,U=0|s[0],Q=8191&U,W=U>>>13,F=0|s[1],Y=8191&F,H=F>>>13,G=0|s[2],Z=8191&G,V=G>>>13,J=0|s[3],q=8191&J,X=J>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],nt=8191&et,rt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,lt=0|s[8],ht=8191<,dt=lt>>>13,ft=0|s[9],pt=8191&ft,mt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(c+(r=Math.imul(h,Q))|0)+((8191&(i=(i=Math.imul(h,W))+Math.imul(d,Q)|0))<<13)|0;c=((o=Math.imul(d,W))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,Q),i=(i=Math.imul(p,W))+Math.imul(m,Q)|0,o=Math.imul(m,W);var yt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(y,Q),i=(i=Math.imul(y,W))+Math.imul(v,Q)|0,o=Math.imul(v,W),r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,H)|0;var vt=(c+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(w,Q),i=(i=Math.imul(w,W))+Math.imul(M,Q)|0,o=Math.imul(M,W),r=r+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,H)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,V)|0;var bt=(c+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(L,Q),i=(i=Math.imul(L,W))+Math.imul(A,Q)|0,o=Math.imul(A,W),r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,H)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,X)|0;var wt=(c+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(E,Q),i=(i=Math.imul(E,W))+Math.imul(N,Q)|0,o=Math.imul(N,W),r=r+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,H)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,H)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,V)|0,r=r+Math.imul(y,q)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(I,Q),i=(i=Math.imul(I,W))+Math.imul(T,Q)|0,o=Math.imul(T,W),r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,H)|0,r=r+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,X)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(m,nt)|0,o=o+Math.imul(m,rt)|0;var kt=(c+(r=r+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(C,Q),i=(i=Math.imul(C,W))+Math.imul(D,Q)|0,o=Math.imul(D,W),r=r+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(L,q)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,X)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(y,nt)|0,i=(i=i+Math.imul(y,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Lt=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(_,Q),i=(i=Math.imul(_,W))+Math.imul(z,Q)|0,o=Math.imul(z,W),r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,H)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,V)|0,r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var At=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,Q),i=(i=Math.imul(B,W))+Math.imul(R,Q)|0,o=Math.imul(R,W),r=r+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,H)|0,r=r+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,V)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,X)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(A,nt)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,r=r+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var xt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,H))+Math.imul(R,Y)|0,o=Math.imul(R,H),r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(z,Z)|0,o=o+Math.imul(z,V)|0,r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,X)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,r=r+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,V))+Math.imul(R,Z)|0,o=Math.imul(R,V),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(z,q)|0,o=o+Math.imul(z,X)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var Nt=(c+(r=r+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,X))+Math.imul(R,q)|0,o=Math.imul(R,X),r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(z,$)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(C,nt)|0,i=(i=i+Math.imul(C,rt)|0)+Math.imul(D,nt)|0,o=o+Math.imul(D,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var St=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(R,$)|0,o=Math.imul(R,tt),r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(z,nt)|0,o=o+Math.imul(z,rt)|0,r=r+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,r=r+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var It=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(R,nt)|0,o=Math.imul(R,rt),r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,at)|0,r=r+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,r=r+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,dt)|0;var Tt=(c+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ot),i=(i=Math.imul(B,at))+Math.imul(R,ot)|0,o=Math.imul(R,at),r=r+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(z,ut)|0,o=o+Math.imul(z,ct)|0,r=r+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,dt)|0;var jt=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(R,ut)|0,o=Math.imul(R,ct),r=r+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(z,ht)|0,o=o+Math.imul(z,dt)|0;var Ct=(c+(r=r+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(R,ht)|0,o=Math.imul(R,dt);var Dt=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(z,pt)|0))<<13)|0;c=((o=o+Math.imul(z,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(R,pt)|0))<<13)|0;return c=((o=Math.imul(R,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=Mt,u[6]=kt,u[7]=Lt,u[8]=At,u[9]=xt,u[10]=Et,u[11]=Nt,u[12]=St,u[13]=It,u[14]=Tt,u[15]=jt,u[16]=Ct,u[17]=Dt,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;s=67108863&(d=d+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(t,e,n){return g(t,e,n)}Math.imul||(m=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?p(this,t,e):n<1024?g(this,t,e):y(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,u=(0|this.words[e])-s<<r;this.words[e]=u|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var u=(0|t.words[i])*e;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==e){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(o,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|r.words[o.length+h])+(0|r.words[o.length+h-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(o,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(o,1,h),r.isZero()||(r.negative^=1);s&&(s.words[h]=d)}return s&&s._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(o=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:o,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,a,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(h)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s),a.isub(u)):(r.isub(e),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(o=0===e.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new A(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function L(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},r(w,b),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(M,b),r(k,b),r(L,b),L.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new M;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new L}return v[t]=e,e},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),d=this.pow(t,o.addn(1).iushrn(1)),f=this.pow(t,o),p=a;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var y=this.pow(h,new i(1).iushln(p-g-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=g}return d},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],a=0,s=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}u=26}return o},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new x(t)},r(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(kh,Fc);var Lh=kh.exports;function Ah(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: ".concat(t))}function xh(t){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(t.length))throw new TypeError("Expected Uint8Array of length ".concat(n,", not of length=").concat(t.length))}var Eh={number:Ah,bool:function(t){if("boolean"!=typeof t)throw new Error("Expected boolean, not ".concat(t))},bytes:xh,hash:function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Ah(t.outputLen),Ah(t.blockLen)},exists:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},output:function(t,e){xh(t);var n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least ".concat(n))}},Nh=Eh,Sh=function(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)},Ih=function(t,e){return t<<32-e|t>>>e};if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function Th(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new TypeError("utf8ToBytes expected string, got ".concat(Xl(t)));return(new TextEncoder).encode(t)}(t)),!(t instanceof Uint8Array))throw new TypeError("Expected input type is Uint8Array (got ".concat(Xl(t),")"));return t}Array.from({length:256},(function(t,e){return e.toString(16).padStart(2,"0")}));var jh=function(){function t(){th(this,t)}return nh(t,[{key:"clone",value:function(){return this._cloneInto()}}]),t}();function Ch(t){var e=function(e){return t().update(Th(e)).digest()},n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=function(){return t()},e}var Dh=function(t){ih(n,jh);var e=dh(n);function n(t,r,i,o){var a;return th(this,n),(a=e.call(this)).blockLen=t,a.outputLen=r,a.padOffset=i,a.isLE=o,a.finished=!1,a.length=0,a.pos=0,a.destroyed=!1,a.buffer=new Uint8Array(t),a.view=Sh(a.buffer),a}return nh(n,[{key:"update",value:function(t){Nh.exists(this);for(var e=this.view,n=this.buffer,r=this.blockLen,i=(t=Th(t)).length,o=0;o<i;){var a=Math.min(r-this.pos,i-o);if(a!==r)n.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===r&&(this.process(e,0),this.pos=0);else for(var s=Sh(t);r<=i-o;o+=r)this.process(s,o)}return this.length+=t.length,this.roundClean(),this}},{key:"digestInto",value:function(t){Nh.exists(this),Nh.output(t,this),this.finished=!0;var e=this.buffer,n=this.view,r=this.blockLen,i=this.isLE,o=this.pos;e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(n,0),o=0);for(var a=o;a<r;a++)e[a]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);var i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),s=Number(n&o),u=r?4:0,c=r?0:4;t.setUint32(e+u,a,r),t.setUint32(e+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);var s=Sh(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(var h=0;h<c;h++)s.setUint32(4*h,l[h],i)}},{key:"digest",value:function(){var t=this.buffer,e=this.outputLen;this.digestInto(t);var n=t.slice(0,e);return this.destroy(),n}},{key:"_cloneInto",value:function(t){var e;t||(t=new this.constructor),(e=t).set.apply(e,mh(this.get()));var n=this.blockLen,r=this.buffer,i=this.length,o=this.finished,a=this.destroyed,s=this.pos;return t.length=i,t.pos=s,t.finished=o,t.destroyed=a,i%n&&t.buffer.set(r),t}}]),n}(),Oh=BigInt(Math.pow(2,32)-1),_h=BigInt(32);function zh(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(t&Oh),l:Number(t>>_h&Oh)}:{h:0|Number(t>>_h&Oh),l:0|Number(t&Oh)}}var Ph={fromBig:zh,split:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(t.length),r=new Uint32Array(t.length),i=0;i<t.length;i++){var o=zh(t[i],e),a=[o.h,o.l];n[i]=a[0],r[i]=a[1]}return[n,r]},toBig:function(t,e){return BigInt(t>>>0)<<_h|BigInt(e>>>0)},shrSH:function(t,e,n){return t>>>n},shrSL:function(t,e,n){return t<<32-n|e>>>n},rotrSH:function(t,e,n){return t>>>n|e<<32-n},rotrSL:function(t,e,n){return t<<32-n|e>>>n},rotrBH:function(t,e,n){return t<<64-n|e>>>n-32},rotrBL:function(t,e,n){return t>>>n-32|e<<64-n},rotr32H:function(t,e){return e},rotr32L:function(t,e){return t},rotlSH:function(t,e,n){return t<<n|e>>>32-n},rotlSL:function(t,e,n){return e<<n|t>>>32-n},rotlBH:function(t,e,n){return e<<n-32|t>>>64-n},rotlBL:function(t,e,n){return t<<n-32|e>>>64-n},add:function(t,e,n,r){var i=(e>>>0)+(r>>>0);return{h:t+n+(i/Math.pow(2,32)|0)|0,l:0|i}},add3L:function(t,e,n){return(t>>>0)+(e>>>0)+(n>>>0)},add3H:function(t,e,n,r){return e+n+r+(t/Math.pow(2,32)|0)|0},add4L:function(t,e,n,r){return(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)},add4H:function(t,e,n,r,i){return e+n+r+i+(t/Math.pow(2,32)|0)|0},add5H:function(t,e,n,r,i,o){return e+n+r+i+o+(t/Math.pow(2,32)|0)|0},add5L:function(t,e,n,r,i){return(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)}},Bh=Ph,Rh=Bh.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((function(t){return BigInt(t)}))),Uh=ph(Rh,2),Qh=Uh[0],Wh=Uh[1],Fh=new Uint32Array(80),Yh=new Uint32Array(80),Hh=function(t){ih(n,Dh);var e=dh(n);function n(){var t;return th(this,n),(t=e.call(this,128,64,16,!1)).Ah=1779033703,t.Al=-205731576,t.Bh=-1150833019,t.Bl=-2067093701,t.Ch=1013904242,t.Cl=-23791573,t.Dh=-1521486534,t.Dl=1595750129,t.Eh=1359893119,t.El=-1377402159,t.Fh=-1694144372,t.Fl=725511199,t.Gh=528734635,t.Gl=-79577749,t.Hh=1541459225,t.Hl=327033209,t}return nh(n,[{key:"get",value:function(){return[this.Ah,this.Al,this.Bh,this.Bl,this.Ch,this.Cl,this.Dh,this.Dl,this.Eh,this.El,this.Fh,this.Fl,this.Gh,this.Gl,this.Hh,this.Hl]}},{key:"set",value:function(t,e,n,r,i,o,a,s,u,c,l,h,d,f,p,m){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|m}},{key:"process",value:function(t,e){for(var n=0;n<16;n++,e+=4)Fh[n]=t.getUint32(e),Yh[n]=t.getUint32(e+=4);for(var r=16;r<80;r++){var i=0|Fh[r-15],o=0|Yh[r-15],a=Bh.rotrSH(i,o,1)^Bh.rotrSH(i,o,8)^Bh.shrSH(i,o,7),s=Bh.rotrSL(i,o,1)^Bh.rotrSL(i,o,8)^Bh.shrSL(i,o,7),u=0|Fh[r-2],c=0|Yh[r-2],l=Bh.rotrSH(u,c,19)^Bh.rotrBH(u,c,61)^Bh.shrSH(u,c,6),h=Bh.rotrSL(u,c,19)^Bh.rotrBL(u,c,61)^Bh.shrSL(u,c,6),d=Bh.add4L(s,h,Yh[r-7],Yh[r-16]),f=Bh.add4H(d,a,l,Fh[r-7],Fh[r-16]);Fh[r]=0|f,Yh[r]=0|d}for(var p=this.Ah,m=this.Al,g=this.Bh,y=this.Bl,v=this.Ch,b=this.Cl,w=this.Dh,M=this.Dl,k=this.Eh,L=this.El,A=this.Fh,x=this.Fl,E=this.Gh,N=this.Gl,S=this.Hh,I=this.Hl,T=0;T<80;T++){var j=Bh.rotrSH(k,L,14)^Bh.rotrSH(k,L,18)^Bh.rotrBH(k,L,41),C=Bh.rotrSL(k,L,14)^Bh.rotrSL(k,L,18)^Bh.rotrBL(k,L,41),D=k&A^~k&E,O=L&x^~L&N,_=Bh.add5L(I,C,O,Wh[T],Yh[T]),z=Bh.add5H(_,S,j,D,Qh[T],Fh[T]),P=0|_,B=Bh.rotrSH(p,m,28)^Bh.rotrBH(p,m,34)^Bh.rotrBH(p,m,39),R=Bh.rotrSL(p,m,28)^Bh.rotrBL(p,m,34)^Bh.rotrBL(p,m,39),U=p&g^p&v^g&v,Q=m&y^m&b^y&b;S=0|E,I=0|N,E=0|A,N=0|x,A=0|k,x=0|L;var W=Bh.add(0|w,0|M,0|z,0|P);k=W.h,L=W.l,w=0|v,M=0|b,v=0|g,b=0|y,g=0|p,y=0|m;var F=Bh.add3L(P,R,Q);p=Bh.add3H(F,z,B,U),m=0|F}var Y=Bh.add(0|this.Ah,0|this.Al,0|p,0|m);p=Y.h,m=Y.l;var H=Bh.add(0|this.Bh,0|this.Bl,0|g,0|y);g=H.h,y=H.l;var G=Bh.add(0|this.Ch,0|this.Cl,0|v,0|b);v=G.h,b=G.l;var Z=Bh.add(0|this.Dh,0|this.Dl,0|w,0|M);w=Z.h,M=Z.l;var V=Bh.add(0|this.Eh,0|this.El,0|k,0|L);k=V.h,L=V.l;var J=Bh.add(0|this.Fh,0|this.Fl,0|A,0|x);A=J.h,x=J.l;var q=Bh.add(0|this.Gh,0|this.Gl,0|E,0|N);E=q.h,N=q.l;var X=Bh.add(0|this.Hh,0|this.Hl,0|S,0|I);S=X.h,I=X.l,this.set(p,m,g,y,v,b,w,M,k,L,A,x,E,N,S,I)}},{key:"roundClean",value:function(){Fh.fill(0),Yh.fill(0)}},{key:"destroy",value:function(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}]),n}(),Gh=function(t){ih(n,Hh);var e=dh(n);function n(){var t;return th(this,n),(t=e.call(this)).Ah=-1942145080,t.Al=424955298,t.Bh=1944164710,t.Bl=-1982016298,t.Ch=502970286,t.Cl=855612546,t.Dh=1738396948,t.Dl=1479516111,t.Eh=258812777,t.El=2077511080,t.Fh=2011393907,t.Fl=79989058,t.Gh=1067287976,t.Gl=1780299464,t.Hh=286451373,t.Hl=-1848208735,t.outputLen=28,t}return nh(n)}(),Zh=function(t){ih(n,Hh);var e=dh(n);function n(){var t;return th(this,n),(t=e.call(this)).Ah=573645204,t.Al=-64227540,t.Bh=-1621794909,t.Bl=-934517566,t.Ch=596883563,t.Cl=1867755857,t.Dh=-1774684391,t.Dl=1497426621,t.Eh=-1775747358,t.El=-1467023389,t.Fh=-1101128155,t.Fl=1401305490,t.Gh=721525244,t.Gl=746961066,t.Hh=246885852,t.Hl=-2117784414,t.outputLen=32,t}return nh(n)}(),Vh=function(t){ih(n,Hh);var e=dh(n);function n(){var t;return th(this,n),(t=e.call(this)).Ah=-876896931,t.Al=-1056596264,t.Bh=1654270250,t.Bl=914150663,t.Ch=-1856437926,t.Cl=812702999,t.Dh=355462360,t.Dl=-150054599,t.Eh=1731405415,t.El=-4191439,t.Fh=-1900787065,t.Fl=1750603025,t.Gh=-619958771,t.Gl=1694076839,t.Hh=1203062813,t.Hl=-1090891868,t.outputLen=48,t}return nh(n)}(),Jh=Ch((function(){return new Hh}));Ch((function(){return new Gh})),Ch((function(){return new Zh})),Ch((function(){return new Vh}));var qh=Wc.crypto,Xh=BigInt(0),Kh=BigInt(1),$h=BigInt(2),td=BigInt(8),ed=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),nd=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:ed,n:ed,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),rd=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),id=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742");var od=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),ad=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),sd=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),ud=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),cd=function(){function t(e,n,r,i){th(this,t),this.x=e,this.y=n,this.z=r,this.t=i}return nh(t,[{key:"equals",value:function(t){hd(t);var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=Id(e*a),u=Id(i*r),c=Id(n*a),l=Id(o*r);return s===u&&c===l}},{key:"negate",value:function(){return new t(Id(-this.x),this.y,this.z,Id(-this.t))}},{key:"double",value:function(){var e=this.x,n=this.y,r=this.z,i=nd.a,o=Id(e*e),a=Id(n*n),s=Id($h*Id(r*r)),u=Id(i*o),c=e+n,l=Id(Id(c*c)-o-a),h=u+a,d=h-s,f=u-a,p=Id(l*d),m=Id(h*f),g=Id(l*f);return new t(p,m,Id(d*h),g)}},{key:"add",value:function(e){hd(e);var n=this.x,r=this.y,i=this.z,o=this.t,a=e.x,s=e.y,u=e.z,c=e.t,l=Id((r-n)*(s+a)),h=Id((r+n)*(s-a)),d=Id(h-l);if(d===Xh)return this.double();var f=Id(i*$h*c),p=Id(o*$h*u),m=p+f,g=h+l,y=p-f,v=Id(m*d),b=Id(g*y),w=Id(m*y);return new t(v,b,Id(d*g),w)}},{key:"subtract",value:function(t){return this.add(t.negate())}},{key:"precomputeWindow",value:function(t){for(var e=1+256/t,n=[],r=this,i=r,o=0;o<e;o++){i=r,n.push(i);for(var a=1;a<Math.pow(2,t-1);a++)i=i.add(r),n.push(i);r=i.double()}return n}},{key:"wNAF",value:function(e,n){!n&&this.equals(t.BASE)&&(n=gd.BASE);var r=n&&n._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");var i=n&&md.get(n);i||(i=this.precomputeWindow(r),n&&1!==r&&(i=t.normalizeZ(i),md.set(n,i)));for(var o=t.ZERO,a=t.BASE,s=1+256/r,u=Math.pow(2,r-1),c=BigInt(Math.pow(2,r)-1),l=Math.pow(2,r),h=BigInt(r),d=0;d<s;d++){var f=d*u,p=Number(e&c);e>>=h,p>u&&(p-=l,e+=Kh);var m=f,g=f+Math.abs(p)-1,y=d%2!=0,v=p<0;0===p?a=a.add(ld(y,i[m])):o=o.add(ld(v,i[g]))}return t.normalizeZ([o,a])[0]}},{key:"multiply",value:function(t,e){return this.wNAF(zd(t,nd.l),e)}},{key:"multiplyUnsafe",value:function(e){var n=zd(e,nd.l,!1),r=t.BASE,i=t.ZERO;if(n===Xh)return i;if(this.equals(i)||n===Kh)return this;if(this.equals(r))return this.wNAF(n);for(var o=i,a=this;n>Xh;)n&Kh&&(o=o.add(a)),a=a.double(),n>>=Kh;return o}},{key:"isSmallOrder",value:function(){return this.multiplyUnsafe(nd.h).equals(t.ZERO)}},{key:"isTorsionFree",value:function(){var e=this.multiplyUnsafe(nd.l/$h).double();return nd.l%$h&&(e=e.add(this)),e.equals(t.ZERO)}},{key:"toAffine",value:function(e){var n=this.x,r=this.y,i=this.z,o=this.equals(t.ZERO);null==e&&(e=o?td:Td(i));var a=Id(n*e),s=Id(r*e),u=Id(i*e);if(o)return gd.ZERO;if(u!==Kh)throw new Error("invZ was invalid");return new gd(a,s)}},{key:"fromRistrettoBytes",value:function(){fd()}},{key:"toRistrettoBytes",value:function(){fd()}},{key:"fromRistrettoHash",value:function(){fd()}}],[{key:"fromAffine",value:function(e){if(!(e instanceof gd))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(gd.ZERO)?t.ZERO:new t(e.x,e.y,Kh,Id(e.x*e.y))}},{key:"toAffineBatch",value:function(t){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nd.P,n=new Array(t.length),r=t.reduce((function(t,r,i){return r===Xh?t:(n[i]=t,Id(t*r,e))}),Kh),i=Td(r,e);return t.reduceRight((function(t,r,i){return r===Xh?t:(n[i]=Id(t*n[i],e),Id(t*r,e))}),i),n}(t.map((function(t){return t.z})));return t.map((function(t,n){return t.toAffine(e[n])}))}},{key:"normalizeZ",value:function(t){return this.toAffineBatch(t).map(this.fromAffine)}}]),t}();function ld(t,e){var n=e.negate();return t?n:e}function hd(t){if(!(t instanceof cd))throw new TypeError("ExtendedPoint expected")}function dd(t){if(!(t instanceof pd))throw new TypeError("RistrettoPoint expected")}function fd(){throw new Error("Legacy method: switch to RistrettoPoint")}cd.BASE=new cd(nd.Gx,nd.Gy,Kh,Id(nd.Gx*nd.Gy)),cd.ZERO=new cd(Xh,Kh,Kh,Xh);var pd=function(){function t(e){th(this,t),this.ep=e}return nh(t,[{key:"toRawBytes",value:function(){var t,e=this.ep,n=e.x,r=e.y,i=e.z,o=e.t,a=Id(Id(i+r)*Id(i-r)),s=Id(n*r),u=Id(s*s),c=Dd(Id(a*u)).value,l=Id(c*a),h=Id(c*s),d=Id(l*h*o);if(Ad(o*d)){var f=Id(r*id),p=Id(n*id);n=f,r=p,t=Id(l*ad)}else t=h;Ad(n*d)&&(r=Id(-r));var m=Id((i-r)*t);return Ad(m)&&(m=Id(-m)),Ld(m)}},{key:"toHex",value:function(){return wd(this.toRawBytes())}},{key:"toString",value:function(){return this.toHex()}},{key:"equals",value:function(t){dd(t);var e=this.ep,n=t.ep,r=Id(e.x*n.y)===Id(e.y*n.x),i=Id(e.y*n.y)===Id(e.x*n.x);return r||i}},{key:"add",value:function(e){return dd(e),new t(this.ep.add(e.ep))}},{key:"subtract",value:function(e){return dd(e),new t(this.ep.subtract(e.ep))}},{key:"multiply",value:function(e){return new t(this.ep.multiply(e))}},{key:"multiplyUnsafe",value:function(e){return new t(this.ep.multiplyUnsafe(e))}}],[{key:"calcElligatorRistrettoMap",value:function(t){var e=nd.d,n=Id(id*t*t),r=Id((n+Kh)*sd),i=BigInt(-1),o=Id((i-e*n)*Id(n+e)),a=Cd(r,o),s=a.isValid,u=a.value,c=Id(u*t);Ad(c)||(c=Id(-c)),s||(u=c),s||(i=n);var l=Id(i*(n-Kh)*ud-o),h=u*u,d=Id((u+u)*o),f=Id(l*od),p=Id(Kh-h),m=Id(Kh+h);return new cd(Id(d*m),Id(p*f),Id(f*m),Id(d*p))}},{key:"hashToCurve",value:function(e){var n=Sd((e=_d(e,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(n),i=Sd(e.slice(32,64)),o=this.calcElligatorRistrettoMap(i);return new t(r.add(o))}},{key:"fromHex",value:function(e){e=_d(e,32);var n=nd.a,r=nd.d,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",o=Sd(e);if(!function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(Ld(o),e)||Ad(o))throw new Error(i);var a=Id(o*o),s=Id(Kh+n*a),u=Id(Kh-n*a),c=Id(s*s),l=Id(u*u),h=Id(n*r*c-l),d=Dd(Id(h*l)),f=d.isValid,p=d.value,m=Id(p*u),g=Id(p*m*h),y=Id((o+o)*m);Ad(y)&&(y=Id(-y));var v=Id(s*g),b=Id(y*v);if(!f||Ad(b)||v===Xh)throw new Error(i);return new t(new cd(y,v,Kh,b))}}]),t}();pd.BASE=new pd(cd.BASE),pd.ZERO=new pd(cd.ZERO);var md=new WeakMap,gd=function(){function t(e,n){th(this,t),this.x=e,this.y=n}var e;return nh(t,[{key:"_setWindowSize",value:function(t){this._WINDOW_SIZE=t,md.delete(this)}},{key:"toRawBytes",value:function(){var t=Ld(this.y);return t[31]|=this.x&Kh?128:0,t}},{key:"toHex",value:function(){return wd(this.toRawBytes())}},{key:"toX25519",value:function(){var t=this.y;return Ld(Id((Kh+t)*Td(Kh-t)))}},{key:"isTorsionFree",value:function(){return cd.fromAffine(this).isTorsionFree()}},{key:"equals",value:function(t){return this.x===t.x&&this.y===t.y}},{key:"negate",value:function(){return new t(Id(-this.x),this.y)}},{key:"add",value:function(t){return cd.fromAffine(this).add(cd.fromAffine(t)).toAffine()}},{key:"subtract",value:function(t){return this.add(t.negate())}},{key:"multiply",value:function(t){return cd.fromAffine(this).multiply(t,this).toAffine()}}],[{key:"fromHex",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=nd.d,i=nd.P,o=(e=_d(e,32)).slice();o[31]=-129&e[31];var a=xd(o);if(n&&a>=i)throw new Error("Expected 0 < hex < P");if(!n&&a>=rd)throw new Error("Expected 0 < hex < 2**256");var s=Id(a*a),u=Cd(Id(s-Kh),Id(r*s+Kh)),c=u.isValid,l=u.value;if(!c)throw new Error("Point.fromHex: invalid y coordinate");var h=(l&Kh)===Kh;return 0!=(128&e[31])!==h&&(l=Id(-l)),new t(l,a)}},{key:"fromPrivateKey",value:(e=$l(ql().mark((function t(e){return ql().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ud(e);case 2:return t.abrupt("return",t.sent.point);case 3:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)})}]),t}();gd.BASE=new gd(nd.Gx,nd.Gy),gd.ZERO=new gd(Xh,Kh);var yd=function(){function t(e,n){th(this,t),this.r=e,this.s=n,this.assertValidity()}return nh(t,[{key:"assertValidity",value:function(){var t=this.r,e=this.s;if(!(t instanceof gd))throw new Error("Expected Point instance");return zd(e,nd.l,!1),this}},{key:"toRawBytes",value:function(){var t=new Uint8Array(64);return t.set(this.r.toRawBytes()),t.set(Ld(this.s),32),t}},{key:"toHex",value:function(){return wd(this.toRawBytes())}}],[{key:"fromHex",value:function(e){var n=_d(e,64);return new t(gd.fromHex(n.slice(0,32),!1),xd(n.slice(32,64)))}}]),t}();function vd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(!e.every((function(t){return t instanceof Uint8Array})))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];for(var r=e.reduce((function(t,e){return t+e.length}),0),i=new Uint8Array(r),o=0,a=0;o<e.length;o++){var s=e[o];i.set(s,a),a+=s.length}return i}var bd=Array.from({length:256},(function(t,e){return e.toString(16).padStart(2,"0")}));function wd(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");for(var e="",n=0;n<t.length;n++)e+=bd[t[n]];return e}function Md(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+Xl(t));if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");for(var e=new Uint8Array(t.length/2),n=0;n<e.length;n++){var r=2*n,i=t.slice(r,r+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[n]=o}return e}function kd(t){return Md(t.toString(16).padStart(64,"0"))}function Ld(t){return kd(t).reverse()}function Ad(t){return(Id(t)&Kh)===Kh}function xd(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+wd(Uint8Array.from(t).reverse()))}var Ed,Nd=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Sd(t){return Id(xd(t)&Nd)}function Id(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nd.P,n=t%e;return n>=Xh?n:e+n}function Td(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nd.P;if(t===Xh||e<=Xh)throw new Error("invert: expected positive integers, got n=".concat(t," mod=").concat(e));for(var n=Id(t,e),r=e,i=Xh,o=Kh;n!==Xh;){var a=r%n,s=i-o*(r/n);r=n,n=a,i=o,o=s}if(r!==Kh)throw new Error("invert: does not exist");return Id(i,e)}function jd(t,e){for(var n=nd.P,r=t;e-- >Xh;)r*=r,r%=n;return r}function Cd(t,e){var n=Id(e*e*e),r=function(t){var e=nd.P,n=BigInt(5),r=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),s=t*t%e*t%e,u=jd(s,$h)*s%e,c=jd(u,Kh)*t%e,l=jd(c,n)*c%e,h=jd(l,r)*l%e,d=jd(h,i)*h%e,f=jd(d,o)*d%e,p=jd(f,a)*f%e,m=jd(p,a)*f%e,g=jd(m,r)*l%e;return{pow_p_5_8:jd(g,$h)*t%e,b2:s}}(t*Id(n*n*e)).pow_p_5_8,i=Id(t*n*r),o=Id(e*i*i),a=i,s=Id(i*id),u=o===t,c=o===Id(-t),l=o===Id(-t*id);return u&&(i=a),(c||l)&&(i=s),Ad(i)&&(i=Id(-i)),{isValid:u||c,value:i}}function Dd(t){return Cd(Kh,t)}function Od(t){return Id(xd(t),nd.l)}function _d(t,e){var n=t instanceof Uint8Array?Uint8Array.from(t):Md(t);if("number"==typeof e&&n.length!==e)throw new Error("Expected ".concat(e," bytes"));return n}function zd(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)throw new TypeError("Specify max value");if("number"==typeof t&&Number.isSafeInteger(t)&&(t=BigInt(t)),"bigint"==typeof t&&t<e)if(n){if(Xh<t)return t}else if(Xh<=t)return t;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function Pd(t){if(32!==(t="bigint"==typeof t||"number"==typeof t?kd(zd(t,rd)):_d(t)).length)throw new Error("Expected 32 bytes");return t}function Bd(t){var e=function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}(t.slice(0,32)),n=t.slice(32,64),r=Od(e),i=gd.BASE.multiply(r),o=i.toRawBytes();return{head:e,prefix:n,scalar:r,point:i,pointBytes:o}}function Rd(){if("function"!=typeof Ed)throw new Error("utils.sha512Sync must be set to use sync methods");return Ed.apply(void 0,arguments)}function Ud(t){return Qd.apply(this,arguments)}function Qd(){return Qd=$l(ql().mark((function t(e){return ql().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Bd,t.next=3,Gd.sha512(Pd(e));case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)}))),Qd.apply(this,arguments)}function Wd(t){return Bd(Rd(Pd(t)))}var Fd={getExtendedPublicKey:Wd,getPublicKey:function(t){return Wd(t).pointBytes},sign:function(t,e){t=_d(t);var n=Wd(e),r=n.prefix,i=n.scalar,o=n.pointBytes,a=Od(Rd(r,t)),s=gd.BASE.multiply(a),u=Id(a+Od(Rd(s.toRawBytes(),o,t))*i,nd.l);return new yd(s,u).toRawBytes()},verify:function(t,e,n){var r=function(t,e,n){e=_d(e),n instanceof gd||(n=gd.fromHex(n,!1));var r=t instanceof yd?t.assertValidity():yd.fromHex(t),i=r.r,o=r.s;return{r:i,s:o,SB:cd.BASE.multiplyUnsafe(o),pub:n,msg:e}}(t,e,n),i=r.r,o=r.SB,a=r.msg,s=r.pub,u=Rd(i.toRawBytes(),s.toRawBytes(),a);return function(t,e,n,r){var i=Od(r),o=cd.fromAffine(t).multiplyUnsafe(i);return cd.fromAffine(e).add(o).subtract(n).multiplyUnsafe(nd.h).equals(cd.ZERO)}(s,i,o,u)}};gd.BASE._setWindowSize(8);var Yd,Hd={node:qh,web:"object"===("undefined"==typeof self?"undefined":Xl(self))&&"crypto"in self?self.crypto:void 0},Gd={bytesToHex:wd,hexToBytes:Md,concatBytes:vd,getExtendedPublicKey:Ud,mod:Id,invert:Td,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:function(t){if((t=_d(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Id(xd(t),nd.l-Kh)+Kh},randomBytes:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Hd.web)return Hd.web.getRandomValues(new Uint8Array(t));if(Hd.node){var e=Hd.node.randomBytes;return new Uint8Array(e(t).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return Gd.randomBytes(32)},sha512:(Yd=$l(ql().mark((function t(){var e,n,r=arguments;return ql().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=vd.apply(void 0,r),!Hd.web){t.next=8;break}return t.next=4,Hd.web.subtle.digest("SHA-512",e.buffer);case 4:return n=t.sent,t.abrupt("return",new Uint8Array(n));case 8:if(!Hd.node){t.next=12;break}return t.abrupt("return",Uint8Array.from(Hd.node.createHash("sha512").update(e).digest()));case 12:throw new Error("The environment doesn't have sha512 function");case 13:case"end":return t.stop()}}),t)}))),function(){return Yd.apply(this,arguments)}),precompute:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gd.BASE,n=e.equals(gd.BASE)?e:new gd(e.x,e.y);return n._setWindowSize(t),n.multiply($h),n},sha512Sync:void 0};Object.defineProperties(Gd,{sha512Sync:{configurable:!1,get:function(){return Ed},set:function(t){Ed||(Ed=t)}}});var Zd={exports:{}};
|