@dodoex/wallet-web3 0.0.43-beta.1 → 0.0.43-beta.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/{DefaultJsonRpcProvider-48aec187.js → DefaultJsonRpcProvider-a5375519.js} +1 -1
- package/dist/__node-resolve_empty-0ed2c058.js +1 -0
- package/dist/{blocto-478b3978.js → blocto-739837e0.js} +1 -1
- package/dist/{bn-efc414a2.js → bn-dbf1b053.js} +1 -1
- package/dist/{browser-ponyfill-bc327969.js → browser-ponyfill-65b68016.js} +1 -1
- package/dist/cjs/{DefaultJsonRpcProvider-55c338f0.cjs → DefaultJsonRpcProvider-af04cc55.cjs} +1 -1
- package/dist/cjs/__node-resolve_empty-e2dee16c.cjs +1 -0
- package/dist/cjs/{blocto-965564db.cjs → blocto-e8847b99.cjs} +1 -1
- package/dist/cjs/{bn-d506e85d.cjs → bn-87cba44d.cjs} +1 -1
- package/dist/cjs/{browser-ponyfill-323d988f.cjs → browser-ponyfill-de0a8ec9.cjs} +1 -1
- package/dist/cjs/{draggabilly-79573f3a.cjs → draggabilly-5c45132c.cjs} +1 -1
- package/dist/cjs/{ethers-1ba31973.cjs → ethers-2b86e17d.cjs} +1 -1
- package/dist/cjs/{id-1118c8d9.cjs → id-1eb25db0.cjs} +1 -1
- package/dist/cjs/{index-285c5389.cjs → index-18446412.cjs} +1 -1
- package/dist/cjs/{index-dc6a6c03.cjs → index-1af4ac9a.cjs} +1 -1
- package/dist/cjs/{index-0122b1eb.cjs → index-21b90e8c.cjs} +1 -1
- package/dist/cjs/{index-58465208.cjs → index-2587eef5.cjs} +1 -1
- package/dist/cjs/{index-4d414966.cjs → index-2a741fbb.cjs} +1 -1
- package/dist/cjs/{index-ac9f2e8f.cjs → index-38ed564c.cjs} +1 -1
- package/dist/cjs/{index-ae56e5a3.cjs → index-3f7251ad.cjs} +2 -2
- package/dist/cjs/index-53583bbc.cjs +1 -0
- package/dist/cjs/{index-0ce04635.cjs → index-aaf32aa5.cjs} +2 -2
- package/dist/cjs/{index-3c74ed4c.cjs → index-d22bf825.cjs} +1 -1
- package/dist/cjs/{index-99521957.cjs → index-e9e5106b.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-6fd28bfe.cjs → index.es-3e845f07.cjs} +1 -1
- package/dist/cjs/{interface-22e176bf.cjs → interface-bc5624b1.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-4ea60734.cjs → lib-typedarrays-7f24496d.cjs} +1 -1
- package/dist/cjs/{portis-5a7056fa.cjs → portis-211bf6ad.cjs} +1 -1
- package/dist/cjs/{provider-d22e1228.cjs → provider-0ddad67c.cjs} +1 -1
- package/dist/cjs/{rainbow-54c01ab2.cjs → rainbow-73e82c82.cjs} +1 -1
- package/dist/cjs/sha224-8056f6e3.cjs +1 -0
- package/dist/cjs/{sha256-ab07124e.cjs → sha256-43414cf6.cjs} +1 -1
- package/dist/cjs/{uAuth-b9d43d2e.cjs → uAuth-5166de3a.cjs} +1 -1
- package/dist/cjs/{walletConnect-398a4c97.cjs → walletConnect-41dc68ec.cjs} +1 -1
- package/dist/cjs/{walletLink-6199ae38.cjs → walletLink-689340b5.cjs} +2 -2
- package/dist/{draggabilly-830dc949.js → draggabilly-fb1c9db3.js} +1 -1
- package/dist/{ethers-1d40d86b.js → ethers-b291db18.js} +1 -1
- package/dist/{id-62e12510.js → id-4e950ad4.js} +1 -1
- package/dist/{index-b32df058.js → index-05ecccce.js} +1 -1
- package/dist/{index-3c4637f0.js → index-0e53e209.js} +1 -1
- package/dist/{index-37f47216.js → index-1aa609d8.js} +1 -1
- package/dist/{index-a33c0bc7.js → index-2068a4fe.js} +2 -2
- package/dist/{index-02350ba2.js → index-27d4b342.js} +1 -1
- package/dist/{index-bcc0fefa.js → index-54955d07.js} +1 -1
- package/dist/{index-acc28a9b.js → index-8151dacc.js} +1 -1
- package/dist/{index-6e901e7d.js → index-929dd85e.js} +1 -1
- package/dist/{index-b659401e.js → index-948c094e.js} +1 -1
- package/dist/{index-11a0760f.js → index-9a0e5b83.js} +1 -1
- package/dist/{index-115f7417.js → index-ede11a7b.js} +1 -1
- package/dist/{index.es-d4badfa1.js → index.es-818610ea.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-c16329c9.js → interface-cb5e1e98.js} +1 -1
- package/dist/{lib-typedarrays-f90f59e3.js → lib-typedarrays-f8420380.js} +1 -1
- package/dist/{portis-a86b0a05.js → portis-0d9d874b.js} +1 -1
- package/dist/{provider-e4a0ed94.js → provider-0b6bd3ac.js} +1 -1
- package/dist/{rainbow-3df70217.js → rainbow-688b2e16.js} +1 -1
- package/dist/{sha224-57921047.js → sha224-3fa562e2.js} +1 -1
- package/dist/{sha256-5bd230f1.js → sha256-39cd7493.js} +1 -1
- package/dist/{uAuth-2e999ea5.js → uAuth-4ba62d4b.js} +1 -1
- package/dist/{walletConnect-565fd3db.js → walletConnect-96c9baa7.js} +1 -1
- package/dist/{walletLink-df58109a.js → walletLink-000fcb81.js} +2 -2
- package/package.json +1 -1
- package/dist/__node-resolve_empty-59fa3c56.js +0 -1
- package/dist/cjs/__node-resolve_empty-fd72eb2c.cjs +0 -1
- package/dist/cjs/index-685f72cf.cjs +0 -1
- package/dist/cjs/sha224-75e384f0.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@ethersproject/contracts"),t=require("@ethersproject/abstract-signer"),r=require("@ethersproject/address"),i=require("@ethersproject/abstract-provider"),n=require("@ethersproject/bytes"),o=require("./index-0ce04635.cjs"),s=require("./id-1118c8d9.cjs"),a=require("./index-285c5389.cjs"),f=require("@ethersproject/properties"),h=require("./__node-resolve_empty-fd72eb2c.cjs"),u=require("./hash-7ce6fed5.cjs"),l=require("@ethersproject/transactions"),d=require("@ethersproject/json-wallets"),c=require("@ethersproject/constants"),p=require("@ethersproject/providers"),m=require("./interface-22e176bf.cjs"),g=require("./index-685f72cf.cjs");function A(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var y=A(c),v=A(p);const w=new s.Logger(s.version),b={},M=s.BigNumber.from(0),S=s.BigNumber.from(-1);function B(e,t,r,i){const n={fault:t,operation:r};return void 0!==i&&(n.value=i),w.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}let C="0";for(;C.length<256;)C+=C;function E(e){if("number"!=typeof e)try{e=s.BigNumber.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+C.substring(0,e):w.throwArgumentError("invalid decimal size","decimals",e)}function x(e,t){null==t&&(t=0);const r=E(t),i=(e=s.BigNumber.from(e)).lt(M);i&&(e=e.mul(S));let n=e.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return e=1===r.length?o:o+"."+n,i&&(e="-"+e),e}function I(e,t){null==t&&(t=0);const r=E(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||w.throwArgumentError("invalid decimal value","value",e);const i="-"===e.substring(0,1);i&&(e=e.substring(1)),"."===e&&w.throwArgumentError("missing value","value",e);const n=e.split(".");n.length>2&&w.throwArgumentError("too many decimal points","value",e);let o=n[0],a=n[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&B("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";const f=s.BigNumber.from(o),h=s.BigNumber.from(a);let u=f.mul(r).add(h);return i&&(u=u.mul(S)),u}class F{constructor(e,t,r,i){e!==b&&w.throwError("cannot use FixedFormat constructor; use FixedFormat.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=i,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(i),this._multiplier=E(i),Object.freeze(this)}static from(e){if(e instanceof F)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,i=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const n=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);n||w.throwArgumentError("invalid fixed format","format",e),t="u"!==n[1],r=parseInt(n[2]),i=parseInt(n[3])}else if(e){const n=(t,r,i)=>null==e[t]?i:(typeof e[t]!==r&&w.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=n("signed","boolean",t),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&w.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&w.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new F(b,t,r,i)}}class P{constructor(e,t,r,i){e!==b&&w.throwError("cannot use FixedNumber constructor; use FixedNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&w.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=P.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(D.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=P.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(D.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&w.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=P.from("1"+C.substring(0,e),this.format),i=k.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&w.throwArgumentError("invalid byte width","width",e);const t=s.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return n.hexZeroPad(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return P.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||s.isBigNumberish(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),P.fromString(x(e,t),F.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=F.from(t),i=I(e,r.decimals);!r.signed&&i.lt(M)&&B("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=n.hexZeroPad(o,r.width/8));const s=x(i,r.decimals);return new P(b,o,s,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=F.from(t);if(n.arrayify(e).length>r.width/8)throw new Error("overflow");let i=s.BigNumber.from(e);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=x(i,r.decimals);return new P(b,o,a,r)}static from(e,t){if("string"==typeof e)return P.fromString(e,t);if(n.isBytes(e))return P.fromBytes(e,t);try{return P.fromValue(e,0,t)}catch(e){if(e.code!==s.Logger.errors.INVALID_ARGUMENT)throw e}return w.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const D=P.from(1),k=P.from("0.5");function R(e){const t=s.toUtf8Bytes(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return n.hexlify(n.concat([t,c.HashZero]).slice(0,32))}function T(e){const t=n.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return s.toUtf8String(t.slice(0,r))}function N(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,i={};return e.split(",").forEach((e=>{let n=e.split(":");r+=parseInt(n[0],16),i[r]=t(n[1])})),i}function O(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let i=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:i,h:t}}))}function L(e,t){let r=0;for(let i=0;i<t.length;i++){let n=t[i];if(r+=n.l,e>=r&&e<=r+n.h&&(e-r)%(n.d||1)==0){if(n.e&&-1!==n.e.indexOf(e-r))continue;return n}}return null}const U=O("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),q="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),K=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],H=N("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),z=N("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),_=N("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),G=O("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Q(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=s.toUtf8CodePoints(e);var r;r=t.map((e=>{if(q.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=L(e,K);if(t)return[e+t.s];let r=H[e];if(r)return r;let i=z[e];return i?[e+i[0]]:_[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=s.toUtf8CodePoints(s._toUtf8String(t),s.UnicodeNormalizationForm.NFKC),t.forEach((e=>{if(L(e,G))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(L(e,U))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let i=s._toUtf8String(t);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");return i}var J=Object.freeze({__proto__:null,decode:a.decode,encode:a.encode});function W(e,t){null==t&&(t=1);const r=[],i=r.forEach,n=function(e,t){i.call(e,(function(e){t>0&&Array.isArray(e)?n(e,t-1):r.push(e)}))};return n(e,t),r}function Y(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let i=r(),n=1,o=[0,1];for(let e=1;e<i;e++)o.push(n+=r());let s=r(),a=t;t+=s;let f=0,h=0;function u(){return 0==f&&(h=h<<8|e[t++],f=8),h>>--f&1}const l=Math.pow(2,31),d=l>>>1,c=d>>1,p=l-1;let m=0;for(let e=0;e<31;e++)m=m<<1|u();let g=[],A=0,y=l;for(;;){let e=Math.floor(((m-A+1)*n-1)/y),t=0,r=i;for(;r-t>1;){let i=t+r>>>1;e<o[i]?r=i:t=i}if(0==t)break;g.push(t);let s=A+Math.floor(y*o[t]/n),a=A+Math.floor(y*o[t+1]/n)-1;for(;0==((s^a)&d);)m=m<<1&p|u(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&c;)m=m&d|m<<1&p>>>1|u(),s=s<<1^d,a=(a^d)<<1|d|1;A=s,y=1+a-s}let v=i-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function V(e){return 1&e?~e>>1:e>>1}function j(e,t){let r=Array(e);for(let i=0,n=-1;i<e;i++)r[i]=n+=1+t();return r}function Z(e,t){let r=Array(e);for(let i=0,n=0;i<e;i++)r[i]=n+=V(t());return r}function X(e,t){let r=j(e(),e),i=e(),n=j(i,e),o=function(e,t){let r=Array(e);for(let i=0;i<e;i++)r[i]=1+t();return r}(i,e);for(let e=0;e<i;e++)for(let t=0;t<o[e];t++)r.push(n[e]+t);return t?r.map((e=>t[e])):r}function $(e,t,r){let i=Array(e).fill(void 0).map((()=>[]));for(let n=0;n<t;n++)Z(e,r).forEach(((e,t)=>i[t].push(e)));return i}function ee(e,t){let r=1+t(),i=t(),n=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return W($(n.length,1+e,t).map(((e,t)=>{const o=e[0],s=e.slice(1);return Array(n[t]).fill(void 0).map(((e,t)=>{let n=t*i;return[o+t*r,s.map((e=>e+n))]}))})))}function te(e,t){return $(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const re=Y(a.decode("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyEC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BBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),ie=new Set(X(re)),ne=new Set(X(re)),oe=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(ee(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(te(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const i=e[r];t[i[0]]=i[1]}return t}(W(t))}(re),se=function(e){let t=X(e).sort(((e,t)=>e-t));return function r(){let i=[];for(;;){let n=X(e,t);if(0==n.length)break;i.push({set:new Set(n),node:r()})}i.sort(((e,t)=>t.set.size-e.set.size));let n=e(),o=n%3;n=n/3|0;let s=!!(1&n);return n>>=1,{branches:i,valid:o,fe0f:s,save:1==n,check:2==n}}()}(re),ae=45,fe=95;function he(e){return s.toUtf8CodePoints(e)}function ue(e){return e.filter((e=>65039!=e))}function le(e){for(let t of e.split(".")){let e=he(t);try{for(let t=e.lastIndexOf(fe)-1;t>=0;t--)if(e[t]!==fe)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===ae&&e[3]===ae)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function de(e){return le(function(e,t){let r=he(e).reverse(),i=[];for(;r.length;){let e=ce(r);if(e){i.push(...t(e));continue}let n=r.pop();if(ie.has(n)){i.push(n);continue}if(ne.has(n))continue;let o=oe[n];if(!o)throw new Error(`Disallowed codepoint: 0x${n.toString(16).toUpperCase()}`);i.push(...o)}return le((n=String.fromCodePoint(...i),n.normalize("NFC")));var n}(e,ue))}function ce(e,t){var r;let i,n,o=se,s=[],a=e.length;for(t&&(t.length=0);a;){let f=e[--a];if(o=null===(r=o.branches.find((e=>e.set.has(f))))||void 0===r?void 0:r.node,!o)break;if(o.save)n=f;else if(o.check&&f===n)break;s.push(f),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(i=s.slice(),2==o.valid&&i.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return i}const pe=new s.Logger(a.version),me=new Uint8Array(32);function ge(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Ae(e){const t=s.toUtf8Bytes(de(e)),r=[];if(0===e.length)return r;let i=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(ge(t.slice(i,e))),i=e+1)}if(i>=t.length)throw new Error("invalid ENS name; empty component");return r.push(ge(t.slice(i))),r}function ye(e){try{return 0!==Ae(e).length}catch(e){}return!1}function ve(e){"string"!=typeof e&&pe.throwArgumentError("invalid ENS name; not a string","name",e);let t=me;const r=Ae(e);for(;r.length;)t=o.keccak256(n.concat([t,o.keccak256(r.pop())]));return n.hexlify(t)}function we(e){return n.hexlify(n.concat(Ae(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}me.fill(0);const be="Ethereum Signed Message:\n";function Me(e){return"string"==typeof e&&(e=s.toUtf8Bytes(e)),o.keccak256(n.concat([s.toUtf8Bytes(be),s.toUtf8Bytes(String(e.length)),e]))}class Se{constructor(e){f.defineReadOnly(this,"alphabet",e),f.defineReadOnly(this,"base",e.length),f.defineReadOnly(this,"_alphabetMap",{}),f.defineReadOnly(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=n.arrayify(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let i=t[e];for(let e=0;e<r.length;++e)i+=r[e]<<8,r[e]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}let i="";for(let e=0;0===t[e]&&e<t.length-1;++e)i+=this._leader;for(let e=r.length-1;e>=0;--e)i+=this.alphabet[r[e]];return i}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let i=this._alphabetMap[e[r]];if(void 0===i)throw new Error("Non-base"+this.base+" character");let n=i;for(let e=0;e<t.length;++e)n+=t[e]*this.base,t[e]=255&n,n>>=8;for(;n>0;)t.push(255&n),n>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return n.arrayify(new Uint8Array(t.reverse()))}}const Be=new Se("abcdefghijklmnopqrstuvwxyz234567"),Ce=new Se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Ee,xe=Object.freeze({__proto__:null,BaseX:Se,Base32:Be,Base58:Ce});exports.SupportedAlgorithm=void 0,(Ee=exports.SupportedAlgorithm||(exports.SupportedAlgorithm={})).sha256="sha256",Ee.sha512="sha512";const Ie=new s.Logger("sha2/5.7.0");function Fe(e){return"0x"+u.hash.ripemd160().update(n.arrayify(e)).digest("hex")}function Pe(e){return"0x"+u.hash.sha256().update(n.arrayify(e)).digest("hex")}function De(e){return"0x"+u.hash.sha512().update(n.arrayify(e)).digest("hex")}function ke(e,t,r){return exports.SupportedAlgorithm[e]||Ie.throwError("unsupported algorithm "+e,s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+u.hash.hmac(u.hash[e],n.arrayify(t)).update(n.arrayify(r)).digest("hex")}var Re={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:h.require$$1.Buffer}catch(e){}function s(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function f(e,t,i,n){for(var o=0,s=0,a=Math.min(e.length,i),f=t;f<a;f++){var h=e.charCodeAt(f)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<n,"Invalid character"),o+=s}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,u=r;u<a;u+=i)h=f(e,u,u+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=f(e,u,e.length,t),u=0;u<s;u++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype._move=function(e){u(e,this)},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=f>>>26,l=67108863&f,d=Math.min(h,t.length-1),c=Math.max(0,h-e.length+1);c<=d;c++){var p=h-c|0;u+=(s=(n=0|e.words[p])*(o=0|t.words[c])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?d[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],u=p[e];i="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(u).toString(e);i=(l=l.idivn(u)).isZero()?m+i:d[h-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},n.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},n.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},n.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},n.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var i,n,o,s=e.words,a=t.words,f=r.words,h=0,u=0|s[0],l=8191&u,d=u>>>13,c=0|s[1],p=8191&c,m=c>>>13,g=0|s[2],A=8191&g,y=g>>>13,v=0|s[3],w=8191&v,b=v>>>13,M=0|s[4],S=8191&M,B=M>>>13,C=0|s[5],E=8191&C,x=C>>>13,I=0|s[6],F=8191&I,P=I>>>13,D=0|s[7],k=8191&D,R=D>>>13,T=0|s[8],N=8191&T,O=T>>>13,L=0|s[9],U=8191&L,q=L>>>13,K=0|a[0],H=8191&K,z=K>>>13,_=0|a[1],G=8191&_,Q=_>>>13,J=0|a[2],W=8191&J,Y=J>>>13,V=0|a[3],j=8191&V,Z=V>>>13,X=0|a[4],$=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],fe=8191&ae,he=ae>>>13,ue=0|a[8],le=8191&ue,de=ue>>>13,ce=0|a[9],pe=8191&ce,me=ce>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,H))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(d,H)|0))<<13)|0;h=((o=Math.imul(d,z))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,H),n=(n=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var Ae=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,Q)|0)+Math.imul(d,G)|0))<<13)|0;h=((o=o+Math.imul(d,Q)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(A,H),n=(n=Math.imul(A,z))+Math.imul(y,H)|0,o=Math.imul(y,z),i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Q)|0;var ye=(h+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,H),n=(n=Math.imul(w,z))+Math.imul(b,H)|0,o=Math.imul(b,z),i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Q)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var ve=(h+(i=i+Math.imul(l,j)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(d,j)|0))<<13)|0;h=((o=o+Math.imul(d,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,H),n=(n=Math.imul(S,z))+Math.imul(B,H)|0,o=Math.imul(B,z),i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Q)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,j)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,$)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(d,$)|0))<<13)|0;h=((o=o+Math.imul(d,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(E,H),n=(n=Math.imul(E,z))+Math.imul(x,H)|0,o=Math.imul(x,z),i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,Q)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,i=i+Math.imul(A,j)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(y,j)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var be=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(d,re)|0))<<13)|0;h=((o=o+Math.imul(d,ie)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(F,H),n=(n=Math.imul(F,z))+Math.imul(P,H)|0,o=Math.imul(P,z),i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,Q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(w,j)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(b,j)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(d,oe)|0))<<13)|0;h=((o=o+Math.imul(d,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(k,H),n=(n=Math.imul(k,z))+Math.imul(R,H)|0,o=Math.imul(R,z),i=i+Math.imul(F,G)|0,n=(n=n+Math.imul(F,Q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Q)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(S,j)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(B,j)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,fe)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(d,fe)|0))<<13)|0;h=((o=o+Math.imul(d,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,H),n=(n=Math.imul(N,z))+Math.imul(O,H)|0,o=Math.imul(O,z),i=i+Math.imul(k,G)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,Q)|0,i=i+Math.imul(F,W)|0,n=(n=n+Math.imul(F,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(E,j)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(x,j)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var Be=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;h=((o=o+Math.imul(d,de)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(U,H),n=(n=Math.imul(U,z))+Math.imul(q,H)|0,o=Math.imul(q,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Q)|0,i=i+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(F,j)|0,n=(n=n+Math.imul(F,Z)|0)+Math.imul(P,j)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(A,fe)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,de)|0;var Ce=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(d,pe)|0))<<13)|0;h=((o=o+Math.imul(d,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Q))+Math.imul(q,G)|0,o=Math.imul(q,Q),i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(k,j)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(R,j)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(F,$)|0,n=(n=n+Math.imul(F,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(w,fe)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,de)|0;var Ee=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(U,W),n=(n=Math.imul(U,Y))+Math.imul(q,W)|0,o=Math.imul(q,Y),i=i+Math.imul(N,j)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(O,j)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(F,re)|0,n=(n=n+Math.imul(F,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(S,fe)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(B,fe)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,de)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,de)|0;var xe=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((o=o+Math.imul(y,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(U,j),n=(n=Math.imul(U,Z))+Math.imul(q,j)|0,o=Math.imul(q,Z),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,i=i+Math.imul(k,re)|0,n=(n=n+Math.imul(k,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(F,oe)|0,n=(n=n+Math.imul(F,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,i=i+Math.imul(E,fe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,de)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,de)|0;var Ie=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,ee))+Math.imul(q,$)|0,o=Math.imul(q,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ie)|0,i=i+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,i=i+Math.imul(F,fe)|0,n=(n=n+Math.imul(F,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0,i=i+Math.imul(E,le)|0,n=(n=n+Math.imul(E,de)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,de)|0;var Fe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,i=Math.imul(U,re),n=(n=Math.imul(U,ie))+Math.imul(q,re)|0,o=Math.imul(q,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,i=i+Math.imul(k,fe)|0,n=(n=n+Math.imul(k,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0,i=i+Math.imul(F,le)|0,n=(n=n+Math.imul(F,de)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,de)|0;var Pe=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(U,oe),n=(n=Math.imul(U,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),i=i+Math.imul(N,fe)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0,i=i+Math.imul(k,le)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,de)|0;var De=(h+(i=i+Math.imul(F,pe)|0)|0)+((8191&(n=(n=n+Math.imul(F,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((o=o+Math.imul(P,me)|0)+(n>>>13)|0)+(De>>>26)|0,De&=67108863,i=Math.imul(U,fe),n=(n=Math.imul(U,he))+Math.imul(q,fe)|0,o=Math.imul(q,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,de)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,de)|0;var ke=(h+(i=i+Math.imul(k,pe)|0)|0)+((8191&(n=(n=n+Math.imul(k,me)|0)+Math.imul(R,pe)|0))<<13)|0;h=((o=o+Math.imul(R,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(U,le),n=(n=Math.imul(U,de))+Math.imul(q,le)|0,o=Math.imul(q,de);var Re=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((o=o+Math.imul(O,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Te=(h+(i=Math.imul(U,pe))|0)+((8191&(n=(n=Math.imul(U,me))+Math.imul(q,pe)|0))<<13)|0;return h=((o=Math.imul(q,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,f[0]=ge,f[1]=Ae,f[2]=ye,f[3]=ve,f[4]=we,f[5]=be,f[6]=Me,f[7]=Se,f[8]=Be,f[9]=Ce,f[10]=Ee,f[11]=xe,f[12]=Ie,f[13]=Fe,f[14]=Pe,f[15]=De,f[16]=ke,f[17]=Re,f[18]=Te,0!==h&&(f[19]=h,r.length++),r};function A(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,f=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=f;h++){var u=o-h,l=(0|e.words[u])*(0|t.words[h]),d=67108863&l;a=67108863&(d=d+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return A(e,t,r)}Math.imul||(g=m),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?A(this,e,t):y(this,e,t)},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),y(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,f=(0|this.words[t])-a<<i;this.words[t]=f|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,f=i;if(n-=s,n=Math.max(0,n),f){for(var h=0;h<s;h++)f.words[h]=this.words[h];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var l=0|this.words[h];this.words[h]=u<<26-o|l>>>o,u=l&a}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var f=(0|e.words[n])*t;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,f=i.length-o.length;if("mod"!==t){(a=new n(null)).length=f+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(o,1,f);0===u.negative&&(i=u,a&&(a.words[f]=1));for(var l=f-1;l>=0;l--){var d=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(o,d,l);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=d)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/e|0,i=o%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),l=t.clone();!t.isZero();){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(l)),a.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(f)):(i.isub(t),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),f=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,u=1;0==(t.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var l=0,d=1;0==(i.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new C(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(b,w),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(M,w),i(S,w),i(B,w),B.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new M;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return v[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},C.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var l=this.pow(u,o),d=this.pow(e,o.addn(1).iushrn(1)),c=this.pow(e,o),p=s;0!==c.cmp(a);){for(var m=c,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var A=this.pow(l,new n(1).iushln(p-g-1));d=d.redMul(A),l=A.redSqr(),c=c.redMul(l),p=g}return d},C.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},C.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,f=t.bitLength()%26;for(0===f&&(f=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var l=h>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===u)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}f=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new E(e)},i(E,C),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Re,o.commonjsGlobal);var Te=Re.exports;function Ne(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Oe=Le;function Le(e,t){if(!e)throw new Error(t||"Assertion failed")}Le.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ue=Ne((function(e,t){var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}})),qe=Ne((function(e,t){var r=t;r.assert=Oe,r.toArray=Ue.toArray,r.zero2=Ue.zero2,r.toHex=Ue.toHex,r.encode=Ue.encode,r.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<<t+1,o=e.clone(),s=0;s<i.length;s++){var a,f=o.andln(n-1);o.isOdd()?(a=f>(n>>1)-1?(n>>1)-f:f,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var s,a,f=e.andln(3)+n&3,h=t.andln(3)+o&3;3===f&&(f=-1),3===h&&(h=-1),s=0==(1&f)?0:3!==(i=e.andln(7)+n&7)&&5!==i||2!==h?f:-f,r[0].push(s),a=0==(1&h)?0:3!==(i=t.andln(7)+o&7)&&5!==i||2!==f?h:-h,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new Te(e,"hex","le")}})),Ke=qe.getNAF,He=qe.getJSF,ze=qe.assert;function _e(e,t){this.type=e,this.p=new Te(t.p,16),this.red=t.prime?Te.red(t.prime):Te.mont(this.p),this.zero=new Te(0).toRed(this.red),this.one=new Te(1).toRed(this.red),this.two=new Te(2).toRed(this.red),this.n=t.n&&new Te(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ge=_e;function Qe(e,t){this.curve=e,this.type=t,this.precomputed=null}_e.prototype.point=function(){throw new Error("Not implemented")},_e.prototype.validate=function(){throw new Error("Not implemented")},_e.prototype._fixedNafMul=function(e,t){ze(e.precomputed);var r=e._getDoubles(),i=Ke(t,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,s,a=[];for(o=0;o<i.length;o+=r.step){s=0;for(var f=o+r.step-1;f>=o;f--)s=(s<<1)+i[f];a.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o<a.length;o++)(s=a[o])===l?u=u.mixedAdd(r.points[o]):s===-l&&(u=u.mixedAdd(r.points[o].neg()));h=h.add(u)}return h.toP()},_e.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=Ke(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var f=0;a>=0&&0===o[a];a--)f++;if(a>=0&&f++,s=s.dblp(f),a<0)break;var h=o[a];ze(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},_e.prototype._wnafMulAdd=function(e,t,r,i,n){var o,s,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(o=0;o<i;o++){var d=(a=t[o])._getNAFPoints(e);f[o]=d.wnd,h[o]=d.points}for(o=i-1;o>=1;o-=2){var c=o-1,p=o;if(1===f[c]&&1===f[p]){var m=[t[c],null,null,t[p]];0===t[c].y.cmp(t[p].y)?(m[1]=t[c].add(t[p]),m[2]=t[c].toJ().mixedAdd(t[p].neg())):0===t[c].y.cmp(t[p].y.redNeg())?(m[1]=t[c].toJ().mixedAdd(t[p]),m[2]=t[c].add(t[p].neg())):(m[1]=t[c].toJ().mixedAdd(t[p]),m[2]=t[c].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],A=He(r[c],r[p]);for(l=Math.max(A[0].length,l),u[c]=new Array(l),u[p]=new Array(l),s=0;s<l;s++){var y=0|A[0][s],v=0|A[1][s];u[c][s]=g[3*(y+1)+(v+1)],u[p][s]=0,h[c]=m}}else u[c]=Ke(r[c],f[c],this._bitLength),u[p]=Ke(r[p],f[p],this._bitLength),l=Math.max(u[c].length,l),l=Math.max(u[p].length,l)}var w=this.jpoint(null,null,null),b=this._wnafT4;for(o=l;o>=0;o--){for(var M=0;o>=0;){var S=!0;for(s=0;s<i;s++)b[s]=0|u[s][o],0!==b[s]&&(S=!1);if(!S)break;M++,o--}if(o>=0&&M++,w=w.dblp(M),o<0)break;for(s=0;s<i;s++){var B=b[s];0!==B&&(B>0?a=h[s][B-1>>1]:B<0&&(a=h[s][-B-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<i;o++)h[o]=null;return n?w:w.toP()},_e.BasePoint=Qe,Qe.prototype.eq=function(){throw new Error("Not implemented")},Qe.prototype.validate=function(){return this.curve.validate(this)},_e.prototype.decodePoint=function(e,t){e=qe.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?ze(e[e.length-1]%2==0):7===e[0]&&ze(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},Qe.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Qe.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},Qe.prototype.encode=function(e,t){return qe.encode(this._encode(t),e)},Qe.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Qe.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},Qe.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},Qe.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},Qe.prototype._getBeta=function(){return null},Qe.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Je=Ne((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),We=qe.assert;function Ye(e){Ge.call(this,"short",e),this.a=new Te(e.a,16).toRed(this.red),this.b=new Te(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Je(Ye,Ge);var Ve=Ye;function je(e,t,r,i){Ge.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Te(t,16),this.y=new Te(r,16),i&&(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 Ze(e,t,r,i){Ge.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Te(0)):(this.x=new Te(t,16),this.y=new Te(r,16),this.z=new Te(i,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}Ye.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new Te(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new Te(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],We(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new Te(e.a,16),b:new Te(e.b,16)}})):this._getEndoBasis(r)}}},Ye.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Te.mont(e),r=new Te(2).toRed(t).redInvm(),i=r.redNeg(),n=new Te(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},Ye.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),c=new Te(1),p=new Te(0),m=new Te(0),g=new Te(1),A=0;0!==l.cmpn(0);){var y=d.div(l);f=d.sub(y.mul(l)),h=m.sub(y.mul(c));var v=g.sub(y.mul(p));if(!i&&f.cmp(u)<0)t=a.neg(),r=c,i=f.neg(),n=h;else if(i&&2==++A)break;a=f,d=l,l=f,m=c,c=h,g=p,p=v}o=f.neg(),s=h;var w=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},Ye.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),f=n.mul(r.b),h=o.mul(i.b);return{k1:e.sub(s).sub(a),k2:f.add(h).neg()}},Ye.prototype.pointFromX=function(e,t){(e=new Te(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},Ye.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Ye.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*o]=a,i[2*o+1]=f,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),u=0;u<2*o;u++)i[u]=null,n[u]=null;return h},Je(je,Ge.BasePoint),Ye.prototype.point=function(e,t,r){return new je(this,e,t,r)},Ye.prototype.pointFromJSON=function(e,t){return je.fromJSON(this,e,t)},je.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},je.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]},je.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},je.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)+">"},je.prototype.isInfinity=function(){return this.inf},je.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},je.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},je.prototype.getX=function(){return this.x.fromRed()},je.prototype.getY=function(){return this.y.fromRed()},je.prototype.mul=function(e){return e=new Te(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},je.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},je.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},je.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},je.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},je.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Je(Ze,Ge.BasePoint),Ye.prototype.jpoint=function(e,t,r){return new Ze(this,e,t,r)},Ze.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},Ze.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ze.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=o.redSub(s);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),l=i.redMul(h),d=f.redSqr().redIAdd(u).redISub(l).redISub(l),c=f.redMul(l.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,c,p)},Ze.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),h=f.redMul(s),u=r.redMul(f),l=a.redSqr().redIAdd(h).redISub(u).redISub(u),d=a.redMul(u.redISub(l)).redISub(n.redMul(h)),c=this.z.redMul(s);return this.curve.jpoint(l,d,c)},Ze.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),h=s.redAdd(s);for(t=0;t<e;t++){var u=o.redSqr(),l=h.redSqr(),d=l.redSqr(),c=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(f)),p=o.redMul(l),m=c.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),A=c.redMul(g);A=A.redIAdd(A).redISub(d);var y=h.redMul(a);t+1<e&&(f=f.redMul(d)),o=m,a=y,h=A}return this.curve.jpoint(o,h.redMul(n),a)},Ze.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ze.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),f=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=f,t=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),c=this.x.redAdd(l).redSqr().redISub(u).redISub(d);c=c.redIAdd(c);var p=u.redAdd(u).redIAdd(u),m=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(c).redISub(c),t=p.redMul(c.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Ze.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),f=a.redSqr().redISub(s).redISub(s);e=f;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),c=this.x.redSub(u).redMul(this.x.redAdd(u));c=c.redAdd(c).redIAdd(c);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);e=c.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=c.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Ze.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),f=t.redAdd(t),h=(f=f.redIAdd(f)).redMul(s),u=a.redSqr().redISub(h.redAdd(h)),l=h.redISub(u),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var c=a.redMul(l).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(u,c,p)},Ze.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),f=i.redIAdd(i);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(f),u=t.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(a).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(h.redMul(f.redISub(h)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var c=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,d,c)},Ze.prototype.mul=function(e,t){return e=new Te(e,t),this.curve._wnafMul(this,e)},Ze.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},Ze.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Ze.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)+">"},Ze.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Xe=Ne((function(e,t){var r=t;r.base=Ge,r.short=Ve,r.mont=null,r.edwards=null})),$e=Ne((function(e,t){var r,i=t,n=qe.assert;function o(e){"short"===e.type?this.curve=new Xe.short(e):"edwards"===e.type?this.curve=new Xe.edwards(e):this.curve=new Xe.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("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:u.hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:u.hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:u.hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:u.hash.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"]}),s("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:u.hash.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.hash.sha256,gRed:!1,g:["9"]}),s("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:u.hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("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:u.hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function et(e){if(!(this instanceof et))return new et(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ue.toArray(e.entropy,e.entropyEnc||"hex"),r=Ue.toArray(e.nonce,e.nonceEnc||"hex"),i=Ue.toArray(e.pers,e.persEnc||"hex");Oe(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var tt=et;et.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},et.prototype._hmac=function(){return new u.hash.hmac(this.hash,this.K)},et.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},et.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=Ue.toArray(e,t),r=Ue.toArray(r,i),Oe(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},et.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=Ue.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,e);return this._update(r),this._reseed++,Ue.encode(o,t)};var rt=qe.assert;function it(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var nt=it;it.fromPublic=function(e,t,r){return t instanceof it?t:new it(e,{pub:t,pubEnc:r})},it.fromPrivate=function(e,t,r){return t instanceof it?t:new it(e,{priv:t,privEnc:r})},it.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},it.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},it.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},it.prototype._importPrivate=function(e,t){this.priv=new Te(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},it.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?rt(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||rt(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},it.prototype.derive=function(e){return e.validate()||rt(e.validate(),"public point not validated"),e.mul(this.priv).getX()},it.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},it.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},it.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var ot=qe.assert;function st(e,t){if(e instanceof st)return e;this._importDER(e,t)||(ot(e.r&&e.s,"Signature without r or s"),this.r=new Te(e.r,16),this.s=new Te(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var at=st;function ft(){this.place=0}function ht(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function ut(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function lt(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}st.prototype._importDER=function(e,t){e=qe.toArray(e,t);var r=new ft;if(48!==e[r.place++])return!1;var i=ht(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=ht(e,r);if(!1===n)return!1;var o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=ht(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new Te(o),this.s=new Te(a),this.recoveryParam=null,!0},st.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=ut(t),r=ut(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];lt(i,t.length),(i=i.concat(t)).push(2),lt(i,r.length);var n=i.concat(r),o=[48];return lt(o,n.length),o=o.concat(n),qe.encode(o,e)};var dt=function(){throw new Error("unsupported")},ct=qe.assert;function pt(e){if(!(this instanceof pt))return new pt(e);"string"==typeof e&&(ct(Object.prototype.hasOwnProperty.call($e,e),"Unknown curve "+e),e=$e[e]),e instanceof $e.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var mt=pt;pt.prototype.keyPair=function(e){return new nt(this,e)},pt.prototype.keyFromPrivate=function(e,t){return nt.fromPrivate(this,e,t)},pt.prototype.keyFromPublic=function(e,t){return nt.fromPublic(this,e,t)},pt.prototype.genKeyPair=function(e){e||(e={});for(var t=new tt({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||dt(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new Te(2));;){var n=new Te(t.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},pt.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},pt.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Te(e,16));for(var n=this.n.byteLength(),o=t.getPrivate().toArray("be",n),s=e.toArray("be",n),a=new tt({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new Te(1)),h=0;;h++){var u=i.k?i.k(h):new Te(a.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(f)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var d=l.getX(),c=d.umod(this.n);if(0!==c.cmpn(0)){var p=u.invm(this.n).mul(c.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(l.getY().isOdd()?1:0)|(0!==d.cmp(c)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new at({r:c,s:p,recoveryParam:m})}}}}}},pt.prototype.verify=function(e,t,r,i){e=this._truncateToN(new Te(e,16)),r=this.keyFromPublic(r,i);var n=(t=new at(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),f=a.mul(e).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},pt.prototype.recoverPubKey=function(e,t,r,i){ct((3&r)===r,"The recovery param is more than two bits"),t=new at(t,i);var n=this.n,o=new Te(e),s=t.r,a=t.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var u=t.r.invm(n),l=n.sub(o).mul(u).umod(n),d=a.mul(u).umod(n);return this.g.mulAdd(l,s,d)},pt.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new at(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var gt=Ne((function(e,t){var r=t;r.version="6.5.4",r.utils=qe,r.rand=function(){throw new Error("unsupported")},r.curve=Xe,r.curves=$e,r.ec=mt,r.eddsa=null})).ec;const At=new s.Logger("signing-key/5.7.0");let yt=null;function vt(){return yt||(yt=new gt("secp256k1")),yt}class wt{constructor(e){f.defineReadOnly(this,"curve","secp256k1"),f.defineReadOnly(this,"privateKey",n.hexlify(e)),32!==n.hexDataLength(this.privateKey)&&At.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=vt().keyFromPrivate(n.arrayify(this.privateKey));f.defineReadOnly(this,"publicKey","0x"+t.getPublic(!1,"hex")),f.defineReadOnly(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),f.defineReadOnly(this,"_isSigningKey",!0)}_addPoint(e){const t=vt().keyFromPublic(n.arrayify(this.publicKey)),r=vt().keyFromPublic(n.arrayify(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=vt().keyFromPrivate(n.arrayify(this.privateKey)),r=n.arrayify(e);32!==r.length&&At.throwArgumentError("bad digest length","digest",e);const i=t.sign(r,{canonical:!0});return n.splitSignature({recoveryParam:i.recoveryParam,r:n.hexZeroPad("0x"+i.r.toString(16),32),s:n.hexZeroPad("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const t=vt().keyFromPrivate(n.arrayify(this.privateKey)),r=vt().keyFromPublic(n.arrayify(Mt(e)));return n.hexZeroPad("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function bt(e,t){const r=n.splitSignature(t),i={r:n.arrayify(r.r),s:n.arrayify(r.s)};return"0x"+vt().recoverPubKey(n.arrayify(e),i,r.recoveryParam).encode("hex",!1)}function Mt(e,t){const r=n.arrayify(e);if(32===r.length){const e=new wt(r);return t?"0x"+vt().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?n.hexlify(r):"0x"+vt().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+vt().keyFromPublic(r).getPublic(!0,"hex"):n.hexlify(r):At.throwArgumentError("invalid public or private key","key","[REDACTED]")}var St=Object.freeze({__proto__:null,SigningKey:wt,recoverPublicKey:bt,computePublicKey:Mt});const Bt=new s.Logger("wordlists/5.7.0");class Ct{constructor(e){Bt.checkAbstract(new.target,Ct),f.defineReadOnly(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const i=e.getWord(r);if(r!==e.getWordIndex(i))return"0x";t.push(i)}return s.id(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let Et=null;function xt(e){if(null==Et&&(Et="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Ct.check(e)))throw Et=null,new Error("BIP39 Wordlist for en (English) FAILED")}const It=new class extends Ct{constructor(){super("en")}getWord(e){return xt(this),Et[e]}getWordIndex(e){return xt(this),Et.indexOf(e)}};Ct.register(It);const Ft={en:It},Pt=new s.Logger("hdnode/5.7.0"),Dt=s.BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),kt=s.toUtf8Bytes("Bitcoin seed"),Rt=2147483648;function Tt(e){return(1<<e)-1<<8-e}function Nt(e){return n.hexZeroPad(n.hexlify(e),32)}function Ot(e){return Ce.encode(n.concat([e,n.hexDataSlice(Pe(Pe(e)),0,4)]))}function Lt(e){if(null==e)return Ft.en;if("string"==typeof e){const t=Ft[e];return null==t&&Pt.throwArgumentError("unknown locale","wordlist",e),t}return e}const Ut={},qt="m/44'/60'/0'/0/0";class Kt{constructor(e,t,r,i,o,s,a,h){if(e!==Ut)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new wt(t);f.defineReadOnly(this,"privateKey",e.privateKey),f.defineReadOnly(this,"publicKey",e.compressedPublicKey)}else f.defineReadOnly(this,"privateKey",null),f.defineReadOnly(this,"publicKey",n.hexlify(r));f.defineReadOnly(this,"parentFingerprint",i),f.defineReadOnly(this,"fingerprint",n.hexDataSlice(Fe(Pe(this.publicKey)),0,4)),f.defineReadOnly(this,"address",l.computeAddress(this.publicKey)),f.defineReadOnly(this,"chainCode",o),f.defineReadOnly(this,"index",s),f.defineReadOnly(this,"depth",a),null==h?(f.defineReadOnly(this,"mnemonic",null),f.defineReadOnly(this,"path",null)):"string"==typeof h?(f.defineReadOnly(this,"mnemonic",null),f.defineReadOnly(this,"path",h)):(f.defineReadOnly(this,"mnemonic",h),f.defineReadOnly(this,"path",h.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Ot(n.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",n.hexlify(this.depth),this.parentFingerprint,n.hexZeroPad(n.hexlify(this.index),4),this.chainCode,null!=this.privateKey?n.concat(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Kt(Ut,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&Rt){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(n.arrayify(this.privateKey),1),t&&(t+="'")}else r.set(n.arrayify(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const i=n.arrayify(ke(exports.SupportedAlgorithm.sha512,this.chainCode,r)),o=i.slice(0,32),a=i.slice(32);let f=null,h=null;if(this.privateKey)f=Nt(s.BigNumber.from(o).add(this.privateKey).mod(Dt));else{h=new wt(n.hexlify(o))._addPoint(this.publicKey)}let u=t;const l=this.mnemonic;return l&&(u=Object.freeze({phrase:l.phrase,path:t,locale:l.locale||"en"})),new Kt(Ut,f,h,this.fingerprint,Nt(a),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const i=t[e];if(i.match(/^[0-9]+'$/)){const e=parseInt(i.substring(0,i.length-1));if(e>=Rt)throw new Error("invalid path index - "+i);r=r._derive(Rt+e)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);{const e=parseInt(i);if(e>=Rt)throw new Error("invalid path index - "+i);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=n.arrayify(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const i=n.arrayify(ke(exports.SupportedAlgorithm.sha512,kt,r));return new Kt(Ut,Nt(i.slice(0,32)),null,"0x00000000",Nt(i.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=_t(zt(e,r=Lt(r)),r),Kt._fromSeed(Ht(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Kt._fromSeed(e,null)}static fromExtendedKey(e){const t=Ce.decode(e);82===t.length&&Ot(t.slice(0,78))===e||Pt.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],i=n.hexlify(t.slice(5,9)),o=parseInt(n.hexlify(t.slice(9,13)).substring(2),16),s=n.hexlify(t.slice(13,45)),a=t.slice(45,78);switch(n.hexlify(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Kt(Ut,null,n.hexlify(a),i,s,o,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Kt(Ut,n.hexlify(a.slice(1)),null,i,s,o,r,null)}return Pt.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Ht(e,t){t||(t="");const r=s.toUtf8Bytes("mnemonic"+t,s.UnicodeNormalizationForm.NFKD);return function(e,t,r,i,o){let s;e=n.arrayify(e),t=n.arrayify(t);let a=1;const f=new Uint8Array(i),h=new Uint8Array(t.length+4);let u,l;h.set(t);for(let d=1;d<=a;d++){h[t.length]=d>>24&255,h[t.length+1]=d>>16&255,h[t.length+2]=d>>8&255,h[t.length+3]=255&d;let c=n.arrayify(ke(o,e,h));s||(s=c.length,l=new Uint8Array(s),a=Math.ceil(i/s),u=i-(a-1)*s),l.set(c);for(let t=1;t<r;t++){c=n.arrayify(ke(o,e,c));for(let e=0;e<s;e++)l[e]^=c[e]}const p=(d-1)*s,m=d===a?u:s;f.set(n.arrayify(l).slice(0,m),p)}return n.hexlify(f)}(s.toUtf8Bytes(e,s.UnicodeNormalizationForm.NFKD),r,2048,64,"sha512")}function zt(e,t){t=Lt(t),Pt.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const i=n.arrayify(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let e=0;e<r.length;e++){let n=t.getWordIndex(r[e].normalize("NFKD"));if(-1===n)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)n&1<<10-e&&(i[o>>3]|=1<<7-o%8),o++}const s=32*r.length/3,a=Tt(r.length/3);if((n.arrayify(Pe(i.slice(0,s/8)))[0]&a)!==(i[i.length-1]&a))throw new Error("invalid checksum");return n.hexlify(i.slice(0,s/8))}function _t(e,t){if(t=Lt(t),(e=n.arrayify(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let i=11;for(let t=0;t<e.length;t++)i>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],i-=8):(r[r.length-1]<<=i,r[r.length-1]|=e[t]>>8-i,r.push(e[t]&(1<<8-i)-1),i+=3);const o=e.length/4,s=n.arrayify(Pe(e))[0]&Tt(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,t.join(r.map((e=>t.getWord(e))))}function Gt(e,t){try{return zt(e,t),!0}catch(e){}return!1}function Qt(e){return("number"!=typeof e||e<0||e>=Rt||e%1)&&Pt.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}var Jt=Object.freeze({__proto__:null,defaultPath:qt,HDNode:Kt,mnemonicToSeed:Ht,mnemonicToEntropy:zt,entropyToMnemonic:_t,isValidMnemonic:Gt,getAccountPath:Qt});const Wt=new s.Logger("random/5.7.0");const Yt=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let Vt=Yt.crypto||Yt.msCrypto;function jt(e){(e<=0||e>1024||e%1||e!=e)&&Wt.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Vt.getRandomValues(t),n.arrayify(t)}function Zt(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),i=e[t];e[t]=e[r],e[r]=i}return e}Vt&&Vt.getRandomValues||(Wt.warn("WARNING: Missing strong random number source"),Vt={getRandomValues:function(e){return Wt.throwError("no secure random source avaialble",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Xt=function(e,t,r,i){return new(r||(r=Promise))((function(n,o){function s(e){try{f(i.next(e))}catch(e){o(e)}}function a(e){try{f(i.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}f((i=i.apply(e,t||[])).next())}))};const $t=new s.Logger("wallet/5.7.0");class er extends t.Signer{constructor(e,t){if(super(),null!=(o=e)&&n.isHexString(o.privateKey,32)&&null!=o.address){const t=new wt(e.privateKey);if(f.defineReadOnly(this,"_signingKey",(()=>t)),f.defineReadOnly(this,"address",l.computeAddress(this.publicKey)),this.address!==r.getAddress(e.address)&&$t.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;f.defineReadOnly(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||qt,locale:t.locale||"en"})));const r=this.mnemonic,i=Kt.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);l.computeAddress(i.privateKey)!==this.address&&$t.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else f.defineReadOnly(this,"_mnemonic",(()=>null))}else{if(wt.isSigningKey(e))"secp256k1"!==e.curve&&$t.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),f.defineReadOnly(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new wt(e);f.defineReadOnly(this,"_signingKey",(()=>t))}f.defineReadOnly(this,"_mnemonic",(()=>null)),f.defineReadOnly(this,"address",l.computeAddress(this.publicKey))}var o;t&&!i.Provider.isProvider(t)&&$t.throwArgumentError("invalid provider","provider",t),f.defineReadOnly(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new er(this,e)}signTransaction(e){return f.resolveProperties(e).then((t=>{null!=t.from&&(r.getAddress(t.from)!==this.address&&$t.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const i=this._signingKey().signDigest(o.keccak256(l.serialize(t)));return l.serialize(t,i)}))}signMessage(e){return Xt(this,void 0,void 0,(function*(){return n.joinSignature(this._signingKey().signDigest(Me(e)))}))}_signTypedData(e,t,r){return Xt(this,void 0,void 0,(function*(){const i=yield a.TypedDataEncoder.resolveNames(e,t,r,(e=>(null==this.provider&&$t.throwError("cannot resolve ENS names without a provider",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return n.joinSignature(this._signingKey().signDigest(a.TypedDataEncoder.hash(i.domain,t,i.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),d.encryptKeystore(this,e,t,r)}static createRandom(e){let t=jt(16);e||(e={}),e.extraEntropy&&(t=n.arrayify(n.hexDataSlice(o.keccak256(n.concat([t,e.extraEntropy])),0,16)));const r=_t(t,e.locale);return er.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return d.decryptJsonWallet(e,t,r).then((e=>new er(e)))}static fromEncryptedJsonSync(e,t){return new er(d.decryptJsonWalletSync(e,t))}static fromMnemonic(e,t,r){return t||(t=qt),new er(Kt.fromMnemonic(e,null,r).derivePath(t))}}function tr(e,t){return l.recoverAddress(Me(e),t)}function rr(e,t,r,i){return l.recoverAddress(a.TypedDataEncoder.hash(e,t,r),i)}var ir=Object.freeze({__proto__:null,Wallet:er,verifyMessage:tr,verifyTypedData:rr});const nr=new RegExp("^bytes([0-9]+)$"),or=new RegExp("^(u?int)([0-9]*)$"),sr=new RegExp("^(.*)\\[([0-9]*)\\]$"),ar="0000000000000000000000000000000000000000000000000000000000000000",fr=new s.Logger("solidity/5.7.0");function hr(e,t,r){switch(e){case"address":return r?n.zeroPad(t,32):n.arrayify(t);case"string":return s.toUtf8Bytes(t);case"bytes":return n.arrayify(t);case"bool":return t=t?"0x01":"0x00",r?n.zeroPad(t,32):n.arrayify(t)}let i=e.match(or);if(i){let o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&fr.throwArgumentError("invalid number type","type",e),r&&(o=256),t=s.BigNumber.from(t).toTwos(o),n.zeroPad(t,o/8)}if(i=e.match(nr),i){const o=parseInt(i[1]);return(String(o)!==i[1]||0===o||o>32)&&fr.throwArgumentError("invalid bytes type","type",e),n.arrayify(t).byteLength!==o&&fr.throwArgumentError(`invalid value for ${e}`,"value",t),r?n.arrayify((t+ar).substring(0,66)):t}if(i=e.match(sr),i&&Array.isArray(t)){const r=i[1];parseInt(i[2]||String(t.length))!=t.length&&fr.throwArgumentError(`invalid array length for ${e}`,"value",t);const o=[];return t.forEach((function(e){o.push(hr(r,e,!0))})),n.concat(o)}return fr.throwArgumentError("invalid type","type",e)}function ur(e,t){e.length!=t.length&&fr.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,i){r.push(hr(e,t[i]))})),n.hexlify(n.concat(r))}function lr(e,t){return o.keccak256(ur(e,t))}function dr(e,t){return Pe(ur(e,t))}var cr=Object.freeze({__proto__:null,pack:ur,keccak256:lr,sha256:dr});const pr=new s.Logger("units/5.7.0"),mr=["wei","kwei","mwei","gwei","szabo","finney","ether"];function gr(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&pr.throwArgumentError("invalid value","value",e);let r=t[0],i="";for("-"===r.substring(0,1)&&(i="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let n="";for(2===t.length&&(n="."+(t[1]||"0"));n.length>2&&"0"===n[n.length-1];)n=n.substring(0,n.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return i+o.join(",")+n}function Ar(e,t){if("string"==typeof t){const e=mr.indexOf(t);-1!==e&&(t=3*e)}return x(e,null!=t?t:18)}function yr(e,t){if("string"!=typeof e&&pr.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=mr.indexOf(t);-1!==e&&(t=3*e)}return I(e,null!=t?t:18)}function vr(e){return Ar(e,18)}function wr(e){return yr(e,18)}var br=Object.freeze({__proto__:null,commify:gr,formatUnits:Ar,parseUnits:yr,formatEther:vr,parseEther:wr}),Mr=Object.freeze({__proto__:null,AbiCoder:m.AbiCoder,defaultAbiCoder:m.defaultAbiCoder,Fragment:m.Fragment,ConstructorFragment:m.ConstructorFragment,ErrorFragment:m.ErrorFragment,EventFragment:m.EventFragment,FunctionFragment:m.FunctionFragment,ParamType:m.ParamType,FormatTypes:m.FormatTypes,checkResultErrors:m.checkResultErrors,Logger:s.Logger,RLP:g.lib_esm,_fetchData:a._fetchData,fetchJson:a.fetchJson,poll:a.poll,checkProperties:f.checkProperties,deepCopy:f.deepCopy,defineReadOnly:f.defineReadOnly,getStatic:f.getStatic,resolveProperties:f.resolveProperties,shallowCopy:f.shallowCopy,arrayify:n.arrayify,concat:n.concat,stripZeros:n.stripZeros,zeroPad:n.zeroPad,isBytes:n.isBytes,isBytesLike:n.isBytesLike,defaultPath:qt,HDNode:Kt,SigningKey:wt,Interface:m.Interface,LogDescription:m.LogDescription,TransactionDescription:m.TransactionDescription,base58:Ce,base64:J,hexlify:n.hexlify,isHexString:n.isHexString,hexConcat:n.hexConcat,hexStripZeros:n.hexStripZeros,hexValue:n.hexValue,hexZeroPad:n.hexZeroPad,hexDataLength:n.hexDataLength,hexDataSlice:n.hexDataSlice,nameprep:Q,_toEscapedUtf8String:s._toEscapedUtf8String,toUtf8Bytes:s.toUtf8Bytes,toUtf8CodePoints:s.toUtf8CodePoints,toUtf8String:s.toUtf8String,Utf8ErrorFuncs:s.Utf8ErrorFuncs,formatBytes32String:R,parseBytes32String:T,dnsEncode:we,hashMessage:Me,namehash:ve,isValidName:ye,id:s.id,_TypedDataEncoder:a.TypedDataEncoder,getAddress:r.getAddress,getIcapAddress:r.getIcapAddress,getContractAddress:r.getContractAddress,getCreate2Address:r.getCreate2Address,isAddress:r.isAddress,formatEther:vr,parseEther:wr,formatUnits:Ar,parseUnits:yr,commify:gr,computeHmac:ke,keccak256:o.keccak256,ripemd160:Fe,sha256:Pe,sha512:De,randomBytes:jt,shuffled:Zt,solidityPack:ur,solidityKeccak256:lr,soliditySha256:dr,splitSignature:n.splitSignature,joinSignature:n.joinSignature,accessListify:l.accessListify,parseTransaction:l.parse,serializeTransaction:l.serialize,TransactionTypes:l.TransactionTypes,getJsonWalletAddress:d.getJsonWalletAddress,computeAddress:l.computeAddress,recoverAddress:l.recoverAddress,computePublicKey:Mt,recoverPublicKey:bt,verifyMessage:tr,verifyTypedData:rr,getAccountPath:Qt,mnemonicToEntropy:zt,entropyToMnemonic:_t,isValidMnemonic:Gt,mnemonicToSeed:Ht,get SupportedAlgorithm(){return exports.SupportedAlgorithm},get UnicodeNormalizationForm(){return s.UnicodeNormalizationForm},get Utf8ErrorReason(){return s.Utf8ErrorReason},Indexed:m.Indexed});const Sr="ethers/5.7.2",Br=new s.Logger(Sr);var Cr=Object.freeze({__proto__:null,Signer:t.Signer,Wallet:er,VoidSigner:t.VoidSigner,getDefaultProvider:p.getDefaultProvider,providers:v,BaseContract:e.BaseContract,Contract:e.Contract,ContractFactory:e.ContractFactory,BigNumber:s.BigNumber,FixedNumber:P,constants:y,get errors(){return s.ErrorCode},logger:Br,utils:Mr,wordlists:Ft,version:Sr,Wordlist:Ct});exports.FixedNumber=P,exports.Wallet=er,exports.Wordlist=Ct,exports.computeHmac=ke,exports.dnsEncode=we,exports.ensNormalize=function(e){return Ae(e).map((e=>s.toUtf8String(e))).join(".")},exports.ethers=Cr,exports.formatBytes32String=R,exports.hashMessage=Me,exports.isValidName=ye,exports.lib_esm=J,exports.lib_esm$1=xe,exports.lib_esm$2=Jt,exports.lib_esm$3=cr,exports.lib_esm$4=St,exports.lib_esm$5=br,exports.lib_esm$6=ir,exports.logger=Br,exports.messagePrefix=be,exports.namehash=ve,exports.nameprep=Q,exports.parseBytes32String=T,exports.randomBytes=jt,exports.ripemd160=Fe,exports.sha256=Pe,exports.sha512=De,exports.shuffled=Zt,exports.utils=Mr,exports.version=Sr,exports.wordlists=Ft;
|
|
1
|
+
"use strict";var e=require("@ethersproject/contracts"),t=require("@ethersproject/abstract-signer"),r=require("@ethersproject/address"),i=require("@ethersproject/abstract-provider"),n=require("@ethersproject/bytes"),o=require("./index-aaf32aa5.cjs"),s=require("./id-1eb25db0.cjs"),a=require("./index-18446412.cjs"),f=require("@ethersproject/properties"),h=require("./__node-resolve_empty-e2dee16c.cjs"),u=require("./hash-7ce6fed5.cjs"),l=require("@ethersproject/transactions"),d=require("@ethersproject/json-wallets"),c=require("@ethersproject/constants"),p=require("@ethersproject/providers"),m=require("./interface-bc5624b1.cjs"),g=require("./index-53583bbc.cjs");function A(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var y=A(c),v=A(p);const w=new s.Logger(s.version),b={},M=s.BigNumber.from(0),S=s.BigNumber.from(-1);function B(e,t,r,i){const n={fault:t,operation:r};return void 0!==i&&(n.value=i),w.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}let C="0";for(;C.length<256;)C+=C;function E(e){if("number"!=typeof e)try{e=s.BigNumber.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+C.substring(0,e):w.throwArgumentError("invalid decimal size","decimals",e)}function x(e,t){null==t&&(t=0);const r=E(t),i=(e=s.BigNumber.from(e)).lt(M);i&&(e=e.mul(S));let n=e.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return e=1===r.length?o:o+"."+n,i&&(e="-"+e),e}function I(e,t){null==t&&(t=0);const r=E(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||w.throwArgumentError("invalid decimal value","value",e);const i="-"===e.substring(0,1);i&&(e=e.substring(1)),"."===e&&w.throwArgumentError("missing value","value",e);const n=e.split(".");n.length>2&&w.throwArgumentError("too many decimal points","value",e);let o=n[0],a=n[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&B("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";const f=s.BigNumber.from(o),h=s.BigNumber.from(a);let u=f.mul(r).add(h);return i&&(u=u.mul(S)),u}class F{constructor(e,t,r,i){e!==b&&w.throwError("cannot use FixedFormat constructor; use FixedFormat.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=i,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(i),this._multiplier=E(i),Object.freeze(this)}static from(e){if(e instanceof F)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,i=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const n=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);n||w.throwArgumentError("invalid fixed format","format",e),t="u"!==n[1],r=parseInt(n[2]),i=parseInt(n[3])}else if(e){const n=(t,r,i)=>null==e[t]?i:(typeof e[t]!==r&&w.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=n("signed","boolean",t),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&w.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&w.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new F(b,t,r,i)}}class P{constructor(e,t,r,i){e!==b&&w.throwError("cannot use FixedNumber constructor; use FixedNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&w.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=I(this._value,this.format.decimals),r=I(e._value,e.format.decimals);return P.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=P.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(D.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=P.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(D.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&w.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=P.from("1"+C.substring(0,e),this.format),i=k.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&w.throwArgumentError("invalid byte width","width",e);const t=s.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return n.hexZeroPad(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return P.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||s.isBigNumberish(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),P.fromString(x(e,t),F.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=F.from(t),i=I(e,r.decimals);!r.signed&&i.lt(M)&&B("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=n.hexZeroPad(o,r.width/8));const s=x(i,r.decimals);return new P(b,o,s,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=F.from(t);if(n.arrayify(e).length>r.width/8)throw new Error("overflow");let i=s.BigNumber.from(e);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=x(i,r.decimals);return new P(b,o,a,r)}static from(e,t){if("string"==typeof e)return P.fromString(e,t);if(n.isBytes(e))return P.fromBytes(e,t);try{return P.fromValue(e,0,t)}catch(e){if(e.code!==s.Logger.errors.INVALID_ARGUMENT)throw e}return w.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const D=P.from(1),k=P.from("0.5");function R(e){const t=s.toUtf8Bytes(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return n.hexlify(n.concat([t,c.HashZero]).slice(0,32))}function T(e){const t=n.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return s.toUtf8String(t.slice(0,r))}function N(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,i={};return e.split(",").forEach((e=>{let n=e.split(":");r+=parseInt(n[0],16),i[r]=t(n[1])})),i}function O(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let i=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:i,h:t}}))}function L(e,t){let r=0;for(let i=0;i<t.length;i++){let n=t[i];if(r+=n.l,e>=r&&e<=r+n.h&&(e-r)%(n.d||1)==0){if(n.e&&-1!==n.e.indexOf(e-r))continue;return n}}return null}const U=O("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),q="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),K=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],H=N("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),z=N("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),_=N("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),G=O("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Q(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=s.toUtf8CodePoints(e);var r;r=t.map((e=>{if(q.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=L(e,K);if(t)return[e+t.s];let r=H[e];if(r)return r;let i=z[e];return i?[e+i[0]]:_[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=s.toUtf8CodePoints(s._toUtf8String(t),s.UnicodeNormalizationForm.NFKC),t.forEach((e=>{if(L(e,G))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(L(e,U))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let i=s._toUtf8String(t);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");return i}var J=Object.freeze({__proto__:null,decode:a.decode,encode:a.encode});function W(e,t){null==t&&(t=1);const r=[],i=r.forEach,n=function(e,t){i.call(e,(function(e){t>0&&Array.isArray(e)?n(e,t-1):r.push(e)}))};return n(e,t),r}function Y(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let i=r(),n=1,o=[0,1];for(let e=1;e<i;e++)o.push(n+=r());let s=r(),a=t;t+=s;let f=0,h=0;function u(){return 0==f&&(h=h<<8|e[t++],f=8),h>>--f&1}const l=Math.pow(2,31),d=l>>>1,c=d>>1,p=l-1;let m=0;for(let e=0;e<31;e++)m=m<<1|u();let g=[],A=0,y=l;for(;;){let e=Math.floor(((m-A+1)*n-1)/y),t=0,r=i;for(;r-t>1;){let i=t+r>>>1;e<o[i]?r=i:t=i}if(0==t)break;g.push(t);let s=A+Math.floor(y*o[t]/n),a=A+Math.floor(y*o[t+1]/n)-1;for(;0==((s^a)&d);)m=m<<1&p|u(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&c;)m=m&d|m<<1&p>>>1|u(),s=s<<1^d,a=(a^d)<<1|d|1;A=s,y=1+a-s}let v=i-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function V(e){return 1&e?~e>>1:e>>1}function j(e,t){let r=Array(e);for(let i=0,n=-1;i<e;i++)r[i]=n+=1+t();return r}function Z(e,t){let r=Array(e);for(let i=0,n=0;i<e;i++)r[i]=n+=V(t());return r}function X(e,t){let r=j(e(),e),i=e(),n=j(i,e),o=function(e,t){let r=Array(e);for(let i=0;i<e;i++)r[i]=1+t();return r}(i,e);for(let e=0;e<i;e++)for(let t=0;t<o[e];t++)r.push(n[e]+t);return t?r.map((e=>t[e])):r}function $(e,t,r){let i=Array(e).fill(void 0).map((()=>[]));for(let n=0;n<t;n++)Z(e,r).forEach(((e,t)=>i[t].push(e)));return i}function ee(e,t){let r=1+t(),i=t(),n=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return W($(n.length,1+e,t).map(((e,t)=>{const o=e[0],s=e.slice(1);return Array(n[t]).fill(void 0).map(((e,t)=>{let n=t*i;return[o+t*r,s.map((e=>e+n))]}))})))}function te(e,t){return $(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const re=Y(a.decode("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoAD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fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),ie=new Set(X(re)),ne=new Set(X(re)),oe=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(ee(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(te(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const i=e[r];t[i[0]]=i[1]}return t}(W(t))}(re),se=function(e){let t=X(e).sort(((e,t)=>e-t));return function r(){let i=[];for(;;){let n=X(e,t);if(0==n.length)break;i.push({set:new Set(n),node:r()})}i.sort(((e,t)=>t.set.size-e.set.size));let n=e(),o=n%3;n=n/3|0;let s=!!(1&n);return n>>=1,{branches:i,valid:o,fe0f:s,save:1==n,check:2==n}}()}(re),ae=45,fe=95;function he(e){return s.toUtf8CodePoints(e)}function ue(e){return e.filter((e=>65039!=e))}function le(e){for(let t of e.split(".")){let e=he(t);try{for(let t=e.lastIndexOf(fe)-1;t>=0;t--)if(e[t]!==fe)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===ae&&e[3]===ae)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function de(e){return le(function(e,t){let r=he(e).reverse(),i=[];for(;r.length;){let e=ce(r);if(e){i.push(...t(e));continue}let n=r.pop();if(ie.has(n)){i.push(n);continue}if(ne.has(n))continue;let o=oe[n];if(!o)throw new Error(`Disallowed codepoint: 0x${n.toString(16).toUpperCase()}`);i.push(...o)}return le((n=String.fromCodePoint(...i),n.normalize("NFC")));var n}(e,ue))}function ce(e,t){var r;let i,n,o=se,s=[],a=e.length;for(t&&(t.length=0);a;){let f=e[--a];if(o=null===(r=o.branches.find((e=>e.set.has(f))))||void 0===r?void 0:r.node,!o)break;if(o.save)n=f;else if(o.check&&f===n)break;s.push(f),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(i=s.slice(),2==o.valid&&i.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return i}const pe=new s.Logger(a.version),me=new Uint8Array(32);function ge(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Ae(e){const t=s.toUtf8Bytes(de(e)),r=[];if(0===e.length)return r;let i=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(ge(t.slice(i,e))),i=e+1)}if(i>=t.length)throw new Error("invalid ENS name; empty component");return r.push(ge(t.slice(i))),r}function ye(e){try{return 0!==Ae(e).length}catch(e){}return!1}function ve(e){"string"!=typeof e&&pe.throwArgumentError("invalid ENS name; not a string","name",e);let t=me;const r=Ae(e);for(;r.length;)t=o.keccak256(n.concat([t,o.keccak256(r.pop())]));return n.hexlify(t)}function we(e){return n.hexlify(n.concat(Ae(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}me.fill(0);const be="Ethereum Signed Message:\n";function Me(e){return"string"==typeof e&&(e=s.toUtf8Bytes(e)),o.keccak256(n.concat([s.toUtf8Bytes(be),s.toUtf8Bytes(String(e.length)),e]))}class Se{constructor(e){f.defineReadOnly(this,"alphabet",e),f.defineReadOnly(this,"base",e.length),f.defineReadOnly(this,"_alphabetMap",{}),f.defineReadOnly(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=n.arrayify(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let i=t[e];for(let e=0;e<r.length;++e)i+=r[e]<<8,r[e]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}let i="";for(let e=0;0===t[e]&&e<t.length-1;++e)i+=this._leader;for(let e=r.length-1;e>=0;--e)i+=this.alphabet[r[e]];return i}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let i=this._alphabetMap[e[r]];if(void 0===i)throw new Error("Non-base"+this.base+" character");let n=i;for(let e=0;e<t.length;++e)n+=t[e]*this.base,t[e]=255&n,n>>=8;for(;n>0;)t.push(255&n),n>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return n.arrayify(new Uint8Array(t.reverse()))}}const Be=new Se("abcdefghijklmnopqrstuvwxyz234567"),Ce=new Se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Ee,xe=Object.freeze({__proto__:null,BaseX:Se,Base32:Be,Base58:Ce});exports.SupportedAlgorithm=void 0,(Ee=exports.SupportedAlgorithm||(exports.SupportedAlgorithm={})).sha256="sha256",Ee.sha512="sha512";const Ie=new s.Logger("sha2/5.7.0");function Fe(e){return"0x"+u.hash.ripemd160().update(n.arrayify(e)).digest("hex")}function Pe(e){return"0x"+u.hash.sha256().update(n.arrayify(e)).digest("hex")}function De(e){return"0x"+u.hash.sha512().update(n.arrayify(e)).digest("hex")}function ke(e,t,r){return exports.SupportedAlgorithm[e]||Ie.throwError("unsupported algorithm "+e,s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+u.hash.hmac(u.hash[e],n.arrayify(t)).update(n.arrayify(r)).digest("hex")}var Re={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:h.require$$1.Buffer}catch(e){}function s(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function f(e,t,i,n){for(var o=0,s=0,a=Math.min(e.length,i),f=t;f<a;f++){var h=e.charCodeAt(f)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<n,"Invalid character"),o+=s}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,u=r;u<a;u+=i)h=f(e,u,u+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=f(e,u,e.length,t),u=0;u<s;u++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype._move=function(e){u(e,this)},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var u=f>>>26,l=67108863&f,d=Math.min(h,t.length-1),c=Math.max(0,h-e.length+1);c<=d;c++){var p=h-c|0;u+=(s=(n=0|e.words[p])*(o=0|t.words[c])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],f=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?d[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],u=p[e];i="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(u).toString(e);i=(l=l.idivn(u)).isZero()?m+i:d[h-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},n.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},n.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},n.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},n.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var i,n,o,s=e.words,a=t.words,f=r.words,h=0,u=0|s[0],l=8191&u,d=u>>>13,c=0|s[1],p=8191&c,m=c>>>13,g=0|s[2],A=8191&g,y=g>>>13,v=0|s[3],w=8191&v,b=v>>>13,M=0|s[4],S=8191&M,B=M>>>13,C=0|s[5],E=8191&C,x=C>>>13,I=0|s[6],F=8191&I,P=I>>>13,D=0|s[7],k=8191&D,R=D>>>13,T=0|s[8],N=8191&T,O=T>>>13,L=0|s[9],U=8191&L,q=L>>>13,K=0|a[0],H=8191&K,z=K>>>13,_=0|a[1],G=8191&_,Q=_>>>13,J=0|a[2],W=8191&J,Y=J>>>13,V=0|a[3],j=8191&V,Z=V>>>13,X=0|a[4],$=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],fe=8191&ae,he=ae>>>13,ue=0|a[8],le=8191&ue,de=ue>>>13,ce=0|a[9],pe=8191&ce,me=ce>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,H))|0)+((8191&(n=(n=Math.imul(l,z))+Math.imul(d,H)|0))<<13)|0;h=((o=Math.imul(d,z))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,H),n=(n=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var Ae=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,Q)|0)+Math.imul(d,G)|0))<<13)|0;h=((o=o+Math.imul(d,Q)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(A,H),n=(n=Math.imul(A,z))+Math.imul(y,H)|0,o=Math.imul(y,z),i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Q)|0;var ye=(h+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,H),n=(n=Math.imul(w,z))+Math.imul(b,H)|0,o=Math.imul(b,z),i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Q)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var ve=(h+(i=i+Math.imul(l,j)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(d,j)|0))<<13)|0;h=((o=o+Math.imul(d,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,H),n=(n=Math.imul(S,z))+Math.imul(B,H)|0,o=Math.imul(B,z),i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Q)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,j)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,$)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(d,$)|0))<<13)|0;h=((o=o+Math.imul(d,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(E,H),n=(n=Math.imul(E,z))+Math.imul(x,H)|0,o=Math.imul(x,z),i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,Q)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,i=i+Math.imul(A,j)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(y,j)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var be=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(d,re)|0))<<13)|0;h=((o=o+Math.imul(d,ie)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(F,H),n=(n=Math.imul(F,z))+Math.imul(P,H)|0,o=Math.imul(P,z),i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,Q)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(w,j)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(b,j)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(d,oe)|0))<<13)|0;h=((o=o+Math.imul(d,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(k,H),n=(n=Math.imul(k,z))+Math.imul(R,H)|0,o=Math.imul(R,z),i=i+Math.imul(F,G)|0,n=(n=n+Math.imul(F,Q)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,Q)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(S,j)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(B,j)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,fe)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(d,fe)|0))<<13)|0;h=((o=o+Math.imul(d,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,H),n=(n=Math.imul(N,z))+Math.imul(O,H)|0,o=Math.imul(O,z),i=i+Math.imul(k,G)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,Q)|0,i=i+Math.imul(F,W)|0,n=(n=n+Math.imul(F,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(E,j)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(x,j)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var Be=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;h=((o=o+Math.imul(d,de)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(U,H),n=(n=Math.imul(U,z))+Math.imul(q,H)|0,o=Math.imul(q,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Q)|0,i=i+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(F,j)|0,n=(n=n+Math.imul(F,Z)|0)+Math.imul(P,j)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(A,fe)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,de)|0;var Ce=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(d,pe)|0))<<13)|0;h=((o=o+Math.imul(d,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Q))+Math.imul(q,G)|0,o=Math.imul(q,Q),i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(k,j)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(R,j)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(F,$)|0,n=(n=n+Math.imul(F,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(w,fe)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,de)|0;var Ee=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(U,W),n=(n=Math.imul(U,Y))+Math.imul(q,W)|0,o=Math.imul(q,Y),i=i+Math.imul(N,j)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(O,j)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(F,re)|0,n=(n=n+Math.imul(F,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(E,oe)|0,n=(n=n+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(S,fe)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(B,fe)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,de)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,de)|0;var xe=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((o=o+Math.imul(y,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(U,j),n=(n=Math.imul(U,Z))+Math.imul(q,j)|0,o=Math.imul(q,Z),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,i=i+Math.imul(k,re)|0,n=(n=n+Math.imul(k,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(F,oe)|0,n=(n=n+Math.imul(F,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,i=i+Math.imul(E,fe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,de)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,de)|0;var Ie=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,ee))+Math.imul(q,$)|0,o=Math.imul(q,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ie)|0,i=i+Math.imul(k,oe)|0,n=(n=n+Math.imul(k,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,i=i+Math.imul(F,fe)|0,n=(n=n+Math.imul(F,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0,i=i+Math.imul(E,le)|0,n=(n=n+Math.imul(E,de)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,de)|0;var Fe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,i=Math.imul(U,re),n=(n=Math.imul(U,ie))+Math.imul(q,re)|0,o=Math.imul(q,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,i=i+Math.imul(k,fe)|0,n=(n=n+Math.imul(k,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0,i=i+Math.imul(F,le)|0,n=(n=n+Math.imul(F,de)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,de)|0;var Pe=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(U,oe),n=(n=Math.imul(U,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),i=i+Math.imul(N,fe)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0,i=i+Math.imul(k,le)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,de)|0;var De=(h+(i=i+Math.imul(F,pe)|0)|0)+((8191&(n=(n=n+Math.imul(F,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((o=o+Math.imul(P,me)|0)+(n>>>13)|0)+(De>>>26)|0,De&=67108863,i=Math.imul(U,fe),n=(n=Math.imul(U,he))+Math.imul(q,fe)|0,o=Math.imul(q,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,de)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,de)|0;var ke=(h+(i=i+Math.imul(k,pe)|0)|0)+((8191&(n=(n=n+Math.imul(k,me)|0)+Math.imul(R,pe)|0))<<13)|0;h=((o=o+Math.imul(R,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(U,le),n=(n=Math.imul(U,de))+Math.imul(q,le)|0,o=Math.imul(q,de);var Re=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((o=o+Math.imul(O,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Te=(h+(i=Math.imul(U,pe))|0)+((8191&(n=(n=Math.imul(U,me))+Math.imul(q,pe)|0))<<13)|0;return h=((o=Math.imul(q,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,f[0]=ge,f[1]=Ae,f[2]=ye,f[3]=ve,f[4]=we,f[5]=be,f[6]=Me,f[7]=Se,f[8]=Be,f[9]=Ce,f[10]=Ee,f[11]=xe,f[12]=Ie,f[13]=Fe,f[14]=Pe,f[15]=De,f[16]=ke,f[17]=Re,f[18]=Te,0!==h&&(f[19]=h,r.length++),r};function A(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,f=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=f;h++){var u=o-h,l=(0|e.words[u])*(0|t.words[h]),d=67108863&l;a=67108863&(d=d+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return A(e,t,r)}Math.imul||(g=m),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?A(this,e,t):y(this,e,t)},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),y(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,f=(0|this.words[t])-a<<i;this.words[t]=f|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,f=i;if(n-=s,n=Math.max(0,n),f){for(var h=0;h<s;h++)f.words[h]=this.words[h];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=n);h--){var l=0|this.words[h];this.words[h]=u<<26-o|l>>>o,u=l&a}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var f=(0|e.words[n])*t;a=((o-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,f=i.length-o.length;if("mod"!==t){(a=new n(null)).length=f+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var u=i.clone()._ishlnsubmul(o,1,f);0===u.negative&&(i=u,a&&(a.words[f]=1));for(var l=f-1;l>=0;l--){var d=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(o,d,l);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=d)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/e|0,i=o%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),l=t.clone();!t.isZero();){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(l)),a.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(f)):(i.isub(t),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),f=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,u=1;0==(t.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var l=0,d=1;0==(i.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new C(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(b,w),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(M,w),i(S,w),i(B,w),B.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new M;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return v[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},C.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var l=this.pow(u,o),d=this.pow(e,o.addn(1).iushrn(1)),c=this.pow(e,o),p=s;0!==c.cmp(a);){for(var m=c,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var A=this.pow(l,new n(1).iushln(p-g-1));d=d.redMul(A),l=A.redSqr(),c=c.redMul(l),p=g}return d},C.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},C.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,f=t.bitLength()%26;for(0===f&&(f=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var l=h>>u&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===u)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}f=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new E(e)},i(E,C),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Re,o.commonjsGlobal);var Te=Re.exports;function Ne(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Oe=Le;function Le(e,t){if(!e)throw new Error(t||"Assertion failed")}Le.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ue=Ne((function(e,t){var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}})),qe=Ne((function(e,t){var r=t;r.assert=Oe,r.toArray=Ue.toArray,r.zero2=Ue.zero2,r.toHex=Ue.toHex,r.encode=Ue.encode,r.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<<t+1,o=e.clone(),s=0;s<i.length;s++){var a,f=o.andln(n-1);o.isOdd()?(a=f>(n>>1)-1?(n>>1)-f:f,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var s,a,f=e.andln(3)+n&3,h=t.andln(3)+o&3;3===f&&(f=-1),3===h&&(h=-1),s=0==(1&f)?0:3!==(i=e.andln(7)+n&7)&&5!==i||2!==h?f:-f,r[0].push(s),a=0==(1&h)?0:3!==(i=t.andln(7)+o&7)&&5!==i||2!==f?h:-h,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new Te(e,"hex","le")}})),Ke=qe.getNAF,He=qe.getJSF,ze=qe.assert;function _e(e,t){this.type=e,this.p=new Te(t.p,16),this.red=t.prime?Te.red(t.prime):Te.mont(this.p),this.zero=new Te(0).toRed(this.red),this.one=new Te(1).toRed(this.red),this.two=new Te(2).toRed(this.red),this.n=t.n&&new Te(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ge=_e;function Qe(e,t){this.curve=e,this.type=t,this.precomputed=null}_e.prototype.point=function(){throw new Error("Not implemented")},_e.prototype.validate=function(){throw new Error("Not implemented")},_e.prototype._fixedNafMul=function(e,t){ze(e.precomputed);var r=e._getDoubles(),i=Ke(t,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,s,a=[];for(o=0;o<i.length;o+=r.step){s=0;for(var f=o+r.step-1;f>=o;f--)s=(s<<1)+i[f];a.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o<a.length;o++)(s=a[o])===l?u=u.mixedAdd(r.points[o]):s===-l&&(u=u.mixedAdd(r.points[o].neg()));h=h.add(u)}return h.toP()},_e.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=Ke(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var f=0;a>=0&&0===o[a];a--)f++;if(a>=0&&f++,s=s.dblp(f),a<0)break;var h=o[a];ze(0!==h),s="affine"===e.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},_e.prototype._wnafMulAdd=function(e,t,r,i,n){var o,s,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(o=0;o<i;o++){var d=(a=t[o])._getNAFPoints(e);f[o]=d.wnd,h[o]=d.points}for(o=i-1;o>=1;o-=2){var c=o-1,p=o;if(1===f[c]&&1===f[p]){var m=[t[c],null,null,t[p]];0===t[c].y.cmp(t[p].y)?(m[1]=t[c].add(t[p]),m[2]=t[c].toJ().mixedAdd(t[p].neg())):0===t[c].y.cmp(t[p].y.redNeg())?(m[1]=t[c].toJ().mixedAdd(t[p]),m[2]=t[c].add(t[p].neg())):(m[1]=t[c].toJ().mixedAdd(t[p]),m[2]=t[c].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],A=He(r[c],r[p]);for(l=Math.max(A[0].length,l),u[c]=new Array(l),u[p]=new Array(l),s=0;s<l;s++){var y=0|A[0][s],v=0|A[1][s];u[c][s]=g[3*(y+1)+(v+1)],u[p][s]=0,h[c]=m}}else u[c]=Ke(r[c],f[c],this._bitLength),u[p]=Ke(r[p],f[p],this._bitLength),l=Math.max(u[c].length,l),l=Math.max(u[p].length,l)}var w=this.jpoint(null,null,null),b=this._wnafT4;for(o=l;o>=0;o--){for(var M=0;o>=0;){var S=!0;for(s=0;s<i;s++)b[s]=0|u[s][o],0!==b[s]&&(S=!1);if(!S)break;M++,o--}if(o>=0&&M++,w=w.dblp(M),o<0)break;for(s=0;s<i;s++){var B=b[s];0!==B&&(B>0?a=h[s][B-1>>1]:B<0&&(a=h[s][-B-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<i;o++)h[o]=null;return n?w:w.toP()},_e.BasePoint=Qe,Qe.prototype.eq=function(){throw new Error("Not implemented")},Qe.prototype.validate=function(){return this.curve.validate(this)},_e.prototype.decodePoint=function(e,t){e=qe.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?ze(e[e.length-1]%2==0):7===e[0]&&ze(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},Qe.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Qe.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},Qe.prototype.encode=function(e,t){return qe.encode(this._encode(t),e)},Qe.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Qe.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},Qe.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},Qe.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},Qe.prototype._getBeta=function(){return null},Qe.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Je=Ne((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),We=qe.assert;function Ye(e){Ge.call(this,"short",e),this.a=new Te(e.a,16).toRed(this.red),this.b=new Te(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Je(Ye,Ge);var Ve=Ye;function je(e,t,r,i){Ge.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Te(t,16),this.y=new Te(r,16),i&&(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 Ze(e,t,r,i){Ge.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Te(0)):(this.x=new Te(t,16),this.y=new Te(r,16),this.z=new Te(i,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}Ye.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new Te(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new Te(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],We(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new Te(e.a,16),b:new Te(e.b,16)}})):this._getEndoBasis(r)}}},Ye.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Te.mont(e),r=new Te(2).toRed(t).redInvm(),i=r.redNeg(),n=new Te(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},Ye.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),c=new Te(1),p=new Te(0),m=new Te(0),g=new Te(1),A=0;0!==l.cmpn(0);){var y=d.div(l);f=d.sub(y.mul(l)),h=m.sub(y.mul(c));var v=g.sub(y.mul(p));if(!i&&f.cmp(u)<0)t=a.neg(),r=c,i=f.neg(),n=h;else if(i&&2==++A)break;a=f,d=l,l=f,m=c,c=h,g=p,p=v}o=f.neg(),s=h;var w=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},Ye.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),f=n.mul(r.b),h=o.mul(i.b);return{k1:e.sub(s).sub(a),k2:f.add(h).neg()}},Ye.prototype.pointFromX=function(e,t){(e=new Te(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},Ye.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Ye.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*o]=a,i[2*o+1]=f,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),u=0;u<2*o;u++)i[u]=null,n[u]=null;return h},Je(je,Ge.BasePoint),Ye.prototype.point=function(e,t,r){return new je(this,e,t,r)},Ye.prototype.pointFromJSON=function(e,t){return je.fromJSON(this,e,t)},je.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},je.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]},je.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},je.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)+">"},je.prototype.isInfinity=function(){return this.inf},je.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},je.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},je.prototype.getX=function(){return this.x.fromRed()},je.prototype.getY=function(){return this.y.fromRed()},je.prototype.mul=function(e){return e=new Te(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},je.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},je.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},je.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},je.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},je.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Je(Ze,Ge.BasePoint),Ye.prototype.jpoint=function(e,t,r){return new Ze(this,e,t,r)},Ze.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},Ze.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ze.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=o.redSub(s);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),l=i.redMul(h),d=f.redSqr().redIAdd(u).redISub(l).redISub(l),c=f.redMul(l.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,c,p)},Ze.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),h=f.redMul(s),u=r.redMul(f),l=a.redSqr().redIAdd(h).redISub(u).redISub(u),d=a.redMul(u.redISub(l)).redISub(n.redMul(h)),c=this.z.redMul(s);return this.curve.jpoint(l,d,c)},Ze.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),h=s.redAdd(s);for(t=0;t<e;t++){var u=o.redSqr(),l=h.redSqr(),d=l.redSqr(),c=u.redAdd(u).redIAdd(u).redIAdd(i.redMul(f)),p=o.redMul(l),m=c.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),A=c.redMul(g);A=A.redIAdd(A).redISub(d);var y=h.redMul(a);t+1<e&&(f=f.redMul(d)),o=m,a=y,h=A}return this.curve.jpoint(o,h.redMul(n),a)},Ze.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ze.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),f=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=f,t=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),c=this.x.redAdd(l).redSqr().redISub(u).redISub(d);c=c.redIAdd(c);var p=u.redAdd(u).redIAdd(u),m=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(c).redISub(c),t=p.redMul(c.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Ze.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),f=a.redSqr().redISub(s).redISub(s);e=f;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=a.redMul(s.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),c=this.x.redSub(u).redMul(this.x.redAdd(u));c=c.redAdd(c).redIAdd(c);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);e=c.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=c.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Ze.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),f=t.redAdd(t),h=(f=f.redIAdd(f)).redMul(s),u=a.redSqr().redISub(h.redAdd(h)),l=h.redISub(u),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var c=a.redMul(l).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(u,c,p)},Ze.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),f=i.redIAdd(i);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(f),u=t.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(a).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(h.redMul(f.redISub(h)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var c=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,d,c)},Ze.prototype.mul=function(e,t){return e=new Te(e,t),this.curve._wnafMul(this,e)},Ze.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},Ze.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Ze.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)+">"},Ze.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Xe=Ne((function(e,t){var r=t;r.base=Ge,r.short=Ve,r.mont=null,r.edwards=null})),$e=Ne((function(e,t){var r,i=t,n=qe.assert;function o(e){"short"===e.type?this.curve=new Xe.short(e):"edwards"===e.type?this.curve=new Xe.edwards(e):this.curve=new Xe.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("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:u.hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:u.hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:u.hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:u.hash.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"]}),s("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:u.hash.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.hash.sha256,gRed:!1,g:["9"]}),s("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:u.hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("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:u.hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function et(e){if(!(this instanceof et))return new et(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ue.toArray(e.entropy,e.entropyEnc||"hex"),r=Ue.toArray(e.nonce,e.nonceEnc||"hex"),i=Ue.toArray(e.pers,e.persEnc||"hex");Oe(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var tt=et;et.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},et.prototype._hmac=function(){return new u.hash.hmac(this.hash,this.K)},et.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},et.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=Ue.toArray(e,t),r=Ue.toArray(r,i),Oe(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},et.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=Ue.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,e);return this._update(r),this._reseed++,Ue.encode(o,t)};var rt=qe.assert;function it(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var nt=it;it.fromPublic=function(e,t,r){return t instanceof it?t:new it(e,{pub:t,pubEnc:r})},it.fromPrivate=function(e,t,r){return t instanceof it?t:new it(e,{priv:t,privEnc:r})},it.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},it.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},it.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},it.prototype._importPrivate=function(e,t){this.priv=new Te(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},it.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?rt(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||rt(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},it.prototype.derive=function(e){return e.validate()||rt(e.validate(),"public point not validated"),e.mul(this.priv).getX()},it.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},it.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},it.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var ot=qe.assert;function st(e,t){if(e instanceof st)return e;this._importDER(e,t)||(ot(e.r&&e.s,"Signature without r or s"),this.r=new Te(e.r,16),this.s=new Te(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var at=st;function ft(){this.place=0}function ht(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function ut(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function lt(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}st.prototype._importDER=function(e,t){e=qe.toArray(e,t);var r=new ft;if(48!==e[r.place++])return!1;var i=ht(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=ht(e,r);if(!1===n)return!1;var o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=ht(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new Te(o),this.s=new Te(a),this.recoveryParam=null,!0},st.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=ut(t),r=ut(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];lt(i,t.length),(i=i.concat(t)).push(2),lt(i,r.length);var n=i.concat(r),o=[48];return lt(o,n.length),o=o.concat(n),qe.encode(o,e)};var dt=function(){throw new Error("unsupported")},ct=qe.assert;function pt(e){if(!(this instanceof pt))return new pt(e);"string"==typeof e&&(ct(Object.prototype.hasOwnProperty.call($e,e),"Unknown curve "+e),e=$e[e]),e instanceof $e.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var mt=pt;pt.prototype.keyPair=function(e){return new nt(this,e)},pt.prototype.keyFromPrivate=function(e,t){return nt.fromPrivate(this,e,t)},pt.prototype.keyFromPublic=function(e,t){return nt.fromPublic(this,e,t)},pt.prototype.genKeyPair=function(e){e||(e={});for(var t=new tt({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||dt(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new Te(2));;){var n=new Te(t.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},pt.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},pt.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Te(e,16));for(var n=this.n.byteLength(),o=t.getPrivate().toArray("be",n),s=e.toArray("be",n),a=new tt({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new Te(1)),h=0;;h++){var u=i.k?i.k(h):new Te(a.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(f)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var d=l.getX(),c=d.umod(this.n);if(0!==c.cmpn(0)){var p=u.invm(this.n).mul(c.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(l.getY().isOdd()?1:0)|(0!==d.cmp(c)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new at({r:c,s:p,recoveryParam:m})}}}}}},pt.prototype.verify=function(e,t,r,i){e=this._truncateToN(new Te(e,16)),r=this.keyFromPublic(r,i);var n=(t=new at(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),f=a.mul(e).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},pt.prototype.recoverPubKey=function(e,t,r,i){ct((3&r)===r,"The recovery param is more than two bits"),t=new at(t,i);var n=this.n,o=new Te(e),s=t.r,a=t.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var u=t.r.invm(n),l=n.sub(o).mul(u).umod(n),d=a.mul(u).umod(n);return this.g.mulAdd(l,s,d)},pt.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new at(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var gt=Ne((function(e,t){var r=t;r.version="6.5.4",r.utils=qe,r.rand=function(){throw new Error("unsupported")},r.curve=Xe,r.curves=$e,r.ec=mt,r.eddsa=null})).ec;const At=new s.Logger("signing-key/5.7.0");let yt=null;function vt(){return yt||(yt=new gt("secp256k1")),yt}class wt{constructor(e){f.defineReadOnly(this,"curve","secp256k1"),f.defineReadOnly(this,"privateKey",n.hexlify(e)),32!==n.hexDataLength(this.privateKey)&&At.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=vt().keyFromPrivate(n.arrayify(this.privateKey));f.defineReadOnly(this,"publicKey","0x"+t.getPublic(!1,"hex")),f.defineReadOnly(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),f.defineReadOnly(this,"_isSigningKey",!0)}_addPoint(e){const t=vt().keyFromPublic(n.arrayify(this.publicKey)),r=vt().keyFromPublic(n.arrayify(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=vt().keyFromPrivate(n.arrayify(this.privateKey)),r=n.arrayify(e);32!==r.length&&At.throwArgumentError("bad digest length","digest",e);const i=t.sign(r,{canonical:!0});return n.splitSignature({recoveryParam:i.recoveryParam,r:n.hexZeroPad("0x"+i.r.toString(16),32),s:n.hexZeroPad("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const t=vt().keyFromPrivate(n.arrayify(this.privateKey)),r=vt().keyFromPublic(n.arrayify(Mt(e)));return n.hexZeroPad("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function bt(e,t){const r=n.splitSignature(t),i={r:n.arrayify(r.r),s:n.arrayify(r.s)};return"0x"+vt().recoverPubKey(n.arrayify(e),i,r.recoveryParam).encode("hex",!1)}function Mt(e,t){const r=n.arrayify(e);if(32===r.length){const e=new wt(r);return t?"0x"+vt().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?n.hexlify(r):"0x"+vt().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+vt().keyFromPublic(r).getPublic(!0,"hex"):n.hexlify(r):At.throwArgumentError("invalid public or private key","key","[REDACTED]")}var St=Object.freeze({__proto__:null,SigningKey:wt,recoverPublicKey:bt,computePublicKey:Mt});const Bt=new s.Logger("wordlists/5.7.0");class Ct{constructor(e){Bt.checkAbstract(new.target,Ct),f.defineReadOnly(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const i=e.getWord(r);if(r!==e.getWordIndex(i))return"0x";t.push(i)}return s.id(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let Et=null;function xt(e){if(null==Et&&(Et="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Ct.check(e)))throw Et=null,new Error("BIP39 Wordlist for en (English) FAILED")}const It=new class extends Ct{constructor(){super("en")}getWord(e){return xt(this),Et[e]}getWordIndex(e){return xt(this),Et.indexOf(e)}};Ct.register(It);const Ft={en:It},Pt=new s.Logger("hdnode/5.7.0"),Dt=s.BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),kt=s.toUtf8Bytes("Bitcoin seed"),Rt=2147483648;function Tt(e){return(1<<e)-1<<8-e}function Nt(e){return n.hexZeroPad(n.hexlify(e),32)}function Ot(e){return Ce.encode(n.concat([e,n.hexDataSlice(Pe(Pe(e)),0,4)]))}function Lt(e){if(null==e)return Ft.en;if("string"==typeof e){const t=Ft[e];return null==t&&Pt.throwArgumentError("unknown locale","wordlist",e),t}return e}const Ut={},qt="m/44'/60'/0'/0/0";class Kt{constructor(e,t,r,i,o,s,a,h){if(e!==Ut)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new wt(t);f.defineReadOnly(this,"privateKey",e.privateKey),f.defineReadOnly(this,"publicKey",e.compressedPublicKey)}else f.defineReadOnly(this,"privateKey",null),f.defineReadOnly(this,"publicKey",n.hexlify(r));f.defineReadOnly(this,"parentFingerprint",i),f.defineReadOnly(this,"fingerprint",n.hexDataSlice(Fe(Pe(this.publicKey)),0,4)),f.defineReadOnly(this,"address",l.computeAddress(this.publicKey)),f.defineReadOnly(this,"chainCode",o),f.defineReadOnly(this,"index",s),f.defineReadOnly(this,"depth",a),null==h?(f.defineReadOnly(this,"mnemonic",null),f.defineReadOnly(this,"path",null)):"string"==typeof h?(f.defineReadOnly(this,"mnemonic",null),f.defineReadOnly(this,"path",h)):(f.defineReadOnly(this,"mnemonic",h),f.defineReadOnly(this,"path",h.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Ot(n.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",n.hexlify(this.depth),this.parentFingerprint,n.hexZeroPad(n.hexlify(this.index),4),this.chainCode,null!=this.privateKey?n.concat(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Kt(Ut,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&Rt){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(n.arrayify(this.privateKey),1),t&&(t+="'")}else r.set(n.arrayify(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const i=n.arrayify(ke(exports.SupportedAlgorithm.sha512,this.chainCode,r)),o=i.slice(0,32),a=i.slice(32);let f=null,h=null;if(this.privateKey)f=Nt(s.BigNumber.from(o).add(this.privateKey).mod(Dt));else{h=new wt(n.hexlify(o))._addPoint(this.publicKey)}let u=t;const l=this.mnemonic;return l&&(u=Object.freeze({phrase:l.phrase,path:t,locale:l.locale||"en"})),new Kt(Ut,f,h,this.fingerprint,Nt(a),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const i=t[e];if(i.match(/^[0-9]+'$/)){const e=parseInt(i.substring(0,i.length-1));if(e>=Rt)throw new Error("invalid path index - "+i);r=r._derive(Rt+e)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);{const e=parseInt(i);if(e>=Rt)throw new Error("invalid path index - "+i);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=n.arrayify(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const i=n.arrayify(ke(exports.SupportedAlgorithm.sha512,kt,r));return new Kt(Ut,Nt(i.slice(0,32)),null,"0x00000000",Nt(i.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=_t(zt(e,r=Lt(r)),r),Kt._fromSeed(Ht(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Kt._fromSeed(e,null)}static fromExtendedKey(e){const t=Ce.decode(e);82===t.length&&Ot(t.slice(0,78))===e||Pt.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],i=n.hexlify(t.slice(5,9)),o=parseInt(n.hexlify(t.slice(9,13)).substring(2),16),s=n.hexlify(t.slice(13,45)),a=t.slice(45,78);switch(n.hexlify(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Kt(Ut,null,n.hexlify(a),i,s,o,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Kt(Ut,n.hexlify(a.slice(1)),null,i,s,o,r,null)}return Pt.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Ht(e,t){t||(t="");const r=s.toUtf8Bytes("mnemonic"+t,s.UnicodeNormalizationForm.NFKD);return function(e,t,r,i,o){let s;e=n.arrayify(e),t=n.arrayify(t);let a=1;const f=new Uint8Array(i),h=new Uint8Array(t.length+4);let u,l;h.set(t);for(let d=1;d<=a;d++){h[t.length]=d>>24&255,h[t.length+1]=d>>16&255,h[t.length+2]=d>>8&255,h[t.length+3]=255&d;let c=n.arrayify(ke(o,e,h));s||(s=c.length,l=new Uint8Array(s),a=Math.ceil(i/s),u=i-(a-1)*s),l.set(c);for(let t=1;t<r;t++){c=n.arrayify(ke(o,e,c));for(let e=0;e<s;e++)l[e]^=c[e]}const p=(d-1)*s,m=d===a?u:s;f.set(n.arrayify(l).slice(0,m),p)}return n.hexlify(f)}(s.toUtf8Bytes(e,s.UnicodeNormalizationForm.NFKD),r,2048,64,"sha512")}function zt(e,t){t=Lt(t),Pt.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const i=n.arrayify(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let e=0;e<r.length;e++){let n=t.getWordIndex(r[e].normalize("NFKD"));if(-1===n)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)n&1<<10-e&&(i[o>>3]|=1<<7-o%8),o++}const s=32*r.length/3,a=Tt(r.length/3);if((n.arrayify(Pe(i.slice(0,s/8)))[0]&a)!==(i[i.length-1]&a))throw new Error("invalid checksum");return n.hexlify(i.slice(0,s/8))}function _t(e,t){if(t=Lt(t),(e=n.arrayify(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let i=11;for(let t=0;t<e.length;t++)i>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],i-=8):(r[r.length-1]<<=i,r[r.length-1]|=e[t]>>8-i,r.push(e[t]&(1<<8-i)-1),i+=3);const o=e.length/4,s=n.arrayify(Pe(e))[0]&Tt(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,t.join(r.map((e=>t.getWord(e))))}function Gt(e,t){try{return zt(e,t),!0}catch(e){}return!1}function Qt(e){return("number"!=typeof e||e<0||e>=Rt||e%1)&&Pt.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}var Jt=Object.freeze({__proto__:null,defaultPath:qt,HDNode:Kt,mnemonicToSeed:Ht,mnemonicToEntropy:zt,entropyToMnemonic:_t,isValidMnemonic:Gt,getAccountPath:Qt});const Wt=new s.Logger("random/5.7.0");const Yt=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let Vt=Yt.crypto||Yt.msCrypto;function jt(e){(e<=0||e>1024||e%1||e!=e)&&Wt.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Vt.getRandomValues(t),n.arrayify(t)}function Zt(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),i=e[t];e[t]=e[r],e[r]=i}return e}Vt&&Vt.getRandomValues||(Wt.warn("WARNING: Missing strong random number source"),Vt={getRandomValues:function(e){return Wt.throwError("no secure random source avaialble",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Xt=function(e,t,r,i){return new(r||(r=Promise))((function(n,o){function s(e){try{f(i.next(e))}catch(e){o(e)}}function a(e){try{f(i.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}f((i=i.apply(e,t||[])).next())}))};const $t=new s.Logger("wallet/5.7.0");class er extends t.Signer{constructor(e,t){if(super(),null!=(o=e)&&n.isHexString(o.privateKey,32)&&null!=o.address){const t=new wt(e.privateKey);if(f.defineReadOnly(this,"_signingKey",(()=>t)),f.defineReadOnly(this,"address",l.computeAddress(this.publicKey)),this.address!==r.getAddress(e.address)&&$t.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;f.defineReadOnly(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||qt,locale:t.locale||"en"})));const r=this.mnemonic,i=Kt.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);l.computeAddress(i.privateKey)!==this.address&&$t.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else f.defineReadOnly(this,"_mnemonic",(()=>null))}else{if(wt.isSigningKey(e))"secp256k1"!==e.curve&&$t.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),f.defineReadOnly(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new wt(e);f.defineReadOnly(this,"_signingKey",(()=>t))}f.defineReadOnly(this,"_mnemonic",(()=>null)),f.defineReadOnly(this,"address",l.computeAddress(this.publicKey))}var o;t&&!i.Provider.isProvider(t)&&$t.throwArgumentError("invalid provider","provider",t),f.defineReadOnly(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new er(this,e)}signTransaction(e){return f.resolveProperties(e).then((t=>{null!=t.from&&(r.getAddress(t.from)!==this.address&&$t.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const i=this._signingKey().signDigest(o.keccak256(l.serialize(t)));return l.serialize(t,i)}))}signMessage(e){return Xt(this,void 0,void 0,(function*(){return n.joinSignature(this._signingKey().signDigest(Me(e)))}))}_signTypedData(e,t,r){return Xt(this,void 0,void 0,(function*(){const i=yield a.TypedDataEncoder.resolveNames(e,t,r,(e=>(null==this.provider&&$t.throwError("cannot resolve ENS names without a provider",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return n.joinSignature(this._signingKey().signDigest(a.TypedDataEncoder.hash(i.domain,t,i.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),d.encryptKeystore(this,e,t,r)}static createRandom(e){let t=jt(16);e||(e={}),e.extraEntropy&&(t=n.arrayify(n.hexDataSlice(o.keccak256(n.concat([t,e.extraEntropy])),0,16)));const r=_t(t,e.locale);return er.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return d.decryptJsonWallet(e,t,r).then((e=>new er(e)))}static fromEncryptedJsonSync(e,t){return new er(d.decryptJsonWalletSync(e,t))}static fromMnemonic(e,t,r){return t||(t=qt),new er(Kt.fromMnemonic(e,null,r).derivePath(t))}}function tr(e,t){return l.recoverAddress(Me(e),t)}function rr(e,t,r,i){return l.recoverAddress(a.TypedDataEncoder.hash(e,t,r),i)}var ir=Object.freeze({__proto__:null,Wallet:er,verifyMessage:tr,verifyTypedData:rr});const nr=new RegExp("^bytes([0-9]+)$"),or=new RegExp("^(u?int)([0-9]*)$"),sr=new RegExp("^(.*)\\[([0-9]*)\\]$"),ar="0000000000000000000000000000000000000000000000000000000000000000",fr=new s.Logger("solidity/5.7.0");function hr(e,t,r){switch(e){case"address":return r?n.zeroPad(t,32):n.arrayify(t);case"string":return s.toUtf8Bytes(t);case"bytes":return n.arrayify(t);case"bool":return t=t?"0x01":"0x00",r?n.zeroPad(t,32):n.arrayify(t)}let i=e.match(or);if(i){let o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&fr.throwArgumentError("invalid number type","type",e),r&&(o=256),t=s.BigNumber.from(t).toTwos(o),n.zeroPad(t,o/8)}if(i=e.match(nr),i){const o=parseInt(i[1]);return(String(o)!==i[1]||0===o||o>32)&&fr.throwArgumentError("invalid bytes type","type",e),n.arrayify(t).byteLength!==o&&fr.throwArgumentError(`invalid value for ${e}`,"value",t),r?n.arrayify((t+ar).substring(0,66)):t}if(i=e.match(sr),i&&Array.isArray(t)){const r=i[1];parseInt(i[2]||String(t.length))!=t.length&&fr.throwArgumentError(`invalid array length for ${e}`,"value",t);const o=[];return t.forEach((function(e){o.push(hr(r,e,!0))})),n.concat(o)}return fr.throwArgumentError("invalid type","type",e)}function ur(e,t){e.length!=t.length&&fr.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,i){r.push(hr(e,t[i]))})),n.hexlify(n.concat(r))}function lr(e,t){return o.keccak256(ur(e,t))}function dr(e,t){return Pe(ur(e,t))}var cr=Object.freeze({__proto__:null,pack:ur,keccak256:lr,sha256:dr});const pr=new s.Logger("units/5.7.0"),mr=["wei","kwei","mwei","gwei","szabo","finney","ether"];function gr(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&pr.throwArgumentError("invalid value","value",e);let r=t[0],i="";for("-"===r.substring(0,1)&&(i="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let n="";for(2===t.length&&(n="."+(t[1]||"0"));n.length>2&&"0"===n[n.length-1];)n=n.substring(0,n.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return i+o.join(",")+n}function Ar(e,t){if("string"==typeof t){const e=mr.indexOf(t);-1!==e&&(t=3*e)}return x(e,null!=t?t:18)}function yr(e,t){if("string"!=typeof e&&pr.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=mr.indexOf(t);-1!==e&&(t=3*e)}return I(e,null!=t?t:18)}function vr(e){return Ar(e,18)}function wr(e){return yr(e,18)}var br=Object.freeze({__proto__:null,commify:gr,formatUnits:Ar,parseUnits:yr,formatEther:vr,parseEther:wr}),Mr=Object.freeze({__proto__:null,AbiCoder:m.AbiCoder,defaultAbiCoder:m.defaultAbiCoder,Fragment:m.Fragment,ConstructorFragment:m.ConstructorFragment,ErrorFragment:m.ErrorFragment,EventFragment:m.EventFragment,FunctionFragment:m.FunctionFragment,ParamType:m.ParamType,FormatTypes:m.FormatTypes,checkResultErrors:m.checkResultErrors,Logger:s.Logger,RLP:g.lib_esm,_fetchData:a._fetchData,fetchJson:a.fetchJson,poll:a.poll,checkProperties:f.checkProperties,deepCopy:f.deepCopy,defineReadOnly:f.defineReadOnly,getStatic:f.getStatic,resolveProperties:f.resolveProperties,shallowCopy:f.shallowCopy,arrayify:n.arrayify,concat:n.concat,stripZeros:n.stripZeros,zeroPad:n.zeroPad,isBytes:n.isBytes,isBytesLike:n.isBytesLike,defaultPath:qt,HDNode:Kt,SigningKey:wt,Interface:m.Interface,LogDescription:m.LogDescription,TransactionDescription:m.TransactionDescription,base58:Ce,base64:J,hexlify:n.hexlify,isHexString:n.isHexString,hexConcat:n.hexConcat,hexStripZeros:n.hexStripZeros,hexValue:n.hexValue,hexZeroPad:n.hexZeroPad,hexDataLength:n.hexDataLength,hexDataSlice:n.hexDataSlice,nameprep:Q,_toEscapedUtf8String:s._toEscapedUtf8String,toUtf8Bytes:s.toUtf8Bytes,toUtf8CodePoints:s.toUtf8CodePoints,toUtf8String:s.toUtf8String,Utf8ErrorFuncs:s.Utf8ErrorFuncs,formatBytes32String:R,parseBytes32String:T,dnsEncode:we,hashMessage:Me,namehash:ve,isValidName:ye,id:s.id,_TypedDataEncoder:a.TypedDataEncoder,getAddress:r.getAddress,getIcapAddress:r.getIcapAddress,getContractAddress:r.getContractAddress,getCreate2Address:r.getCreate2Address,isAddress:r.isAddress,formatEther:vr,parseEther:wr,formatUnits:Ar,parseUnits:yr,commify:gr,computeHmac:ke,keccak256:o.keccak256,ripemd160:Fe,sha256:Pe,sha512:De,randomBytes:jt,shuffled:Zt,solidityPack:ur,solidityKeccak256:lr,soliditySha256:dr,splitSignature:n.splitSignature,joinSignature:n.joinSignature,accessListify:l.accessListify,parseTransaction:l.parse,serializeTransaction:l.serialize,TransactionTypes:l.TransactionTypes,getJsonWalletAddress:d.getJsonWalletAddress,computeAddress:l.computeAddress,recoverAddress:l.recoverAddress,computePublicKey:Mt,recoverPublicKey:bt,verifyMessage:tr,verifyTypedData:rr,getAccountPath:Qt,mnemonicToEntropy:zt,entropyToMnemonic:_t,isValidMnemonic:Gt,mnemonicToSeed:Ht,get SupportedAlgorithm(){return exports.SupportedAlgorithm},get UnicodeNormalizationForm(){return s.UnicodeNormalizationForm},get Utf8ErrorReason(){return s.Utf8ErrorReason},Indexed:m.Indexed});const Sr="ethers/5.7.2",Br=new s.Logger(Sr);var Cr=Object.freeze({__proto__:null,Signer:t.Signer,Wallet:er,VoidSigner:t.VoidSigner,getDefaultProvider:p.getDefaultProvider,providers:v,BaseContract:e.BaseContract,Contract:e.Contract,ContractFactory:e.ContractFactory,BigNumber:s.BigNumber,FixedNumber:P,constants:y,get errors(){return s.ErrorCode},logger:Br,utils:Mr,wordlists:Ft,version:Sr,Wordlist:Ct});exports.FixedNumber=P,exports.Wallet=er,exports.Wordlist=Ct,exports.computeHmac=ke,exports.dnsEncode=we,exports.ensNormalize=function(e){return Ae(e).map((e=>s.toUtf8String(e))).join(".")},exports.ethers=Cr,exports.formatBytes32String=R,exports.hashMessage=Me,exports.isValidName=ye,exports.lib_esm=J,exports.lib_esm$1=xe,exports.lib_esm$2=Jt,exports.lib_esm$3=cr,exports.lib_esm$4=St,exports.lib_esm$5=br,exports.lib_esm$6=ir,exports.logger=Br,exports.messagePrefix=be,exports.namehash=ve,exports.nameprep=Q,exports.parseBytes32String=T,exports.randomBytes=jt,exports.ripemd160=Fe,exports.sha256=Pe,exports.sha512=De,exports.shuffled=Zt,exports.utils=Mr,exports.version=Sr,exports.wordlists=Ft;
|